public class TLcdNumericParameterizedIcon extends Object implements ILcdParameterizedIcon
ILcdParameterizedIcon
displays numbers, based on the first value in the array of parameters.Constructor and Description |
---|
TLcdNumericParameterizedIcon()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
void |
anchorPointSFCT(double[] aParameters,
Point aPointSFCT)
Returns the anchor point of this icon.
|
Color |
getColor()
Gets the color of the numbers.
|
Font |
getFont()
Gets the font of the numbers.
|
Format |
getFormat()
Gets the format for the numbers.
|
int |
getHeight(double[] aParameters)
Returns the height of the icon for the given parameter values.
|
int |
getWidth(double[] aParameters)
Returns the width of the icon for the given parameter values.
|
void |
paintIcon(Graphics aGraphics,
int aX,
int aY,
double[] aParameters)
Paint the icon at the specified location for the parameters
|
void |
setColor(Color aColor)
Sets the color of the numbers.
|
void |
setFont(Font aFont)
Sets the font of the numbers.
|
void |
setFormat(Format aFormat)
Sets the format for the numbers.
|
public TLcdNumericParameterizedIcon()
public Font getFont()
setFont(java.awt.Font)
public void setFont(Font aFont)
aFont
- The font of the numbers.getFont()
public Color getColor()
setColor(java.awt.Color)
public void setColor(Color aColor)
aColor
- The color of the numbers.getColor()
public Format getFormat()
setFormat(java.text.Format)
public void setFormat(Format aFormat)
aFormat
- The format for the numbers.getFormat()
public void anchorPointSFCT(double[] aParameters, Point aPointSFCT)
ILcdParameterizedIcon
Returns the anchor point of this icon. The anchor point of an icon is the point on the icon that is attached to the underlying object. For example: a circle icon is attached to an underlying point object by its center. An arrow icon can for example be attached to its object at the start of the arrow. The x-coordinate of the anchor point typically lies between 0 and getWidth(). The y-coordinate typically lies between 0 and getHeight().
Note that implementations don't need to take the anchor point into account when implementing the
paintIcon
method. The coordinates passed to that method always represent the top
left corner of the icon. Callers of the paint
method should make sure that the anchor point is
taken into account.
A good default implementation can be to use the middle of the icon:
aPointSFCT.setLocation(getWidth(aParameters) / 2, getHeight(aParameters) / 2);
anchorPointSFCT
in interface ILcdParameterizedIcon
aParameters
- the parameter valuesaPointSFCT
- the point that has to be moved to the location of the anchor point
of this icon.public void paintIcon(Graphics aGraphics, int aX, int aY, double[] aParameters)
ILcdParameterizedIcon
paintIcon
in interface ILcdParameterizedIcon
aGraphics
- the Graphics on which the icon is paintedaX
- the x coordinate at which the icon is painted. aX
is the
x-coordinate of the top left corner point of the icon.aY
- the y coordinate at which the icon is painted. aY
is the
y-coordinate of the top left corner point of the icon.aParameters
- the parameter valuespublic int getWidth(double[] aParameters)
ILcdParameterizedIcon
getWidth
in interface ILcdParameterizedIcon
aParameters
- the parameter values as passed in ILcdParameterizedIcon.paintIcon(java.awt.Graphics, int, int, double[])
public int getHeight(double[] aParameters)
ILcdParameterizedIcon
getHeight
in interface ILcdParameterizedIcon
aParameters
- the parameter values as passed in ILcdParameterizedIcon.paintIcon(java.awt.Graphics, int, int, double[])