Class TLcdLabelPlacement

java.lang.Object
com.luciad.view.labeling.algorithm.TLcdLabelPlacement
All Implemented Interfaces:
ILcdCloneable, Cloneable

public class TLcdLabelPlacement extends Object implements ILcdCloneable
A label placement defines a location of a label. This location is specified by a TLcdLabelLocation, and label bounds.

The label bounds is a rotated rectangle expressed in view coordinates (pixels), see illustration.

obstacle

It is possible to store other information in a label placement using getProperties(). A TLcdLabelPlacement is always created for a specific TLcdCollectedLabelInfo, which is also stored inside this class.

Since:
10.1
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new TLcdLabelPlacement for the given label.
  • Method Summary

    Modifier and Type
    Method
    Description
    Makes Object.clone() public.
    double
    Returns the cached cosine value of the rotation in this label placement.
    int
    Returns the height.
    Returns the label of this label placement.
    Returns the label location set in this label placement.
    Returns a map that can be used to store and retrieve info properties using a String key.
    double
    Returns the rotation of the label bounds in radians, clockwise, 0 radians at 3 o'clock.
    double
    Returns the cached sine value of the rotation in this label placement.
    int
    Returns the width.
    int
    Returns x.
    int
    Returns y.
    boolean
    Returns if this TLcdLabelPlacement is visible.
    void
    setBounds(Rectangle aBoundsRectangle, double aRotation)
    Sets bounds of this label placement to the given bounds.
    void
    setHeight(int aHeight)
    Sets the height of this label placement, expressed in view coordinates (pixels).
    void
    Sets the label location of this label placement.
    void
    setRotation(double aRotation)
    Sets the orientation of the rectangle in radians, clockwise, 0 radians at 3 o'clock.
    void
    setVisible(boolean aVisible)
    Set to true to mark this TLcdLabelPlacement as visible and to false to mark it as invisible.
    void
    setWidth(int aWidth)
    Sets the width of this label placement, expressed in view coordinates (pixels).
    void
    setX(int aX)
    Sets the x-coordinate of the upper left corner of this label placement, expressed in view coordinates (pixels).
    void
    setY(int aY)
    Sets the y-coordinate of the upper left corner of this label placement, expressed in view coordinates (pixels).

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TLcdLabelPlacement

      public TLcdLabelPlacement(TLcdCollectedLabelInfo aLabel)
      Creates a new TLcdLabelPlacement for the given label.
      Parameters:
      aLabel - the label for which this placement is created.
  • Method Details

    • getLabel

      public TLcdCollectedLabelInfo getLabel()
      Returns the label of this label placement.
      Returns:
      the label of this label placement.
    • getLabelLocation

      public TLcdLabelLocation getLabelLocation()
      Returns the label location set in this label placement.
      Returns:
      the label location set in this label placement.
    • setLabelLocation

      public void setLabelLocation(TLcdLabelLocation aLabelLocation)
      Sets the label location of this label placement.
      Parameters:
      aLabelLocation - the label location of this label placement.
    • getX

      public int getX()
      Returns x.
      Returns:
      x.
      See Also:
    • setX

      public void setX(int aX)
      Sets the x-coordinate of the upper left corner of this label placement, expressed in view coordinates (pixels).
      Parameters:
      aX - The x.
    • getY

      public int getY()
      Returns y.
      Returns:
      y.
      See Also:
    • setY

      public void setY(int aY)
      Sets the y-coordinate of the upper left corner of this label placement, expressed in view coordinates (pixels).
      Parameters:
      aY - The y.
    • getWidth

      public int getWidth()
      Returns the width.
      Returns:
      the width.
      See Also:
    • setWidth

      public void setWidth(int aWidth)
      Sets the width of this label placement, expressed in view coordinates (pixels).
      Parameters:
      aWidth - The width.
    • getHeight

      public int getHeight()
      Returns the height.
      Returns:
      the height.
      See Also:
    • setHeight

      public void setHeight(int aHeight)
      Sets the height of this label placement, expressed in view coordinates (pixels).
      Parameters:
      aHeight - The height.
    • getRotation

      public double getRotation()
      Returns the rotation of the label bounds in radians, clockwise, 0 radians at 3 o'clock.
      Returns:
      the rotation of the label bounds.
      See Also:
    • setRotation

      public void setRotation(double aRotation)
      Sets the orientation of the rectangle in radians, clockwise, 0 radians at 3 o'clock.
      Parameters:
      aRotation - The rotation of the label bounds.
    • setBounds

      public void setBounds(Rectangle aBoundsRectangle, double aRotation)
      Sets bounds of this label placement to the given bounds.
      Parameters:
      aBoundsRectangle - the bounds rectangle.
      aRotation - the orientation of the rectangle in RADIANs, clockwise, 0 radians at 3 o'clock.
    • isVisible

      public boolean isVisible()
      Returns if this TLcdLabelPlacement is visible.
      Returns:
      if this TLcdLabelPlacement is visible.
      See Also:
    • setVisible

      public void setVisible(boolean aVisible)
      Set to true to mark this TLcdLabelPlacement as visible and to false to mark it as invisible. Setting this field to false denotes that the label location should be stored, but not marked as to-be-painted.

      The default value is true.

      Parameters:
      aVisible - true to mark this TLcdLabelPlacement as visible and to false to mark it as invisible.
    • getProperties

      public Map<String,Object> getProperties()
      Returns a map that can be used to store and retrieve info properties using a String key.
      Returns:
      a map that can be used to store and retrieve info properties using a String key.
    • clone

      public TLcdLabelPlacement 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:
    • getCosRotation

      public double getCosRotation()
      Returns the cached cosine value of the rotation in this label placement.
      Returns:
      the cached cosine value of the rotation in this label placement.
    • getSinRotation

      public double getSinRotation()
      Returns the cached sine value of the rotation in this label placement.
      Returns:
      the cached sine value of the rotation in this label placement.