public class SequenceIndexArea extends DataArea
You would usually use this component in the head area of an AlignmentArea
but it is possible to
insert it at any position.
The labeling interval if this area is calculated from the space needed to label the highest index in the associated alignment model. Note that due to rounding effects the label interval may vary by one depending on the zoom factor.
Modifier and Type | Field and Description |
---|---|
static double |
DASH_LENGTH_FACTOR
The length of a dash
|
static Stroke |
DASH_STROKE
The stroke used to paint the dashes
|
static int |
DEFAULT_FIRST_INDEX
The default value returned by
getFirstIndex() if it has not been changed. |
static double |
LABEL_LEFT_DISTANCE_FACTOR
The distance of the labels to their dash
|
static double |
LABEL_TOP_DISTANCE_FACTOR
The distance of the labels to the border of the component
|
static double |
LABELED_DASH_LENGTH_FACTOR
The length of a dash with a label
|
Constructor and Description |
---|
SequenceIndexArea(AlignmentContentArea owner)
Creates a new instance of this class using the parent alignment area of
owner as the labeled area. |
SequenceIndexArea(AlignmentContentArea owner,
AlignmentArea labeledArea)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
<T,U> void |
afterProviderChanged(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.
|
int |
getFirstIndex()
Returns the index that will be displayed for the first column of the alignment area.
|
int |
getHeight()
Returns the height in pixels considering the current zoom factor this component needs.
|
void |
paint(TICPaintEvent e) |
void |
setFirstIndex(int firstIndex)
Sets a new index that will be displayed for the first column of the alignment area.
|
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, getSize, isVisible, setList, setVisible
createLabelSubArea, getLabelSubArea, getOwner
addKeyListener, addMouseListener, addMouseWheelListener, assignSize, getCurrentToolkit, getKeyListenersSet, getMouseListenersSet, getMouseWheelListenersSet, getSwingComponentClassName, getSWTComponentClassName, getToolkitComponent, hasToolkitComponent, removeKeyListener, removeMouseListener, removeWheelMouseListener, repaint, setToolkitComponent
public static final int DEFAULT_FIRST_INDEX
getFirstIndex()
if it has not been changed.public static final Stroke DASH_STROKE
public static final double DASH_LENGTH_FACTOR
public static final double LABELED_DASH_LENGTH_FACTOR
public static final double LABEL_TOP_DISTANCE_FACTOR
public static final double LABEL_LEFT_DISTANCE_FACTOR
public SequenceIndexArea(AlignmentContentArea owner, AlignmentArea labeledArea)
owner
- the alignment area that is going to contain this data arealabeledArea
- the alignment area displays the sequence which is labeled by the new instance
(If null
is specified here, the parent alignment area of owner
will be assumed.)public SequenceIndexArea(AlignmentContentArea owner)
owner
as the labeled area.owner
- the alignment area that is going to contain this data areapublic void paint(TICPaintEvent e)
paint
in class TICComponent
public 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 int getFirstIndex()
The default value is 1. Note that the methods of AlignmentArea
and associated classes will always
use 0 as the index of the first column no matter which value is set here. It is used for the GUI output
of this data area only.
public void setFirstIndex(int firstIndex)
The methods of AlignmentArea
and associated classes will always use 0 as the index of the first
column no matter which value is specified here. It is used for the GUI output of this data area only.
firstIndex
- the new index display for the first columnpublic int getHeight()
DataArea
public <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 afterProviderChanged(AlignmentModel<T> previous, AlignmentModel<U> current)
AlignmentModelChangeListener
AlignmentModel
.
This might e.g. happen, if the data provider of an AlignmentArea
was changed.
previous
- the data provider this listener was attached to before the event happenedcurrent
- the new data provider this listener is attached to now