net.sourceforge.chart2d
Class GraphChartArea

java.lang.Object
  |
  +--net.sourceforge.chart2d.Area
        |
        +--net.sourceforge.chart2d.FontArea
              |
              +--net.sourceforge.chart2d.TitledArea
                    |
                    +--net.sourceforge.chart2d.ChartArea
                          |
                          +--net.sourceforge.chart2d.GraphChartArea
Direct Known Subclasses:
LBChartArea, LLChartArea

class GraphChartArea
extends ChartArea

A container containing information and components for cartesian coordinate charts. That is, charts that are plotted on a parralelogram surface.


Fields inherited from class net.sourceforge.chart2d.ChartArea
DEFAULT_FLOAT, MAX_FLOAT, MAX_INTEGER
 
Fields inherited from class net.sourceforge.chart2d.Area
BETWEEN, BOTTOM, CENTER, CENTERED, CONTINUOUS, DASHED, DOTTED, FLOAT, HEIGHT, HORIZONTAL, INTEGER, LABELSBOTTOM, LABELSLEFT, LEFT, LEFTBOTTOM, LEFTRIGHT, LEFTTOP, LESSER, MAX, MAXMODEL, MIN, RIGHT, RIGHTBOTTOM, RIGHTTOP, TOP, TOPBOTTOM, VERTICAL, WIDTH
 
Constructor Summary
(package private) GraphChartArea()
          Creates a Graph Chart Area with the default values of a TitledArea, and its own default values.
 
Method Summary
(package private)  void addDataset(Dataset dataset)
          Adds another "dataSets" to the chart.
(package private)  void addGraph(GraphArea graph)
          Adds another graph area to the chart.
(package private)  void clearDatasetVector()
          Clears the dataset vector.
(package private)  float getCustomGreatestValue()
          Gets the float value passed to setCustomGreatestValue (boolean, float).
(package private)  boolean getCustomizeGreatestValue()
          Gets the boolean value passed to setCustomGreatestValue (boolean, float).
(package private)  boolean getCustomizeLeastValue()
          Gets the boolean value passed to setCustomLeastValue (boolean, float).
(package private)  float getCustomLeastValue()
          Gets the float value passed to setCustomLeastValue (boolean, float).
(package private)  java.util.Vector getDataSetsVector()
          Returns a vector with all the data sets that were added by the addDataSets method.
(package private)  java.util.Vector getDatasetVector()
          Returns all the Dataset objects added to this object.
(package private)  float getGraphableToAvailableRatio()
          Returns this property in order for subclasses to have access to it.
(package private)  boolean getGraphChartAreaNeedsUpdate()
          Indicates whether some property of this class has changed.
(package private)  int getGraphOverlayOrder()
          Matches GraphChart2DProperties.setGraphOverlayOrder (int).
(package private)  int[] getGraphOverlayOrderCustom()
          Matches GraphChart2DProperties.setGraphOverlayOrderCustom (int[]).
(package private)  float getGraphToHeightRatio()
          Returns this property in order for subclasses to have access to it.
(package private)  float getGraphToWidthRatio()
          Returns this property in order for subclasses to have access to it.
(package private)  java.util.Vector getGraphVector()
          Returns a vector with all the graphs that were added by the addGraph method.
(package private)  float getNumbersAxisRangeHigh()
          For accessing the range of the numbers axis.
(package private)  float getNumbersAxisRangeLow()
          For accessing the range of the numbers axis.
(package private)  int getNumPlotAxisLabels()
          Gets the number of labels for the plot axis.
(package private)  XAxisArea getXAxis()
          Returns the x Axis in order to allow customizations of it.
(package private)  float getXAxisToHeightRatio()
          Returns this property in order for subclasses to have access to it.
(package private)  float getXAxisToWidthRatio()
          Returns this property in order for subclasses to have access to it.
(package private)  YAxisArea getYAxis()
          Returns the y axis in order to allow customization of it.
(package private)  float getYAxisToHeightRatio()
          Returns this property in order for subclasses to have access to it.
(package private)  float getYAxisToWidthRatio()
          Returns this property in order for subclasses to have access to it.
(package private)  void paintComponent(java.awt.Graphics2D g2D)
          Updates this parent's variables, and this' variables.
(package private)  void resetGraphChartAreaModel(boolean reset)
          Resets the model for this class.
(package private)  void setCustomGreatestValue(boolean customize, float value)
          Influences the plot axis' label with the highest value.
(package private)  void setCustomLeastValue(boolean customize, float value)
          Influences the plot axis' label with the lowest value.
(package private)  void setGraphableToAvailableRatio(float ratio)
          Specifies how much of he height of the graph to make available to the components plot area.
(package private)  void setGraphOverlayOrder(int which)
          Matches GraphChart2DProperties.setGraphOverlayOrder (int).
(package private)  void setGraphOverlayOrderCustom(int[] order)
          Matches GraphChart2DProperties.setGraphOverlayOrderCustom (int[]).
(package private)  void setGraphToHeightRatio(float ratio)
          Specifies how much of the maximum height less borders, gaps, and title to make availalble to the graph maximum size.
(package private)  void setGraphToWidthRatio(float ratio)
          Specifies how much of the maximum width less borders and gaps to make availalble to the graph maximum size.
(package private)  void setNumbersAxisRangeHigh(float high)
          For setting the range of the numbers axis.
(package private)  void setNumbersAxisRangeLow(float low)
          For setting the range of the numbers axis.
(package private)  void setNumPlotAxisLabels(int num)
          Sets the number of labels for the plot axis.
(package private)  void setXAxisToHeightRatio(float ratio)
          Specifies how much of the maximum height less borders, gaps, and title to make availalble to the x axis maximum size.
(package private)  void setXAxisToWidthRatio(float ratio)
          Specifies how much of the maximum width less borders and gaps to make availalble to the x axis maximum size.
(package private)  void setYAxisToHeightRatio(float ratio)
          Specifies how much of the maximum height less borders, gaps, and title to make availalble to the y axis maximum size.
(package private)  void setYAxisToWidthRatio(float ratio)
          Specifies how much of the maximum width less borders and gaps to make availalble to the y axis maximum size.
(package private)  void updateGraphChartArea(java.awt.Graphics2D g2D)
          Updates this parent's variables, and this' variables.
 
Methods inherited from class net.sourceforge.chart2d.ChartArea
getAutoColor, getAutoSetLayoutRatios, getBetweenChartAndLegendGapExistence, getBetweenChartAndLegendGapThicknessModel, getChartAreaNeedsUpdate, getColorsType, getDataCategoryTotals, getDataSetColors, getDataSetColors, getDataSetTotal, getFloatToString, getLabelsPrecisionNum, getLegend, getLegendExistence, getLegendToHeightRatio, getLegendToWidthRatio, getPrecisionCeil, getPrecisionFloor, getPrecisionRound, getTitleSqueeze, resetChartAreaModel, setAutoColor, setAutoSetLayoutRatios, setBetweenChartAndLegendGapExistence, setBetweenChartAndLegendGapThicknessModel, setDataSetColors, setDataSetColorsType, setLabelsPrecisionNum, setLegendExistence, setLegendToHeightRatio, setLegendToWidthRatio, setNumDataSets, setTitleSqueeze, updateChartArea
 
Methods inherited from class net.sourceforge.chart2d.TitledArea
getBetweenTitleAndSpaceGapThickness, getBetweenTitleAndSpaceGapThicknessModel, getMaxEntitledSpaceBounds, getTitle, getTitleAutoLocate, getTitledAreaNeedsUpdate, getTitleExistence, getTitleJustifications, getTitleSize, getTitleText, resetTitledAreaModel, setBetweenTitleAndSpaceGapExistence, setBetweenTitleAndSpaceGapThicknessModel, setTitle, setTitleAutoLocate, setTitleExistence, setTitleJustifications, setTitleLocation, setTitleRotateLeft, updateTitledArea
 
Methods inherited from class net.sourceforge.chart2d.FontArea
getFont, getFontAreaNeedsUpdate, getFontColor, getFontName, getFontPointModel, getFontStyle, resetFontAreaModel, setFontColor, setFontName, setFontPointModel, setFontStyle, updateFontArea
 
Methods inherited from class net.sourceforge.chart2d.Area
applyRatio, getAreaNeedsUpdate, getAutoSize, getBackgroundColor, getBackgroundExistence, getBorderColor, getBorderColor, getBorderExistence, getBorderExistence, getBorderThickness, getBorderThickness, getBorderThicknessModel, getBorderThicknessModel, getGapThickness, getGapThicknessModel, getJustifications, getRatio, getResetAreaModel, getSize, getSizeLocation, getSpaceSize, getSpaceSizeLocation, resetAreaModel, setAutoJustifys, setAutoSizes, setBackgroundColor, setBackgroundExistence, setBorderAssociations, setBorderColor, setBorderColors, setBorderCornerAssociations, setBorderExistence, setBorderExistences, setBorderThicknessModel, setBorderThicknessModels, setCustomRatio, setGapAssociations, setGapExistence, setGapExistences, setGapThicknessModel, setGapThicknessModels, setJustifications, setLockRatios, setSize, setSizeLocation, setSpaceSize, setSpaceSizeLocation, updateArea
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphChartArea

GraphChartArea()
Creates a Graph Chart Area with the default values of a TitledArea, and its own default values.
Method Detail

setNumbersAxisRangeHigh

void setNumbersAxisRangeHigh(float high)
For setting the range of the numbers axis.

setNumbersAxisRangeLow

void setNumbersAxisRangeLow(float low)
For setting the range of the numbers axis.

getNumbersAxisRangeHigh

float getNumbersAxisRangeHigh()
For accessing the range of the numbers axis.

getNumbersAxisRangeLow

float getNumbersAxisRangeLow()
For accessing the range of the numbers axis.

setGraphOverlayOrder

void setGraphOverlayOrder(int which)
Matches GraphChart2DProperties.setGraphOverlayOrder (int).

setGraphOverlayOrderCustom

void setGraphOverlayOrderCustom(int[] order)
Matches GraphChart2DProperties.setGraphOverlayOrderCustom (int[]).

getGraphOverlayOrder

int getGraphOverlayOrder()
Matches GraphChart2DProperties.setGraphOverlayOrder (int).

getGraphOverlayOrderCustom

int[] getGraphOverlayOrderCustom()
Matches GraphChart2DProperties.setGraphOverlayOrderCustom (int[]).

addDataset

void addDataset(Dataset dataset)
Adds another "dataSets" to the chart. When adding another "dataSets" to the chart, the inner array must be a multiple of the number of labels on the "labels" axis. Also, one must configure and add a new LBGraphArea the the LBGraphChartArea.
Parameters:
dataSets - Another data set to graph.

clearDatasetVector

void clearDatasetVector()
Clears the dataset vector.

getDataSetsVector

java.util.Vector getDataSetsVector()
Returns a vector with all the data sets that were added by the addDataSets method.
Returns:
Vector A vector of data sets.

getDatasetVector

java.util.Vector getDatasetVector()
Returns all the Dataset objects added to this object.
Returns:
Vector The Dataset objects.

setNumPlotAxisLabels

void setNumPlotAxisLabels(int num)
Sets the number of labels for the plot axis. For every graph chart, there are two axes. One axis you specify the labels (ex. June, July, August); the other axis, this library figures out the labels (ex. 250 or 1.95). The axis the library labels is the plot axis.
Parameters:
num - The number of plot axis labels.

setYAxisToWidthRatio

void setYAxisToWidthRatio(float ratio)
Specifies how much of the maximum width less borders and gaps to make availalble to the y axis maximum size.
Parameters:
ratio - The ratio to the width, to make available to the y axis.

setYAxisToHeightRatio

void setYAxisToHeightRatio(float ratio)
Specifies how much of the maximum height less borders, gaps, and title to make availalble to the y axis maximum size.
Parameters:
ratio - The ratio to the height, to make available to the y axis.

setXAxisToWidthRatio

void setXAxisToWidthRatio(float ratio)
Specifies how much of the maximum width less borders and gaps to make availalble to the x axis maximum size.
Parameters:
ratio - The ratio to the width, to make available to the x axis.

setXAxisToHeightRatio

void setXAxisToHeightRatio(float ratio)
Specifies how much of the maximum height less borders, gaps, and title to make availalble to the x axis maximum size.
Parameters:
ratio - The ratio to the height, to make available to the x axis.

setGraphToWidthRatio

void setGraphToWidthRatio(float ratio)
Specifies how much of the maximum width less borders and gaps to make availalble to the graph maximum size.
Parameters:
ratio - The ratio to the width, to make available to the graph.

setGraphToHeightRatio

void setGraphToHeightRatio(float ratio)
Specifies how much of the maximum height less borders, gaps, and title to make availalble to the graph maximum size.
Parameters:
ratio - The ratio to the height, to make available to the graph.

setCustomGreatestValue

void setCustomGreatestValue(boolean customize,
                            float value)
Influences the plot axis' label with the highest value. Does this by tricking chart2d into thinking that the passed value is the largest value in the dataset. Then if setGraphableToAvailableRatio (1f), the plot axis' label with the the highest value will be the custom greatest value. So, in order to control what the highest value plot axis label is, then use this method, the setGraphableToAvailableRatio method, and the setLabelsPrecisionNum method. Note: If there are both positive and negative numbers in the dataset then you may need to set both custom greatest and custom least methods since labels are always equally far from zero.
Parameters:
customize - Whether this value is used.
value - The value to use.

setCustomLeastValue

void setCustomLeastValue(boolean customize,
                         float value)
Influences the plot axis' label with the lowest value. Does this by tricking chart2d into thinking that the passed value is the largest value in the dataset. Then if setGraphableToAvailableRatio (1f), the plot axis' label with the the highest value will be the custom greatest value. So, in order to control what the highest value plot axis label is, then use this method, the setGraphableToAvailableRatio method, and the setLabelsPrecisionNum method. Note: If there are both positive and negative numbers in the dataset then you may need to set both custom greatest and custom least methods since labels are always equally far from zero.
Parameters:
customize - Whether this value is used.
value - The value to use.

setGraphableToAvailableRatio

void setGraphableToAvailableRatio(float ratio)
Specifies how much of he height of the graph to make available to the components plot area. If this ratio is set to one, then the highest value of all the data sets will touch the top of the graph area.
Parameters:
ratio - The ratio of the graph height to the greatest value in the data set. [Must be between 0.0 and 1.0]

getXAxis

XAxisArea getXAxis()
Returns the x Axis in order to allow customizations of it.
Returns:
The x axis of this chart.

getYAxis

YAxisArea getYAxis()
Returns the y axis in order to allow customization of it.
Returns:
The y axis of this chart.

addGraph

void addGraph(GraphArea graph)
Adds another graph area to the chart. This must be accompanied by adding another "datasets".
Parameters:
graph - The graph for the added dataset.

getGraphVector

java.util.Vector getGraphVector()
Returns a vector with all the graphs that were added by the addGraph method.
Returns:
Vector A vector of graphs.

getNumPlotAxisLabels

int getNumPlotAxisLabels()
Gets the number of labels for the plot axis. For every graph chart, there are two axes. One axis you specify the labels (ex. June, July, August); the other axis, this library figures out the labels (ex. 250 or 1.95). The axis the library labels is the plot axis.
Returns:
The number of plot axis labels.

getYAxisToWidthRatio

float getYAxisToWidthRatio()
Returns this property in order for subclasses to have access to it.
Returns:
The specified property.

getYAxisToHeightRatio

float getYAxisToHeightRatio()
Returns this property in order for subclasses to have access to it.
Returns:
The specified property.

getXAxisToWidthRatio

float getXAxisToWidthRatio()
Returns this property in order for subclasses to have access to it.
Returns:
The specified property.

getXAxisToHeightRatio

float getXAxisToHeightRatio()
Returns this property in order for subclasses to have access to it.
Returns:
The specified property.

getGraphToWidthRatio

float getGraphToWidthRatio()
Returns this property in order for subclasses to have access to it.
Returns:
The specified property.

getGraphToHeightRatio

float getGraphToHeightRatio()
Returns this property in order for subclasses to have access to it.
Returns:
The specified property.

getCustomizeGreatestValue

boolean getCustomizeGreatestValue()
Gets the boolean value passed to setCustomGreatestValue (boolean, float).
Returns:
True if the max value is being customized.

getCustomGreatestValue

float getCustomGreatestValue()
Gets the float value passed to setCustomGreatestValue (boolean, float).
Returns:
The max value.

getCustomizeLeastValue

boolean getCustomizeLeastValue()
Gets the boolean value passed to setCustomLeastValue (boolean, float).
Returns:
True if the min value is being customized.

getCustomLeastValue

float getCustomLeastValue()
Gets the float value passed to setCustomLeastValue (boolean, float).
Returns:
The min value.

getGraphableToAvailableRatio

float getGraphableToAvailableRatio()
Returns this property in order for subclasses to have access to it.
Returns:
The specified property.

getGraphChartAreaNeedsUpdate

boolean getGraphChartAreaNeedsUpdate()
Indicates whether some property of this class has changed.
Returns:
boolean true if some property has changed.

resetGraphChartAreaModel

void resetGraphChartAreaModel(boolean reset)
Resets the model for this class. The model is used for shrinking and growing of its components based on the maximum size of this class. If this method is called, then the next time the maximum size is set, this classes model maximum size will be made equal to the new maximum size. Effectively what this does is ensure that whenever this objects maximum size is equal to the one given, then all of the components will take on their default model sizes. Note: This is only useful when auto model max sizing is disabled.
Parameters:
reset - True resets the max model upon the next max sizing.

updateGraphChartArea

void updateGraphChartArea(java.awt.Graphics2D g2D)
Updates this parent's variables, and this' variables.
Parameters:
g2D - The graphics context to use for calculations.

paintComponent

void paintComponent(java.awt.Graphics2D g2D)
Updates this parent's variables, and this' variables.
Overrides:
paintComponent in class ChartArea
Parameters:
g2D - The graphics context to use for calculations.