public class LabelDataArea extends DataArea
DISPATCHER_MAP, repaintRequested
Constructor and Description |
---|
LabelDataArea(AlignmentContentArea owner,
AlignmentArea labeledArea) |
LabelDataArea(AlignmentContentArea owner,
AlignmentArea labeledArea,
java.lang.String text) |
LabelDataArea(AlignmentContentArea owner,
AlignmentArea labeledArea,
java.lang.String text,
boolean alignToFirstColumn,
boolean alignToScrollPosition) |
Modifier and Type | Method and Description |
---|---|
<T,U> void |
afterModelChanged(AlignmentModel<T> previous,
AlignmentModel<U> current)
Called if this listener was moved to another instance of
AlignmentModel . |
<T> void |
afterSequenceChange(SequenceChangeEvent<T> e)
Called after a sequence has been inserted, removed or replaced.
|
<T> void |
afterSequenceRenamed(SequenceRenamedEvent<T> e)
Called after a sequence was renamed.
|
<T> void |
afterTokenChange(TokenChangeEvent<T> e)
Called after a single token or a set of tokens has been inserted, removed or replaced.
|
java.awt.Color |
getBackgroundColor() |
java.awt.Font |
getFont()
Returns the font used to display the text in this data area.
|
double |
getHeight()
Returns the height in pixels considering the current zoom factor this component needs.
|
java.lang.String |
getText() |
java.awt.Color |
getTextColor() |
boolean |
isAlignToFirstColumn()
Determines whether the start of the text is displayed at the left end of the component or at the left
end of the first column of the alignment.
|
boolean |
isAlignToScrollPosition()
Determines whether the start of the text of this component should move if the component is scrolled
horizontally.
|
void |
paintPart(AlignmentPaintEvent e)
Implementations of this method perform the painting of a part of the component.
|
void |
setAlignToFirstColumn(boolean alignToFirstColumn) |
void |
setAlignToScrollPosition(boolean alignToScrollPosition) |
void |
setBackgroundColor(java.awt.Color backgroundColor) |
void |
setFont(java.awt.Font font) |
void |
setText(java.lang.String text) |
void |
setTextColor(java.awt.Color textColor) |
java.util.Set<DataAreaListType> |
validLocations()
The result should enumerate all valid locations where the implementing data area is allowed to be located.
|
getLabeledAlignmentArea, getLabeledAlignmentModel, getLengthAfterEnd, getLengthBeforeStart, getList, isVisible, setList, setVisible
createLabelSubArea, getLabelSubArea, getOwner, getSize, paint, repaint
addKeyListener, addMouseListener, addMouseWheelListener, assignSize, dispatchEvent, getCurrentToolkit, getKeyListenersSet, getMouseListenersSet, getMouseWheelListenersSet, getSwingComponentClassName, getSwingComponentConstructorParameters, getSWTComponentClassName, getSWTComponentConstructorParameters, getToolkitComponent, hasDefinedSize, hasToolkitComponent, isUpdateOngoing, removeKeyListener, removeMouseListener, removeWheelMouseListener, setToolkitComponent, setUpdateOngoing
public LabelDataArea(AlignmentContentArea owner, AlignmentArea labeledArea)
public LabelDataArea(AlignmentContentArea owner, AlignmentArea labeledArea, java.lang.String text)
public LabelDataArea(AlignmentContentArea owner, AlignmentArea labeledArea, java.lang.String text, boolean alignToFirstColumn, boolean alignToScrollPosition)
public java.lang.String getText()
public void setText(java.lang.String text)
public java.awt.Font getFont()
Note that the size of the returned font applies to 100 % zoom.
public void setFont(java.awt.Font font)
public boolean isAlignToScrollPosition()
true
if the start of the text moves within the component to stay visible during scrolling
or false
if it remains at a fixed positionpublic void setAlignToScrollPosition(boolean alignToScrollPosition)
public boolean isAlignToFirstColumn()
Note that the text may start even further right, if isAlignToScrollPosition()
is set too,
depending on the scroll position.
true
if the text should start above the first column or false
if it always
starts at the left of the componentpublic void setAlignToFirstColumn(boolean alignToFirstColumn)
public java.awt.Color getTextColor()
public void setTextColor(java.awt.Color textColor)
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color backgroundColor)
public java.util.Set<DataAreaListType> validLocations()
DataArea
An implementation for a data area could be located everywhere could look like this:
return EnumSet.of(DataAreaListType.TOP, DataAreaListType.BOTTOM, DataAreaListType.SEQUENCE);
validLocations
in class DataArea
public void paintPart(AlignmentPaintEvent e)
AlignmentSubArea
AlignmentArea
is set to contain no subcomponents but to paint its contents directly.
This default implementation always throws an UnsupportedOperationException
. Note that
therefore inherited classes must either overwrite this method or #createComponent()
in
order to return an instance there that does not delegate to this method.
Note that the aim of this method is to allow painting very wide components, which may have a width
larger than Integer.MAX_VALUE
. Therefore painting coordinates are stored as double
values (using Graphics2D
and Rectangle2D.Double
). Implementations should not
calculate pixel coordinates as int
s at any time to avoid overflows, but only use
double
(or possibly long
if necessary).
paintPart
in class AlignmentSubArea
e
- the paint event providing information on the area to be painted, the graphics context
and tool methods.public double getHeight()
AlignmentSubArea
getHeight
in class AlignmentSubArea
double
value > 0public <T> void afterSequenceChange(SequenceChangeEvent<T> e)
AlignmentModelChangeListener
e
- the event object containing information on the changepublic <T> void afterSequenceRenamed(SequenceRenamedEvent<T> e)
AlignmentModelChangeListener
e
- the event object containing information on the changepublic <T> void afterTokenChange(TokenChangeEvent<T> e)
AlignmentModelChangeListener
e
- the event object containing information on the changepublic <T,U> void afterModelChanged(AlignmentModel<T> previous, AlignmentModel<U> current)
AlignmentModelChangeListener
AlignmentModel
.
This happens if the alignment model of an AlignmentArea
was changed.
previous
- the alignment model this listener was attached to before the event happenedcurrent
- the new alignment model this listener is attached to now