All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JSci.swing.JGraph2D

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----javax.swing.JComponent
                           |
                           +----JSci.swing.JDoubleBufferedComponent
                                   |
                                   +----JSci.swing.JGraph2D

public abstract class JGraph2D
extends JDoubleBufferedComponent
implements GraphDataListener
The JGraph2D superclass provides an abstract encapsulation of 2D graphs.


Variable Index

 o axisPad
Padding.
 o maxX
Min and max data points.
 o maxY
Min and max data points.
 o minX
Min and max data points.
 o minY
Min and max data points.
 o model
Data model.
 o origin
Origin.
 o scalePad
Padding.
 o xScale
Axis scaling.
 o yScale
Axis scaling.

Constructor Index

 o JGraph2D(Graph2DModel)
Constructs a 2D graph.

Method Index

 o dataChanged(GraphDataEvent)
Sent when the contents of the model has changed.
 o dataToScreen(float, float)
Converts a data point to screen coordinates.
 o drawAxes(Graphics)
Draws the graph axes.
 o getModel()
Returns the model used by this graph.
 o rescale()
Rescales the JGraph2D.
 o round(float)
Rounds numbers to so many significant figures.
 o setBounds(int, int, int, int)
Reshapes the JGraph2D to the specified bounding box.
 o setModel(Graph2DModel)
Sets the data plotted by this graph to the specified data.
 o setNumbering(boolean)
Turns axis numbering on/off.

Variables

 o model
 protected Graph2DModel model
Data model.

 o origin
 protected Point origin
Origin.

 o minX
 protected float minX
Min and max data points.

 o minY
 protected float minY
Min and max data points.

 o maxX
 protected float maxX
Min and max data points.

 o maxY
 protected float maxY
Min and max data points.

 o xScale
 protected float xScale
Axis scaling.

 o yScale
 protected float yScale
Axis scaling.

 o scalePad
 protected final int scalePad
Padding.

 o axisPad
 protected final int axisPad
Padding.

Constructors

 o JGraph2D
 public JGraph2D(Graph2DModel gm)
Constructs a 2D graph.

Methods

 o setModel
 public final void setModel(Graph2DModel gm)
Sets the data plotted by this graph to the specified data.

 o getModel
 public final Graph2DModel getModel()
Returns the model used by this graph.

 o setNumbering
 public final void setNumbering(boolean flag)
Turns axis numbering on/off.

 o setBounds
 public final void setBounds(int x,
                             int y,
                             int width,
                             int height)
Reshapes the JGraph2D to the specified bounding box.

Overrides:
setBounds in class Component
 o rescale
 protected final void rescale()
Rescales the JGraph2D.

 o dataToScreen
 protected final Point dataToScreen(float x,
                                    float y)
Converts a data point to screen coordinates.

 o drawAxes
 protected final void drawAxes(Graphics g)
Draws the graph axes.

 o round
 protected final float round(float x)
Rounds numbers to so many significant figures.


All Packages  Class Hierarchy  This Package  Previous  Next  Index