Class TLcdGXYCollectedLabelInfoUtil
ILcdGXYLabelingAlgorithms.- Since:
- 10.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDimensionAndLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method adds dimension data toTLcdCollectedLabelInfoobjects when it doesn't exist yet.static booleanaddDimensionAndLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method adds dimension data to the givenTLcdCollectedLabelInfoobject when it doesn't exist yet.static voidaddDimensionDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method adds dimension data toTLcdCollectedLabelInfoobjects when it doesn't exist yet.static booleanaddDimensionDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method adds dimension data to the givenTLcdCollectedLabelInfowhen it doesn't exist yet.static voidaddInteractiveLabelDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView) This method checks if the given labels are interactive labels and stores it usingTLcdCollectedLabelInfo.IS_INTERACTIVE_LABEL.static voidaddInteractiveLabelDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext) This method checks if the given label is an interactive label and stores this usingTLcdCollectedLabelInfo.IS_INTERACTIVE_LABEL.static voidaddLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method calculates label anchor offset data, and stores it usingTLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY.static booleanaddLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method calculates label anchor offset data for the givenTLcdCollectedLabelInfo, and stores it usingTLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY.static voidaddLabelLocationPrototypeDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView) This method adds a prototypeTLcdLabelLocationto eachTLcdCollectedLabelInfo.static voidaddObjectAnchorPointDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method tries to add an anchor point to eachTLcdCollectedLabeledObjectInfoobject.static voidaddParentLabelIdentifierDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView) This methods add the parent label identifier toTLcdCollectedLabelInfoobjects when it doesn't exist yet.static voidaddPrioritiesDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYMultiLabelPriorityProvider aPriorityProvider, ILcdGXYView aGXYView) This method adds priority data toTLcdCollectedLabelInfoobjects when it doesn't exist yet.static voidaddSelectionDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT) This method adds selection data to eachTLcdCollectedLabeledObjectInfoobject.static TLcdCollectedLabelInfoListcreateCollectedLabelInfoList(List<TLcdLabelIdentifier> aLabels, ILcdGXYView aGXYView) This method creates aTLcdCollectedLabelInfoListfrom the given list ofTLcdLabelIdentifiers.static booleanresolveParentBoundsSFCT(TLcdLabelLocation aLabelLocationSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method resolves the parent bounds of the given label location.
-
Method Details
-
createCollectedLabelInfoList
public static TLcdCollectedLabelInfoList createCollectedLabelInfoList(List<TLcdLabelIdentifier> aLabels, ILcdGXYView aGXYView) This method creates aTLcdCollectedLabelInfoListfrom the given list ofTLcdLabelIdentifiers. It only does so if the labels layer is aILcdGXYEditableLabelsLayer.- Parameters:
aLabels- a list of labels to be collected and placed.aGXYView- the gxy view.- Returns:
- the
TLcdCollectedLabelInfoListcreated using the list ofTLcdLabelIdentifiers.
-
addLabelLocationPrototypeDataSFCT
public static void addLabelLocationPrototypeDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView) This method adds a prototypeTLcdLabelLocationto eachTLcdCollectedLabelInfo. If its layer is aILcdGXYEditableLabelsLayerit callsALcdLabelLocations.createLabelLocation()andALcdLabelLocations.getDefaultLabelLocationSFCT. Otherwise it just creates a newTLcdLabelLocation.This method stored this label location using
TLcdCollectedLabelInfo.LABEL_LOCATION_PROTOTYPE_KEY.- Parameters:
aLabelInfoListSFCT- the label info list object.aGXYView- the gxy view.
-
resolveParentBoundsSFCT
public static boolean resolveParentBoundsSFCT(TLcdLabelLocation aLabelLocationSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method resolves the parent bounds of the given label location. For this to work- the layer set in the gxy context should be a
ILcdGXYEditableLabelsLayer, - it should be possible to resolve the parent bounds of the label location of the parent,
- the label painter of the parent label should be a
ILcdGXYLabelPainter2.
This method works the following way :
- If the given label location has no parent label, nothing is modified and the method returns
true. - If the given label location has a parent label, its label location is retrieved from the
ALcdLabelLocationsin the layer. - The parent label location is also resolved (this is done recursively in case the parent has a parent too).
- The resolved parent label location is set on the label painter, and the bounds are retrieved using
ILcdGXYLabelPainter2.labelBoundsSFCT. - These bounds are set on the given label location.
- Parameters:
aLabelLocationSFCT- the label location to be resolved.aGXYContext- a gxy context.aGraphics- the graphics.aLabelPainterMode- the label painter mode.- Returns:
trueif the parent bounds could be resolved, andfalseotherwise.
- the layer set in the gxy context should be a
-
addPrioritiesDataSFCT
public static void addPrioritiesDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYMultiLabelPriorityProvider aPriorityProvider, ILcdGXYView aGXYView) This method adds priority data toTLcdCollectedLabelInfoobjects when it doesn't exist yet. This priority is stored usingTLcdCollectedLabelInfo.PRIORITY_KEY. It does so for all labels of the givenTLcdCollectedLabelInfoListobject.- Parameters:
aLabelInfoListSFCT- the label infos object.aPriorityProvider- the priority provider that is used to retrieve priorities.aGXYView- the view.
-
addParentLabelIdentifierDataSFCT
public static void addParentLabelIdentifierDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView) This methods add the parent label identifier toTLcdCollectedLabelInfoobjects when it doesn't exist yet. This parent label identifier is stored usingTLcdCollectedLabelInfo.PARENT_LABEL_IDENTIFIER_KEY. It does so for all labels of the givenTLcdCollectedLabelInfoListobject.- Parameters:
aLabelInfoListSFCT- a label infos object.aGXYView- the view.
-
addDimensionAndLabelAnchorOffsetDataSFCT
public static void addDimensionAndLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method adds dimension data toTLcdCollectedLabelInfoobjects when it doesn't exist yet. This dimension is stored usingTLcdCollectedLabelInfo.LABEL_DIMENSION_KEY. It also adds a label anchor offset, and stores it usingTLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY. It does so for all labels of the givenTLcdCollectedLabelInfoListobject.The dimension is calculated by retrieving the bounds using a label location with location index -1. When no dimension could be calculated, it is set to
null.The label anchor offset is found by subtracting the upper left point of the label from its label anchor point. The upper left point is calculated by retrieving the bounds using a label location with location index -1. The label anchor point is retrieved using a label location with location index -1. When no label anchor offset could be found, it is set to
(0, 0).- Parameters:
aLabelInfoListSFCT- the label infos object.aGXYView- the view.aGraphics- the graphics.
-
addDimensionDataSFCT
public static void addDimensionDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method adds dimension data toTLcdCollectedLabelInfoobjects when it doesn't exist yet. This dimension is stored usingTLcdCollectedLabelInfo.LABEL_DIMENSION_KEY. It does so for all labels of the givenTLcdCollectedLabelInfoListobject.The dimension is calculated by retrieving the bounds using a label location with location index -1. When no dimension could be calculated, it is set to
null.- Parameters:
aLabelInfoListSFCT- the label infos object.aGXYView- the view.aGraphics- the graphics.
-
addLabelAnchorOffsetDataSFCT
public static void addLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method calculates label anchor offset data, and stores it usingTLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY. It does so for all labels of the givenTLcdCollectedLabelInfoListobject.The label anchor offset is found by subtracting the upper left point of the label from its label anchor point. The upper left point is calculated by retrieving the bounds using a label location with location index -1. The label anchor point is retrieved using a label location with location index -1. When no label anchor offset could be found, it is set to
(0, 0).- Parameters:
aLabelInfoListSFCT- the label infos object.aGXYView- the view.aGraphics- the graphics.
-
addInteractiveLabelDataSFCT
public static void addInteractiveLabelDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView) This method checks if the given labels are interactive labels and stores it usingTLcdCollectedLabelInfo.IS_INTERACTIVE_LABEL. This is done for all labels in the givenTLcdCollectedLabelInfoList.- Parameters:
aLabelInfoListSFCT- the label infos object.aGXYView- the view.
-
addObjectAnchorPointDataSFCT
public static void addObjectAnchorPointDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method tries to add an anchor point to eachTLcdCollectedLabeledObjectInfoobject. The anchor point is retrieved by usingILcdGXYPainter.anchorPointSFCT.- Parameters:
aLabelInfoListSFCT- the label infos object.aGXYView- the view.aGraphics- the graphics.
-
addSelectionDataSFCT
This method adds selection data to eachTLcdCollectedLabeledObjectInfoobject. This is done usingILcdSelection.isSelected(Object). The retrieved boolean is stored usingTLcdCollectedLabeledObjectInfo.OBJECT_SELECTED_KEY.- Parameters:
aLabelInfoListSFCT- the label infos object.
-
addDimensionAndLabelAnchorOffsetDataSFCT
public static boolean addDimensionAndLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method adds dimension data to the givenTLcdCollectedLabelInfoobject when it doesn't exist yet. This dimension is stored usingTLcdCollectedLabelInfo.LABEL_DIMENSION_KEY. It also adds a label anchor offset, and stores it usingTLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY.The dimension is calculated by retrieving the bounds using a label location with location index -1. When no dimension could be calculated, it is set to
null.The label anchor offset is found by subtracting the upper left point of the label from its label anchor point. The upper left point is calculated by retrieving the bounds using a label location with location index -1. The label anchor point is retrieved using a label location with location index -1. When no label anchor offset could be found, it is set to
(0, 0).- Parameters:
aLabelInfoSFCT- a label info object.aGXYContext- a gxy context.aGraphics- the graphics.aLabelPainterMode- the label painter mode to be used.- Returns:
trueif the dimension and label anchor offset could be calculated or if they were already present, andfalseotherwise.
-
addDimensionDataSFCT
public static boolean addDimensionDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method adds dimension data to the givenTLcdCollectedLabelInfowhen it doesn't exist yet. This dimension is stored usingTLcdCollectedLabelInfo.LABEL_DIMENSION_KEY.The dimension is calculated by retrieving the bounds using a label location with location index -1. When no dimension could be calculated, it is set to
null.- Parameters:
aLabelInfoSFCT- a label info object.aGXYContext- a gxy context.aGraphics- the graphics.aLabelPainterMode- the label painter mode to be used.- Returns:
trueif the dimension could be calculated or if it was already present, andfalseotherwise.
-
addLabelAnchorOffsetDataSFCT
public static boolean addLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method calculates label anchor offset data for the givenTLcdCollectedLabelInfo, and stores it usingTLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY.The label anchor offset is found by subtracting the upper left point of the label from its label anchor point. The upper left point is calculated by retrieving the bounds using a label location with location index -1. The label anchor point is retrieved using a label location with location index -1. When no label anchor offset could be found, it is set to
(0, 0).- Parameters:
aLabelInfoSFCT- a label info object.aGXYContext- a gxy context.aGraphics- the graphics.aLabelPainterMode- the label painter mode to be used.- Returns:
trueif the label anchor offset could be calculated or was already present, andfalseotherwise.
-
addInteractiveLabelDataSFCT
public static void addInteractiveLabelDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext) This method checks if the given label is an interactive label and stores this usingTLcdCollectedLabelInfo.IS_INTERACTIVE_LABEL.- Parameters:
aLabelInfoSFCT- a label info object.aGXYContext- a gxy context.
-