|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biojava.utils.AbstractChangeable
org.biojava.bio.gui.sequence.AbstractBeadRenderer
org.biojava.bio.gui.sequence.RectangularBeadRenderer
public class RectangularBeadRenderer
RectangularBeadRenderer renders features as simple
rectangles. Their outline and fill Paint,
Stroke, feature depth, Y-axis displacement are
configurable. The height of the rectangle will be equal to half its
width, but not greater than the beadDepth set in the
constructor.
An alternative bead height behaviour is available where the
rectangle height does not scale with its current width. The
setHeightScaling method should be passed a boolean
value to change this. The default is to use height scaling.
| Field Summary | |
|---|---|
static ChangeType |
HEIGHTSCALING
Constant HEIGHTSCALING indicating a change to the
feature height scaling policy. |
protected Rectangle2D |
rect
|
protected boolean |
scaleHeight
|
| Fields inherited from class org.biojava.bio.gui.sequence.AbstractBeadRenderer |
|---|
beadDepth, beadDisplacement, beadFill, beadOutline, beadStroke, delegates, delegationCache, DEPTH, DISPLACEMENT, FILL, OUTLINE, STROKE |
| Constructor Summary | |
|---|---|
RectangularBeadRenderer()
Creates a new RectangularBeadRenderer with the
default settings. |
|
RectangularBeadRenderer(double beadDepth,
double beadDisplacement,
Paint beadOutline,
Paint beadFill,
Stroke beadStroke)
Creates a new RectangularBeadRenderer. |
|
| Method Summary | |
|---|---|
double |
getDepth(SequenceRenderContext context)
getDepth calculates the depth required by this
renderer to display its beads. |
boolean |
getHeightScaling()
getHeightScaling returns the state of the height
scaling policy. |
void |
renderBead(Graphics2D g2,
Feature f,
SequenceRenderContext context)
renderBead renders features as simple rectangle. |
void |
setHeightScaling(boolean isEnabled)
setHeightScaling sets the height scaling
policy. |
| 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 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ChangeType HEIGHTSCALING
HEIGHTSCALING indicating a change to the
feature height scaling policy.
protected Rectangle2D rect
protected boolean scaleHeight
| Constructor Detail |
|---|
public RectangularBeadRenderer()
RectangularBeadRenderer with the
default settings.
public RectangularBeadRenderer(double beadDepth,
double beadDisplacement,
Paint beadOutline,
Paint beadFill,
Stroke beadStroke)
RectangularBeadRenderer.
beadDepth - a double.beadDisplacement - a double.beadOutline - a Paint.beadFill - a Paint.beadStroke - a Stroke.| Method Detail |
|---|
public void renderBead(Graphics2D g2,
Feature f,
SequenceRenderContext context)
renderBead renders features as simple rectangle.
renderBead in interface BeadFeatureRendererrenderBead in class AbstractBeadRendererg2 - a Graphics2D.f - a Feature to render.context - a SequenceRenderContext context.public double getDepth(SequenceRenderContext context)
getDepth calculates the depth required by this
renderer to display its beads.
getDepth in interface FeatureRenderergetDepth in class AbstractBeadRenderercontext - a SequenceRenderContext.
double.public boolean getHeightScaling()
getHeightScaling returns the state of the height
scaling policy.
boolean true if height scaling is
enabled.
public void setHeightScaling(boolean isEnabled)
throws ChangeVetoException
setHeightScaling sets the height scaling
policy. Default behaviour is for this to be enabled leading to
features being drawn with a height equal to half their width,
subject to a maximum height restriction equal to the
beadDepth set in the constructor. If disabled,
features will always be drawn at the maximum height allowed by
the beadDepth parameter.
isEnabled - a boolean.
ChangeVetoException - if an error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||