Package org.biojava.bio.gui.sequence
Class GlyphFeatureRenderer
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojava.bio.gui.sequence.SequenceRendererWrapper
-
- org.biojava.bio.gui.sequence.FilteringRenderer
-
- org.biojava.bio.gui.sequence.GlyphFeatureRenderer
-
- All Implemented Interfaces:
Serializable
,FeatureRenderer
,SequenceRenderer
,Changeable
- Direct Known Subclasses:
SecondaryStructureFeatureRenderer
public class GlyphFeatureRenderer extends FilteringRenderer implements FeatureRenderer
A FeatureRenderer that renders a particular Glyph for Features accepted by a particular FeatureFilter- Since:
- 1.5
- Author:
- Mark Southern, Andreas Dräger
- See Also:
Glyph
, Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.biojava.bio.gui.sequence.SequenceRenderer
SequenceRenderer.RendererForwarder
-
-
Field Summary
Fields Modifier and Type Field Description protected List<FeatureFilter>
fList
protected List<Glyph>
gList
-
Fields inherited from class org.biojava.bio.gui.sequence.FilteringRenderer
filter, FILTER, recurse, RECURSE
-
Fields inherited from class org.biojava.bio.gui.sequence.SequenceRendererWrapper
RENDERER
-
-
Constructor Summary
Constructors Constructor Description GlyphFeatureRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFilterAndGlyph(FeatureFilter ff, Glyph g)
boolean
containsFilter(FeatureFilter ff)
Returns true if the givenFeatureFilter
is already contained in this renderer.double
getDepth(SequenceRenderContext src)
Returns the depth property of this class.FeatureFilter
getFeatureFilter(int i)
Returns the ithFeatureFilter
in this renderer.Glyph
getGlyphForFilter(FeatureFilter ff)
Returns theGlyph
object which is assigned to the given feature filter.FeatureHolder
processMouseEvent(FeatureHolder fh, SequenceRenderContext src, MouseEvent me)
void
removeFilterWithGlyph(FeatureFilter ff)
void
renderFeature(Graphics2D g2, Feature f, SequenceRenderContext src)
void
setDepth(double depth)
void
setGlyphForFilter(FeatureFilter ff, Glyph glyph)
Allows setting anotherGlyph
object to be painted for the given FeatureFilter.-
Methods inherited from class org.biojava.bio.gui.sequence.FilteringRenderer
getChangeSupport, getContext, getFilter, getMinimumLeader, getMinimumTrailer, getRecurse, hasListeners, paint, processMouseEvent, setFilter, setRecurse, toString
-
Methods inherited from class org.biojava.bio.gui.sequence.SequenceRendererWrapper
getRenderer, setRenderer
-
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
-
-
-
-
Constructor Detail
-
GlyphFeatureRenderer
public GlyphFeatureRenderer()
-
-
Method Detail
-
addFilterAndGlyph
public void addFilterAndGlyph(FeatureFilter ff, Glyph g) throws ChangeVetoException
- Throws:
ChangeVetoException
-
removeFilterWithGlyph
public void removeFilterWithGlyph(FeatureFilter ff) throws ChangeVetoException
- Throws:
ChangeVetoException
-
getFeatureFilter
public FeatureFilter getFeatureFilter(int i)
Returns the ithFeatureFilter
in this renderer.- Parameters:
i
-- Returns:
- the featureFilter
-
containsFilter
public boolean containsFilter(FeatureFilter ff)
Returns true if the givenFeatureFilter
is already contained in this renderer.- Parameters:
ff
-- Returns:
- flag if featurefilter is contained
-
setGlyphForFilter
public void setGlyphForFilter(FeatureFilter ff, Glyph glyph) throws NoSuchElementException
Allows setting anotherGlyph
object to be painted for the given FeatureFilter.- Parameters:
ff
-glyph
-- Throws:
ChangeVetoException
NoSuchElementException
-
getGlyphForFilter
public Glyph getGlyphForFilter(FeatureFilter ff) throws NoSuchElementException
Returns theGlyph
object which is assigned to the given feature filter.- Parameters:
ff
-- Returns:
Glyph
object- Throws:
NoSuchElementException
-
setDepth
public void setDepth(double depth)
-
getDepth
public double getDepth(SequenceRenderContext src)
Returns the depth property of this class.- Specified by:
getDepth
in interfaceFeatureRenderer
- Specified by:
getDepth
in interfaceSequenceRenderer
- Overrides:
getDepth
in classFilteringRenderer
- Parameters:
src
- the SequenceRenderContext to return info for- Returns:
- the depth
-
processMouseEvent
public FeatureHolder processMouseEvent(FeatureHolder fh, SequenceRenderContext src, MouseEvent me)
- Specified by:
processMouseEvent
in interfaceFeatureRenderer
-
renderFeature
public void renderFeature(Graphics2D g2, Feature f, SequenceRenderContext src)
- Specified by:
renderFeature
in interfaceFeatureRenderer
-
-