Class WarningRegionProperties

java.lang.Object
net.sourceforge.chart2d.WarningRegionProperties

public final class WarningRegionProperties extends 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 Details

    • 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:
    • 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:
    • HIGH_DEFAULT

      public static final float HIGH_DEFAULT
      The default is HIGH.
      See Also:
    • LOW_DEFAULT

      public static final float LOW_DEFAULT
      The default is LOW.
      See Also:
    • COMPONENT_COLOR_DEFAULT

      public static final 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:
    • BACKGROUND_COLOR_DEFAULT

      public static final Color BACKGROUND_COLOR_DEFAULT
      The default is Color.pink.
  • Constructor Details

    • WarningRegionProperties

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

      public WarningRegionProperties(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 Details

    • setToDefaults

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

      public final void setWarningRegionProperties(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(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(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 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 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.