public class TLcdS52Symbol extends Object implements ILcdS52Icon, ILcdRotation
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
.
Constructor and Description |
---|
TLcdS52Symbol()
Creates a new, empty
TLcdS52Symbol . |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Makes
Object.clone() public. |
boolean |
equals(Object o) |
int |
getBoundingBoxHeight()
Returns the width of the bounding box of this symbol.
|
int |
getBoundingBoxWidth()
Returns the height of the bounding box of this symbol.
|
int |
getBoundingBoxX()
Returns the X coordinate of the upper left corner of the bounding box of this symbol.
|
int |
getBoundingBoxY()
Returns the Y coordinate of the upper left corner of the bounding box of this symbol.
|
String |
getColor() |
ILcdIcon[] |
getComponents()
Returns the components of which this symbol is composed.
|
int |
getIconHeight()
Returns the fixed height of the icon.
|
int |
getIconWidth()
Returns the fixed width of the icon.
|
Shape |
getShape() |
int |
hashCode() |
void |
paintIcon(Component aComponent,
Graphics aGraphics,
int aX,
int aY)
Draw the
ILcdIcon at the specified location. |
static void |
setColorProvider(ILcdS52ColorProvider aColorProvider)
Deprecated.
this static method shouldn't be used anymore. Color retrieval functions should
be implemented by the icons that make up the symbol.
|
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.
|
String |
toString() |
public static void setColorProvider(ILcdS52ColorProvider aColorProvider)
ILcdS52ColorProvider
to be used for the visualization
of S-52 symbols.aColorProvider
- the color provider to be sued.public void setIconWidth(int aIconWidth)
aIconWidth
- the icon height of this icon.public void setIconHeight(int aIconHeight)
aIconHeight
- the icon height of this icon.public ILcdIcon[] getComponents()
public void setComponents(ILcdIcon[] aComponents)
aComponents
- an array containing the icon of which this symbol is to be composed.public void setRotationAngle(double aRotation)
ILcdRotation
setRotationAngle
in interface ILcdRotation
aRotation
- the rotation for this object.public Shape getShape()
getShape
in interface ILcdS52Icon
public String getColor()
getColor
in interface ILcdS52Icon
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 int getIconHeight()
ILcdIcon
getIconHeight
in interface ILcdIcon
public int getIconWidth()
ILcdIcon
getIconWidth
in interface ILcdIcon
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 int getBoundingBoxX()
public int getBoundingBoxY()
public int getBoundingBoxWidth()
public int getBoundingBoxHeight()