public class TLcdGXYCollectedLabelInfoUtil extends Object
ILcdGXYLabelingAlgorithm
s.Modifier and Type | Method and Description |
---|---|
static boolean |
addDimensionAndLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT,
ILcdGXYContext aGXYContext,
Graphics aGraphics,
int aLabelPainterMode)
This method adds dimension data to the given
TLcdCollectedLabelInfo object when it doesn't
exist yet. |
static void |
addDimensionAndLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT,
ILcdGXYView aGXYView,
Graphics aGraphics)
This method adds dimension data to
TLcdCollectedLabelInfo 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 given
TLcdCollectedLabelInfo when it doesn't
exist yet. |
static void |
addDimensionDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT,
ILcdGXYView aGXYView,
Graphics aGraphics)
This method adds dimension data to
TLcdCollectedLabelInfo objects when it doesn't
exist yet. |
static void |
addInteractiveLabelDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT,
ILcdGXYContext aGXYContext)
This method checks if the given label is an interactive label and stores this using
TLcdCollectedLabelInfo.IS_INTERACTIVE_LABEL . |
static void |
addInteractiveLabelDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT,
ILcdGXYView aGXYView)
This method checks if the given labels are interactive labels and stores it using
TLcdCollectedLabelInfo.IS_INTERACTIVE_LABEL . |
static boolean |
addLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT,
ILcdGXYContext aGXYContext,
Graphics aGraphics,
int aLabelPainterMode)
This method calculates label anchor offset data for the given
TLcdCollectedLabelInfo ,
and stores it using TLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY . |
static void |
addLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT,
ILcdGXYView aGXYView,
Graphics aGraphics)
This method calculates label anchor offset data, and stores it using
TLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY . |
static void |
addLabelLocationPrototypeDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT,
ILcdGXYView aGXYView)
This method adds a prototype
TLcdLabelLocation to each TLcdCollectedLabelInfo . |
static void |
addObjectAnchorPointDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT,
ILcdGXYView aGXYView,
Graphics aGraphics)
This method tries to add an anchor point to each
TLcdCollectedLabeledObjectInfo object. |
static void |
addParentLabelIdentifierDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT,
ILcdGXYView aGXYView)
This methods add the parent label identifier to
TLcdCollectedLabelInfo objects when
it doesn't exist yet. |
static void |
addPrioritiesDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT,
ILcdGXYMultiLabelPriorityProvider aPriorityProvider,
ILcdGXYView aGXYView)
This method adds priority data to
TLcdCollectedLabelInfo objects when it doesn't
exist yet. |
static void |
addSelectionDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT)
This method adds selection data to each
TLcdCollectedLabeledObjectInfo object. |
static TLcdCollectedLabelInfoList |
createCollectedLabelInfoList(List<TLcdLabelIdentifier> aLabels,
ILcdGXYView aGXYView)
This method creates a
TLcdCollectedLabelInfoList from the given list of
TLcdLabelIdentifier s. |
static boolean |
resolveParentBoundsSFCT(TLcdLabelLocation aLabelLocationSFCT,
ILcdGXYContext aGXYContext,
Graphics aGraphics,
int aLabelPainterMode)
This method resolves the parent bounds of the given label location.
|
public static TLcdCollectedLabelInfoList createCollectedLabelInfoList(List<TLcdLabelIdentifier> aLabels, ILcdGXYView aGXYView)
TLcdCollectedLabelInfoList
from the given list of
TLcdLabelIdentifier
s. It only does so if the labels layer is a
ILcdGXYEditableLabelsLayer
.aLabels
- a list of labels to be collected and placed.aGXYView
- the gxy view.TLcdCollectedLabelInfoList
created using the list of
TLcdLabelIdentifier
s.public static void addLabelLocationPrototypeDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView)
TLcdLabelLocation
to each TLcdCollectedLabelInfo
.
If its layer is a ILcdGXYEditableLabelsLayer
it calls
ALcdLabelLocations.createLabelLocation()
and
ALcdLabelLocations.getDefaultLabelLocationSFCT
.
Otherwise it just creates a new TLcdLabelLocation
.
This method stored this label location using TLcdCollectedLabelInfo.LABEL_LOCATION_PROTOTYPE_KEY
.
aLabelInfoListSFCT
- the label info list object.aGXYView
- the gxy view.public static boolean resolveParentBoundsSFCT(TLcdLabelLocation aLabelLocationSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode)
ILcdGXYEditableLabelsLayer
,ILcdGXYLabelPainter2
.This method works the following way :
true
.ALcdLabelLocations
in the layer.ILcdGXYLabelPainter2.labelBoundsSFCT
.aLabelLocationSFCT
- the label location to be resolved.aGXYContext
- a gxy context.aGraphics
- the graphics.aLabelPainterMode
- the label painter mode.true
if the parent bounds could be resolved, and false
otherwise.public static void addPrioritiesDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYMultiLabelPriorityProvider aPriorityProvider, ILcdGXYView aGXYView)
TLcdCollectedLabelInfo
objects when it doesn't
exist yet. This priority is stored using TLcdCollectedLabelInfo.PRIORITY_KEY
. It does
so for all labels of the given TLcdCollectedLabelInfoList
object.aLabelInfoListSFCT
- the label infos object.aPriorityProvider
- the priority provider that is used to retrieve priorities.aGXYView
- the view.public static void addParentLabelIdentifierDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView)
TLcdCollectedLabelInfo
objects when
it doesn't exist yet. This parent label identifier is stored using TLcdCollectedLabelInfo.PARENT_LABEL_IDENTIFIER_KEY
.
It does so for all labels of the given TLcdCollectedLabelInfoList
object.aLabelInfoListSFCT
- a label infos object.aGXYView
- the view.public static void addDimensionAndLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics)
TLcdCollectedLabelInfo
objects when it doesn't
exist yet. This dimension is stored using TLcdCollectedLabelInfo.LABEL_DIMENSION_KEY
.
It also adds a label anchor offset, and stores it using TLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY
.
It does so for all labels of the given TLcdCollectedLabelInfoList
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)
.
aLabelInfoListSFCT
- the label infos object.aGXYView
- the view.aGraphics
- the graphics.public static void addDimensionDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics)
TLcdCollectedLabelInfo
objects when it doesn't
exist yet. This dimension is stored using TLcdCollectedLabelInfo.LABEL_DIMENSION_KEY
.
It does so for all labels of the given TLcdCollectedLabelInfoList
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
.
aLabelInfoListSFCT
- the label infos object.aGXYView
- the view.aGraphics
- the graphics.public static void addLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics)
TLcdCollectedLabelInfo.LABEL_ANCHOR_OFFSET_KEY
. It does so for all labels
of the given TLcdCollectedLabelInfoList
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)
.
aLabelInfoListSFCT
- the label infos object.aGXYView
- the view.aGraphics
- the graphics.public static void addInteractiveLabelDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView)
TLcdCollectedLabelInfo.IS_INTERACTIVE_LABEL
. This is done for all labels in
the given TLcdCollectedLabelInfoList
.aLabelInfoListSFCT
- the label infos object.aGXYView
- the view.public static void addObjectAnchorPointDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT, ILcdGXYView aGXYView, Graphics aGraphics)
TLcdCollectedLabeledObjectInfo
object.
The anchor point is retrieved by using ILcdGXYPainter.anchorPointSFCT
.aLabelInfoListSFCT
- the label infos object.aGXYView
- the view.aGraphics
- the graphics.public static void addSelectionDataSFCT(TLcdCollectedLabelInfoList aLabelInfoListSFCT)
TLcdCollectedLabeledObjectInfo
object.
This is done using ILcdSelection.isSelected(Object)
. The retrieved boolean is stored
using TLcdCollectedLabeledObjectInfo.OBJECT_SELECTED_KEY
.aLabelInfoListSFCT
- the label infos object.public static boolean addDimensionAndLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode)
TLcdCollectedLabelInfo
object when it doesn't
exist yet. This dimension is stored using TLcdCollectedLabelInfo.LABEL_DIMENSION_KEY
. It also
adds a label anchor offset, and stores it using TLcdCollectedLabelInfo.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)
.
aLabelInfoSFCT
- a label info object.aGXYContext
- a gxy context.aGraphics
- the graphics.aLabelPainterMode
- the label painter mode to be used.true
if the dimension and label anchor offset could be calculated or if
they were already present, and false
otherwise.public static boolean addDimensionDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode)
TLcdCollectedLabelInfo
when it doesn't
exist yet. This dimension is stored using TLcdCollectedLabelInfo.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
.
aLabelInfoSFCT
- a label info object.aGXYContext
- a gxy context.aGraphics
- the graphics.aLabelPainterMode
- the label painter mode to be used.true
if the dimension could be calculated or if it was already present,
and false
otherwise.public static boolean addLabelAnchorOffsetDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext, Graphics aGraphics, int aLabelPainterMode)
TLcdCollectedLabelInfo
,
and stores it using TLcdCollectedLabelInfo.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)
.
aLabelInfoSFCT
- a label info object.aGXYContext
- a gxy context.aGraphics
- the graphics.aLabelPainterMode
- the label painter mode to be used.true
if the label anchor offset could be calculated or was already present,
and false
otherwise.public static void addInteractiveLabelDataSFCT(TLcdCollectedLabelInfo aLabelInfoSFCT, ILcdGXYContext aGXYContext)
TLcdCollectedLabelInfo.IS_INTERACTIVE_LABEL
.aLabelInfoSFCT
- a label info object.aGXYContext
- a gxy context.