com.jinsight.jetchart
Class GaugeLed

java.lang.Object
  extended bycom.jinsight.jetchart.GaugeLed

public class GaugeLed
extends java.lang.Object

A gauge chart led is a color-filled circle placed within the gauge frame area and associated with a gauge series to show whether a threshold value has been reached or not. Two colors are displayed, one showing that the gauge series value is within a normal expected range and the other signaling an abnormal state.

See Also:
GaugeSerie.setGaugeLed(com.jinsight.jetchart.GaugeLed)

Constructor Summary
GaugeLed(double value, double thresholdValue, double radiusPos)
          GaugeLed constructor.
 
Method Summary
 void setBorderColor(java.awt.Color borderColor)
          Sets the border color of a gauge led.
 void setBorderEnabled(boolean isBorderEnabled)
          Enables/disables a border around the led.
 void setColor(java.awt.Color color)
          Sets the color to be displayed in normal condition.
 void setDiameter(int diameter)
          Sets the diameter of this GaugeLed object.
 void setRadiusPosition(double radiusPos)
          Sets the position of this GaugeLed object.
 void setThresholdValue(double thresholdValue)
          Sets the threshold value.
 void setValue(double value)
          Sets the scale value of this GaugeLed object.
 void setWarningColor(java.awt.Color warningColor)
          Sets the warning color.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GaugeLed

public GaugeLed(double value,
                double thresholdValue,
                double radiusPos)
GaugeLed constructor. It takes the scale value to determine the angle the led center makes with the horizontal gauge radius, the threshold value to display a warning color and the led position as a fraction of the gauge radius.
For instance, if a scale ranges from 0 to 100, the value parameter is 10 and the position is .5, the led center is positioned at the middle of the radius that makes an angle corresponding to the value 10 within the scale range.

Parameters:
value - A double precision number.
thresholdValue - A double precision number.
radiusPos - A double precision number ranging from 0 to 1, corresponding to the center and the border of the gauge, respectively.
Method Detail

setValue

public void setValue(double value)
Sets the scale value of this GaugeLed object. This value determines the angle the led center makes with the horizontal gauge radius, within the scale range.

Parameters:
value - A double precision number.

setThresholdValue

public void setThresholdValue(double thresholdValue)
Sets the threshold value. If a gauge series associated with a GaugeLed object has a value equal to or larger than the threshold value, the GaugeLed object displays a warning color.

Parameters:
thresholdValue - A double precision number

setRadiusPosition

public void setRadiusPosition(double radiusPos)
Sets the position of this GaugeLed object. The position is specified as a fraction of the gauge radius, ranging from 0 to 1.

Parameters:
radiusPos - A double precision number.

setDiameter

public void setDiameter(int diameter)
Sets the diameter of this GaugeLed object. Default value is 10 pixels.

Parameters:
diameter - An integer value larger than 1.

setColor

public void setColor(java.awt.Color color)
Sets the color to be displayed in normal condition. This color is displayed if the gauge series associated with this GaugeLed object has a value smaller than the threshold value. Default color is Color.green.darker().

Parameters:
color - A Color object.
See Also:
setThresholdValue(double)

setWarningColor

public void setWarningColor(java.awt.Color warningColor)
Sets the warning color. This color is displayed if the gauge series associated with this GaugeLed object has a value equal to or larger than the threshold value. Default color is Color.red.

Parameters:
warningColor - A Color object.
See Also:
setThresholdValue(double)

setBorderEnabled

public void setBorderEnabled(boolean isBorderEnabled)
Enables/disables a border around the led. The border is disabled by default.

Parameters:
isBorderEnabled - A boolean value(true/false).

setBorderColor

public void setBorderColor(java.awt.Color borderColor)
Sets the border color of a gauge led. Default color is Color.black.

Parameters:
borderColor - A Color object.
See Also:
setBorderEnabled(boolean)