public class ConsensusSequenceArea extends DataArea
Modifier and Type | Field and Description |
---|---|
static float |
DEFAULT_HEIGHT_FACTOR |
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 |
afterProviderChanged(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.
|
String |
getConsensusToken(int column)
Returns the string representation of the most frequent token at the specified column.
|
int |
getHeight()
Returns the height in pixels considering the current zoom factor this component needs.
|
void |
paint(TICPaintEvent event) |
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 float DEFAULT_HEIGHT_FACTOR
public ConsensusSequenceArea(AlignmentContentArea owner)
owner
- the alignment area that will be containing the returned data area instanceIllegalArgumentException
- 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
.)IllegalArgumentException
- if sequenceDataProvider
is null
public int getHeight()
DataArea
public void paint(TICPaintEvent event)
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 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 afterProviderChanged(AlignmentModel previous, AlignmentModel 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