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.


Constructor Index

 o NeedleGauge()
Construct a needle gauge with initial value of 0, and a range of 0 to 100.
 o NeedleGauge(int, int, int)
Minimal constructor which accepts the initial value, minimum value, maximum value.
 o 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.

Method Index

 o copyright()
 o 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.
 o getInnerImage()
Return the Image to tile within the needle radius, or null if no image is specified.
 o getMinimumSize()
 o getNeedleColor()
Return the fill color of the needle, or null if the needle is transparent.
 o getNumberOfTicks()
Return the number of intermediate tick marks to be drawn around the circumference of the dial.
 o getScaleColorGradient()
Return the ColorGradient used to fill inside or around the gauge, or null if no color gradient is set.
 o getTitle()
Return the title string of the gauge, or null if there is no title.
 o 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.
 o isGradientOutside()
Return whether the ColorGradient is to be drawn outside or within the needle gauge radius.
 o paintComponent(Graphics, Dimension, int, int, int)
Paint the gauge.
 o paintHighlight(Graphics, Dimension)
Override this method to paint on top of the gauge.
 o processComponentEvent(ComponentEvent)
 o processMouseEvent(MouseEvent)
 o processMouseMotionEvent(MouseEvent)
 o setBackground(Color)
 o setFont(Font)
 o setForeground(Color)
 o setGradientOutside(boolean)
Specify whether the ColorGradient is to be drawn outside or within the needle gauge radius.
 o setInnerImage(Image)
Specify an Image to tile within the needle radius.
 o setNeedleColor(Color)
Set the fill color of the needle.
 o setNumberOfTicks(int)
Specify the number of intermediate tick marks to be drawn around the circumference of the dial.
 o setOpaque(boolean)
 o setScaleColorGradient(ColorGradient)
Set the ColorGradient used to fill inside or around the needle gauge radius.
 o setTitle(String)
Set the title of the gauge.

Constructors

 o 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.

 o 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.

 o 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.

Methods

 o copyright
 public static String copyright()
 o getNumberOfTicks
 public int getNumberOfTicks()
Return the number of intermediate tick marks to be drawn around the circumference of the dial.

 o setNumberOfTicks
 public void setNumberOfTicks(int numberOfTicks)
Specify the number of intermediate tick marks to be drawn around the circumference of the dial.

 o 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.

 o 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
 o setGradientOutside
 public void setGradientOutside(boolean gradientOutside)
Specify whether the ColorGradient is to be drawn outside or within the needle gauge radius.

See Also:
setScaleColorGradient
 o isGradientOutside
 public boolean isGradientOutside()
Return whether the ColorGradient is to be drawn outside or within the needle gauge radius.

 o 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
 o getInnerImage
 public Image getInnerImage()
Return the Image to tile within the needle radius, or null if no image is specified.

 o setTitle
 public void setTitle(String title)
Set the title of the gauge. Specify null for no title.

 o getTitle
 public String getTitle()
Return the title string of the gauge, or null if there is no title.

 o setNeedleColor
 public void setNeedleColor(Color color)
Set the fill color of the needle. Specify null to makes the needle transparent.

 o getNeedleColor
 public Color getNeedleColor()
Return the fill color of the needle, or null if the needle is transparent.

 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent
 o processComponentEvent
 public void processComponentEvent(ComponentEvent e)
Overrides:
processComponentEvent in class BaseGauge
 o setFont
 public void setFont(Font font)
Overrides:
setFont in class Component
 o setForeground
 public synchronized void setForeground(Color foreground)
Overrides:
setForeground in class Component
 o setBackground
 public synchronized void setBackground(Color color)
Overrides:
setBackground in class Component
 o setOpaque
 public void setOpaque(boolean isOpaque)
Overrides:
setOpaque in class BaseGauge
 o paintHighlight
 protected synchronized void paintHighlight(Graphics g,
                                            Dimension size)
Override this method to paint on top of the gauge.

 o paintComponent
 public void paintComponent(Graphics g,
                            Dimension d,
                            int displayvalue,
                            int min,
                            int max)
Paint the gauge.

Overrides:
paintComponent in class BaseGauge
 o 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
 o 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
 o processMouseEvent
 public void processMouseEvent(MouseEvent evt)
Overrides:
processMouseEvent in class Component
 o processMouseMotionEvent
 public void processMouseMotionEvent(MouseEvent evt)
Overrides:
processMouseMotionEvent in class JComponent

All Packages  Class Hierarchy  This Package  Previous  Next  Index