public class CrosshairRenderer extends AbstractChangeable implements PairwiseSequenceRenderer
CrosshairRenderer draws a crosshair, optionally
with coordinates. The crosshair is set to a sequence position by a
click and then stays there through scrolls/rescales until the next
click. See the processMouseEvent documentation for
details of responses to various mouse actions.
PairwiseSequenceRenderer.PairwiseRendererForwarder| Modifier and Type | Field and Description |
|---|---|
static ChangeType |
OUTLINE
Constant
OUTLINE indicating a change to the
crosshair paint. |
protected java.awt.Point |
point
point is the current location (in sequence
coordinates) of the crosshair in the X and Y sequences. |
protected java.awt.geom.Line2D |
xHair
xHair is the vertical line positioned along the
X-axis. |
protected java.awt.geom.Line2D |
yHair
yHair is the horizontal line positioned along the
Y-axis. |
| Constructor and Description |
|---|
CrosshairRenderer()
Creates a new
CrosshairRenderer in light grey with
coordinates displayed. |
CrosshairRenderer(java.awt.Paint outline)
Creates a new
CrosshairRenderer of the specified
colour, with coordinates displayed. |
| Modifier and Type | Method and Description |
|---|---|
void |
coordinateDisplayOn(boolean display)
coordinateDisplayOn toggles the display of
sequence coordinates. |
java.awt.Paint |
getOutline()
getOutline returns the colour used to draw the
lines. |
void |
paint(java.awt.Graphics2D g2,
PairwiseRenderContext context)
paints some or all of the information about the
sequence pair. |
SequenceViewerEvent |
processMouseEvent(PairwiseRenderContext context,
java.awt.event.MouseEvent me,
java.util.List path)
processMouseEvent processes any
MouseEvents directed to the renderer. |
void |
setOutline(java.awt.Paint outline)
setOutline sets the the colour used to draw the
lines. |
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerpublic static final ChangeType OUTLINE
OUTLINE indicating a change to the
crosshair paint.protected java.awt.geom.Line2D xHair
xHair is the vertical line positioned along the
X-axis.protected java.awt.geom.Line2D yHair
yHair is the horizontal line positioned along the
Y-axis.protected java.awt.Point point
point is the current location (in sequence
coordinates) of the crosshair in the X and Y sequences.public CrosshairRenderer()
CrosshairRenderer in light grey with
coordinates displayed.public CrosshairRenderer(java.awt.Paint outline)
CrosshairRenderer of the specified
colour, with coordinates displayed.outline - a Paint.public void paint(java.awt.Graphics2D g2,
PairwiseRenderContext context)
PairwiseSequenceRendererpaints some or all of the information about the
sequence pair.paint in interface PairwiseSequenceRendererg2 - a Graphics2D.context - a PairwiseRenderContext encapsulating
the information to be displayed.public void coordinateDisplayOn(boolean display)
coordinateDisplayOn toggles the display of
sequence coordinates.display - a boolean.public java.awt.Paint getOutline()
getOutline returns the colour used to draw the
lines.Paint.public void setOutline(java.awt.Paint outline)
throws ChangeVetoException
setOutline sets the the colour used to draw the
lines.outline - a Paint.ChangeVetoException - if an error occurs.public SequenceViewerEvent processMouseEvent(PairwiseRenderContext context, java.awt.event.MouseEvent me, java.util.List path)
processMouseEvent processes any
MouseEvents directed to the renderer.
Mouse actions are as follows (all are button-1 only):
Point in sequence
coordinates. The X coordinate is in the primary sequence,
the Y coordinate is in the secondary sequence.Point is
not setPoint
is not setPoint is
not set and the target is nullprocessMouseEvent in interface PairwiseSequenceRenderercontext - a PairwiseRenderContext.me - a MouseEvent.path - a List.SequenceViewerEvent.Copyright © 2018 BioJava. All Rights Reserved.