public class PairwiseFilteringRenderer extends AbstractChangeable implements PairwiseSequenceRenderer, java.io.Serializable
PairwiseFilteringRenderer wraps a
PairwiseSequenceRenderer and filters the
PairwiseRenderContexts passed to it. The renderer
receives a new PairwiseRenderContext which has had
both of its FeatureHolders filtered with the
FeatureFilter.
Instances of this class cache up to 5 of the derived
PairwiseRenderContexts. Therefore cycling through up
to 5 different FeatureFilters will only be hitting the
cache rather than recalculating everthing. Should the
FeatureHolders themselves change, the cache will be
flushed. As only the features overlapping the context's range are
filtered, changing the range will also result in re-filtering.
PairwiseSequenceRenderer.PairwiseRendererForwarder| Modifier and Type | Field and Description |
|---|---|
protected FeatureFilter |
filter
filter is the filter applied to both
FeatureHolders. |
static ChangeType |
FILTER
Constant
FILTER indicating a change to the
renderer's filter. |
protected boolean |
recurse
recurse indicates whether the filter should
recurse through any subfeatures. |
static ChangeType |
RECURSE
Constant
RECURSE indicating a change to the
renderer's filter recursion flag. |
static ChangeType |
RENDERER
Constant
RENDERER indicating a change to the
renderer. |
| Constructor and Description |
|---|
PairwiseFilteringRenderer(PairwiseSequenceRenderer renderer)
Creates a new
PairwiseFilteringRenderer which uses
a filter which accepts all features. |
PairwiseFilteringRenderer(PairwiseSequenceRenderer renderer,
FeatureFilter filter,
boolean recurse)
Creates a new
PairwiseFilteringRenderer. |
| Modifier and Type | Method and Description |
|---|---|
protected ChangeSupport |
getChangeSupport(ChangeType ct) |
FeatureFilter |
getFilter()
getFilter returns the current filter. |
boolean |
getRecurse()
getRecurse returns the recursion flag of the
filter. |
PairwiseSequenceRenderer |
getRenderer()
getRenderer return the current renderer. |
protected PairwiseRenderContext |
getSubContext(PairwiseRenderContext context)
getSubContext creates a new context which has
FeatureHolders filtered using the current filter. |
void |
paint(java.awt.Graphics2D g2,
PairwiseRenderContext context)
paints some or all of the information about the
sequence pair. |
SequenceViewerEvent |
processMouseEvent(PairwiseRenderContext context,
java.awt.event.MouseEvent me,
java.util.List path)
processMouseEvent produces a
SequenceViewerEvent in response to a mouse
gesture. |
void |
setFilter(FeatureFilter filter)
setFilter sets the filter. |
void |
setRecurse(boolean recurse)
setRecurse sets the recursion flag on the filter. |
void |
setRenderer(PairwiseSequenceRenderer renderer)
setRenderer sets the renderer. |
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListenerpublic static final ChangeType FILTER
FILTER indicating a change to the
renderer's filter.public static final ChangeType RECURSE
RECURSE indicating a change to the
renderer's filter recursion flag.public static final ChangeType RENDERER
RENDERER indicating a change to the
renderer.protected FeatureFilter filter
filter is the filter applied to both
FeatureHolders.protected boolean recurse
recurse indicates whether the filter should
recurse through any subfeatures.public PairwiseFilteringRenderer(PairwiseSequenceRenderer renderer)
PairwiseFilteringRenderer which uses
a filter which accepts all features.renderer - a PairwiseSequenceRenderer.public PairwiseFilteringRenderer(PairwiseSequenceRenderer renderer, FeatureFilter filter, boolean recurse)
PairwiseFilteringRenderer.renderer - a PairwiseSequenceRenderer.filter - a FeatureFilter.recurse - a boolean.protected ChangeSupport getChangeSupport(ChangeType ct)
getChangeSupport in class AbstractChangeablepublic PairwiseSequenceRenderer getRenderer()
getRenderer return the current renderer.PairwiseSequenceRenderer.public void setRenderer(PairwiseSequenceRenderer renderer) throws ChangeVetoException
setRenderer sets the renderer.renderer - a PairwiseSequenceRenderer.ChangeVetoException - if the change is vetoed.public FeatureFilter getFilter()
getFilter returns the current filter.FeatureFilter.public void setFilter(FeatureFilter filter) throws ChangeVetoException
setFilter sets the filter.filter - a FeatureFilter.ChangeVetoException - if the change is vetoed.public boolean getRecurse()
getRecurse returns the recursion flag of the
filter.boolean.public void setRecurse(boolean recurse)
throws ChangeVetoException
setRecurse sets the recursion flag on the filter.recurse - a boolean.ChangeVetoException - if the change is vetoed.public void paint(java.awt.Graphics2D g2,
PairwiseRenderContext context)
PairwiseSequenceRendererpaints some or all of the information about the
sequence pair.paint in interface PairwiseSequenceRendererg2 - a Graphics2D.context - a PairwiseRenderContext encapsulating
the information to be displayed.public SequenceViewerEvent processMouseEvent(PairwiseRenderContext context, java.awt.event.MouseEvent me, java.util.List path)
PairwiseSequenceRendererprocessMouseEvent produces a
SequenceViewerEvent in response to a mouse
gesture.processMouseEvent in interface PairwiseSequenceRenderercontext - a PairwiseRenderContext.me - a MouseEvent that caused the request.path - a List of
PairwiseSequenceRenderer instances passed through
so far.SequenceViewerEvent encapsulating the
mouse gesture.protected PairwiseRenderContext getSubContext(PairwiseRenderContext context)
getSubContext creates a new context which has
FeatureHolders filtered using the current filter.context - a PairwiseRenderContext.PairwiseRenderContext.Copyright © 2018 BioJava. All Rights Reserved.