Working with the Gauge Beans
Setting a Gauge Value within a Visual Builder
Each of the supplied Gauge Beans expose properties that you can change to modify the gauge value, value range, and general appearance. In a visual builder environment, such as IBM VisualAge for Java, set these properties using the builder's property editor interface. To have another bean automatically update the value of a gauge, connect the value property of the gauge bean to a numeric property of the other bean. For example, in VisualAge for Java, right-click on the source bean, choose Connect from the menu and select a suitable int property of the source bean. Drag the connection to the gauge bean and mouse click, selecting the value property of gauge as the target. Every time the source bean property changes, the gauge value also changes.
Setting a Gauge Value using Accumulation
Another way to set the value of a gauge is to accumulate a total based on a time period.
To set the value of a gauge by accumulating a total based on an event:
Each time the chosen event occurs, the gauge increments the accumulated total. When the accumulator interval is reached, the gauge's value is set to the accumulation total, the accumulation total is reset to zero, then the next interval begins.
You can also control accumulation behavior. To accumulate values on a rolling average basis:
The total is accumulated at a frequency equal to the accumulator interval, using a rolling average basis. For example, if you set the accumulator interval to 1000, and the accumulator measurement interval of 10000, the gauge value updates every second based on the total accumulator increments that have been received over the last 10 seconds.
See Samples for a step-by-step scenario using accumulation.
Setting a Gauge Value using the API
Not all gauge features are accessible using visual builder interfaces. For example, the stack indicator beans all predefine images to be used with the StackImageIndicator class. If you need to supply your own image, use the API to create an instance of StackImageIndicator and choose a constructor that allows the image(s) to be passed as parameters.
Creating your own gauge is a slightly more ambitious undertaking; some guidance is provided in the Tutorial.
The following gauges are supplied with the Gauge Beans. You can use them with VisualAge
for Java or any other Java builder.
| Gauge | Description | |
| LED Counter | The LED Counter presents an LED with a variable number of digits. The digits change to reflect the current gauge value, with options for immediate update or update via all intermediate values. | |
| Rolling Counter | The Rolling Counter is very similar to the LED counter, but simulates a car odometer, with digits that can slide into place vertically. | |
| Needle | The Needle gauge is a traditional semi-circular gauge, with a heavy swinging needle and a shaded color scale. The degree of needle damping may be controlled, along with various display colors and styles. | |
| RAG Needle | The RAG Needle gauge is similar to the Needle gauge, but it divides the scale into three areas, which are colored Red, Amber, and Green. This gauge is ideal for MIS presentations. The changeover points between the colors can be set, including whether Red appears at the high or low end of the range. | |
| Thermometer | The Thermometer represents a value by the height of a column of liquid in a tube. Positive and negative scales can be drawn up the side of the tube. When the value changes, the liquid level in the tube changes quickly but smoothly. Various color and style properties may be set. | |
| Oscilloscope | The Oscilloscope records a trace of the value, repeatedly traversing the display area and erasing the previous trace. The trace is always a continuous line connecting past values, and the position of the line end represents the current gauge value. Trace line color and various other visual properties may be set. | |
| Trace Recorder | The TraceRecorder records a trace of the gauge value, scrolling continually across the display area. This creates a display like the output graphs available with many system performance monitoring tools. Trace line color and various other visual properties may be set. | |
| Lightbulb Indicator | The Lightbulb indicator shows an image of a light bulb with various intensities to reflect the current gauge value. The rapidity of change between intensities in response to value changes may be controlled. | |
| Block Indicator | The BlockIndicator represents the gauge value by the number of blocks arranged in a line. By controlling the dimensions and spacing of the blocks and their colors, effects such as progress indicators and "hi-fi" gauges can be achieved. | |
| Bar Indicator | The Bar Indicator represents the gauge value by the length of a bar. This sort of gauge is commonly used for progress indicators. The bar can be filled with one of a set of pre-defined color gradients. | |
| Arc Block Indicator | The ArcBlockIndicator is similar to BlockIndicator and RAGNeedle. It uses blocks, arranged in a semicircle, and supports three colour zones for those blocks. The color of each zone may be specified, as may the number and size of the blocks. | |
| Stack Book Indicator | The Stack Book Indicator represents the gauge value by the stacking a number of book images. A crossover value may be specified such that gauge values below the crossover are represented by an alternative book image. This sort of gauge might be used for a themed representation of a value, perhaps with a scholarly flavor. | |
| Stack Coin Indicator | The Stack Coin Indicator represents the gauge value by the stacking a number of coin images. A crossover value may be specified such that gauge values below the crossover are represented by an alternative coin image. This sort of gauge might be used for a themed representation of a value, perhaps with a financial flavor. | |
| Stack Disk Indicator | The Stack Disk Indicator represents the gauge value by the stacking a number of computer disk images. A crossover value may be specified such that gauge values below the crossover are represented by an alternative disk image. This sort of gauge might be used for a themed representation of a value, perhaps with a technological flavor. |