Class TLcdLabelingUtil

java.lang.Object
com.luciad.view.labeling.util.TLcdLabelingUtil

public class TLcdLabelingUtil extends Object
Utility class for labeling.
Since:
10.1
  • Method Details

    • adjustLabelLocationFromBoundsSFCT

      public static void adjustLabelLocationFromBoundsSFCT(Point aObjectAnchorPoint, Point aLabelAnchorOffset, TLcdLabelPlacement aLabelPlacementSFCT)
      This method takes a label placement as input and adjusts its TLcdLabelLocation to describe a position based on its bounds. It does this using free placement (TLcdLabelLocation.getLocationIndex() == -1). The resulting TLcdLabelLocation contains a relative location, i.e. it doesn't use the TLcdLabelLocation.ABSOLUTE_POSITION flag.

      This method needs :

      • a label anchor offset (see TLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY). This offset is needed to determine the label anchor point using the upper-left corner of the bounds.
      • the object anchor point. The label anchor point is stored relative to the object anchor point int the TLcdLabelLocation

      The resulting TLcdLabelLocation doesn't contain parent bounds. These need to be resolved later if needed.

      Parameters:
      aObjectAnchorPoint - an anchor point.
      aLabelAnchorOffset - a label anchor offset. This offset should be valid for a label with zero rotation.
      aLabelPlacementSFCT - the label placement to adjust.
    • adjustLabelLocationFromBoundsSFCT

      public static void adjustLabelLocationFromBoundsSFCT(Point aObjectAnchorPoint, Point aLabelAnchorOffset, int aUpperLeftX, int aUpperLeftY, double aRotation, TLcdLabelLocation aLabelLocationSFCT)
      This method takes a rotated rectangle as input and adjusts the given TLcdLabelLocation to describe a position based on these bounds. It does this using free placement (TLcdLabelLocation.getLocationIndex() == -1). The resulting TLcdLabelLocation contains a relative location, i.e. it doesn't use the TLcdLabelLocation.ABSOLUTE_POSITION flag.

      This method needs

      • a label anchor offset (see TLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY). This offset is needed to determine the label anchor point using the upper-left corner of the bounds.
      • the object anchor point. The label anchor point is stored relative to the object anchor point int the TLcdLabelLocation

      The resulting TLcdLabelLocation doesn't contain parent bounds. These need to be resolved later if needed.

      Parameters:
      aObjectAnchorPoint - an anchor point.
      aLabelAnchorOffset - a label anchor offset. This offset should be valid for a label with zero rotation.
      aUpperLeftX - the x-coordinate of the upper-left point of the label bounds in absolute view coordinates.
      aUpperLeftY - the y-coordinate of the upper-left point of the label bounds in absolute view coordinates.
      aRotation - the label rotation around the upper left corner of the bounds. In radians, clockwise, 0 radians at 3 'o clock.
      aLabelLocationSFCT - the label location to be calculated.