com.jinsight.jetchart
Class TargetZone

java.lang.Object
  |
  +--com.jinsight.jetchart.TargetZone

public class TargetZone
extends java.lang.Object

A target zone is a color filled polygon horizontally or vertically painted across the chart area. A target zone is made up of values representing the upper and lower borders of the polygon. These borders delimit an area against which a sequence of data points can be plotted and compared with.
Only two dimensional charts display target zones.


Field Summary
static int BEHIND
          This constant is used to place the target zone behind the grid.
static int FRONT
          This constant is used to place the target zone in front of the grid.
 
Constructor Summary
TargetZone()
          Default constructor of the TargetZone class.
TargetZone(double[] lowerValues, double[] upperValues)
          Constructor of the TargetZone class.
 
Method Summary
protected  void finalize()
           
 void setBorderEnabled(boolean isBorderEnabled)
          Enables/disables the upper and lower borders of the target zone.
 void setColor(java.awt.Color color)
          Sets the color of the target zone area.
 void setLowerBorderColor(java.awt.Color lowerBorderColor)
          sets the color of the lower border.
static void setPosition(int position)
          Sets the position where all target zones are painted.
 void setStretchEnabled(boolean isStretchEnabled)
          Enables/disables target zone stretching.
 void setUpperBorderColor(java.awt.Color upperBorderColor)
          Sets the color of the upper border.
 void setValues(double[] lowerValues, double[] upperValues)
          Sets the lower and upper values of the target zone limits.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FRONT

public static final int FRONT
This constant is used to place the target zone in front of the grid.

BEHIND

public static final int BEHIND
This constant is used to place the target zone behind the grid.
Constructor Detail

TargetZone

public TargetZone()
Default constructor of the TargetZone class.

TargetZone

public TargetZone(double[] lowerValues,
                  double[] upperValues)
Constructor of the TargetZone class. The 'lowerValues' and 'upperValues' arrays specify the values of the lower and upper zone limits, respectively. Both arrays must be of the same length, otherwise the largest array is shrinked.
If both arrays contain only one value each and the streching method is not enabled, the target zone is drawn as a colored rectangle spanning horizontally from the beginning to the end of the horizontal axis.
If chart is horizontal the rectangle spans vertically from the beginning to the end of the vertical axis.
Parameters:
lowerValues - An array of double precision numbers.
upperValues - An array of double precision numbers.
See Also:
setStretchEnabled(boolean)
Method Detail

setValues

public void setValues(double[] lowerValues,
                      double[] upperValues)
Sets the lower and upper values of the target zone limits. Both arrays must be of the same length, otherwise the largest array is shrinked.
If both arrays contain only one value each and the streching method is not enabled, the target zone is drawn as a colored rectangle spanning horizontally from the beginning to the end of the horizontal axis.
If chart is horizontal the rectangle spans vertically from the beginning to the end of the vertical axis.
Parameters:
lowerValues - An array of double precision numbers.
upperValues - An array of double precision numbers.
See Also:
setStretchEnabled(boolean)

setColor

public void setColor(java.awt.Color color)
Sets the color of the target zone area. Default color is light gray.
Parameters:
color - A Color object.

setUpperBorderColor

public void setUpperBorderColor(java.awt.Color upperBorderColor)
Sets the color of the upper border. Default color is black.
Parameters:
upperBorderColor - A Color object.
See Also:
setLowerBorderColor(java.awt.Color)

setLowerBorderColor

public void setLowerBorderColor(java.awt.Color lowerBorderColor)
sets the color of the lower border. Default color is black.
Parameters:
lowerBorderColor - A Color object.
See Also:
setUpperBorderColor(java.awt.Color)

setBorderEnabled

public void setBorderEnabled(boolean isBorderEnabled)
Enables/disables the upper and lower borders of the target zone. Default value is true.
Parameters:
isBorderEnabled - A boolean value(true/false).
See Also:
setUpperBorderColor(java.awt.Color), setLowerBorderColor(java.awt.Color)

setStretchEnabled

public void setStretchEnabled(boolean isStretchEnabled)
Enables/disables target zone stretching. If enabled, the target zone expands to take up the full width or height of the graph area, whether orientation is vertical or horizontal, respectively. Default value is false.
Parameters:
isStretchEnabled - A boolean value(true/false).

setPosition

public static void setPosition(int position)
Sets the position where all target zones are painted. Target zones can be painted in front of or behind the grid. The default position is in front of the grid.
Parameters:
position - An integer value.
See Also:
FRONT, BEHIND

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object