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 doublestatic final ChangeTypeConstantRATIOindicating 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 newEllipticalBeadRendererobject with the default settings.EllipticalBeadRenderer(double beadDepth, double beadDisplacement, Paint beadOutline, Paint beadFill, Stroke beadStroke, double dimensionRatio) Creates a newEllipticalBeadRenderer. -
Method Summary
Modifier and TypeMethodDescriptiondoublegetDepth(SequenceRenderContext context) getDepthcalculates the depth required by this renderer to display its beads.doublegetDimensionRatioreturns 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, setDelegateRendererMethods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
-
Field Details
-
RATIO
ConstantRATIOindicating a change to the minimum allowed ratio of long axis to short axis of the features. -
dimensionRatio
-
-
Constructor Details
-
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 Details
-
renderBead
renderBeadrenders features as simple ellipse.- Specified by:
renderBeadin interfaceBeadFeatureRenderer- Specified by:
renderBeadin classAbstractBeadRenderer- Parameters:
g2- aGraphics2Dcontext.f- aFeatureto render.context- aSequenceRenderContextcontext.
-
getDepth
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
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
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.
-