|
||||||||||
| 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.PairwiseFilteringRenderer
public class PairwiseFilteringRenderer
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.biojava.bio.gui.sequence.PairwiseSequenceRenderer |
|---|
PairwiseSequenceRenderer.PairwiseRendererForwarder |
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
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. |
|
| Method Summary | |
|---|---|
protected ChangeSupport |
getChangeSupport(ChangeType ct)
Called to retrieve the ChangeSupport for this object. |
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(Graphics2D g2,
PairwiseRenderContext context)
paints some or all of the information about the
sequence pair. |
SequenceViewerEvent |
processMouseEvent(PairwiseRenderContext context,
MouseEvent me,
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. |
| Methods inherited from class org.biojava.utils.AbstractChangeable |
|---|
addChangeListener, addChangeListener, generateChangeSupport, 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 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.
| Constructor Detail |
|---|
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.| Method Detail |
|---|
protected ChangeSupport getChangeSupport(ChangeType ct)
AbstractChangeable
Your implementation of this method should have the following structure:
It is usual for the forwarding listeners (someForwarder in this example) to
be transient and lazily instantiated. Be sure to register & unregister the
forwarder in the code that does the ChangeEvent handling in setter methods.
ChangeSupport cs = super.getChangeSupport(ct);
if(someForwarder == null && ct.isMatching(SomeInterface.SomeChangeType)) {
someForwarder = new ChangeForwarder(...
this.stateVariable.addChangeListener(someForwarder, VariableInterface.AChange);
}
return cs;
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(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,
MouseEvent me,
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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||