All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.eou.toolkit.gauge.ArcBlockIndicator
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.BlockIndicator
|
+----com.ibm.eou.toolkit.gauge.ArcBlockIndicator
- public class ArcBlockIndicator
- extends BlockIndicator
- implements Serializable
This gauge is composed of a semicircular array of quadrilateral ticks.
The range of possible values is shown by faded ticks.
The ticks are divided into three sections which can be given different
colors and positions.
As the gauge value changes ticks are added or removed one by one.
To use this gauge the changeover values and colors for the three sections
need to be specfied along with the inner radius, number of ticks and
the tick size.
-
ArcBlockIndicator()
- Create an ArcBlockIndicator with an initial value of 0 and a range of 0 to 100.
-
ArcBlockIndicator(int, int, int)
- Create an ArcBlockIndicator specifying only the initial value, minimum
value and maximum value.
-
ArcBlockIndicator(int, int, int, int, int, int, int, int, Color, Color, Color)
- Create an ArcBlockIndicator specifying all properties.
-
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.
-
getBlockWidthProportion()
- Return the percentage of the available space to use for each tick.
-
getHighColor()
- Return the high color.
-
getHighThreshold()
- Return the value at which the medium colored ticks turn to high colored ticks.
-
getInnerRadius()
- Return the inner radius of the arc.
-
getLowColor()
- Return the low color.
-
getLowThreshold()
- Return the value at which the low colored ticks turn to medium colored ticks.
-
getMediumColor()
- Return the medium color.
-
getMinimumSize()
-
-
getUpdateBounds(Dimension, int, int, int, int, int, int)
- Return an array of one rectangle that defines the area of the gauge
that will need to be updated as a result of the supplied next and
current display values.
-
paintComponent(Graphics, Dimension, int, int, int)
- Paint the gauge so that it represents the supplied value.
-
setBlockWidthProportion(int)
- Specify the percentage of the available space to use for each tick.
-
setHighColor(Color)
- Set the high color.
-
setHighThreshold(int)
- Specify the value at which the medium colored ticks turn to high colored ticks.
-
setInnerRadius(int)
- Set the inner radius of the arc.
-
setLowColor(Color)
- Set the low color.
-
setLowThreshold(int)
- Specify the value at which the low colored ticks turn to medium colored ticks.
-
setMediumColor(Color)
- Set the medium color.
-
setNumberOfBlocks(int)
- Specify the number of blocks in the gauge.
ArcBlockIndicator
public ArcBlockIndicator(int initialValue,
int minimum,
int maximum,
int numberOfTicks,
int tickSize,
int lowThreshold,
int highThreshold,
int innerRadius,
Color high,
Color mediumColor,
Color low)
- Create an ArcBlockIndicator specifying all properties. You need to specify
the number of ticks, the percentage of the available space to use for
each tick, the thresholds for the color changes, the inner radius of the arc
(as a percentage of the total arc radius), and the colors to use for the
ticks in each region.
If the colors are specified as null the default colors will be used.
These are red, yellow and green, representing low, medium and high.
If the there is not enough space to draw the ticks as specified,
with at least one pixel gap between each tick on the inner radius, then
the ticks will be drawn as single lines.
ArcBlockIndicator
public ArcBlockIndicator(int initialValue,
int minimum,
int maximum)
- Create an ArcBlockIndicator specifying only the initial value, minimum
value and maximum value. The remaining properties default to 30 ticks that
are 60 pixels in height. The lower and higher
thresholds are set as 1/4 and 3/4 of the minimum and maximum values, the inner arc
radius is 50% of the total arc radius. The default colors are, red, yellow and green
representing low, medium and high.
ArcBlockIndicator
public ArcBlockIndicator()
- Create an ArcBlockIndicator with an initial value of 0 and a range of 0 to 100.
The remaining properties default to 30 ticks that
are 60 pixels in height. The lower and higher
thresholds are set as 1/4 and 3/4 of the minimum and maximum values, the inner arc
radius is 50% of the total arc radius. The default colors are, red, yellow and green
representing low, medium and high.
copyright
public static String copyright()
setNumberOfBlocks
public void setNumberOfBlocks(int blocks)
- Specify the number of blocks in the gauge.
- Overrides:
- setNumberOfBlocks in class BlockIndicator
getLowThreshold
public int getLowThreshold()
- Return the value at which the low colored ticks turn to medium colored ticks.
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class BlockIndicator
setLowThreshold
public void setLowThreshold(int thresholdValue)
- Specify the value at which the low colored ticks turn to medium colored ticks.
getHighThreshold
public int getHighThreshold()
- Return the value at which the medium colored ticks turn to high colored ticks.
setHighThreshold
public void setHighThreshold(int thresholdValue)
- Specify the value at which the medium colored ticks turn to high colored ticks.
setInnerRadius
public void setInnerRadius(int percentageRadius)
- Set the inner radius of the arc.
This is a percentage of the total arc radius.
For best results do not use values less than twenty.
getInnerRadius
public int getInnerRadius()
- Return the inner radius of the arc.
This is a percentage of the total arc radius.
setHighColor
public void setHighColor(Color color)
- Set the high color. Null is ignored.
getHighColor
public Color getHighColor()
- Return the high color.
setMediumColor
public void setMediumColor(Color color)
- Set the medium color. Null is ignored.
getMediumColor
public Color getMediumColor()
- Return the medium color.
setLowColor
public void setLowColor(Color color)
- Set the low color. Null is ignored.
getLowColor
public Color getLowColor()
- Return the low color.
setBlockWidthProportion
public void setBlockWidthProportion(int blockWidth)
- Specify the percentage of the available space to use for each tick.
getBlockWidthProportion
public int getBlockWidthProportion()
- Return the percentage of the available space to use for each tick.
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 BlockIndicator
getUpdateBounds
protected Rectangle[] getUpdateBounds(Dimension size,
int nextDisplayValue,
int nextDisplayMinimum,
int nextDisplayMaximum,
int currentDisplayValue,
int currentDisplayMinimum,
int currentDisplayMaximum)
- Return an array of one rectangle that defines the area of the gauge
that will need to be updated as a result of the supplied next and
current display values. This area is used to generate a paint
request which will have a clipping region set that matches the
update region. Paint processing is optimized to only paint gauge
artefacts that intersect this region.
- Overrides:
- getUpdateBounds in class BlockIndicator
paintComponent
public void paintComponent(Graphics g,
Dimension size,
int value,
int minimum,
int maximum)
- Paint the gauge so that it represents the supplied value.
- Overrides:
- paintComponent in class BlockIndicator
All Packages Class Hierarchy This Package Previous Next Index