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.
-
Counter(Image[])
- Create a Counter accepting only an image array that holds the series of digits to
show in the counter.
-
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.
-
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.
-
areImagesReady()
- Return true if all images registered to be
monitored during loading are now ready.
-
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.
-
getBase()
- Return the numeric base of the counter.
-
getDigitImages()
- Return the array of images that represent the digits.
-
getMinimumSize()
-
-
getNextValue(int, int, int, int, int, int)
- Return the next value which the gauge display will show.
-
getNumberOfDigits()
- Return the number of digit fields.
-
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.
-
isImmediate()
- Return whether the display jumps to immediate values.
-
isSlideEnabled()
- Return whether the slide animation effect is to be used.
-
isSynchronized(int, int, int, int, int, int)
- Return true if the gauge considers the current display to be fully synchronized.
-
paintComponent(Graphics, Dimension, int, int, int)
- Paint the gauge.
-
setBase(int)
- Specify the numeric base of the counter.
-
setDigitImages(Image[])
- Specify the array of images that represent the digits.
-
setImmediate(boolean)
- Specify whether the display jumps to immediate values.
-
setNumberOfDigits(int)
- Set the number of digit fields in the counter.
-
setPositiveNumberOfDigits()
-
-
setSlideEnabled(boolean)
- Specify whether the slide animation effect is to be used.
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.
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.
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.
copyright
public static String copyright()
setPositiveNumberOfDigits
protected void setPositiveNumberOfDigits()
getDigitImages
public Image[] getDigitImages()
- Return the array of images that represent the digits.
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
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
getBase
public int getBase()
- Return the numeric base of the counter.
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
getNumberOfDigits
public int getNumberOfDigits()
- Return the number of digit fields.
setSlideEnabled
public void setSlideEnabled(boolean slideEnabled)
- Specify whether the slide animation effect is to be used.
isSlideEnabled
public boolean isSlideEnabled()
- Return whether the slide animation effect is to be used.
setImmediate
public void setImmediate(boolean immediate)
- Specify whether the display jumps to immediate values.
isImmediate
public boolean isImmediate()
- Return whether the display jumps to immediate values.
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class JComponent
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
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
paintComponent
public synchronized void paintComponent(Graphics g,
Dimension s,
int value,
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
areImagesReady
public boolean areImagesReady()
- Return true if all images registered to be
monitored during loading are now ready.
- Overrides:
- areImagesReady 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
All Packages Class Hierarchy This Package Previous Next Index