All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class COM.ibm.beans.gauge.BaseGauge

java.lang.Object
   |
   +----java.awt.Component
           |
           +----COM.ibm.beans.gauge.BaseGauge

public abstract class BaseGauge
extends Component
implements Gauge, GaugeSynchronization, Runnable, Serializable

This class provides a generic extensible implementation of the Gauge interface. This class is abstract, and can be extended to create widgets which act as single-value gauges. There is an abstract extended form of the paint method, which must be implemented in derived classes; these must not override the standard component paint method.


Constructor Index

 o BaseGauge(long, long, long, GaugeSynchronization)
Create a base gauge with an initial value and range, and the given gauge synchronization as the default gauge synchronization.

Method Index

 o addImage(Image)
Register an image to be monitored during loading
 o addImages(Image[])
Register images to be monitored during loading
 o addNotify()
 
 o addPropertyChangeListener(PropertyChangeListener)
Add listeners to gauge properties
 o adjustValue(long)
Adjust the value for the gauge to present by a relative amount.
 o areImagesReady()
Return true if all images registered to be monitored during loading are now ready.
 o background()
Return the background to be drawn by this gauge prior to each paint, or null if no background is set.
 o copyright()
 
 o dispose()
Release all resources used by the gauge, including stopping all threads.
 o getDefaultGaugeSynchronization()
Return the default gauge synchronization, which is set when the gauge is created.
 o getGaugeSynchronization()
Return the current gauge synchronization.
 o getMaximum()
Return the maximum of the current gauge range.
 o getMinimum()
Return the minimum of the current gauge range.
 o getPreferredSize()
Return the preferred size for the gauge, as set by setPreferredSize().
 o getSupport()
 
 o getValue()
Return the current value of the gauge.
 o imagesReady()
This method is called automatically whenever the final image currently registered to be monitored during loading becomes ready.
 o imageUpdate(Image, int, int, int, int, int)
The standard component imageUpdate method.
 o isImageReady(Image)
Return true if the image registered to be monitored during loading is now ready.
 o isSynchronized(long, long, long, long, long, long)
Return true if the gauge considers the current display to be fully synchronized.
 o nextValue(long, long, long, long, long, long)
Return the next value which the gauge display will show.
 o nextValueDelay(boolean)
Return the time interval in milliseconds after which the next value is to be displayed by the gauge.
 o paint(Graphics)
The standard paint method, this cannot be overridden by derived classes
 o paint(Graphics, Dimension, long, long, long, boolean, long, long, long)
Paint the gauge.
 o processComponentEvent(ComponentEvent)
 
 o removeNotify()
 
 o removePropertyChangeListener(PropertyChangeListener)
Remove listeners to gauge properties
 o resetSynchronization()
 
 o run()
The standard Runnable run method.
 o setBackground(Background)
Set the background to be drawn by this gauge prior to each paint.
 o setDefaultGaugeSynchronization(GaugeSynchronization)
Set the default gauge synchronization to be used by this gauge.
 o setGaugeSynchronization(GaugeSynchronization)
Set the gauge synchronization to be used by this gauge.
 o setMaximum(long)
Set the maximum value property for the gauge
 o setMinimum(long)
Set the minimum value property for the gauge
 o setPreferredSize(int, int)
Set the preferred size for the gauge.
 o setRange(long, long)
Set the range for the gauge to present.
 o setValue(long)
Set the value for the gauge to present.
 o setValueAndRange(long, long, long)
Set the value for the gauge to present, together with the range to present it in.
 o synchronize()
Wait until the gauge is synchronized.
 o update(Graphics)
The standard update method, this cannot be overridden by derived classes
 o waitForImages()
This method waits until all currently registered images are loaded.

Constructors

 o BaseGauge

 public BaseGauge(long initialValue,
                  long minimum,
                  long maximum,
                  GaugeSynchronization defaultGaugeSynchronization)
Create a base gauge with an initial value and range, and the given gauge synchronization as the default gauge synchronization. The Background is set to null.
See Also:
setDefaultGaugeSynchronization, setBackground

Methods

 o dispose

 public void dispose()
Release all resources used by the gauge, including stopping all threads. This method should be called when the gauge is no longer required.

 o copyright

 public static String copyright()

 o resetSynchronization

 public void resetSynchronization()

 o getDefaultGaugeSynchronization

 public GaugeSynchronization getDefaultGaugeSynchronization()
Return the default gauge synchronization, which is set when the gauge is created.
See Also:
setDefaultGaugeSynchronization

 o setDefaultGaugeSynchronization

 protected final void setDefaultGaugeSynchronization(GaugeSynchronization defaultGaugeSynchronization)
Set the default gauge synchronization to be used by this gauge. If null is passed, the default gauge synchronization is reset to an immediate update synchronization.
See Also:
setGaugeSynchronization

 o getGaugeSynchronization

 public GaugeSynchronization getGaugeSynchronization()
Return the current gauge synchronization. If a gauge synchronization has been set, that will be returned, otherwise this gauge's default gauge synchronization will be returned.
See Also:
setGaugeSynchronization

 o setPreferredSize

 public void setPreferredSize(int x,
                              int y)
Set the preferred size for the gauge.
See Also:
preferredSize

 o getPreferredSize

 public final Dimension getPreferredSize()
Return the preferred size for the gauge, as set by setPreferredSize(). The preferred size returned is constrained below by the size returned by minimumSize().
Overrides:
getPreferredSize in class Component
See Also:
setPreferredSize

 o adjustValue

 public void adjustValue(long valueChange)
Adjust the value for the gauge to present by a relative amount.

 o background

 public Background background()
Return the background to be drawn by this gauge prior to each paint, or null if no background is set.
See Also:
setBackground

 o nextValueDelay

 public long nextValueDelay(boolean isSynchronized)
Return the time interval in milliseconds after which the next value is to be displayed by the gauge. This class delegates this method to the current gauge synchronization.
See Also:
setGaugeSynchronization, getGaugeSynchronization, nextValueDelay

 o isSynchronized

 public boolean isSynchronized(long gaugevalue,
                               long gaugemin,
                               long gaugemax,
                               long currentdisplayvalue,
                               long currentdisplaymin,
                               long currentdisplaymax)
Return true if the gauge considers the current display to be fully synchronized. This class delegates this method to the current gauge synchronization.
See Also:
setGaugeSynchronization, getGaugeSynchronization, isSynchronized

 o setGaugeSynchronization

 public void setGaugeSynchronization(GaugeSynchronization gaugeSynchronization)
Set the gauge synchronization to be used by this gauge. If null is passed, the gauge synchronization is reset to this gauge's default synchronization.
See Also:
setDefaultGaugeSynchronization

 o setBackground

 public void setBackground(Background background)
Set the background to be drawn by this gauge prior to each paint. Setting null as the background causes no background to be drawn prior to each paint.
See Also:
background

 o waitForImages

 protected void waitForImages()
This method waits until all currently registered images are loaded.
See Also:
addImage, addImages, imagesReady, imagesReadyNotify, isImageReady

 o imagesReady

 protected void imagesReady()
This method is called automatically whenever the final image currently registered to be monitored during loading becomes ready. The default implementation re-lays out the parent and repaints this component.
See Also:
addImage, addImages, imagesReady, imagesReadyNotify, isImageReady, waitForImages

 o imageUpdate

 public boolean imageUpdate(Image image,
                            int flags,
                            int x,
                            int y,
                            int w,
                            int h)
The standard component imageUpdate method. This method is essential for correct functioning of this class. If overridden, super.imageUpdate should still be called.
Overrides:
imageUpdate in class Component

 o addImages

 protected void addImages(Image images[])
Register images to be monitored during loading
See Also:
addImage, areImagesReady, imagesReady, isImageReady, waitForImages

 o addImage

 protected void addImage(Image image)
Register an image to be monitored during loading
See Also:
addImages, areImagesReady, imagesReady, isImageReady, waitForImages

 o isImageReady

 public boolean isImageReady(Image image)
Return true if the image registered to be monitored during loading is now ready. An image is considered ready when it has completed loading, been aborted, or has an error.
See Also:
addImage, addImages, imagesReadyNotify, waitForImages

 o areImagesReady

 public boolean areImagesReady()
Return true if all images registered to be monitored during loading are now ready. An image is considered ready when it has completed loading, been aborted, or has an error.
See Also:
addImage, addImages, imagesReadyNotify, isImageReady, waitForImages

 o nextValue

 public long nextValue(long gaugeValue,
                       long gaugeMinimum,
                       long gaugeMaximum,
                       long currentDisplayValue,
                       long currentDisplayMinimum,
                       long currentDisplayMaximum)
Return the next value which the gauge display will show. This class delegates this method to the current gauge synchronization.
See Also:
setGaugeSynchronization, getGaugeSynchronization, nextValue

 o update

 public final void update(Graphics g)
The standard update method, this cannot be overridden by derived classes
Overrides:
update in class Component

 o paint

 public final void paint(Graphics g)
The standard paint method, this cannot be overridden by derived classes
Overrides:
paint in class Component

 o addNotify

 public void addNotify()
Overrides:
addNotify in class Component

 o removeNotify

 public void removeNotify()
Overrides:
removeNotify in class Component

 o paint

 public abstract void paint(Graphics g,
                            Dimension d,
                            long nextDisplayValue,
                            long nextDisplayMinimum,
                            long nextDisplayMaximum,
                            boolean incremental,
                            long currentDisplayValue,
                            long currentDisplayMinimum,
                            long currentDisplayMaximum)
Paint the gauge. The display value to showm and the range this value is in, are supplied. This method may be called to perform incremental updates, in which case incremental will be true and the currently displayed value and range are also supplied. In this case, it is sufficient to amend only the parts of the display which change. Note that the given dimension should be used to determine the area to be drawn, since this may be different from the component size.
Parameters:
g - a graphics to draw on.
d - the dimension of the area to draw into.
nextDisplayValue - the value to show.
nextDisplayMinimum - the minimum of the range to show.
nextDisplayMaximum - the maximum of the range to show.
incremental - whether this is an incremental paint request.
currentDisplayValue - the value currently displaying.
currentDisplayMinimum - the minimum of the range the current display value is in.
currentDisplayMaximum - the maximum of the range the current display value is in.

 o run

 public void run()
The standard Runnable run method.

 o synchronize

 public void synchronize()
Wait until the gauge is synchronized. The gauge is synchronized when the current gauge synchronization confirms that it is synchronized.
See Also:
setGaugeSynchronization

 o setMinimum

 public void setMinimum(long minimum)
Set the minimum value property for the gauge

 o setMaximum

 public void setMaximum(long maximum)
Set the maximum value property for the gauge

 o getMinimum

 public long getMinimum()
Return the minimum of the current gauge range.

 o getMaximum

 public long getMaximum()
Return the maximum of the current gauge range.

 o setRange

 public void setRange(long minimum,
                      long maximum)
Set the range for the gauge to present.

 o setValueAndRange

 public void setValueAndRange(long value,
                              long minimum,
                              long maximum)
Set the value for the gauge to present, together with the range to present it in.

 o getValue

 public long getValue()
Return the current value of the gauge. Note that this may not be the value currently displayed to the user, if the gauge display is not yet synchronized.

 o setValue

 public void setValue(long value)
Set the value for the gauge to present.

 o addPropertyChangeListener

 public void addPropertyChangeListener(PropertyChangeListener l)
Add listeners to gauge properties

 o removePropertyChangeListener

 public void removePropertyChangeListener(PropertyChangeListener l)
Remove listeners to gauge properties

 o getSupport

 protected PropertyChangeSupport getSupport()

 o processComponentEvent

 protected void processComponentEvent(ComponentEvent evt)
Overrides:
processComponentEvent in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index