|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IGraph2DTrace
This interface provides the functionality that is required of a trace object, to be used by the Graph2D control.
Classes implementing this interface should be programmed for efficiency, as they are called many times per draw loop. The intended way to work is to store the points of the line in an internal array. When the draw() method is called from the IRenderable interface the method should use the array for plotting the trace. Usually the trace will not change so it is unnescessary to recalculate the equations everytime.
Traces also have the option of having an ITraceColourEffect applied to it. The draw() method should use this effect object to determine the colour of the trace at given points.
ITraceColourEffect
,
ILine2DEquation
Method Summary | |
---|---|
void |
generate()
This is called everytime the equation callback object is changed. |
void |
onAddTrace(java.lang.Object[] traces)
Before the trace is added to the graph control this method is called. |
void |
onRemoveTrace()
Before the trace is officially removed from the trace list of a Graph2D object, the onRemove method is called. |
void |
setGraph(IGraph2D grp)
Sets an internal variable to store a reference to the graph object the trace is being plotted on |
void |
setPosition(int x,
int y)
alters the initial position of the trace on the graph |
Methods inherited from interface org.gwoptics.graphics.IRenderable |
---|
draw, setParent |
Method Detail |
---|
void setGraph(IGraph2D grp)
void generate()
void setPosition(int x, int y)
void onAddTrace(java.lang.Object[] traces)
Before the trace is added to the graph control this method is called. It allows a trace to check the settings of other traces that have previously been added for in Compatibilities. Leave method empty in implementation if no checks are necessary.
w onAddTrace is called from with a synchronised lock so the traces object won't be modified whilst reading it. Therefore it is not necessary to provide custom thread locks.
void onRemoveTrace()
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |