public class CharSetArea extends DataArea
Modifier and Type | Field and Description |
---|---|
static double |
BORDER_FRACTION |
DISPATCHER_MAP, repaintRequested
Constructor and Description |
---|
CharSetArea(AlignmentContentArea owner,
AlignmentArea labeledAlignmentArea)
Creates a new instance of this class with an empty data model.
|
CharSetArea(AlignmentContentArea owner,
AlignmentArea labeledAlignmentArea,
CharSetDataModel model)
Creates a new instance of this class.
|
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.
|
protected AlignmentLabelSubArea |
createLabelSubArea(AlignmentLabelArea owner)
This method can be overwritten to provide a specific implementation for labeling the implementing data area.
|
protected void |
fireSelectionChanged() |
double |
getHeight()
Returns the height in pixels considering the current zoom factor this component needs.
|
CharSetDataModel |
getModel()
Returns the underlying model providing character set data.
|
int |
getSelectedIndex() |
java.util.Set<SelectionListener<info.bioinfweb.commons.events.GenericEventObject<CharSetArea>>> |
getSelectionListeners() |
void |
paintPart(AlignmentPaintEvent event)
Implementations of this method perform the painting of a part of the component.
|
CharSetDataModel |
setModel(CharSetDataModel model,
boolean moveListeners)
Changes the model instance that is displayed by this area.
|
void |
setSelectedIndex(int selectedIndex) |
java.util.Set<DataAreaListType> |
validLocations()
This data area is allowed to attached at the top and bottom of an alignment area as well as to each sequence.
|
getLabeledAlignmentArea, getLabeledAlignmentModel, getLengthAfterEnd, getLengthBeforeStart, getList, isVisible, setList, setVisible
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 double BORDER_FRACTION
public CharSetArea(AlignmentContentArea owner, AlignmentArea labeledAlignmentArea, CharSetDataModel model)
owner
- the alignment area that will be containing the returned data area instancelabeledAlignmentArea
- the alignment area that shall determine the token widths considered when painting
the character sets (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
.)model
- the model providing the character set datajava.lang.IllegalArgumentException
- if model
is null
public CharSetArea(AlignmentContentArea owner, AlignmentArea labeledAlignmentArea)
owner
- the alignment area that will be containing the returned data area instancelabeledAlignmentArea
- the alignment area that shall determine the token widths considered when painting
the character sets (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
.)public CharSetDataModel getModel()
public CharSetDataModel setModel(CharSetDataModel model, boolean moveListeners)
model
- the new modelmoveListeners
- Specify true
here if all listers registered to the current model should be
moved to the new model or false
otherwisejava.lang.IllegalArgumentException
- if model
is null
public int getSelectedIndex()
public void setSelectedIndex(int selectedIndex)
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()
validLocations
in class DataArea
DataArea.validLocations()
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 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 nowprotected AlignmentLabelSubArea createLabelSubArea(AlignmentLabelArea owner)
AlignmentSubArea
This default implementation always returns an instance of DefaultLabelSubArea
.
createLabelSubArea
in class AlignmentSubArea
owner
- the alignment label area that can be set as the owner of the returned component.DefaultLabelSubArea
linked to this instanceprotected void fireSelectionChanged()
public java.util.Set<SelectionListener<info.bioinfweb.commons.events.GenericEventObject<CharSetArea>>> getSelectionListeners()