Package com.luciad.gui
Class TLcdSymbol
java.lang.Object
com.luciad.gui.TLcdSymbol
- All Implemented Interfaces:
ILcdIcon,ILcdResizeableIcon,ILcdCloneable,Serializable,Cloneable
A convenience icon implementation for simple symbols, such as squares or
circles.
This width and the height of this icon are always the same. Setting the width
using
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.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant for an area symbol.static final intConstant for a circle.static final intConstant for a cross symbol.static final intConstant for cross symbol in a rectangle.static final intConstant for a filled circle having a double outline.static final intConstant for a filled rectangle having a double outline.static final intConstant for a filled circle.static final intConstant for a filled rectangle.static final intConstant for a filled triangle.static final intThe number of available symbols.static final intConstant for a outlined area symbol.static final intConstant for a plus sign.static final intConstant for a plus sign in a diamond.static final intConstant for a plus sign in a rectangle.static final intConstant for points symbol.static final intConstant for a polygon symbol.static final intConstant for a polyline symbol.static final intConstant for rectangle.static final intConstant for a text symbol.static final intConstant for a triangle. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs 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. -
Method Summary
Modifier and TypeMethodDescriptionclone()MakesObject.clone()public.booleanReturns the color used for the outline/border of this symbol.floatReturns the width of the outline (if any).Returns the color used for the inner area of this symbol.intReturns the fixed height of the icon.intReturns the fixed width of the icon.intReturns the symbol shape.intgetShape()Returns the symbol shape.intgetSize()Returns the size of the symbol.static String[]Returns the names of the symbols.inthashCode()booleanDetermines if anti-aliasing is enabled or not.static voidDeprecated.use the non-static paint methodvoidDraw theILcdIconat the specified location.voidsetAntiAliasing(boolean aAntiAliasing) Enables or disables anti-aliased rendering of this symbol.voidsetBorderColor(Color newColor) Sets the border color for this symbol.voidsetBorderWidth(float aBorderWidth) Set the width of the outline (if any) of the symbol.voidsetFillColor(Color newColor) Sets the fill color for this symbol.voidsetIconHeight(int aHeight) Set the height of the icon.voidsetIconWidth(int aWidth) Set the width of the icon.voidsetShape(int aShape) Sets the symbol shape.voidsetSize(int aSize) Sets the size of the symbol.toString()toString(int aType) Return the name of this type of symbol.
-
Field Details
-
N_ICON
public static final int N_ICONThe number of available symbols.- See Also:
-
CIRCLE
public static final int CIRCLEConstant for a circle.- See Also:
-
FILLED_CIRCLE
public static final int FILLED_CIRCLEConstant for a filled circle.- See Also:
-
RECT
public static final int RECTConstant for rectangle.- See Also:
-
FILLED_RECT
public static final int FILLED_RECTConstant for a filled rectangle.- See Also:
-
PLUS
public static final int PLUSConstant for a plus sign.- See Also:
-
PLUS_RECT
public static final int PLUS_RECTConstant for a plus sign in a rectangle.- See Also:
-
CROSS
public static final int CROSSConstant for a cross symbol.- See Also:
-
CROSS_RECT
public static final int CROSS_RECTConstant for cross symbol in a rectangle.- See Also:
-
TRIANGLE
public static final int TRIANGLEConstant for a triangle.- See Also:
-
FILLED_TRIANGLE
public static final int FILLED_TRIANGLEConstant for a filled triangle.- See Also:
-
POLYLINE
public static final int POLYLINEConstant for a polyline symbol.- See Also:
-
POLYGON
public static final int POLYGONConstant for a polygon symbol.- See Also:
-
AREA
public static final int AREAConstant for an area symbol.- See Also:
-
POINTS
public static final int POINTSConstant for points symbol.- See Also:
-
OUTLINED_AREA
public static final int OUTLINED_AREAConstant for a outlined area symbol.- See Also:
-
TEXT
public static final int TEXTConstant for a text symbol.- See Also:
-
DOUBLE_OUTLINED_RECT
public static final int DOUBLE_OUTLINED_RECTConstant for a filled rectangle having a double outline. The inner outline uses the border color, the outer outline uses the fill color.- Since:
- 2012.1
- See Also:
-
DOUBLE_OUTLINED_CIRCLE
public static final int DOUBLE_OUTLINED_CIRCLEConstant for a filled circle having a double outline. The inner outline uses the border color, the outer outline uses the fill color.- Since:
- 2017.0
- See Also:
-
PLUS_DIAMOND
public static final int PLUS_DIAMONDConstant for a plus sign in a diamond.- Since:
- 2023.1
- See Also:
-
-
Constructor Details
-
TLcdSymbol
public TLcdSymbol()Constructs a default symbol (using FILLED_RECT). -
TLcdSymbol
public TLcdSymbol(int aType) Constructs a symbol of type aType.- Parameters:
aType- the type this symbol should represent.
-
TLcdSymbol
public TLcdSymbol(int aType, int aSize) Construct a symbol of a given type and size.- Parameters:
aType- the type this symbol should represent.aSize- the size of the symbol, in pixels.
-
TLcdSymbol
Construct a symbol of a given type, size and color.- Parameters:
aType- the type this symbol should represent.aSize- the size of the symbol, in pixels.aColor- the color of this symbol.
-
TLcdSymbol
Construct a symbol of a given type, size and colors.- Parameters:
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.
-
TLcdSymbol
Construct a symbol of a given type, size, colors and border width.- Parameters:
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.- Since:
- 2019.1
-
TLcdSymbol
Constructs a symbol, identical to the argument symbol.- Parameters:
aSymbol- the symbol to copy.
-
-
Method Details
-
isAntiAliasing
public boolean isAntiAliasing()Determines if anti-aliasing is enabled or not.- Returns:
trueif anti-aliasing is enabled; false otherwise- Since:
- 2014.0
- See Also:
-
setAntiAliasing
public void setAntiAliasing(boolean aAntiAliasing) Enables or disables anti-aliased rendering of this symbol. By default, anti-aliasing is enabled.- Parameters:
aAntiAliasing-trueto enable anti-aliasing;falseto disable it- Since:
- 2014.0
- See Also:
-
getTypeNames
Returns the names of the symbols.- Returns:
- the names of the symbols.
-
getIconWidth
public int getIconWidth()Description copied from interface:ILcdIconReturns the fixed width of the icon.- Specified by:
getIconWidthin interfaceILcdIcon- Returns:
- the fixed width of the icon.
-
getIconHeight
public int getIconHeight()Description copied from interface:ILcdIconReturns the fixed height of the icon.- Specified by:
getIconHeightin interfaceILcdIcon- Returns:
- the fixed height of the icon.
-
getShape
public int getShape()Returns the symbol shape.- Returns:
- the symbol shape.
- See Also:
-
setShape
public void setShape(int aShape) Sets the symbol shape.- Parameters:
aShape- the shape this symbol should display.- See Also:
-
getMemberIndex
public int getMemberIndex()Returns the symbol shape.- Returns:
- get the symbol shape.
- See Also:
-
setSize
public void setSize(int aSize) Sets the size of the symbol.- Parameters:
aSize- the size to set to the symbol.- See Also:
-
getSize
public int getSize()Returns the size of the symbol.- Returns:
- the size of the symbol.
- See Also:
-
setBorderColor
Sets the border color for this symbol.- Parameters:
newColor- the color to use for the border/outline.- See Also:
-
getBorderColor
Returns the color used for the outline/border of this symbol.- Returns:
- the color used for the outline/border of this symbol.
- See Also:
-
getBorderWidth
public float getBorderWidth()Returns the width of the outline (if any).- Returns:
- the width of the outline
- Since:
- 2019.1
-
setBorderWidth
public void setBorderWidth(float aBorderWidth) Set the width of the outline (if any) of the symbol.- Parameters:
aBorderWidth- the width of the outline- Since:
- 2024.1
-
setFillColor
Sets the fill color for this symbol.- Parameters:
newColor- the color to use for the inner area of this symbol.- See Also:
-
getFillColor
Returns the color used for the inner area of this symbol.- Returns:
- the color used for the inner area of this symbol.
- See Also:
-
paint
public static void paint(int aType, int aSize, Graphics g, Color aBorderColor, Color aFillColor, int aX, int aY) Deprecated.use the non-static paint method -
paintIcon
Description copied from interface:ILcdIconDraw theILcdIconat the specified location.ILcdIconimplementations may use theComponentargument to get properties useful for painting, e.g. the foreground or background color.- Specified by:
paintIconin interfaceILcdIcon- Parameters:
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.
-
toString
-
toString
Return the name of this type of symbol.- Parameters:
aType- the type of symbol.- Returns:
- the name for this type of symbol.
-
clone
Description copied from interface:ILcdCloneableMakes
When for example extending fromObject.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 ); } }- Specified by:
clonein interfaceILcdCloneable- Overrides:
clonein classObject- See Also:
-
equals
-
hashCode
public int hashCode() -
setIconWidth
public void setIconWidth(int aWidth) Description copied from interface:ILcdResizeableIconSet the width of the icon.- Specified by:
setIconWidthin interfaceILcdResizeableIcon- Parameters:
aWidth- the new width.
-
setIconHeight
public void setIconHeight(int aHeight) Description copied from interface:ILcdResizeableIconSet the height of the icon.- Specified by:
setIconHeightin interfaceILcdResizeableIcon- Parameters:
aHeight- the new height.
-