net.sourceforge.chart2d
Class WarningRegionProperties

java.lang.Object
  |
  +--net.sourceforge.chart2d.WarningRegionProperties

public final class WarningRegionProperties
extends java.lang.Object

The properties of a warning region for GraphChart2D charts. A warning region is a rectangular region of a graph that when a graph component enters it, the graph component in that region is painted with a specific color; also the background of that region is also a specific color. Pass this to any number of GraphChart2D objects.


Field Summary
static java.awt.Color BACKGROUND_COLOR_DEFAULT
          The default is Color.pink.
static boolean BACKGROUND_EXISTENCE_DEFAULT
          The default is true.
static java.awt.Color COMPONENT_COLOR_DEFAULT
          The default is Color.red.
static float HIGH
          Indicates the high value should be the maximum.
static float HIGH_DEFAULT
          The default is HIGH.
static float LOW
          Indicates the low value should be the minimum.
static float LOW_DEFAULT
          The default is LOW.
 
Constructor Summary
WarningRegionProperties()
          Creates a WarningRegionProperties object with the documented default values.
WarningRegionProperties(net.sourceforge.chart2d.WarningRegionProperties warningRegionProps)
          Creates a WarningRegionProperties object with property values copied from another object.
 
Method Summary
 java.awt.Color getBackgroundColor()
          Gets the color that the graph background becomes in this region if the graph background exists.
 boolean getBackgroundExistence()
          Gets the existence of the background irrespective of the existence of the graph's background.
 java.awt.Color getComponentColor()
          Gets the color that any component entering this region should become.
 float getHigh()
          Gets the high value of this warning region.
 float getLow()
          Gets the low value of this warning region.
 void setBackgroundColor(java.awt.Color c)
          Sets the color that the graph background becomes in this region if the graph background exists.
 void setBackgroundExistence(boolean existence)
          Sets the existence of the background irrespective of the existence of the graph's background.
 void setComponentColor(java.awt.Color c)
          Sets the color that any component entering this region should become.
 void setHigh(float h)
          Sets the high value of this warning region.
 void setLow(float l)
          Sets the low value of this warning region.
 void setToDefaults()
          Sets all properties to their default values.
 void setWarningRegionProperties(net.sourceforge.chart2d.WarningRegionProperties warningRegionProps)
          Sets all properties to be the values of another WarningRegionProperties object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIGH

public static final float HIGH
Indicates the high value should be the maximum. For use with setHigh(). Note that HIGH - N where N is some number is invalid.

See Also:
Constant Field Values

LOW

public static final float LOW
Indicates the low value should be the minimum. For use with setHigh(). Note that LOW - N where N is some number is invalid.

See Also:
Constant Field Values

HIGH_DEFAULT

public static final float HIGH_DEFAULT
The default is HIGH.

See Also:
Constant Field Values

LOW_DEFAULT

public static final float LOW_DEFAULT
The default is LOW.

See Also:
Constant Field Values

COMPONENT_COLOR_DEFAULT

public static final java.awt.Color COMPONENT_COLOR_DEFAULT
The default is Color.red.


BACKGROUND_EXISTENCE_DEFAULT

public static final boolean BACKGROUND_EXISTENCE_DEFAULT
The default is true.

See Also:
Constant Field Values

BACKGROUND_COLOR_DEFAULT

public static final java.awt.Color BACKGROUND_COLOR_DEFAULT
The default is Color.pink.

Constructor Detail

WarningRegionProperties

public WarningRegionProperties()
Creates a WarningRegionProperties object with the documented default values.


WarningRegionProperties

public WarningRegionProperties(net.sourceforge.chart2d.WarningRegionProperties warningRegionProps)
Creates a WarningRegionProperties object with property values copied from another object. The copying is a deep copy.

Parameters:
warningRegionProps - The properties to copy.
Method Detail

setToDefaults

public final void setToDefaults()
Sets all properties to their default values.


setWarningRegionProperties

public final void setWarningRegionProperties(net.sourceforge.chart2d.WarningRegionProperties warningRegionProps)
Sets all properties to be the values of another WarningRegionProperties object. The copying is a deep copy.

Parameters:
warningRegionProps - The properties to copy.

setHigh

public final void setHigh(float h)
Sets the high value of this warning region. For example, if your data ranges from 10000 to 0 and you want an orange region from 6000 to 8000, then set the high to 8000. If you want the region to extend from 8000 to the top of the graph, then set the high to HIGH.

Parameters:
h - The high value of this region.

setLow

public final void setLow(float l)
Sets the low value of this warning region. For example, if your data ranges from 10000 to 0 and you want an orange region from 6000 to 8000, then set the low to 6000. If you want the region to extend from 6000 to the bottom of the graph, then set the low to LOW.

Parameters:
l - The low value of this region.

setComponentColor

public final void setComponentColor(java.awt.Color c)
Sets the color that any component entering this region should become. Only the portion of the component that is in the region will be this color. Examples of components are: bars, lines, and dots.

Parameters:
c - The color of the components sections in the region.

setBackgroundExistence

public final void setBackgroundExistence(boolean existence)
Sets the existence of the background irrespective of the existence of the graph's background.

Parameters:
existence - If true, then the background of the warning region will exist.

setBackgroundColor

public final void setBackgroundColor(java.awt.Color c)
Sets the color that the graph background becomes in this region if the graph background exists.

Parameters:
c - The color of the section of the graph background.

getHigh

public final float getHigh()
Gets the high value of this warning region. For example, if your data ranges from 10000 to 0 and you want an orange region from 6000 to 8000, then set the high to 8000. If you want the region to extend from 8000 to the top of the graph, then set the high to HIGH.

Returns:
The high value of this region.

getLow

public final float getLow()
Gets the low value of this warning region. For example, if your data ranges from 10000 to 0 and you want an orange region from 6000 to 8000, then set the low to 6000. If you want the region to extend from 6000 to the bottom of the graph, then set the low to LOW.

Returns:
The low value of this region.

getComponentColor

public final java.awt.Color getComponentColor()
Gets the color that any component entering this region should become. Only the portion of the component that is in the region will be this color. Examples of components are: bars, lines, and dots.

Returns:
The color of the components sections in the region.

getBackgroundExistence

public final boolean getBackgroundExistence()
Gets the existence of the background irrespective of the existence of the graph's background.

Returns:
If true, then the background of the warning region will exist.

getBackgroundColor

public final java.awt.Color getBackgroundColor()
Gets the color that the graph background becomes in this region if the graph background exists.

Returns:
The color of the section of the graph background.