|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjaron.gui.Panel
jaron.pde.Graph
public class Graph
The Graph
class provides a graphical component for the Processing
Development Environment (PDE). It contains n graphs that are added and
referenced via a unique key.
Reversing the graph's is done by swapping the high and the low signal values of
the corresponding graph's signal.
The graphs usually get their current amplitudes via the EventListener
mechanism as demonstrated in the example of the UAVsim
.
Field Summary |
---|
Fields inherited from class jaron.gui.Panel |
---|
content, frame, labelBottom, labelLeft, labelRight, labelTop |
Constructor Summary | |
---|---|
Graph(processing.core.PApplet applet,
int left,
int top)
Creates a new Graph object for the Processing Development Environment
(PDE) at a certain position. |
|
Graph(processing.core.PApplet applet,
int left,
int top,
int width,
int height)
Creates a new Graph object for the Processing Development Environment
(PDE) at a certain position and with a certain width and height. |
Method Summary | |
---|---|
void |
addGraph(java.lang.String label,
int color)
Adds a graph that will be drawn periodically. |
Signal |
createGraph(java.lang.String label,
int color)
Adds a graph that will be drawn periodically and returns its signal. |
void |
draw()
Draws the whole graph component, containing all its graphs and the labels,to the screen. |
Signal |
getSignal(java.lang.String label)
Returns the Signal of a certain graph. |
void |
setUpdateFrequency(int frequency)
Sets the frequency on which the graphs should be updated. |
Methods inherited from class jaron.gui.Panel |
---|
getContent, getFrame, getLabelBottom, getLabelLeft, getLabelRight, getLabelTop, setContent, setFrame, setLabelBottomHeight, setLabelLeftWidth, setLabelRightWidth, setLabelTopHeight |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Graph(processing.core.PApplet applet, int left, int top, int width, int height)
Graph
object for the Processing Development Environment
(PDE) at a certain position and with a certain width and height.
applet
- a reference to the PDE applet that provides the drawing environmentleft
- the component's position from the lefttop
- the component's position from topheight
- the component's height including the labelswidth
- the component's width including the labelspublic Graph(processing.core.PApplet applet, int left, int top)
Graph
object for the Processing Development Environment
(PDE) at a certain position.
applet
- a reference to the PDE applet that provides the drawing environmentleft
- the component's position from the lefttop
- the component's position from topMethod Detail |
---|
public void addGraph(java.lang.String label, int color)
label
- a short description and unique identifier of the graphcolor
- the color of the graphColors
public Signal createGraph(java.lang.String label, int color)
label
- a short description and unique identifier of the graphcolor
- the color of the graph
Colors
,
Signal
public void draw()
draw
method of the Processing Development Environment. This ensures that the graph is
updated periodically.
public Signal getSignal(java.lang.String label)
Signal
of a certain graph. The graph is identified
by its label (unique key).
label
- the label identifying the graph
public void setUpdateFrequency(int frequency)
frequency
- the new update frequency
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |