Class TLcdS52Symbol

java.lang.Object
com.luciad.format.s52.TLcdS52Symbol
All Implemented Interfaces:
ILcdRotation, ILcdS52Icon, ILcdIcon, ILcdCloneable, Serializable, Cloneable

public class TLcdS52Symbol extends Object implements ILcdS52Icon, ILcdRotation
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.

S-52 symbol properties

See Also:
  • Constructor Details

    • TLcdS52Symbol

      public TLcdS52Symbol()
      Creates a new, empty TLcdS52Symbol.
  • Method Details

    • setColorProvider

      public 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.
      Sets the ILcdS52ColorProvider 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

      public ILcdIcon[] getComponents()
      Returns the components of which this symbol is composed.
      Returns:
      an array containing the components of which symbol icon is composed.
    • setComponents

      public void setComponents(ILcdIcon[] aComponents)
      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 interface ILcdRotation
      Parameters:
      aRotation - the rotation for this object.
    • getShape

      public Shape getShape()
      Specified by:
      getShape in interface ILcdS52Icon
    • getColor

      public String getColor()
      Specified by:
      getColor in interface ILcdS52Icon
    • paintIcon

      public void paintIcon(Component aComponent, Graphics aGraphics, int aX, int aY)
      Description copied from interface: ILcdIcon
      Draw the 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.
      Specified by:
      paintIcon in interface ILcdIcon
      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 interface ILcdIcon
      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 interface ILcdIcon
      Returns:
      the fixed width of the icon.
    • clone

      public Object clone()
      Description copied from interface: ILcdCloneable

      Makes Object.clone() public.

      When for example extending from 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 interface ILcdCloneable
      Overrides:
      clone in class Object
      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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object