org.gwoptics.graphics.graph2D.traces
Class UpdatingLine2DTrace

java.lang.Object
  extended by org.gwoptics.graphics.graph2D.traces.Line2DTrace
      extended by org.gwoptics.graphics.graph2D.traces.UpdatingLine2DTrace
All Implemented Interfaces:
IGraph2DTrace, IRenderable

public class UpdatingLine2DTrace
extends Line2DTrace


Constructor Summary
UpdatingLine2DTrace(ILine2DEquation eq, long msRefreshRate, float xTickIncr)
           
 
Method Summary
 void draw()
          Uses the data that generate produced beforehand to plot the final trace line.
 void generate()
          Uses the ILineEquation object provided to fill the internal arrays.
 long getRefreshRate()
           
 void onAddTrace(java.lang.Object[] traces)
          Here we override the onAddTrace method to see if any Rolling2DTraces have been previously added.
 void onRemoveTrace()
           Before the trace is officially removed from the trace list of a Graph2D object, the onRemove method is called.
 void pre()
           
 void setParent(processing.core.PApplet parent)
          Sets the parent PApplet object
 
Methods inherited from class org.gwoptics.graphics.graph2D.traces.Line2DTrace
removeEffect, setEquationCallback, setGraph, setLineWidth, setPosition, setTraceColour, setTraceEffect
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdatingLine2DTrace

public UpdatingLine2DTrace(ILine2DEquation eq,
                           long msRefreshRate,
                           float xTickIncr)
Method Detail

getRefreshRate

public long getRefreshRate()

setParent

public void setParent(processing.core.PApplet parent)
Description copied from class: Line2DTrace
Sets the parent PApplet object

Specified by:
setParent in interface IRenderable
Overrides:
setParent in class Line2DTrace

onAddTrace

public void onAddTrace(java.lang.Object[] traces)
Here we override the onAddTrace method to see if any Rolling2DTraces have been previously added. Then check to see if our refresh rate is the same as the others

Specified by:
onAddTrace in interface IGraph2DTrace
Overrides:
onAddTrace in class Line2DTrace

onRemoveTrace

public void onRemoveTrace()
Description copied from interface: IGraph2DTrace

Before the trace is officially removed from the trace list of a Graph2D object, the onRemove method is called. This allows the trace object to provide any cleanup needed, if at all needed. Leave blank if nothing is needed.

Specified by:
onRemoveTrace in interface IGraph2DTrace
Overrides:
onRemoveTrace in class Line2DTrace

generate

public void generate()
Description copied from class: Line2DTrace
Uses the ILineEquation object provided to fill the internal arrays. The arrays are then used to plot the data in the draw method.

Specified by:
generate in interface IGraph2DTrace
Overrides:
generate in class Line2DTrace

pre

public void pre()

draw

public void draw()
Description copied from class: Line2DTrace
Uses the data that generate produced beforehand to plot the final trace line. Also applies any colour of effect to the trace.

Specified by:
draw in interface IRenderable
Overrides:
draw in class Line2DTrace


processing library gwoptics by Daniel Brown and Andreas Freise. (c) 2009 onwards