public abstract class AbstractVisualization extends Object implements Visualization, ContextChangeListener, ResultListener
Modifier and Type | Field and Description |
---|---|
protected VisualizerContext |
context
Our context
|
protected Element |
layer
Layer storage
|
protected Runnable |
pendingRedraw
Pending redraw
|
protected SVGPlot |
svgp
The plot we are attached to
|
protected VisualizationTask |
task
The visualization task we do.
|
Constructor and Description |
---|
AbstractVisualization(VisualizationTask task)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
contextChanged(ContextChangedEvent e)
Method called on context changes (e.g. projection changes).
|
void |
destroy()
Destroy the visualization.
|
protected double |
getHeight()
Get the height
|
Element |
getLayer()
Get the SVG layer of the given visualization.
|
protected double |
getWidth()
Get the width
|
protected void |
incrementalRedraw()
Redraw the visualization (maybe incremental).
|
protected abstract void |
redraw()
Perform a full redraw.
|
void |
resultAdded(Result child,
Result parent)
A new derived result was added.
|
void |
resultChanged(Result current)
Notify that the current result has changed substantially.
|
void |
resultRemoved(Result child,
Result parent)
A result was removed.
|
protected void |
synchronizedRedraw()
Trigger a redraw, but avoid excessive redraws.
|
protected boolean |
testRedraw(ContextChangedEvent e)
Override this method to add additional redraw triggers!
|
protected final VisualizationTask task
protected final VisualizerContext context
protected final SVGPlot svgp
protected Runnable pendingRedraw
protected Element layer
public AbstractVisualization(VisualizationTask task)
task
- Visualization taskpublic void destroy()
Visualization
destroy
in interface Visualization
public Element getLayer()
Visualization
getLayer
in interface Visualization
protected double getWidth()
protected double getHeight()
public void contextChanged(ContextChangedEvent e)
ContextChangeListener
contextChanged
in interface ContextChangeListener
e
- Change eventprotected boolean testRedraw(ContextChangedEvent e)
e
- Eventprotected final void synchronizedRedraw()
protected void incrementalRedraw()
protected abstract void redraw()
public void resultAdded(Result child, Result parent)
ResultListener
resultAdded
in interface ResultListener
child
- New child result addedparent
- Parent result that was added topublic void resultChanged(Result current)
ResultListener
resultChanged
in interface ResultListener
current
- Result that has changed.public void resultRemoved(Result child, Result parent)
ResultListener
resultRemoved
in interface ResultListener
child
- result that was removedparent
- Parent result that was removed from