All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eou.toolkit.gauge.Counter

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

public class Counter
extends BaseGauge
This gauge displays a number representing the current display gauge value using digit images. The value can be displayed in any base, using any number of digits. Negative values and overflow values cause the display to wrap.


Constructor Index

 o Counter(Image[])
Create a Counter accepting only an image array that holds the series of digits to show in the counter.
 o Counter(int, int, int, Image[])
Create a Counter accepting only the inital value, the minimum value, the maximum value and an image array that holds the series of digits to show in the counter.
 o Counter(int, int, int, Image[], int, int, boolean, boolean)
Create a Counter specifying the digit images to use, the number of digits to display, the base the value is displayed in, whether the display jumps immediately to new values, and whether a slide animation effect is used.

Method Index

 o areImagesReady()
Return true if all images registered to be monitored during loading are now ready.
 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 getBase()
Return the numeric base of the counter.
 o getDigitImages()
Return the array of images that represent the digits.
 o getMinimumSize()
 o getNextValue(int, int, int, int, int, int)
Return the next value which the gauge display will show.
 o getNumberOfDigits()
Return the number of digit fields.
 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 isImmediate()
Return whether the display jumps to immediate values.
 o isSlideEnabled()
Return whether the slide animation effect is to be used.
 o isSynchronized(int, int, int, int, int, int)
Return true if the gauge considers the current display to be fully synchronized.
 o paintComponent(Graphics, Dimension, int, int, int)
Paint the gauge.
 o setBase(int)
Specify the numeric base of the counter.
 o setDigitImages(Image[])
Specify the array of images that represent the digits.
 o setImmediate(boolean)
Specify whether the display jumps to immediate values.
 o setNumberOfDigits(int)
Set the number of digit fields in the counter.
 o setPositiveNumberOfDigits()
 o setSlideEnabled(boolean)
Specify whether the slide animation effect is to be used.

Constructors

 o Counter
 public Counter(int initialValue,
                int minimum,
                int maximum,
                Image digitImages[],
                int numberOfDigits,
                int base,
                boolean immediate,
                boolean slide)
Create a Counter specifying the digit images to use, the number of digits to display, the base the value is displayed in, whether the display jumps immediately to new values, and whether a slide animation effect is used. If the base is specified as zero, the base to which the numbers are displayed is determined by the number of images provided. If immediate display is not selected a sequence of intermediate values is displayed whenever the gauge value changes. When used in conjunction with the slide animation effect this gauge emulates a mechanical counter. The numeric base used for displaying the value is the specified value, or the number of images in the array, whichever is smaller.

 o Counter
 public Counter(int initialValue,
                int minimum,
                int maximum,
                Image digitImages[])
Create a Counter accepting only the inital value, the minimum value, the maximum value and an image array that holds the series of digits to show in the counter. The remaining properties default to base 10, (or the number of images in the array, whichever is fewer) and to slide through all digits without jumps, animating the counter.

 o Counter
 public Counter(Image digitImages[])
Create a Counter accepting only an image array that holds the series of digits to show in the counter. The initial value is 0 and it has a range of 0 to 100. The remaining properties default to base 10, (or the number of images in the array, whichever is fewer) and to slide through all digits without jumps, animating the counter.

Methods

 o copyright
 public static String copyright()
 o setPositiveNumberOfDigits
 protected void setPositiveNumberOfDigits()
 o getDigitImages
 public Image[] getDigitImages()
Return the array of images that represent the digits.

 o setDigitImages
 public void setDigitImages(Image digitImages[])
Specify the array of images that represent the digits. The numeric base that will be used to display the gauge value is the current numeric base or the number of images in the array, whichever is smaller. Null is ignored.

See Also:
setBase, setNumberOfDigits
 o setBase
 public void setBase(int base)
Specify the numeric base of the counter. The number of digit fields is adjusted to enable it to display the maximum value in the new base.

See Also:
setDigitImages, setNumberOfDigits
 o getBase
 public int getBase()
Return the numeric base of the counter.

 o setNumberOfDigits
 public void setNumberOfDigits(int numberOfDigits)
Set the number of digit fields in the counter. If the number of digit fields is fewer than the maximum value the gauge can display the value displayed maybe truncated.

See Also:
setDigitImages, setBase
 o getNumberOfDigits
 public int getNumberOfDigits()
Return the number of digit fields.

 o setSlideEnabled
 public void setSlideEnabled(boolean slideEnabled)
Specify whether the slide animation effect is to be used.

 o isSlideEnabled
 public boolean isSlideEnabled()
Return whether the slide animation effect is to be used.

 o setImmediate
 public void setImmediate(boolean immediate)
Specify whether the display jumps to immediate values.

 o isImmediate
 public boolean isImmediate()
Return whether the display jumps to immediate values.

 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent
 o getNextValue
 public synchronized int getNextValue(int value,
                                      int minimum,
                                      int maximum,
                                      int previousDisplayValue,
                                      int previousMinimum,
                                      int previousMaximum)
Return the next value which the gauge display will show.

Overrides:
getNextValue in class BaseGauge
 o isSynchronized
 public boolean isSynchronized(int gaugeValue,
                               int gaugeMinimum,
                               int gaugeMaximum,
                               int currentDisplayValue,
                               int currentDisplayMinimum,
                               int currentDisplayMaximum)
Return true if the gauge considers the current display to be fully synchronized.

Overrides:
isSynchronized in class BaseGauge
 o paintComponent
 public synchronized void paintComponent(Graphics g,
                                         Dimension s,
                                         int value,
                                         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 areImagesReady
 public boolean areImagesReady()
Return true if all images registered to be monitored during loading are now ready.

Overrides:
areImagesReady 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

All Packages  Class Hierarchy  This Package  Previous  Next  Index