org.haldean.simplegraph
Class GraphConfiguration

java.lang.Object
  extended by org.haldean.simplegraph.GraphConfiguration

public class GraphConfiguration
extends java.lang.Object

A data object that contains configuration parameters for GraphComponent objects

Author:
Will Brown (will.h.brown@gmail.com)

Constructor Summary
GraphConfiguration()
          Create a GraphConfiguration with the default colors and no label
GraphConfiguration(GraphConfiguration gc)
          Create a GraphConfiguration by doing a shallow copy on a different GraphConfiguration
GraphConfiguration(java.lang.String label)
          Create a GraphConfiguration with a label
 
Method Summary
 java.awt.Color getAxisColor()
          Get the color of the graph's axes.
 java.awt.Color getBackgroundColor()
          Get the background color of the graph.
 java.awt.Color getBorderColor()
          Get the color of the graph's border.
 boolean getEnableInspector()
          Returns true if the inspector is shown.
 boolean getEnableTickLabels()
          Returns true if labels are shown under ticks
 java.awt.Color getInspectorColor()
          Get the inspector color of the graph.
 java.awt.Font getLabelFont()
          Get the font used to draw the label.
 java.lang.String getLabelValue()
          Get the text of the label.
 java.awt.Color getLineColor()
          Get the color of the data series's line.
 int getTickDistance()
          Get the number of units between ticks
 int getTickSkip()
           
 void setAxisColor(java.awt.Color axis)
          Set the color of the graph's axes.
 void setBackgroundColor(java.awt.Color bg)
          Set the background color of the graph.
 void setBorderColor(java.awt.Color border)
          Set the color of the graph's border.
 void setEnableInspector(boolean enable)
          Set to true to show the inspector.
 void setEnableTickLabels(boolean enable)
          Set to true to show labels under ticks
 void setInspectorColor(java.awt.Color bg)
          Set the inspector color of the graph.
 void setLabelFont(java.awt.Font font)
          Set the font used to draw the label.
 void setLabelValue(java.lang.String text)
          Set the text of the label.
 void setLineColor(java.awt.Color line)
          Set the color of the data series's line.
 void setTickDistance(int distance)
          Set the number of units between ticks.
 void setTickSkip(int skip)
          Set the number of ticks to skip between ticks with labels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphConfiguration

public GraphConfiguration()
Create a GraphConfiguration with the default colors and no label


GraphConfiguration

public GraphConfiguration(java.lang.String label)
Create a GraphConfiguration with a label

Parameters:
label - The label for the graph

GraphConfiguration

public GraphConfiguration(GraphConfiguration gc)
Create a GraphConfiguration by doing a shallow copy on a different GraphConfiguration

Parameters:
gc - The GraphConfiguration to copy.
Method Detail

setBackgroundColor

public void setBackgroundColor(java.awt.Color bg)
Set the background color of the graph.


getBackgroundColor

public java.awt.Color getBackgroundColor()
Get the background color of the graph.


setBorderColor

public void setBorderColor(java.awt.Color border)
Set the color of the graph's border. These will be drawn on the four outside edges of the graph.


getBorderColor

public java.awt.Color getBorderColor()
Get the color of the graph's border.


setLineColor

public void setLineColor(java.awt.Color line)
Set the color of the data series's line.


getLineColor

public java.awt.Color getLineColor()
Get the color of the data series's line.


setAxisColor

public void setAxisColor(java.awt.Color axis)
Set the color of the graph's axes.


getAxisColor

public java.awt.Color getAxisColor()
Get the color of the graph's axes.


setInspectorColor

public void setInspectorColor(java.awt.Color bg)
Set the inspector color of the graph.


getInspectorColor

public java.awt.Color getInspectorColor()
Get the inspector color of the graph.


setLabelFont

public void setLabelFont(java.awt.Font font)
Set the font used to draw the label.


getLabelFont

public java.awt.Font getLabelFont()
Get the font used to draw the label.


setLabelValue

public void setLabelValue(java.lang.String text)
Set the text of the label.


getLabelValue

public java.lang.String getLabelValue()
Get the text of the label.


setTickDistance

public void setTickDistance(int distance)
Set the number of units between ticks. Set to zero to disable ticks altogether.


getTickDistance

public int getTickDistance()
Get the number of units between ticks


setEnableTickLabels

public void setEnableTickLabels(boolean enable)
Set to true to show labels under ticks


getEnableTickLabels

public boolean getEnableTickLabels()
Returns true if labels are shown under ticks


setTickSkip

public void setTickSkip(int skip)
Set the number of ticks to skip between ticks with labels. For example, setting this to two means there will be a label on every third tick, or setting it to zero puts a label on every tick.


getTickSkip

public int getTickSkip()

setEnableInspector

public void setEnableInspector(boolean enable)
Set to true to show the inspector.


getEnableInspector

public boolean getEnableInspector()
Returns true if the inspector is shown.