Package org.biojava.bio.gui.sequence
Class EllipticalBeadRenderer
java.lang.Object
org.biojava.utils.AbstractChangeable
org.biojava.bio.gui.sequence.AbstractBeadRenderer
org.biojava.bio.gui.sequence.EllipticalBeadRenderer
- All Implemented Interfaces:
Serializable
,BeadFeatureRenderer
,FeatureRenderer
,Changeable
EllipticalBeadRenderer
renders features as simple
ellipses. Their outline and fill Paint
,
Stroke
, feature depth, Y-axis displacement are
configurable. Also configurable is the minimum ratio of long axis
to short axis of the ellipse - this prevents long features also
becoming ever wider and obscuring neighbours.
- Since:
- 1.2
- Author:
- Keith James
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
static final ChangeType
ConstantRATIO
indicating a change to the minimum allowed ratio of long axis to short axis of the features.Fields inherited from class org.biojava.bio.gui.sequence.AbstractBeadRenderer
beadDepth, beadDisplacement, beadFill, beadOutline, beadStroke, delegates, delegationCache, DEPTH, DISPLACEMENT, FILL, OUTLINE, STROKE
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newEllipticalBeadRenderer
object with the default settings.EllipticalBeadRenderer
(double beadDepth, double beadDisplacement, Paint beadOutline, Paint beadFill, Stroke beadStroke, double dimensionRatio) Creates a newEllipticalBeadRenderer
. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getDepth
(SequenceRenderContext context) getDepth
calculates the depth required by this renderer to display its beads.double
getDimensionRatio
returns the maximum ratio of long dimension to short dimension of the bead.void
renderBead
(Graphics2D g2, Feature f, SequenceRenderContext context) renderBead
renders features as simple ellipse.void
setDimensionRatio
(double ratio) setDimensionRatio
sets the minimum ratio of long dimension to short dimension of the bead.Methods inherited from class org.biojava.bio.gui.sequence.AbstractBeadRenderer
getBeadDepth, getBeadDisplacement, getBeadFill, getBeadOutline, getBeadStroke, processMouseEvent, removeDelegateRenderer, renderFeature, setBeadDepth, setBeadDisplacement, setBeadFill, setBeadOutline, setBeadStroke, setDelegateRenderer
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
-
Field Details
-
RATIO
ConstantRATIO
indicating a change to the minimum allowed ratio of long axis to short axis of the features. -
dimensionRatio
-
-
Constructor Details
-
EllipticalBeadRenderer
public EllipticalBeadRenderer()Creates a newEllipticalBeadRenderer
object with the default settings. -
EllipticalBeadRenderer
public EllipticalBeadRenderer(double beadDepth, double beadDisplacement, Paint beadOutline, Paint beadFill, Stroke beadStroke, double dimensionRatio) Creates a newEllipticalBeadRenderer
.- Parameters:
beadDepth
- adouble
.beadDisplacement
- adouble
.beadOutline
- aPaint
.beadFill
- aPaint
.beadStroke
- aStroke
.dimensionRatio
- adouble
.
-
-
Method Details
-
renderBead
renderBead
renders features as simple ellipse.- Specified by:
renderBead
in interfaceBeadFeatureRenderer
- Specified by:
renderBead
in classAbstractBeadRenderer
- Parameters:
g2
- aGraphics2D
context.f
- aFeature
to render.context
- aSequenceRenderContext
context.
-
getDepth
getDepth
calculates the depth required by this renderer to display its beads.- Specified by:
getDepth
in interfaceFeatureRenderer
- Overrides:
getDepth
in classAbstractBeadRenderer
- Parameters:
context
- aSequenceRenderContext
object.- Returns:
- a
double
.
-
getDimensionRatio
getDimensionRatio
returns the maximum ratio of long dimension to short dimension of the bead. This should be equal, or greater than 1.- Returns:
- a
double
.
-
setDimensionRatio
setDimensionRatio
sets the minimum ratio of long dimension to short dimension of the bead. This should be equal, or greater than 1.- Parameters:
ratio
- adouble
ratio of depth.- Throws:
ChangeVetoException
- if an error occurs.
-