All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.eou.toolkit.gauge.NeedleGauge
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.JPanel
|
+----com.ibm.eou.toolkit.gauge.BaseGauge
|
+----com.ibm.eou.toolkit.gauge.NeedleGauge
- public class NeedleGauge
- extends BaseGauge
- implements Serializable
This gauge is semicircular with a swinging needle.
A color gradient may be provided to highlight segments of the gauge range.
A title may also be drawn.
-
NeedleGauge()
- Construct a needle gauge with initial value of 0, and a range of 0 to 100.
-
NeedleGauge(int, int, int)
- Minimal constructor which accepts the initial value, minimum value, maximum value.
-
NeedleGauge(int, int, int, int, String, Color, ColorGradient, boolean, Image)
- Create a NeedleGauge specifying the number of intermediate tick marks required,
the title, the color for the needle, a color gradient for range highlighting,
whether the gradient is to be drawn outside or within the needle radius, and an
image to tile within the needle radius.
-
copyright()
-
-
gaugeModelChanged(GaugeModelChangeEvent)
- This method can be overriden by extending classes which
need to react to a change to one or more of the models settings.
-
getInnerImage()
- Return the Image to tile within the needle radius, or null if no image is
specified.
-
getMinimumSize()
-
-
getNeedleColor()
- Return the fill color of the needle, or null if
the needle is transparent.
-
getNumberOfTicks()
- Return the number of intermediate tick marks to be drawn around the
circumference of the dial.
-
getScaleColorGradient()
- Return the ColorGradient used to fill inside or around the gauge, or
null if no color gradient is set.
-
getTitle()
- Return the title string of the gauge, or null if there is no title.
-
getUpdateBounds(Dimension, int, int, int, int, int, int)
- Return an array of rectangles defining the regions within the gauge
display area that will need to be repainted as a result of the
supplied next and current display values.
-
isGradientOutside()
- Return whether the ColorGradient is to be drawn outside or
within the needle gauge radius.
-
paintComponent(Graphics, Dimension, int, int, int)
- Paint the gauge.
-
paintHighlight(Graphics, Dimension)
- Override this method to paint on top of the gauge.
-
processComponentEvent(ComponentEvent)
-
-
processMouseEvent(MouseEvent)
-
-
processMouseMotionEvent(MouseEvent)
-
-
setBackground(Color)
-
-
setFont(Font)
-
-
setForeground(Color)
-
-
setGradientOutside(boolean)
- Specify whether the ColorGradient is to be drawn outside or
within the needle gauge radius.
-
setInnerImage(Image)
- Specify an Image to tile within the needle radius.
-
setNeedleColor(Color)
- Set the fill color of the needle.
-
setNumberOfTicks(int)
- Specify the number of intermediate tick marks to be drawn around the
circumference of the dial.
-
setOpaque(boolean)
-
-
setScaleColorGradient(ColorGradient)
- Set the ColorGradient used to fill inside or around the needle gauge radius.
-
setTitle(String)
- Set the title of the gauge.
NeedleGauge
public NeedleGauge(int initialValue,
int minimum,
int maximum,
int numberOticks,
String title,
Color needleColor,
ColorGradient gradient,
boolean gradientOutside,
Image innerImage)
- Create a NeedleGauge specifying the number of intermediate tick marks required,
the title, the color for the needle, a color gradient for range highlighting,
whether the gradient is to be drawn outside or within the needle radius, and an
image to tile within the needle radius. If the title, gradient or inner image
are not required, then null may be specified. If the needle color is null the
needle appears transparent. If both an image and a color gradient are set, the
image is tiled over the color gradient.
NeedleGauge
public NeedleGauge(int initialValue,
int minimum,
int maximum)
- Minimal constructor which accepts the initial value, minimum value, maximum value.
The remaining properties default to 10 ticks, no title, a transparent needle, a red
and blue color gradient inside the gauge, and no image loaded.
NeedleGauge
public NeedleGauge()
- Construct a needle gauge with initial value of 0, and a range of 0 to 100.
The remaining properties default to 10 ticks, no title, a transparent needle,
a grey shades color gradient inside the gauge, and no image loaded.
copyright
public static String copyright()
getNumberOfTicks
public int getNumberOfTicks()
- Return the number of intermediate tick marks to be drawn around the
circumference of the dial.
setNumberOfTicks
public void setNumberOfTicks(int numberOfTicks)
- Specify the number of intermediate tick marks to be drawn around the
circumference of the dial.
getScaleColorGradient
public ColorGradient getScaleColorGradient()
- Return the ColorGradient used to fill inside or around the gauge, or
null if no color gradient is set. In this case, if there is no
image specified, the gauge is transparent.
setScaleColorGradient
public void setScaleColorGradient(ColorGradient colorGradient)
- Set the ColorGradient used to fill inside or around the needle gauge radius.
Specify null to remove the ColorGradient.
- See Also:
- setGradientOutside
setGradientOutside
public void setGradientOutside(boolean gradientOutside)
- Specify whether the ColorGradient is to be drawn outside or
within the needle gauge radius.
- See Also:
- setScaleColorGradient
isGradientOutside
public boolean isGradientOutside()
- Return whether the ColorGradient is to be drawn outside or
within the needle gauge radius.
setInnerImage
public void setInnerImage(Image image)
- Specify an Image to tile within the needle radius.
Any image supplied with this method is drawn after the colorGradient.
- See Also:
- setGradientOutside
getInnerImage
public Image getInnerImage()
- Return the Image to tile within the needle radius, or null if no image is
specified.
setTitle
public void setTitle(String title)
- Set the title of the gauge. Specify null for no title.
getTitle
public String getTitle()
- Return the title string of the gauge, or null if there is no title.
setNeedleColor
public void setNeedleColor(Color color)
- Set the fill color of the needle. Specify null to makes the needle transparent.
getNeedleColor
public Color getNeedleColor()
- Return the fill color of the needle, or null if
the needle is transparent.
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class JComponent
processComponentEvent
public void processComponentEvent(ComponentEvent e)
- Overrides:
- processComponentEvent in class BaseGauge
setFont
public void setFont(Font font)
- Overrides:
- setFont in class Component
setForeground
public synchronized void setForeground(Color foreground)
- Overrides:
- setForeground in class Component
setBackground
public synchronized void setBackground(Color color)
- Overrides:
- setBackground in class Component
setOpaque
public void setOpaque(boolean isOpaque)
- Overrides:
- setOpaque in class BaseGauge
paintHighlight
protected synchronized void paintHighlight(Graphics g,
Dimension size)
- Override this method to paint on top of the gauge.
paintComponent
public void paintComponent(Graphics g,
Dimension d,
int displayvalue,
int min,
int max)
- Paint the gauge.
- Overrides:
- paintComponent in class BaseGauge
getUpdateBounds
protected Rectangle[] getUpdateBounds(Dimension size,
int nextDisplayValue,
int nextDisplayMinimum,
int nextDisplayMaximum,
int currentDisplayValue,
int currentDisplayMinimum,
int currentDisplayMaximum)
- Return an array of rectangles defining the regions within the gauge
display area that will need to be repainted as a result of the
supplied next and current display values.
- Overrides:
- getUpdateBounds in class BaseGauge
gaugeModelChanged
protected void gaugeModelChanged(GaugeModelChangeEvent e)
- This method can be overriden by extending classes which
need to react to a change to one or more of the models settings.
- Overrides:
- gaugeModelChanged in class BaseGauge
processMouseEvent
public void processMouseEvent(MouseEvent evt)
- Overrides:
- processMouseEvent in class Component
processMouseMotionEvent
public void processMouseMotionEvent(MouseEvent evt)
- Overrides:
- processMouseMotionEvent in class JComponent
All Packages Class Hierarchy This Package Previous Next Index