public abstract class AbstractTokenPainter extends java.lang.Object implements TokenPainter
TokenPainter
.
This includes calculating the overlay color for single tokens.Constructor and Description |
---|
AbstractTokenPainter() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doPaintToken(AlignmentArea alignmentModel,
java.lang.String sequenceID,
int columnIndex,
java.lang.Object token,
java.lang.String tokenRepresentation,
java.awt.Graphics2D g,
java.awt.geom.Rectangle2D paintArea,
java.awt.Color overlayColor)
Method to be implemented by inherited classes performing the actual paint operation.
|
java.awt.Color |
getColor(java.lang.String tokenRepresentation)
Default implementation that returns
null . |
void |
paintToken(AlignmentArea alignmentArea,
java.lang.String sequenceID,
int columnIndex,
java.awt.Graphics2D g,
java.awt.geom.Rectangle2D paintArea,
java.awt.Color selectionColor)
Default implementation that delegates to
#doPaintToken(AlignmentModel, Object, String, Graphics2D, Rectangle2D) and determines
the string representation of the specified token from the token set of the specified alignment
model. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPreferredHeight, getPreferredWidth
public AbstractTokenPainter()
protected abstract void doPaintToken(AlignmentArea alignmentModel, java.lang.String sequenceID, int columnIndex, java.lang.Object token, java.lang.String tokenRepresentation, java.awt.Graphics2D g, java.awt.geom.Rectangle2D paintArea, java.awt.Color overlayColor)
TokenPainter
by an additional parameter providing the string representation of
the token.
- * @param alignmentArea the alignment area displaying the token to be paintedsequenceID
- the ID of the sequence containing the token to be paintedcolumnIndex
- the index of the alignment column containing the token to be paintedtoken
- the token to be paintedtokenRepresentation
- the string representation of token
determined from the token set of
alignmentModel
g
- the graphics context to paint topaintArea
- the rectangle to be filled with the representation of the tokenoverlayColor
- this color must be mixed by half with the painted output if it is not null
public void paintToken(AlignmentArea alignmentArea, java.lang.String sequenceID, int columnIndex, java.awt.Graphics2D g, java.awt.geom.Rectangle2D paintArea, java.awt.Color selectionColor)
#doPaintToken(AlignmentModel, Object, String, Graphics2D, Rectangle2D)
and determines
the string representation of the specified token from the token set of the specified alignment
model.
- * @param alignmentArea the alignment area displaying the token to be paintedpaintToken
in interface TokenPainter
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
public java.awt.Color getColor(java.lang.String tokenRepresentation)
null
. Inherited classes providing colors should overwrite this method.getColor
in interface TokenPainter
tokenRepresentation
- the string representation of the tokennull
TokenPainter.getColor(java.lang.String)