public class ConsensusSequenceArea extends DataArea
Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_HEIGHT_FACTOR |
DISPATCHER_MAP, repaintRequested
Constructor and Description |
---|
ConsensusSequenceArea(AlignmentContentArea owner)
Creates a new instance of this class that uses the sequence data provider of the specified
alignment area.
|
ConsensusSequenceArea(AlignmentContentArea owner,
AlignmentArea labeledAlignmentArea)
Creates a new instance of this class that uses the specified sequence data provider.
|
Modifier and Type | Method and Description |
---|---|
void |
afterModelChanged(AlignmentModel previous,
AlignmentModel current)
Called if this listener was moved to another instance of
AlignmentModel . |
void |
afterSequenceChange(SequenceChangeEvent e)
Called after a sequence has been inserted, removed or replaced.
|
void |
afterSequenceRenamed(SequenceRenamedEvent e)
Called after a sequence was renamed.
|
void |
afterTokenChange(TokenChangeEvent e)
Called after a single token or a set of tokens has been inserted, removed or replaced.
|
java.lang.String |
getConsensusToken(int column)
Returns the string representation of the most frequent token at the specified column.
|
double |
getHeight()
Returns the height in pixels considering the current zoom factor this component needs.
|
void |
paintPart(AlignmentPaintEvent event)
Implementations of this method perform the painting of a part of the component.
|
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 static final float DEFAULT_HEIGHT_FACTOR
public ConsensusSequenceArea(AlignmentContentArea owner)
owner
- the alignment area that will be containing the returned data area instancejava.lang.IllegalArgumentException
- if owner
does not have a sequence data providerpublic ConsensusSequenceArea(AlignmentContentArea owner, AlignmentArea labeledAlignmentArea)
Note that this instance will not react to calls of
#afterProviderChanged(AlignmentModel, AlignmentModel)
when this constructor
is used. Such changes would than have to be done manually by the application code using
#setAlignmentModel(AlignmentModel)
.
owner
- the alignment area that will be containing the returned data area instancelabeledAlignmentArea
- the alignment area containing the alignment model that shall provide the
source data for the consensus sequence (Should only be different from owner.getOwner()
if the new instance will be placed in a different alignment area than the sequence data in a
scenario with a MultipleAlignmentsContainer
.)java.lang.IllegalArgumentException
- if sequenceDataProvider
is null
public double getHeight()
AlignmentSubArea
getHeight
in class AlignmentSubArea
double
value > 0public void paintPart(AlignmentPaintEvent event)
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
event
- the paint event providing information on the area to be painted, the graphics context
and tool methods.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 java.lang.String getConsensusToken(int column)
DataArea.getLabeledAlignmentModel()
public void afterTokenChange(TokenChangeEvent e)
AlignmentModelChangeListener
e
- the event object containing information on the changepublic void afterSequenceRenamed(SequenceRenamedEvent e)
AlignmentModelChangeListener
e
- the event object containing information on the changepublic void afterSequenceChange(SequenceChangeEvent e)
AlignmentModelChangeListener
e
- the event object containing information on the changepublic void afterModelChanged(AlignmentModel previous, AlignmentModel 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