|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gwoptics.graphics.Renderable org.gwoptics.graphics.graph2D.Graph2D
public class Graph2D
Graph2D is a collection of Axis2D objects and IGraphTrace's. It is the basis of a 2D graph and can have multiple traces added to it, with access to various methods to alter the look and feel of the graph axes and layout.
The traces that this graph excepts must conform to the IGraphTrace interface and must fully implement it correctly. The graph also allows full control over the X and Y axes through controls that begin with setXAxis and setYaxis. Also available is the option to display a border and major grid lines.
Field Summary |
---|
Fields inherited from class org.gwoptics.graphics.Renderable |
---|
position |
Fields inherited from interface processing.core.PConstants |
---|
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MOVE, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, TEXT, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z |
Constructor Summary | |
---|---|
Graph2D(processing.core.PApplet parent,
int xLength,
int yLength,
boolean crossAxesAtZero)
Graph constructor that requires you to define the dimensions of the graph, whether the axes should cross at the 0 and the parent PApplet object which is rendering the graph. |
Method Summary | |
---|---|
int |
addTrace(IGraph2DTrace trace)
Method to add an object that has implements the IGraphTrace interface. |
void |
draw()
Draw method that calls various internal methods to generate each part of the graph. |
void |
generateTrace(int index)
Calls the traces generate method to refresh data. |
IGraph2DBackground |
getGraphBackground()
Gets a reference to the current Background renderer |
Axis2D |
getXAxis()
|
Axis2D |
getYAxis()
|
void |
removeTrace(IGraph2DTrace trace)
Removes a trace from the graph depending on its index. |
void |
setAxisColour(GWColour c)
Sets the colour of the X and Y axes, through a Colour object |
void |
setAxisColour(int R,
int G,
int B)
Sets the colour of the X and Y axes, through RGB values |
void |
setBackground(IGraph2DBackground bk)
Sets an IGraph2DBackground to use to fill the graph background |
void |
setBorderColour(int R,
int G,
int B)
Sets the colour of the border surrounding the graph object |
void |
setFontColour(GWColour c)
Sets the colour of the X and Y fonts, through a Colour object |
void |
setFontColour(int R,
int G,
int B)
Sets the colour of the X and Y axes fonts, through RGB values |
void |
setNoBackground()
Sets the colour of the border surrounding the graph object |
void |
setNoBorder()
Removes border |
void |
setXAxisLabel(java.lang.String s)
Sets the label that describes the data shown on the X-Axis |
void |
setXAxisLabelAccuracy(int l)
Sets the decimal places to show on the X-Axis tick labels |
void |
setXAxisLabelPos(LabelPos lblpos)
Sets the label position for the X-Axis |
void |
setXAxisMax(float val)
Sets the maximum value to be shown on the X-Axis |
void |
setXAxisMin(float val)
Sets the minimum value to be shown on the X-Axis |
void |
setXAxisMinorTicks(int n)
Sets number of minor ticks to show on the X-Axis |
void |
setXAxisTickSpacing(float s)
|
void |
setYAxisLabel(java.lang.String s)
Sets the label that describes the data shown on the Y-Axis |
void |
setYAxisLabelAccuracy(int l)
Sets the decimal places to show on the Y-Axis tick labels |
void |
setYAxisLabelPos(LabelPos lblpos)
Sets the label position for the Y-Axis |
void |
setYAxisMax(float val)
Sets the maximum value to be shown on the Y-Axis |
void |
setYAxisMin(float val)
Sets the minimum value to be shown on the Y-Axis |
void |
setYAxisMinorTicks(int n)
Sets number of minor ticks to show on the Y-Axis |
void |
setYAxisTickSpacing(float s)
|
Methods inherited from class org.gwoptics.graphics.Renderable |
---|
setParent |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Graph2D(processing.core.PApplet parent, int xLength, int yLength, boolean crossAxesAtZero)
parent
- xLength
- yLength
- crossAxesAtZero
- Method Detail |
---|
public void setXAxisTickSpacing(float s)
public void setYAxisTickSpacing(float s)
public void setXAxisMin(float val)
public void setXAxisMax(float val)
public void setYAxisMin(float val)
public void setYAxisMax(float val)
public void setXAxisLabel(java.lang.String s)
public void setYAxisLabel(java.lang.String s)
public void setXAxisLabelPos(LabelPos lblpos)
public void setYAxisLabelPos(LabelPos lblpos)
public void setXAxisLabelAccuracy(int l)
public void setYAxisLabelAccuracy(int l)
public void setXAxisMinorTicks(int n)
public void setYAxisMinorTicks(int n)
public void setAxisColour(int R, int G, int B)
public void setAxisColour(GWColour c)
public void setFontColour(int R, int G, int B)
public void setFontColour(GWColour c)
public IGraph2DBackground getGraphBackground()
IGraph2D
getGraphBackground
in interface IGraph2D
public Axis2D getXAxis()
getXAxis
in interface IGraph2D
public Axis2D getYAxis()
getYAxis
in interface IGraph2D
public void setNoBorder()
public void setNoBackground()
public void setBorderColour(int R, int G, int B)
public void setBackground(IGraph2DBackground bk)
public int addTrace(IGraph2DTrace trace)
trace
- IGraphTrace
public void removeTrace(IGraph2DTrace trace)
trace
- public void generateTrace(int index)
index
- public void draw()
draw
in interface IRenderable
draw
in class Renderable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |