Package org.biojava.bio.gui.sequence
Class SimpleLabelRenderer
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojava.bio.gui.sequence.SimpleLabelRenderer
-
- All Implemented Interfaces:
LabelRenderer
,Changeable
public class SimpleLabelRenderer extends AbstractChangeable implements LabelRenderer
- Author:
- Matthew Pocock
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.biojava.bio.gui.sequence.LabelRenderer
LabelRenderer.RenderNothing
-
-
Field Summary
Fields Modifier and Type Field Description static ChangeType
LABEL
-
Fields inherited from interface org.biojava.bio.gui.sequence.LabelRenderer
RENDER_NOTHING
-
-
Constructor Summary
Constructors Constructor Description SimpleLabelRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getLabel()
protected Shape
getLabelGlyph(SequenceRenderContext src, FontRenderContext frc)
double
getMinimumWidth(SequenceRenderContext sp)
Retrieve the minimum space required to render the label.void
paint(Graphics2D g, SequenceRenderContext sp, int min, int max, SequenceRenderContext.Border side)
Render a label for the information for sp to g.void
setLabel(String label)
-
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
-
-
-
-
Field Detail
-
LABEL
public static final ChangeType LABEL
-
-
Constructor Detail
-
SimpleLabelRenderer
public SimpleLabelRenderer()
-
-
Method Detail
-
getLabelGlyph
protected Shape getLabelGlyph(SequenceRenderContext src, FontRenderContext frc)
-
setLabel
public void setLabel(String label) throws ChangeVetoException
- Throws:
ChangeVetoException
-
getMinimumWidth
public double getMinimumWidth(SequenceRenderContext sp)
Description copied from interface:LabelRenderer
Retrieve the minimum space required to render the label.- Specified by:
getMinimumWidth
in interfaceLabelRenderer
- Parameters:
sp
- the SequencePanel to return info for- Returns:
- the leading distance of the renderer for that sequence panel
-
paint
public void paint(Graphics2D g, SequenceRenderContext sp, int min, int max, SequenceRenderContext.Border side)
Description copied from interface:LabelRenderer
Render a label for the information for sp to g.- Specified by:
paint
in interfaceLabelRenderer
- Parameters:
g
- the Graphics2D to render tosp
- the SequencePanel that encapsulates the information to rendermin
- the minimum symbol to render (inclusive)max
- the maximum symbol to render (inclusive)
-
-