|
||||||||||
| 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.PairwiseOverlayRenderer
public class PairwiseOverlayRenderer
PairwiseOverlayRenderer allows a list of other
PairwiseSequenceRenderers to superimpose their
output. Operations on the child renderers (rendering, event
handling) are carried out in the order in which they were
added.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.biojava.bio.gui.sequence.PairwiseSequenceRenderer |
|---|
PairwiseSequenceRenderer.PairwiseRendererForwarder |
| Field Summary | |
|---|---|
static ChangeType |
RENDERERS
Constant RENDERERS indicating a change to the
renderers handled by the overlay. |
| Constructor Summary | |
|---|---|
PairwiseOverlayRenderer()
Creates a new, empty PairwiseOverlayRenderer. |
|
| Method Summary | |
|---|---|
protected void |
_addRenderer(PairwiseSequenceRenderer renderer)
|
protected void |
_removeRenderer(PairwiseSequenceRenderer renderer)
|
void |
addRenderer(PairwiseSequenceRenderer renderer)
addRenderer adds a renderer. |
void |
clearRenderers()
clearRenderers removes all the renderers. |
protected ChangeSupport |
getChangeSupport(ChangeType ct)
Called to retrieve the ChangeSupport for this object. |
void |
paint(Graphics2D g2,
PairwiseRenderContext context)
paint applies all renderers in the order in which
they were added. |
SequenceViewerEvent |
processMouseEvent(PairwiseRenderContext context,
MouseEvent me,
List path)
processMouseEvent produces a
SequenceViewerEvent in response to a mouse
gesture. |
void |
removeRenderer(PairwiseSequenceRenderer renderer)
removeRenderer removes a 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 RENDERERS
RENDERERS indicating a change to the
renderers handled by the overlay.
| Constructor Detail |
|---|
public PairwiseOverlayRenderer()
PairwiseOverlayRenderer.
| Method Detail |
|---|
public void addRenderer(PairwiseSequenceRenderer renderer)
throws ChangeVetoException
addRenderer adds a renderer.
renderer - a PairwiseSequenceRenderer.
ChangeVetoException - if an error occurs.
public void removeRenderer(PairwiseSequenceRenderer renderer)
throws ChangeVetoException
removeRenderer removes a renderer.
renderer - a PairwiseSequenceRenderer.
ChangeVetoException - if an error occurs.
public void clearRenderers()
throws ChangeVetoException
clearRenderers removes all the renderers.
ChangeVetoException - if an error occurs.
public void paint(Graphics2D g2,
PairwiseRenderContext context)
paint applies all renderers in the order in which
they were added.
paint in interface PairwiseSequenceRendererg2 - a Graphics2D.context - a PairwiseRenderContext.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 AbstractChangeable
public SequenceViewerEvent processMouseEvent(PairwiseRenderContext context,
MouseEvent me,
List path)
processMouseEvent produces a
SequenceViewerEvent in response to a mouse
gesture. The list of renderers are probed in the order in which
they were added and the first renderer to accept the event will
return.
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 void _addRenderer(PairwiseSequenceRenderer renderer)
protected void _removeRenderer(PairwiseSequenceRenderer renderer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||