Package net.sourceforge.chart2d
Class WarningRegionProperties
java.lang.Object
net.sourceforge.chart2d.WarningRegionProperties
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
FieldsModifier and TypeFieldDescriptionstatic final ColorThe default is Color.pink.static final booleanThe default is true.static final ColorThe default is Color.red.static final floatIndicates the high value should be the maximum.static final floatThe default is HIGH.static final floatIndicates the low value should be the minimum.static final floatThe default is LOW. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a WarningRegionProperties object with the documented default values.WarningRegionProperties(WarningRegionProperties warningRegionProps) Creates a WarningRegionProperties object with property values copied from another object. -
Method Summary
Modifier and TypeMethodDescriptionfinal ColorGets the color that the graph background becomes in this region if the graph background exists.final booleanGets the existence of the background irrespective of the existence of the graph's background.final ColorGets the color that any component entering this region should become.final floatgetHigh()Gets the high value of this warning region.final floatgetLow()Gets the low value of this warning region.final voidSets the color that the graph background becomes in this region if the graph background exists.final voidsetBackgroundExistence(boolean existence) Sets the existence of the background irrespective of the existence of the graph's background.final voidSets the color that any component entering this region should become.final voidsetHigh(float h) Sets the high value of this warning region.final voidsetLow(float l) Sets the low value of this warning region.final voidSets all properties to their default values.final voidsetWarningRegionProperties(WarningRegionProperties warningRegionProps) Sets all properties to be the values of another WarningRegionProperties object.
-
Field Details
-
HIGH
public static final float HIGHIndicates the high value should be the maximum. For use with setHigh(). Note that HIGH - N where N is some number is invalid.- See Also:
-
LOW
public static final float LOWIndicates the low value should be the minimum. For use with setHigh(). Note that LOW - N where N is some number is invalid.- See Also:
-
HIGH_DEFAULT
public static final float HIGH_DEFAULTThe default is HIGH.- See Also:
-
LOW_DEFAULT
public static final float LOW_DEFAULTThe default is LOW.- See Also:
-
COMPONENT_COLOR_DEFAULT
The default is Color.red. -
BACKGROUND_EXISTENCE_DEFAULT
public static final boolean BACKGROUND_EXISTENCE_DEFAULTThe default is true.- See Also:
-
BACKGROUND_COLOR_DEFAULT
The default is Color.pink.
-
-
Constructor Details
-
WarningRegionProperties
public WarningRegionProperties()Creates a WarningRegionProperties object with the documented default values. -
WarningRegionProperties
Creates a WarningRegionProperties object with property values copied from another object. The copying is a deep copy.- Parameters:
warningRegionProps- The properties to copy.
-
-
Method Details
-
setToDefaults
public final void setToDefaults()Sets all properties to their default values. -
setWarningRegionProperties
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
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
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
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
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.
-