Class TLcdGXYCollectedLabelInfoUtil
ILcdGXYLabelingAlgorithm
s.- Since:
- 10.1
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addDimensionAndLabelAnchorOffsetDataSFCT
(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method adds dimension data toTLcdCollectedLabelInfo
objects when it doesn't exist yet.static boolean
addDimensionAndLabelAnchorOffsetDataSFCT
(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method adds dimension data to the givenTLcdCollectedLabelInfo
object when it doesn't exist yet.static void
addDimensionDataSFCT
(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method adds dimension data toTLcdCollectedLabelInfo
objects when it doesn't exist yet.static boolean
addDimensionDataSFCT
(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method adds dimension data to the givenTLcdCollectedLabelInfo
when it doesn't exist yet.static void
addInteractiveLabelDataSFCT
(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView) This method checks if the given labels are interactive labels and stores it usingTLcdCollectedLabelInfo.IS_INTERACTIVE_LABEL
.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
.static void
addLabelAnchorOffsetDataSFCT
(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method calculates label anchor offset data, and stores it usingTLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY
.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
.static void
addLabelLocationPrototypeDataSFCT
(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView) This method adds a prototypeTLcdLabelLocation
to eachTLcdCollectedLabelInfo
.static void
addObjectAnchorPointDataSFCT
(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics) This method tries to add an anchor point to eachTLcdCollectedLabeledObjectInfo
object.static void
addParentLabelIdentifierDataSFCT
(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView) This methods add the parent label identifier toTLcdCollectedLabelInfo
objects when it doesn't exist yet.static void
addPrioritiesDataSFCT
(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYMultiLabelPriorityProvider aPriorityProvider, ILcdGXYView aGXYView) This method adds priority data toTLcdCollectedLabelInfo
objects when it doesn't exist yet.static void
addSelectionDataSFCT
(TLcdCollectedLabelInfoList aLabelInfoListSFCT) This method adds selection data to eachTLcdCollectedLabeledObjectInfo
object.static TLcdCollectedLabelInfoList
createCollectedLabelInfoList
(List<TLcdLabelIdentifier> aLabels, ILcdGXYView aGXYView) This method creates aTLcdCollectedLabelInfoList
from the given list ofTLcdLabelIdentifier
s.static boolean
resolveParentBoundsSFCT
(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 aTLcdCollectedLabelInfoList
from the given list ofTLcdLabelIdentifier
s. 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
TLcdCollectedLabelInfoList
created using the list ofTLcdLabelIdentifier
s.
-
addLabelLocationPrototypeDataSFCT
public static void addLabelLocationPrototypeDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView) This method adds a prototypeTLcdLabelLocation
to eachTLcdCollectedLabelInfo
. If its layer is aILcdGXYEditableLabelsLayer
it 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
ALcdLabelLocations
in 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:
true
if the parent bounds could be resolved, andfalse
otherwise.
- 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 toTLcdCollectedLabelInfo
objects when it doesn't exist yet. This priority is stored usingTLcdCollectedLabelInfo.PRIORITY_KEY
. It does so for all labels of the givenTLcdCollectedLabelInfoList
object.- 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 toTLcdCollectedLabelInfo
objects 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 givenTLcdCollectedLabelInfoList
object.- 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 toTLcdCollectedLabelInfo
objects 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 givenTLcdCollectedLabelInfoList
object.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 toTLcdCollectedLabelInfo
objects when it doesn't exist yet. This dimension is stored usingTLcdCollectedLabelInfo.LABEL_DIMENSION_KEY
. It does so for all labels of the givenTLcdCollectedLabelInfoList
object.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 givenTLcdCollectedLabelInfoList
object.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 eachTLcdCollectedLabeledObjectInfo
object. 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 eachTLcdCollectedLabeledObjectInfo
object. 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 givenTLcdCollectedLabelInfo
object 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:
true
if the dimension and label anchor offset could be calculated or if they were already present, andfalse
otherwise.
-
addDimensionDataSFCT
public static boolean addDimensionDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode) This method adds dimension data to the givenTLcdCollectedLabelInfo
when 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:
true
if the dimension could be calculated or if it was already present, andfalse
otherwise.
-
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:
true
if the label anchor offset could be calculated or was already present, andfalse
otherwise.
-
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.
-