Package org.biojava.bio.gui.sequence
Class RoundRectangularBeadRenderer
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojava.bio.gui.sequence.AbstractBeadRenderer
-
- org.biojava.bio.gui.sequence.RoundRectangularBeadRenderer
-
- All Implemented Interfaces:
Serializable
,BeadFeatureRenderer
,FeatureRenderer
,Changeable
public class RoundRectangularBeadRenderer extends AbstractBeadRenderer
RoundRectangularBeadRenderer
renders features as rectangles with rounded corners. Their outline and fillPaint
,Stroke
, feature depth, Y-axis displacement are configurable.- Since:
- 1.2
- Author:
- Keith James
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected double
arcHeight
protected double
arcWidth
protected RoundRectangle2D
rect
-
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 RoundRectangularBeadRenderer()
Creates a newRoundRectangularBeadRenderer
object with the default settings.RoundRectangularBeadRenderer(double beadDepth, double beadDisplacement, Paint beadOutline, Paint beadFill, Stroke beadStroke, double arcWidth, double arcHeight)
Creates a newRoundRectangularBeadRenderer
.
-
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.void
renderBead(Graphics2D g2, Feature f, SequenceRenderContext context)
renderBead
renders features as a rectangle with rounded corners.-
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
-
rect
protected RoundRectangle2D rect
-
arcWidth
protected double arcWidth
-
arcHeight
protected double arcHeight
-
-
Constructor Detail
-
RoundRectangularBeadRenderer
public RoundRectangularBeadRenderer()
Creates a newRoundRectangularBeadRenderer
object with the default settings.
-
RoundRectangularBeadRenderer
public RoundRectangularBeadRenderer(double beadDepth, double beadDisplacement, Paint beadOutline, Paint beadFill, Stroke beadStroke, double arcWidth, double arcHeight)
Creates a newRoundRectangularBeadRenderer
.- Parameters:
beadDepth
- adouble
.beadDisplacement
- adouble
.beadOutline
- aPaint
.beadFill
- aPaint
.beadStroke
- aStroke
.arcWidth
- adouble
value which sets the arc width of the corners.arcHeight
- adouble
value which sets the arc height of the corners.
-
-
Method Detail
-
renderBead
public void renderBead(Graphics2D g2, Feature f, SequenceRenderContext context)
renderBead
renders features as a rectangle with rounded corners.- Specified by:
renderBead
in interfaceBeadFeatureRenderer
- Specified by:
renderBead
in classAbstractBeadRenderer
- Parameters:
g2
- aGraphics2D
.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
.- Returns:
- a
double
.
-
-