Package com.luciad.format.s52
Class TLcdS52Symbol
java.lang.Object
com.luciad.format.s52.TLcdS52Symbol
- All Implemented Interfaces:
ILcdRotation
,ILcdS52Icon
,ILcdIcon
,ILcdCloneable
,Serializable
,Cloneable
This class represents an icon from the S-52 symbology.
Such an icon is composed of zero or more of the following shapes:
- arc
- circle
- polyline
- polygon
An S-52 symbol has a pivot point, that acts as the center point of the symbol, around which
the symbol should be rotated and scaled. When decoded into a TLcdS52Symbol
,
the shapes defining the symbol are translated and the icon size is adapted, such that the
pivot point corresponds to the center of the icon.
The bounding box of the symbol can also be retrieved, and is defined relatively to the left-upper corner of the icon.
The image below illustrates the relationship between a symbol definition
in the S-52 standard, and the corresponding symbol representation in TLcdS52Symbol
.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
MakesObject.clone()
public.boolean
int
Returns the width of the bounding box of this symbol.int
Returns the height of the bounding box of this symbol.int
Returns the X coordinate of the upper left corner of the bounding box of this symbol.int
Returns the Y coordinate of the upper left corner of the bounding box of this symbol.getColor()
ILcdIcon[]
Returns the components of which this symbol is composed.int
Returns the fixed height of the icon.int
Returns the fixed width of the icon.getShape()
int
hashCode()
void
Draw theILcdIcon
at the specified location.static void
setColorProvider
(ILcdS52ColorProvider aColorProvider) Deprecated.this static method shouldn't be used anymore.void
setComponents
(ILcdIcon[] aComponents) Sets the components of which this symbol is to be composed.void
setIconHeight
(int aIconHeight) Sets the icon height of this icon.void
setIconWidth
(int aIconWidth) Sets the icon width of this icon.void
setRotationAngle
(double aRotation) Sets the rotation for this object.toString()
-
Constructor Details
-
TLcdS52Symbol
public TLcdS52Symbol()Creates a new, emptyTLcdS52Symbol
.
-
-
Method Details
-
setColorProvider
Deprecated.this static method shouldn't be used anymore. Color retrieval functions should be implemented by the icons that make up the symbol.Sets theILcdS52ColorProvider
to be used for the visualization of S-52 symbols.- Parameters:
aColorProvider
- the color provider to be sued.
-
setIconWidth
public void setIconWidth(int aIconWidth) Sets the icon width of this icon.- Parameters:
aIconWidth
- the icon height of this icon.
-
setIconHeight
public void setIconHeight(int aIconHeight) Sets the icon height of this icon.- Parameters:
aIconHeight
- the icon height of this icon.
-
getComponents
Returns the components of which this symbol is composed.- Returns:
- an array containing the components of which symbol icon is composed.
-
setComponents
Sets the components of which this symbol is to be composed.- Parameters:
aComponents
- an array containing the icon of which this symbol is to be composed.
-
setRotationAngle
public void setRotationAngle(double aRotation) Description copied from interface:ILcdRotation
Sets the rotation for this object.- Specified by:
setRotationAngle
in interfaceILcdRotation
- Parameters:
aRotation
- the rotation for this object.
-
getShape
- Specified by:
getShape
in interfaceILcdS52Icon
-
getColor
- Specified by:
getColor
in interfaceILcdS52Icon
-
paintIcon
Description copied from interface:ILcdIcon
Draw theILcdIcon
at the specified location.ILcdIcon
implementations may use theComponent
argument to get properties useful for painting, e.g. the foreground or background color.- Specified by:
paintIcon
in 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.
-
getIconHeight
public int getIconHeight()Description copied from interface:ILcdIcon
Returns the fixed height of the icon.- Specified by:
getIconHeight
in interfaceILcdIcon
- Returns:
- the fixed height of the icon.
-
getIconWidth
public int getIconWidth()Description copied from interface:ILcdIcon
Returns the fixed width of the icon.- Specified by:
getIconWidth
in interfaceILcdIcon
- Returns:
- the fixed width of the icon.
-
clone
Description copied from interface:ILcdCloneable
Makes
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:
clone
in interfaceILcdCloneable
- Overrides:
clone
in classObject
- See Also:
-
getBoundingBoxX
public int getBoundingBoxX()Returns the X coordinate of the upper left corner of the bounding box of this symbol.- Returns:
- the X coordinate of the upper left corner of the bounding box.
-
getBoundingBoxY
public int getBoundingBoxY()Returns the Y coordinate of the upper left corner of the bounding box of this symbol.- Returns:
- the Y coordinate of the upper left corner of the bounding box.
-
getBoundingBoxWidth
public int getBoundingBoxWidth()Returns the height of the bounding box of this symbol.- Returns:
- the height of the bounding box.
-
getBoundingBoxHeight
public int getBoundingBoxHeight()Returns the width of the bounding box of this symbol.- Returns:
- the width of the bounding box.
-
equals
-
hashCode
public int hashCode() -
toString
-