    All Packages  Class Hierarchy  This Package  Previous  Next  Index

# Class JSci.awt.Graph2D

    java.lang.Object
       |
       +----java.awt.Component
               |
               +----java.awt.Canvas
                       |
                       +----JSci.awt.DoubleBufferedCanvas
                               |
                               +----JSci.awt.Graph2D

public abstract class Graph2D
extends DoubleBufferedCanvas
implements GraphDataListener

The Graph2D superclass provides an abstract encapsulation of 2D graphs.

##

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

##

Graph2D(Graph2DModel)
  Constructs a 2D graph.

##

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

##

model

     protected Graph2DModel model

  Data model.

origin

     protected Point origin

  Origin.

minX

     protected float minX

  Min and max data points.

minY

     protected float minY

  Min and max data points.

maxX

     protected float maxX

  Min and max data points.

maxY

     protected float maxY

  Min and max data points.

xScale

     protected float xScale

  Axis scaling.

yScale

     protected float yScale

  Axis scaling.

scalePad

     protected final int scalePad

  Padding.

axisPad

     protected final int axisPad

  Padding.

##

Graph2D

     public Graph2D(Graph2DModel gm)

  Constructs a 2D graph.

##

setModel

     public final void setModel(Graph2DModel gm)

  Sets the data plotted by this graph to the specified data.

getModel

     public final Graph2DModel getModel()

  Returns the model used by this graph.

setNumbering

     public final void setNumbering(boolean flag)

  Turns axis numbering on/off.

setBounds

     public final void setBounds(int x,
                                 int y,
                                 int width,
                                 int height)

  Reshapes the Graph2D to the specified bounding box.

  Overrides:
    setBounds in class Component

rescale

     protected final void rescale()

  Rescales the Graph2D.

dataToScreen

     protected final Point dataToScreen(float x,
                                        float y)

  Converts a data point to screen coordinates.

drawAxes

     protected final void drawAxes(Graphics g)

  Draws the graph axes.

round

     protected final float round(float x)

  Rounds numbers to so many significant figures.

    All Packages  Class Hierarchy  This Package  Previous  Next  Index