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
public class EllipticalBeadRenderer extends AbstractBeadRenderer
EllipticalBeadRenderer
renders features as simple ellipses. Their outline and fillPaint
,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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double
dimensionRatio
static ChangeType
RATIO
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
Constructors Constructor Description EllipticalBeadRenderer()
Creates 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getDepth(SequenceRenderContext context)
getDepth
calculates the depth required by this renderer to display its beads.double
getDimensionRatio()
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 Detail
-
RATIO
public static final ChangeType RATIO
ConstantRATIO
indicating a change to the minimum allowed ratio of long axis to short axis of the features.
-
dimensionRatio
protected double dimensionRatio
-
-
Constructor Detail
-
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 Detail
-
renderBead
public void renderBead(Graphics2D g2, Feature f, SequenceRenderContext context)
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
public double getDepth(SequenceRenderContext context)
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
public 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
public void setDimensionRatio(double ratio) throws ChangeVetoException
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.
-
-