Class TLcdS52Text

java.lang.Object
com.luciad.format.s52.TLcdS52Text
All Implemented Interfaces:
ILcdS52Text, ILcdAnchoredIcon, ILcdIcon, ILcdCloneable, Serializable, Cloneable

public class TLcdS52Text extends Object implements ILcdS52Text, Cloneable, ILcdAnchoredIcon
Representation of a text element in the S52 domain model.
See Also:
  • Field Details

  • Constructor Details

    • TLcdS52Text

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

    • 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:
    • setColorProvider

      public static void setColorProvider(ILcdS52ColorProvider aColorProvider)
      Deprecated.
      This method should no longer be used.
      Parameters:
      aColorProvider -
    • anchorPointSFCT

      public void anchorPointSFCT(Point aPointSFCT)
      Description copied from interface: ILcdAnchoredIcon
      Updates the given point to the location of the icon's anchor point, in relative coordinates with respect to the top left. The x-coordinate of the anchor point typically lies between 0 and getWidth(). The y-coordinate typically lies between 0 and getHeight().
      Specified by:
      anchorPointSFCT in interface ILcdAnchoredIcon
      Parameters:
      aPointSFCT - the point that has to be moved to the location of the anchor point of this 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.
    • 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.
    • getTextType

      public int getTextType()
      Returns the text type (TEXT_TYPE_TX or TEXT_TYPE_TE).
      Returns:
      the text type (TEXT_TYPE_TX or TEXT_TYPE_TE).
    • setTextType

      public void setTextType(int aType)
      Sets the text type (TEXT_TYPE_TX or TEXT_TYPE_TE).
      Parameters:
      aType - the text type (TEXT_TYPE_TX or TEXT_TYPE_TE).
    • setAttribute

      public void setAttribute(int aAttribute)
      Sets the attribute of this text object
      Parameters:
      aAttribute - the attribute of this text object
    • getAttribute

      public int getAttribute()
      Gets the attribute of this text object
      Specified by:
      getAttribute in interface ILcdS52Text
      Returns:
      the attribute
    • setColor

      public void setColor(String aColor)
      Sets the color for this text. The given string will be resolved by the color provider.
      Parameters:
      aColor - the color to set
    • setHorizontalJustification

      public void setHorizontalJustification(int aHorizontalJustification)
      Sets the horizontal justification for this text object. This can be either HJUST_CENTRE(1), HJUST_RIGHT(2) or HJUST_LEFT(3).
      Parameters:
      aHorizontalJustification - the horizontal justification
    • setVerticalJustification

      public void setVerticalJustification(int aVerticalJustification)
      Sets the vertical justification for this text object. This can be either VJUST_BOTTOM(1), VJUST_CENTRE(2) or VJUST_TOP(3).
      Parameters:
      aVerticalJustification - the vertical justification
    • setXOffset

      public void setXOffset(int aXOffset)
      Sets the offset for this text object on the x-axis
      Parameters:
      aXOffset - the x-axis offset
    • setYOffset

      public void setYOffset(int aYOffset)
      Sets the offset for this text object on the y-axis
      Parameters:
      aYOffset - the y-axis offset
    • setSpace

      public void setSpace(int aSpace)
      Sets the spacing of this text
      Parameters:
      aSpace - the spacing
    • setBodySize

      public void setBodySize(int aBodySize)
      Sets the size of the body for this text object. The size of the actual font in pixels will depend on a combination of the scale factor and this body size.
      Parameters:
      aBodySize - the body size of the text
    • setStyle

      public void setStyle(int aStyle)
      Sets the style of this text
      Parameters:
      aStyle - the style of this text
    • setWeight

      public void setWeight(int aWeight)
      Sets the weight for this text. This can be WEIGHT_LIGHT(4), WEIGHT_MEDIUM(5) or WEIGHT_BOLD(6).
      Parameters:
      aWeight - the weight of the text
    • setWidth

      public void setWidth(int aWidth)
      Sets the width of the characters in this text. Can be either WIDTH_PLAIN(1) or WIDTH_ITALIC(2)
      Parameters:
      aWidth -
    • getText

      public String getText()
      Gets the string representation of this text object
      Returns:
      the string representation of this text object
    • setText

      public void setText(String aText)
      Sets the string representation of this text object
      Specified by:
      setText in interface ILcdS52Text
      Parameters:
      aText - the string representation of this text object
    • getFont

      public Font getFont()
      Gets the font used by this text object
      Returns:
      the font used by this text object
    • getHorizontalJustification

      public int getHorizontalJustification()
      Gets the horizontal justification for this text object. This can be either HJUST_CENTRE(1), HJUST_RIGHT(2) or HJUST_LEFT(3).
      Returns:
      the horizontal justification
    • getVerticalJustification

      public int getVerticalJustification()
      Gets the vertical justification for this text object. This can be either VJUST_BOTTOM(1), VJUST_CENTRE(2) or VJUST_TOP(3).
      Returns:
      the vertical justification
    • getXOffset

      public int getXOffset()
      Gets the offset for this text object on the x-axis
      Returns:
      the x-axis offset
    • getYOffset

      public int getYOffset()
      Gets the offset for this text object on the y-axis
      Returns:
      the y-axis offset
    • getBodySize

      public int getBodySize()
      Gets the size of the body for this text object. The size of the actual font in pixels will depend on a combination of the scale factor and this body size.
      Returns:
      the body size of the text
    • getWeight

      public int getWeight()
      Gets the weight for this text. This can be WEIGHT_LIGHT(4), WEIGHT_MEDIUM(5) or WEIGHT_BOLD(6).
      Returns:
      the weight of the text
    • getScaleFactor

      public double getScaleFactor()
      Gets the scale factor of this text object. The scale factor determines how much the object is scaled. This value is used primarily to scale text objects to the correct size when using high-dpi devices or prints.
      Returns:
      the scale factor
    • setTextGroup

      public void setTextGroup(int aTextGroup)
      Sets the text group of this text
      Parameters:
      aTextGroup - the text group
    • getTextGroup

      public int getTextGroup()
      Gets the text group of this text
      Specified by:
      getTextGroup in interface ILcdS52Text
      Returns:
      the text group
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object