bookExamples.ch27BusinessGraphics.charts
Class DoubleDataBean

java.lang.Object
  extended by bookExamples.ch27BusinessGraphics.charts.DoubleDataBean

public class DoubleDataBean
extends java.lang.Object

DoubleDataBean is the base class which is required in order to draw any graphs. It contains all the utility methods to calculate the necessary graphics.graph data for drawing. Constants include:

Passed parameters set with defaults include:

Since:
JDK 1.3
Author:
Allison McHenry, Douglas Lyon, PhD

Constructor Summary
DoubleDataBean(int w, int h)
          Default constructor, used particularly to instantiate an instance of DoubleDataBean by the LineGraph, PieGraph and BarGraph classes
 
Method Summary
 int getHeight()
          Gets image height.
 java.lang.String getTitle()
          Gets title of all graphs.
 int getWidth()
          Gets image width.
 java.lang.String getXLabel()
          Gets x-axis label on bar graphs and line graphs.
 double[] getXVals()
          Gets X data values - the only values which are set for pie graphs.
 java.lang.String getYLabel()
          Gets y-axis label on bar graphs and line graphs.
 double[] getYVals()
          Gets Y data values - indicate height of bars for bar graphics.graph.
 boolean isGridOn()
          Gets whether or not a grid (lines the height and breadth of the image indicating increment size) should be drawn on line graphs and bar graphs.
 boolean isTicksOn()
          Gets whether ticks (small marks on the x and y axis to indicate increment size) should be drawn on line graphs and bar graphs.
 void setGrid(boolean _isGridOn)
          Sets whether or not a grid (lines the height and breadth of the image indicating increment size) should be drawn on line graphs and bar graphs.
 void setHeight(int _height)
          Sets image height.
 void setTicks(boolean _isTicksOn)
          Sets whether ticks (small marks on the x and y axis to indicate increment size) should be drawn on line graphs and bar graphs.
 void setTitle(java.lang.String _title)
          Sets title of all graphs.
 void setWidth(int _width)
          Sets image width.
 void setXLabel(java.lang.String _xLabel)
          Sets x-axis label on bar graphs and line graphs.
 void setXVals(double[] _xVals)
           
 void setYLabel(java.lang.String _yLabel)
          Sets y-axis label on bar graphs and line graphs.
 void setYVals(double[] _yVals)
          Sets Y data values - indicate height of bars for bar graphics.graph.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleDataBean

public DoubleDataBean(int w,
                      int h)
Default constructor, used particularly to instantiate an instance of DoubleDataBean by the LineGraph, PieGraph and BarGraph classes

Method Detail

setWidth

public void setWidth(int _width)
Sets image width.

Parameters:
_width - image width (not frame width)

setHeight

public void setHeight(int _height)
Sets image height.

Parameters:
_height - image height (not frame height)

setXLabel

public void setXLabel(java.lang.String _xLabel)
Sets x-axis label on bar graphs and line graphs.

Parameters:
_xLabel - x-axis label

setYLabel

public void setYLabel(java.lang.String _yLabel)
Sets y-axis label on bar graphs and line graphs.

Parameters:
_yLabel - y-axis label

setTitle

public void setTitle(java.lang.String _title)
Sets title of all graphs.

Parameters:
_title - Graph title

setGrid

public void setGrid(boolean _isGridOn)
Sets whether or not a grid (lines the height and breadth of the image indicating increment size) should be drawn on line graphs and bar graphs.

Parameters:
_isGridOn - whether a grid should be drawn

setTicks

public void setTicks(boolean _isTicksOn)
Sets whether ticks (small marks on the x and y axis to indicate increment size) should be drawn on line graphs and bar graphs.

Parameters:
_isTicksOn - whether ticks should be drawn

setXVals

public void setXVals(double[] _xVals)
Parameters:
_xVals - array of x data values

setYVals

public void setYVals(double[] _yVals)
Sets Y data values - indicate height of bars for bar graphics.graph. Not set for pie.

Parameters:
_yVals - array of y data values

getWidth

public int getWidth()
Gets image width.

Returns:
width image width (not frame width)

getHeight

public int getHeight()
Gets image height.

Returns:
height image height (not frame height)

getXLabel

public java.lang.String getXLabel()
Gets x-axis label on bar graphs and line graphs.

Returns:
xLabel x-axis label

getYLabel

public java.lang.String getYLabel()
Gets y-axis label on bar graphs and line graphs.

Returns:
yLabel y-axis label

getTitle

public java.lang.String getTitle()
Gets title of all graphs.

Returns:
title Graph title

isGridOn

public boolean isGridOn()
Gets whether or not a grid (lines the height and breadth of the image indicating increment size) should be drawn on line graphs and bar graphs.

Returns:
isGridOn whether a grid should be drawn

isTicksOn

public boolean isTicksOn()
Gets whether ticks (small marks on the x and y axis to indicate increment size) should be drawn on line graphs and bar graphs.

Returns:
isTicksOn whether ticks should be drawn

getXVals

public double[] getXVals()
Gets X data values - the only values which are set for pie graphs.

Returns:
xVals array of x data values

getYVals

public double[] getYVals()
Gets Y data values - indicate height of bars for bar graphics.graph. Not set for pie.

Returns:
yVals array of y data values