public class TLcdSymbol extends Object implements ILcdResizeableIcon
setIconWidth(int)
also sets the height and vice versa.
Note that the hashCode
implementation of this class matches the
equals
implementation, and therefore the hashcode will change
when modifying the instance. Hence, it is strongly advised to treat a
TLcdSymbol
as an immutable object, and never change it after
construction. If you want to change the symbol, create a new one instead.Modifier and Type | Field and Description |
---|---|
static int |
AREA
Constant for an area symbol.
|
static int |
CIRCLE
Constant for a circle.
|
static int |
CROSS
Constant for a cross symbol.
|
static int |
CROSS_RECT
Constant for cross symbol in a rectangle.
|
static int |
DOUBLE_OUTLINED_CIRCLE
Constant for a filled circle having a double outline.
|
static int |
DOUBLE_OUTLINED_RECT
Constant for a filled rectangle having a double outline.
|
static int |
FILLED_CIRCLE
Constant for a filled circle.
|
static int |
FILLED_RECT
Constant for a filled rectangle.
|
static int |
FILLED_TRIANGLE
Constant for a filled triangle.
|
static int |
N_ICON
The number of available symbols.
|
static int |
OUTLINED_AREA
Constant for a outlined area symbol.
|
static int |
PLUS
Constant for a plus sign.
|
static int |
PLUS_RECT
Constant for a plus sign in a rectangle.
|
static int |
POINTS
Constant for points symbol.
|
static int |
POLYGON
Constant for a polygon symbol.
|
static int |
POLYLINE
Constant for a polyline symbol.
|
static int |
RECT
Constant for rectangle.
|
static int |
TEXT
Constant for a text symbol.
|
static int |
TRIANGLE
Constant for a triangle.
|
Constructor and Description |
---|
TLcdSymbol()
Constructs a default symbol (using FILLED_RECT).
|
TLcdSymbol(int aType)
Constructs a symbol of type aType.
|
TLcdSymbol(int aType,
int aSize)
Construct a symbol of a given type and size.
|
TLcdSymbol(int aType,
int aSize,
Color aColor)
Construct a symbol of a given type, size and color.
|
TLcdSymbol(int aType,
int aSize,
Color aBorderColor,
Color aFillColor)
Construct a symbol of a given type, size and colors.
|
TLcdSymbol(int aType,
int aSize,
Color aBorderColor,
Color aFillColor,
float aBorderWidth)
Construct a symbol of a given type, size, colors and border width.
|
TLcdSymbol(TLcdSymbol aSymbol)
Constructs a symbol, identical to the argument symbol.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Makes
Object.clone() public. |
boolean |
equals(Object aObject) |
Color |
getBorderColor()
Returns the color used for the outline/border of this symbol.
|
float |
getBorderWidth()
Returns the width of the outline (if any).
The border width can only be specified when constructing a new symbol. |
Color |
getFillColor()
Returns the color used for the inner area of this symbol.
|
int |
getIconHeight()
Returns the fixed height of the icon.
|
int |
getIconWidth()
Returns the fixed width of the icon.
|
int |
getMemberIndex()
Returns the symbol shape.
|
int |
getShape()
Returns the symbol shape.
|
int |
getSize()
Returns the size of the symbol.
|
static String[] |
getTypeNames()
Returns the names of the symbols.
|
int |
hashCode() |
boolean |
isAntiAliasing()
Determines if anti-aliasing is enabled or not.
|
static void |
paint(int aType,
int aSize,
Graphics g,
Color aBorderColor,
Color aFillColor,
int aX,
int aY)
Deprecated.
use the non-static paint method
|
void |
paintIcon(Component aComponent,
Graphics aGraphics,
int aX,
int aY)
Draw the
ILcdIcon at the specified location. |
void |
setAntiAliasing(boolean aAntiAliasing)
Enables or disables anti-aliased rendering of this symbol.
|
void |
setBorderColor(Color newColor)
Sets the border color for this symbol.
|
void |
setFillColor(Color newColor)
Sets the fill color for this symbol.
|
void |
setIconHeight(int aHeight)
Set the height of the icon.
|
void |
setIconWidth(int aWidth)
Set the width of the icon.
|
void |
setShape(int aShape)
Sets the symbol shape.
|
void |
setSize(int aSize)
Sets the size of the symbol.
|
String |
toString() |
String |
toString(int aType)
Return the name of this type of symbol.
|
public static final int N_ICON
public static final int CIRCLE
public static final int FILLED_CIRCLE
public static final int RECT
public static final int FILLED_RECT
public static final int PLUS
public static final int PLUS_RECT
public static final int CROSS
public static final int CROSS_RECT
public static final int TRIANGLE
public static final int FILLED_TRIANGLE
public static final int POLYLINE
public static final int POLYGON
public static final int AREA
public static final int POINTS
public static final int OUTLINED_AREA
public static final int TEXT
public static final int DOUBLE_OUTLINED_RECT
public static final int DOUBLE_OUTLINED_CIRCLE
public TLcdSymbol()
public TLcdSymbol(int aType)
aType
- the type this symbol should represent.public TLcdSymbol(int aType, int aSize)
aType
- the type this symbol should represent.aSize
- the size of the symbol, in pixels.public TLcdSymbol(int aType, int aSize, Color aColor)
aType
- the type this symbol should represent.aSize
- the size of the symbol, in pixels.aColor
- the color of this symbol.public TLcdSymbol(int aType, int aSize, Color aBorderColor, Color aFillColor)
aType
- the type this symbol should represent.aSize
- the size of the symbol, in pixels.aBorderColor
- the color to use for the outline of this symbol.aFillColor
- the color to use for the inner area of this symbol.public TLcdSymbol(int aType, int aSize, Color aBorderColor, Color aFillColor, float aBorderWidth)
aType
- the type this symbol should represent.aSize
- the size of the symbol, in pixels.aBorderColor
- the color to use for the outline of this symbol.aFillColor
- the color to use for the inner area of this symbol.aBorderWidth
- the width used for the outline/border of this symbol.public TLcdSymbol(TLcdSymbol aSymbol)
aSymbol
- the symbol to copy.public boolean isAntiAliasing()
true
if anti-aliasing is enabled; false otherwisesetAntiAliasing(boolean)
public void setAntiAliasing(boolean aAntiAliasing)
aAntiAliasing
- true
to enable anti-aliasing; false
to disable itisAntiAliasing()
public static String[] getTypeNames()
public int getIconWidth()
ILcdIcon
getIconWidth
in interface ILcdIcon
public int getIconHeight()
ILcdIcon
getIconHeight
in interface ILcdIcon
public int getShape()
setShape(int)
public void setShape(int aShape)
aShape
- the shape this symbol should display.getShape()
public int getMemberIndex()
getShape()
public void setSize(int aSize)
aSize
- the size to set to the symbol.getSize()
public int getSize()
setSize(int)
public void setBorderColor(Color newColor)
newColor
- the color to use for the border/outline.getBorderColor()
public Color getBorderColor()
setBorderColor(java.awt.Color)
public float getBorderWidth()
public void setFillColor(Color newColor)
newColor
- the color to use for the inner area of this symbol.getFillColor()
public Color getFillColor()
setFillColor(java.awt.Color)
public static void paint(int aType, int aSize, Graphics g, Color aBorderColor, Color aFillColor, int aX, int aY)
public void paintIcon(Component aComponent, Graphics aGraphics, int aX, int aY)
ILcdIcon
ILcdIcon
at the specified location. ILcdIcon
implementations
may use the Component
argument to get properties useful for
painting, e.g. the foreground or background color.paintIcon
in interface ILcdIcon
aComponent
- a Component to retrieve properties from.aGraphics
- the Graphics on which the icon will be painted.aX
- the x position where the icon will be painted. x is the first coordinate of the top left
corner point of the icon.aY
- the y position where the icon will be painted. y is the second coordinate of the top left
corner point of the icon.public String toString(int aType)
aType
- the type of symbol.public Object clone()
ILcdCloneable
Makes Object.clone()
public.
java.lang.Object
, it can be implemented like this:
public Object clone() {
try {
return super.clone();
} catch ( CloneNotSupportedException e ) {
// Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
throw new RuntimeException( e );
}
}
clone
in interface ILcdCloneable
clone
in class Object
Object.clone()
public void setIconWidth(int aWidth)
ILcdResizeableIcon
setIconWidth
in interface ILcdResizeableIcon
aWidth
- the new width.public void setIconHeight(int aHeight)
ILcdResizeableIcon
setIconHeight
in interface ILcdResizeableIcon
aHeight
- the new height.