public interface TokenPainter
AlignmentModel
in an AlignmentArea
.Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColor(java.lang.String tokenRepresentation)
Returns the color associated with the specified token.
|
double |
getPreferredHeight()
Returns the optimal height this painter would need to paint a supported token in original size (100 % zoom).
|
double |
getPreferredWidth()
Returns the optimal width this painter would need to paint a supported token in original size (100 % zoom).
|
void |
paintToken(AlignmentArea alignmentArea,
java.lang.String sequenceID,
int columnIndex,
java.awt.Graphics2D g,
java.awt.geom.Rectangle2D paintArea,
java.awt.Color selectionColor)
Paints a representation of the specified token filling up the specified area.
|
void paintToken(AlignmentArea alignmentArea, java.lang.String sequenceID, int columnIndex, java.awt.Graphics2D g, java.awt.geom.Rectangle2D paintArea, java.awt.Color selectionColor)
area
may be different from the preferred width and height specified by this instance, if necessary.
Tokens are identified by the alignment area they are contained, the sequence ID of their sequence and their column index instead of a direct reference, to allow implementing classes to consider information e.g. on neighboring tokens. - * @param alignmentArea the alignment area displaying the token to be painted
sequenceID
- the ID of the sequence containing the token to be paintedcolumnIndex
- the index of the alignment column containing the token to be paintedg
- the graphics context to paint topaintArea
- the rectangle to be filled with the representation of the tokenselectionColor
- this color must be mixed by half with the painted output if it is not null
double getPreferredWidth()
double getPreferredHeight()
java.awt.Color getColor(java.lang.String tokenRepresentation)
This is an optional method. Classes not implementing this feature should always return null
here.
tokenRepresentation
- the string representation of the tokennull
of no associated color is known.