com.ge.research.acuity.ui
Class GraphPO

java.lang.Object
  extended bycom.ge.research.acuity.ui.PresentationObject
      extended bycom.ge.research.acuity.ui.IndependentDisplayPO
          extended bycom.ge.research.acuity.ui.GraphPO
Direct Known Subclasses:
Graph2D, Graph3D

public abstract class GraphPO
extends IndependentDisplayPO

Abstract presentation object that represents a Graph. Graphs have attributes and properties about their title and their axes. Graphs contain Dataseries, which hold the actual information that is plotted.

Version:
$Revision: 1.1 $ $Date: 2006/08/11 00:17:24 $
Author:
garbiras
Created on:
Dec 7, 2004

Constructor Summary
GraphPO(java.lang.String title)
          The default constructor.
 
Method Summary
 void addDataseries(Dataseries series)
          Adds a Dataseries to the List of dataseries to be displayed in this graph.
 void addXLabel(double xValue, java.lang.String label)
          Adds a label to the Map of x axis values to display labels for the x axis point xValue
 void addYLabel(double yValue, java.lang.String label)
          Adds a label to the Map of y axis values to display labels for the y axis point yValue
 boolean displayXGridlines()
          Returns the state of the x axis gridline display flag
 boolean displayYGridlines()
          Returns the state of the y axis gridline display flag
 java.util.List getDataseries()
          Returns the ordered list of Dataseries to be displayed in this graph.
 Dataseries getDataseries(int index)
          Returns the Dataseries from the list of contained series, at the specified index The order is checked and guaranteed before attempting to find the specified index.
 double getMaxXValue()
          Returns the max x value of all the Dataseries contained within this graph
 double getMaxYValue()
          Returns the max y value of all the Dataseries contained within this graph
 double getMinXValue()
          Returns the min x value of all the Dataseries contained within this graph
 double getMinYValue()
          Returns the min y value of all the Dataseries contained within this graph
 float getOpacity()
          Returns the opaqueness factor that gets applied to all the Dataseries contained by this graph
 java.lang.String getTitle()
          Returns the label to be used as the title of the graph
 java.lang.String getXAxisTitle()
          Returns the label to be used as the title of the x axis on the graph
 java.util.Map getXLabels()
          Returns the map of x axis point values to the labels that should be used when displaying the x axis in a graph
 java.lang.String getYAxisTitle()
          Returns the label to be used as the title of the y axis on the graph
 java.util.Map getYLabels()
          Returns the map of y axis point values to the labels that should be used when displaying the y axis in a graph
 void refreshHighlightRegions()
          Sets the current max plotting boundaries to any highlight region dataseries within the graph, so that they cover the current width or height of the chart.
 void removeDataseries()
          Removes all Dataseries from the list of series displayed in this graph
 void removeDataseries(Dataseries series)
          Removes the specified Dataseries from the list of contained series
 void removeDataseries(int index)
          Removes the Dataseries, at the specified index, from the list of contained series
 void removeXLabel(double xValue)
          Removes the x axis point value to label relationship in the xLabels map for the x axis point value xValue
 void removeXLabels()
          Removes all the x axis point value to label relationships
 void removeYLabel(double yValue)
          Removes the y axis point value to label relationship in the yLabels map for the y axis point value yValue
 void removeYLabels()
          Removes all the y axis point value to label relationships
protected  void reorderDataseries()
          Sets the flag indicating that the List of dataseries needs to be reordered.
 void setDisplayXGridlines(boolean b)
          Sets the state of the x axis gridline display flag
 void setDisplayYGridlines(boolean b)
          Sets the state of the y axis gridline display flag
 void setHasPresentationNature(java.lang.String string)
          Overrides setHasPresentationNature in PresentationObject.
 void setOpacity(float f)
          Sets the opaqueness factor that gets applied to all the Dataseries contained by this graph
 void setTitle(java.lang.String title)
          Sets the title of the graph
 void setXAxisTitle(java.lang.String title)
          Sets the title of the x axis
 void setXLabels(java.util.Map map)
          Sets the map relating x axis point values to the labels that should be used when displaying the x axis in a graph
 void setYAxisTitle(java.lang.String title)
          Sets the title of the y axis
 void setYLabels(java.util.Map map)
          Sets the map relating y axis point values to the labels that should be used when displaying the y axis in a graph
 
Methods inherited from class com.ge.research.acuity.ui.IndependentDisplayPO
canBeRemoved, displayBanner, getHeight, getIdentifierTitle, getWidth, getXPos, getYPos, getZOrder, setCanBeRemoved, setDisplayBanner, setHeight, setIdentifier, setIdentifierTitle, setPos, setPos, setPos, setPos, setWidth, setXPos, setYPos, setZOrder
 
Methods inherited from class com.ge.research.acuity.ui.PresentationObject
addLookupInfo, getHasPresentationNature, getIdentifier, getLookupInfo, getSubject, hasSubject, isDisplayed, isEditable, setEditability, setIsDisplayed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphPO

public GraphPO(java.lang.String title)
The default constructor. Calls super(). Sets the graph title.

Parameters:
title - the graph title
See Also:
PresentationObject.PresentationObject(), setTitle(java.lang.String)
Method Detail

addDataseries

public void addDataseries(Dataseries series)
Adds a Dataseries to the List of dataseries to be displayed in this graph. If the Dataseries is a HighlightRegionDataseries, then it sets the region min/max values for the series, from the information about the other Dataseries in the graph.

Parameters:
series - the dataseries to add to the list of series to be displayed in the graph
See Also:
HighlightRegionDataseries.isXOrientation(), HighlightRegionDataseries.setRegionMax(double), HighlightRegionDataseries.setRegionMin(double)

addXLabel

public void addXLabel(double xValue,
                      java.lang.String label)
Adds a label to the Map of x axis values to display labels for the x axis point xValue

Parameters:
xValue - the value of the x axis to add a label for
label - the label to display on the x axis at the point xValue

addYLabel

public void addYLabel(double yValue,
                      java.lang.String label)
Adds a label to the Map of y axis values to display labels for the y axis point yValue

Parameters:
yValue - the value of the y axis to add a label for
label - the label to display on the y axis at the point yValue

displayXGridlines

public boolean displayXGridlines()
Returns the state of the x axis gridline display flag

Returns:
true if x axis gridlines are to be displayed in the graph; false otherwise

displayYGridlines

public boolean displayYGridlines()
Returns the state of the y axis gridline display flag

Returns:
true if y axis gridlines are to be displayed in the graph; false otherwise

getDataseries

public java.util.List getDataseries()
Returns the ordered list of Dataseries to be displayed in this graph. The order is checked and guaranteed before returning the reference.

Returns:
The list of Dataseries contained by this graph
See Also:
com.ge.research.acuity.ui.GraphPO#reorderDataseriesList()

getDataseries

public Dataseries getDataseries(int index)
                         throws java.lang.IndexOutOfBoundsException
Returns the Dataseries from the list of contained series, at the specified index The order is checked and guaranteed before attempting to find the specified index.

Parameters:
index - index of the Dataseries list to extract (zero based)
Returns:
The Dataseries, from the list of contained dataseries, at the specified index
Throws:
java.lang.IndexOutOfBoundsException - If the index argument is negative or greater than or equal to the number of Dataseries contained by this graph
See Also:
com.ge.research.acuity.ui.GraphPO#reorderDataseriesList()

getMaxXValue

public double getMaxXValue()
Returns the max x value of all the Dataseries contained within this graph

Returns:
The max x value of all the the Dataseries contained within this graph

getMaxYValue

public double getMaxYValue()
Returns the max y value of all the Dataseries contained within this graph

Returns:
The max y value of all the the Dataseries contained within this graph

getMinXValue

public double getMinXValue()
Returns the min x value of all the Dataseries contained within this graph

Returns:
The min x value of all the the Dataseries contained within this graph

getMinYValue

public double getMinYValue()
Returns the min y value of all the Dataseries contained within this graph

Returns:
The min y value of all the the Dataseries contained within this graph

getOpacity

public float getOpacity()
Returns the opaqueness factor that gets applied to all the Dataseries contained by this graph

Returns:
The opaqueness factor that is applied to all dataseries displayed in this graph

getTitle

public java.lang.String getTitle()
Returns the label to be used as the title of the graph

Returns:
The label for the graph title

getXAxisTitle

public java.lang.String getXAxisTitle()
Returns the label to be used as the title of the x axis on the graph

Returns:
The label for the x axis

getXLabels

public java.util.Map getXLabels()
Returns the map of x axis point values to the labels that should be used when displaying the x axis in a graph

Returns:
the map of x axis point values to their display labels

getYAxisTitle

public java.lang.String getYAxisTitle()
Returns the label to be used as the title of the y axis on the graph

Returns:
The label for the y axis

getYLabels

public java.util.Map getYLabels()
Returns the map of y axis point values to the labels that should be used when displaying the y axis in a graph

Returns:
the map of y axis point values to their display labels

refreshHighlightRegions

public void refreshHighlightRegions()
Sets the current max plotting boundaries to any highlight region dataseries within the graph, so that they cover the current width or height of the chart.


removeDataseries

public void removeDataseries()
Removes all Dataseries from the list of series displayed in this graph


removeDataseries

public void removeDataseries(Dataseries series)
Removes the specified Dataseries from the list of contained series

Parameters:
series - the dataseries to remove from the list of series to display

removeDataseries

public void removeDataseries(int index)
                      throws java.lang.IndexOutOfBoundsException
Removes the Dataseries, at the specified index, from the list of contained series

Parameters:
index - index of the dataseries list to remove (zero based)
Throws:
java.lang.IndexOutOfBoundsException - If the index argument is negative or greater than or equal to the number of Dataseries contained by this graph

removeXLabel

public void removeXLabel(double xValue)
Removes the x axis point value to label relationship in the xLabels map for the x axis point value xValue

Parameters:
xValue - the x axis value for which to remove label information about from the xLabel map

removeXLabels

public void removeXLabels()
Removes all the x axis point value to label relationships


removeYLabel

public void removeYLabel(double yValue)
Removes the y axis point value to label relationship in the yLabels map for the y axis point value yValue

Parameters:
yValue - the y axis value for which to remove label information about from the yLabel map

removeYLabels

public void removeYLabels()
Removes all the y axis point value to label relationships


setDisplayXGridlines

public void setDisplayXGridlines(boolean b)
Sets the state of the x axis gridline display flag

Parameters:
b - the value of the x axis gridline display flag. true to set x axis gridlines visible; false otherwise

setDisplayYGridlines

public void setDisplayYGridlines(boolean b)
Sets the state of the y axis gridline display flag

Parameters:
b - the value of the y axis gridline display flag. true to set y axis gridlines visible; false otherwise

setHasPresentationNature

public void setHasPresentationNature(java.lang.String string)
Overrides setHasPresentationNature in PresentationObject. Checks that the new value for presentation nature is a valid type for a GraphPO. If not, the value of presentation nature does not change.

Overrides:
setHasPresentationNature in class PresentationObject
Parameters:
string - the new value of presentation nature
See Also:
PresentationNatureConstants.isGraphType(java.lang.String)

setOpacity

public void setOpacity(float f)
Sets the opaqueness factor that gets applied to all the Dataseries contained by this graph

Parameters:
f - the new opaqueness factor to apply to all dataseries displayed in this graph

setTitle

public void setTitle(java.lang.String title)
Sets the title of the graph

Parameters:
title - the new label for the graph title

setXAxisTitle

public void setXAxisTitle(java.lang.String title)
Sets the title of the x axis

Parameters:
title - the new label for the x axis title

setXLabels

public void setXLabels(java.util.Map map)
Sets the map relating x axis point values to the labels that should be used when displaying the x axis in a graph

Parameters:
map - the map of x axis point values to their display labels

setYAxisTitle

public void setYAxisTitle(java.lang.String title)
Sets the title of the y axis

Parameters:
title - the new label for the y axis title

setYLabels

public void setYLabels(java.util.Map map)
Sets the map relating y axis point values to the labels that should be used when displaying the y axis in a graph

Parameters:
map - the map of y axis point values to their display labels

reorderDataseries

protected void reorderDataseries()
Sets the flag indicating that the List of dataseries needs to be reordered.