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
EllipticalBeadRendererrenders 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 doubledimensionRatiostatic ChangeTypeRATIOConstantRATIOindicating 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 newEllipticalBeadRendererobject 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 doublegetDepth(SequenceRenderContext context)getDepthcalculates the depth required by this renderer to display its beads.doublegetDimensionRatio()getDimensionRatioreturns the maximum ratio of long dimension to short dimension of the bead.voidrenderBead(Graphics2D g2, Feature f, SequenceRenderContext context)renderBeadrenders features as simple ellipse.voidsetDimensionRatio(double ratio)setDimensionRatiosets 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
ConstantRATIOindicating 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 newEllipticalBeadRendererobject 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)
renderBeadrenders features as simple ellipse.- Specified by:
renderBeadin interfaceBeadFeatureRenderer- Specified by:
renderBeadin classAbstractBeadRenderer- Parameters:
g2- aGraphics2Dcontext.f- aFeatureto render.context- aSequenceRenderContextcontext.
-
getDepth
public double getDepth(SequenceRenderContext context)
getDepthcalculates the depth required by this renderer to display its beads.- Specified by:
getDepthin interfaceFeatureRenderer- Overrides:
getDepthin classAbstractBeadRenderer- Parameters:
context- aSequenceRenderContextobject.- Returns:
- a
double.
-
getDimensionRatio
public double getDimensionRatio()
getDimensionRatioreturns 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
setDimensionRatiosets the minimum ratio of long dimension to short dimension of the bead. This should be equal, or greater than 1.- Parameters:
ratio- adoubleratio of depth.- Throws:
ChangeVetoException- if an error occurs.
-
-