All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.eou.toolkit.gauge.BlockIndicator
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
- public class BlockIndicator
- extends BaseGauge
This gauge is composed of a horizontal or vertical array of rectangular blocks.
The range of possible values is shown by tick marks.
As the gauge value changes blocks are added or removed one by one.
One way to use this gauge is to specify a changeover point together with positive and
negative colors. For positive values blocks are drawn in the positive color
extending up or right from the changeover point. For negative values blocks are drawn
in the negative color extending down or left from the changeover point.
Alternatively an array of colors can be provided, which are used for the blocks.
If the number of blocks exceeds the number of colors provided the final color is
used for the remaining blocks.
-
BlockIndicator()
- Create a block indicator with an initial value of 0 and a range of 0 to 100.
-
BlockIndicator(int, int, int)
- Create a block indicator specifying the initial value, minimum and maximum values
The remaining properties default to being 2 way, red represents negative blocks,
green represents positive blocks and 10 blocks that are 16 by 16
pixels seperated by a 2 pixel interval.
-
BlockIndicator(int, int, int, int, Dimension, int, boolean, Color, Color, int)
- Create a BlockIndicator specifying the number of blocks, the block dimensions, the
spacing between blocks, the orientation, and the colors to use for negative and
positive values.
-
BlockIndicator(int, int, int, int, Dimension, int, boolean, Color[])
- Create a BlockIndicator specifying the number of blocks, the block dimensions, the
spacing between blocks, the orientation, and the colors to use for the blocks.
-
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.
-
getBlockColors()
- Specify array of colors to color the blocks with, each color in the array is used
as the color of an individual block.
-
getBlockHeight()
- Return the height of the blocks.
-
getBlockSize()
- Return the size of the blocks in the gauge, in pixels.
-
getBlockSpace()
- Return the pixel interval between the blocks.
-
getBlockWidth()
- Return the width of the blocks.
-
getChangeOver()
- Return the value that the indicator colors change from positive
to negative.
-
getImmediate()
- 'get' accessor method for immediate property.
-
getMinimumSize()
-
-
getNegativeColor()
- Return the negative color.
-
getNumberOfBlocks()
- Return the number of blocks in the gauge.
-
getPositiveColor()
- Return the positive color.
-
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.
-
setBackground(Color)
- Specify the color of the background.
-
setBlockColors(Color[])
- Specify array of colors to color the blocks with, each color in the array is used
as the color of an individual block.
-
setBlockHeight(int)
- Specify the height of the blocks in pixels.
-
setBlockSize(Dimension)
- Specify the size of the blocks in the gauge, in pixels.
-
setBlockSpace(int)
- Rpecify the pixel interval between the blocks.
-
setBlockWidth(int)
- Specify the width of the blocks in pixels.
-
setChangeOver(int)
- Specify the value that the colors change from positive to
negative.
-
setImmediate(boolean)
- Specify if the changes to the value displayed by the gauge are shown immediately.
-
setNegativeColor(Color)
- Set the coloring of the negative blocks.
-
setNumberOfBlocks(int)
- Specify the number of blocks in the gauge.
-
setPositiveColor(Color)
- Set the coloring of the positive blocks.
BlockIndicator
public BlockIndicator(int initialValue,
int minimum,
int maximum,
int blocks,
Dimension blockSize,
int spacing,
boolean horizontal,
Color blockColors[])
- Create a BlockIndicator specifying the number of blocks, the block dimensions, the
spacing between blocks, the orientation, and the colors to use for the blocks.
If there are more blocks than colors, the last color is used for the remaining blocks.
BlockIndicator
public BlockIndicator(int initialValue,
int minimum,
int maximum,
int blocks,
Dimension blockSize,
int spacing,
boolean horizontal,
Color positive,
Color negative,
int changeOver)
- Create a BlockIndicator specifying the number of blocks, the block dimensions, the
spacing between blocks, the orientation, and the colors to use for negative and
positive values. The colors can be specified as null, in which case the defaults are
green for positive values and red for negative values.
BlockIndicator
public BlockIndicator(int initialValue,
int minimum,
int maximum)
- Create a block indicator specifying the initial value, minimum and maximum values
The remaining properties default to being 2 way, red represents negative blocks,
green represents positive blocks and 10 blocks that are 16 by 16
pixels seperated by a 2 pixel interval.
BlockIndicator
public BlockIndicator()
- Create a block indicator with an initial value of 0 and a range of 0 to 100.
The remaining properties default to being 2 way, red represents negative blocks,
green represents positive blocks and 10 blocks that are 16 by 20
pixels seperated by a 2 pixel interval.
copyright
public static String copyright()
getNumberOfBlocks
public int getNumberOfBlocks()
- Return the number of blocks in the gauge.
setNumberOfBlocks
public void setNumberOfBlocks(int numberOfBlocks)
- Specify the number of blocks in the gauge.
getBlockSize
public Dimension getBlockSize()
- Return the size of the blocks in the gauge, in pixels.
setBlockSize
public void setBlockSize(Dimension blockSize)
- Specify the size of the blocks in the gauge, in pixels.
Null is ignored.
setBlockHeight
public void setBlockHeight(int blockHeight)
- Specify the height of the blocks in pixels. Constrained to greater than zero.
getBlockHeight
public int getBlockHeight()
- Return the height of the blocks.
setBlockWidth
public void setBlockWidth(int blockWidth)
- Specify the width of the blocks in pixels. Constrained to greater than zero.
getBlockWidth
public int getBlockWidth()
- Return the width of the blocks.
getBlockSpace
public int getBlockSpace()
- Return the pixel interval between the blocks.
setBlockSpace
public void setBlockSpace(int interval)
- Rpecify the pixel interval between the blocks.
setImmediate
public void setImmediate(boolean immediate)
- Specify if the changes to the value displayed by the gauge are shown immediately.
getImmediate
public boolean getImmediate()
- 'get' accessor method for immediate property.
setBlockColors
public void setBlockColors(Color colors[])
- Specify array of colors to color the blocks with, each color in the array is used
as the color of an individual block.
If there
This automatically disables the positive and negative colors.
Null is ignored, the previous fill is used.
- See Also:
- setPositiveColor, setNegativeColor
getBlockColors
public Color[] getBlockColors()
- Specify array of colors to color the blocks with, each color in the array is used
as the color of an individual block.
setPositiveColor
public void setPositiveColor(Color positiveColor)
- Set the coloring of the positive blocks.
The use of the positive and negative colors is enabled.
Any array of colors previously used to color the blocks is set to null.
Null is ignored.
- See Also:
- SetBlockColors
getPositiveColor
public Color getPositiveColor()
- Return the positive color.
setNegativeColor
public void setNegativeColor(Color negativeColor)
- Set the coloring of the negative blocks.
The use of the positive and negative colors is enabled.
Any array of colors previously used to color the blocks is set to null.
Null is ignored.
- See Also:
- SetBlockColors
getNegativeColor
public Color getNegativeColor()
- Return the negative color.
setChangeOver
public void setChangeOver(int changeOver)
- Specify the value that the colors change from positive to
negative.
getChangeOver
public int getChangeOver()
- Return the value that the indicator colors change from positive
to negative.
setBackground
public void setBackground(Color color)
- Specify the color of the background.
- Overrides:
- setBackground in class Component
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class JComponent
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 BaseGauge
paintComponent
public void paintComponent(Graphics g,
Dimension s,
int value,
int minimum,
int maximum)
- Paint the gauge so that it represents the supplied value.
- Overrides:
- paintComponent 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