Class TLcdAIXM51LabelingAlgorithm

java.lang.Object
com.luciad.format.aixm51.view.gxy.TLcdAIXM51LabelingAlgorithm
All Implemented Interfaces:
ILcdCloneable, ILcdGXYLabelingAlgorithm, Cloneable

public class TLcdAIXM51LabelingAlgorithm extends Object implements ILcdGXYLabelingAlgorithm
A labeling algorithm that can compute label positions for AIXM 5.1. This algorithm can be used with label painters that are provided by a TLcdAIXM51GXYPainterEditorProvider.
Since:
11.0
  • Constructor Details

    • TLcdAIXM51LabelingAlgorithm

      public TLcdAIXM51LabelingAlgorithm()
  • Method Details

    • collectLabelInfo

      public TLcdCollectedLabelInfoList collectLabelInfo(List<TLcdLabelIdentifier> aLabelsToCollect, Graphics aGraphics, ILcdGXYView aGXYView)
      Description copied from interface: ILcdGXYLabelingAlgorithm
      This method returns a TLcdCollectedLabelInfoList object based on the given list of TLcdLabelIdentifiers. The returned TLcdCollectedLabelInfoList should contain a TLcdCollectedLabelInfo object for each label that should be placed.

      Each TLcdCollectedLabelInfo should also contain all information needed by computeLabelPlacements to place the labels. In order to enable correct asynchronous label placing, all calls to the layer and the (label) painters should be done in this method. The results should then be stored in the info objects.

      It is possible that the returned TLcdCollectedLabelInfoList doesn't contain a TLcdCollectedLabelInfo object for every given TLcdLabelIdentifier. In that case the missing labels are not placed.

      Specified by:
      collectLabelInfo in interface ILcdGXYLabelingAlgorithm
      Parameters:
      aLabelsToCollect - the labels for which a TLcdCollectedLabelInfoList should be created.
      aGraphics - the graphics.
      aGXYView - the view.
      Returns:
      a TLcdCollectedLabelInfoList which contains all the information needed to place the labels.
    • computeLabelPlacements

      public List<TLcdLabelPlacement> computeLabelPlacements(TLcdCollectedLabelInfoList aLabelInfoList, ILcdLabelConflictChecker aLabelConflictChecker, ILcdGXYView aView)
      Description copied from interface: ILcdGXYLabelingAlgorithm
      This method computes a list of TLcdLabelPlacements using the given TLcdCollectedLabelInfoList. The returned label placements should contain a valid TLcdLabelLocation and label bounds. They should also point to their corresponding TLcdCollectedLabelInfo, which in turn should point to its corresponding TLcdCollectedLabeledObjectInfo.

      The given TLcdCollectedLabelInfoList should always be an object created or returned by collectLabelInfo.

      The returned List of TLcdLabelPlacements contains label placements that are either visible or invisible. When a placement is present in the list, it means that the location should be stored. When a placement in the list is marked as visible, it means that its location should be marked as to-be-painted.

      The labels should by preference be placed in the order in which the labels are returned by TLcdCollectedLabelInfoList.getLabels().

      Specified by:
      computeLabelPlacements in interface ILcdGXYLabelingAlgorithm
      Parameters:
      aLabelInfoList - the info object that contains all information needed to place the labels.
      aLabelConflictChecker - the bounds conflict checker that can be used to detect conflicts between labels.
      aView - the view.
      Returns:
      a list of labels to be rendered.
    • canHandle

      public boolean canHandle(TLcdLabelIdentifier aLabel)
      Returns if this algorithm can handle the given label. Returns true if the TLcdAIXM51GXYPainterEditorProvider is used to provide a label painter for the layer of the given label.
      Parameters:
      aLabel - the label to handle
      Returns:
      if this algorithm can handle the label
    • 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: