|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojava.bio.gui.sequence.CrosshairRenderer
public class CrosshairRenderer
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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.biojava.bio.gui.sequence.PairwiseSequenceRenderer |
---|
PairwiseSequenceRenderer.PairwiseRendererForwarder |
Field Summary | |
---|---|
static ChangeType |
OUTLINE
Constant OUTLINE indicating a change to the
crosshair paint. |
protected Point |
point
point is the current location (in sequence
coordinates) of the crosshair in the X and Y sequences. |
protected Line2D |
xHair
xHair is the vertical line positioned along the
X-axis. |
protected Line2D |
yHair
yHair is the horizontal line positioned along the
Y-axis. |
Constructor Summary | |
---|---|
CrosshairRenderer()
Creates a new CrosshairRenderer in light grey with
coordinates displayed. |
|
CrosshairRenderer(Paint outline)
Creates a new CrosshairRenderer of the specified
colour, with coordinates displayed. |
Method Summary | |
---|---|
void |
coordinateDisplayOn(boolean display)
coordinateDisplayOn toggles the display of
sequence coordinates. |
Paint |
getOutline()
getOutline returns the colour used to draw the
lines. |
void |
paint(Graphics2D g2,
PairwiseRenderContext context)
paint s some or all of the information about the
sequence pair. |
SequenceViewerEvent |
processMouseEvent(PairwiseRenderContext context,
MouseEvent me,
List path)
processMouseEvent processes any
MouseEvent s directed to the renderer. |
void |
setOutline(Paint outline)
setOutline sets the the colour used to draw the
lines. |
Methods inherited from class org.biojava.utils.AbstractChangeable |
---|
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ChangeType OUTLINE
OUTLINE
indicating a change to the
crosshair paint.
protected Line2D xHair
xHair
is the vertical line positioned along the
X-axis.
protected Line2D yHair
yHair
is the horizontal line positioned along the
Y-axis.
protected Point point
point
is the current location (in sequence
coordinates) of the crosshair in the X and Y sequences.
Constructor Detail |
---|
public CrosshairRenderer()
CrosshairRenderer
in light grey with
coordinates displayed.
public CrosshairRenderer(Paint outline)
CrosshairRenderer
of the specified
colour, with coordinates displayed.
outline
- a Paint
.Method Detail |
---|
public void paint(Graphics2D g2, PairwiseRenderContext context)
PairwiseSequenceRenderer
paint
s some or all of the information about the
sequence pair.
paint
in interface PairwiseSequenceRenderer
g2
- 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 Paint getOutline()
getOutline
returns the colour used to draw the
lines.
Paint
.public void setOutline(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, MouseEvent me, List path)
processMouseEvent
processes any
MouseEvent
s 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 null
processMouseEvent
in interface PairwiseSequenceRenderer
context
- a PairwiseRenderContext
.me
- a MouseEvent
.path
- a List
.
SequenceViewerEvent
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |