Package com.luciad.format.mif.gxy
Class TLcdMIFGXYLabelPainterProvider
java.lang.Object
com.luciad.format.mif.gxy.TLcdMIFGXYLabelPainterProvider
- All Implemented Interfaces:
ILcdGXYLabelPainterProvider
,Serializable
,Cloneable
This class implements an
ILcdGXYLabelPainterProvider
for MIF objects.
Depending on the MIF shape type, it returns
a TLcdGXYDataObjectLabelPainter
,
a TLcdGXYDataObjectPolylineLabelPainter
, or a
a TLcdGXYDataObjectPolygonLabelPainter
.
Setting and getting the provider's properties is delegated to these label
painters, as far as applicable.
Expressions are converted into labels using this object's data object expression language
. The default data object language expression of this label
painter is TLcdDataObjectExpressionLanguage
.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreates a new TLcdMIFGXYLabelPainterProvider. -
Method Summary
Modifier and TypeMethodDescriptionclone()
RedefinesObject.clone
to make it public.Returns the background color labels are displayed on.Returns the data object expression language used by this label painter.String[]
Returns the expressions used to compose a label.int[]
Deprecated.getFont()
Returns the font used to display labels.Returns the color label text is displayed in.getGXYLabelPainter
(Object aObject) Finds anILcdGXYLabelPainter
that can be used to label the object passed.getPositionAsString
(int aPosition) Returns an integer code denoting a direction in human readable form.int[]
Returns the list of possible relative positions for an objects label.String[]
Returns the list of possible relative positions for an objects label as a set of String objects.Returns the color used to display label texts of selected objects.int
Returns an integer code denoting a direction in which the label will be displaced.int
Returns the vertical space between lines in the labels.boolean
Returns whether the pin is taken into account when calculating the label bounds.boolean
isFilled()
Returns whether the labels are displayed embedded in filled rectangles.boolean
isFrame()
Returns whether labels should be displayed in frames.boolean
Returns whether objects anchor points are painted together with the label.boolean
Returns whether a line between the object and the objects label is drawn.void
setBackground
(Color aNewBackgroundColor) Sets the background color labels are displayed on.void
setConsiderPinForBounds
(boolean aNewConsiderPinForBounds) Sets whether to consider the pin when calculating the label bounds.void
setDataObjectExpressionLanguage
(ALcdDataObjectExpressionLanguage aExpressionLanguage) Sets the data object expression language used by this label painter.void
setExpressions
(String[] aExpressions) Sets the expressions to be used to compose the contents of the label.void
setFeatureIndices
(int[] aFeatureIndices) Deprecated.void
setFilled
(boolean newFilled) Sets whether labels should be surrounded by a filled rectangle.void
Sets the font for the labels.void
setForeground
(Color newForeground) Sets the color for labels.void
setFrame
(boolean newFrame) Sets whether a frame should be surrounding the labels.void
setPositionList
(int[] aNewPositionList) Sets the list of possible positions relative to the object where the objects label can be drawn.void
setPositionListAsString
(String[] aNewPositionList) Sets the list of possible positions relative to the object where the objects label can be drawn by means of String objects.void
setSelectionColor
(Color aNewSelectionColor) Sets the color to use to display label texts of selected objects.void
setShiftLabelPosition
(int aNewShift) Determines where the labels should be placed with regards to the object on the map.void
setVerticalSpacing
(int aNewVerticalSpacing) The value of the property VerticalSpacing represents the vertical distance in pixels between successive lines of the labels.void
setWithAnchorPoint
(boolean newWithAnchorPoint) Sets whether to draw the anchor point of the object the label belongs to.void
setWithPin
(boolean aNewWithPin) Sets whether to draw a line connecting the object and the objects label.
-
Constructor Details
-
TLcdMIFGXYLabelPainterProvider
public TLcdMIFGXYLabelPainterProvider()Creates a new TLcdMIFGXYLabelPainterProvider.
-
-
Method Details
-
setFont
Sets the font for the labels.- Parameters:
newFont
- the font to use to display labels.- See Also:
-
getFont
Returns the font used to display labels.- Returns:
- the font used to display labels.
- See Also:
-
setForeground
Sets the color for labels.- Parameters:
newForeground
- the color label text will be displayed in.- See Also:
-
getForeground
Returns the color label text is displayed in.- Returns:
- the color label text is displayed in.
- See Also:
-
setBackground
Sets the background color labels are displayed on.- Parameters:
aNewBackgroundColor
- the background color labels are displayed on.- See Also:
-
getBackground
Returns the background color labels are displayed on.- Returns:
- the background color labels are displayed on.
- See Also:
-
setSelectionColor
Sets the color to use to display label texts of selected objects.- Parameters:
aNewSelectionColor
- the color to use to display label texts of selected objects.- See Also:
-
getSelectionColor
Returns the color used to display label texts of selected objects.- Returns:
- the color used to display label texts of selected objects.
- See Also:
-
setFrame
public void setFrame(boolean newFrame) Sets whether a frame should be surrounding the labels.- Parameters:
newFrame
- true to display the labels in frames.- See Also:
-
isFrame
public boolean isFrame()Returns whether labels should be displayed in frames.- Returns:
- true if the labels should be displayed in frames.
- See Also:
-
setFilled
public void setFilled(boolean newFilled) Sets whether labels should be surrounded by a filled rectangle.- Parameters:
newFilled
- true to embed the labels in filled rectangles.- See Also:
-
isFilled
public boolean isFilled()Returns whether the labels are displayed embedded in filled rectangles.- Returns:
- true if the labels are displayed embedded in filled rectangles.
- See Also:
-
setShiftLabelPosition
public void setShiftLabelPosition(int aNewShift) Determines where the labels should be placed with regards to the object on the map.- Parameters:
aNewShift
- an integer code denoting a direction in which the label will be displaced.- See Also:
-
getShiftLabelPosition
public int getShiftLabelPosition()Returns an integer code denoting a direction in which the label will be displaced.- Returns:
- an integer code denoting a direction in which the label will be displaced.
- See Also:
-
setVerticalSpacing
public void setVerticalSpacing(int aNewVerticalSpacing) The value of the property VerticalSpacing represents the vertical distance in pixels between successive lines of the labels.- Parameters:
aNewVerticalSpacing
- the vertical space between lines in the label.- See Also:
-
getVerticalSpacing
public int getVerticalSpacing()Returns the vertical space between lines in the labels.- Returns:
- the vertical space between lines in the labels.
- See Also:
-
setWithAnchorPoint
public void setWithAnchorPoint(boolean newWithAnchorPoint) Sets whether to draw the anchor point of the object the label belongs to.- Parameters:
newWithAnchorPoint
- true to draw the anchor point of the object the label belongs to.- See Also:
-
isWithAnchorPoint
public boolean isWithAnchorPoint()Returns whether objects anchor points are painted together with the label.- Returns:
- true if objects anchor points are painted together with the label.
- See Also:
-
setWithPin
public void setWithPin(boolean aNewWithPin) Sets whether to draw a line connecting the object and the objects label.- Parameters:
aNewWithPin
- true to draw a line between the object and the objects label.- See Also:
-
isWithPin
public boolean isWithPin()Returns whether a line between the object and the objects label is drawn.- Returns:
- true if a line between the object and the objects label is drawn.
- See Also:
-
setConsiderPinForBounds
public void setConsiderPinForBounds(boolean aNewConsiderPinForBounds) Sets whether to consider the pin when calculating the label bounds.- Parameters:
aNewConsiderPinForBounds
- true to consider the pin calculating the label bounds.- See Also:
-
isConsiderPinForBounds
public boolean isConsiderPinForBounds()Returns whether the pin is taken into account when calculating the label bounds.- Returns:
- true when the pin is considered when calculating the label bounds.
- See Also:
-
setPositionList
public void setPositionList(int[] aNewPositionList) Sets the list of possible positions relative to the object where the objects label can be drawn.- Parameters:
aNewPositionList
- the list of relative positions to draw the objects label.- See Also:
-
getPositionList
public int[] getPositionList()Returns the list of possible relative positions for an objects label.- Returns:
- the list of possible relative positions for an objects label.
- See Also:
-
setPositionListAsString
Sets the list of possible positions relative to the object where the objects label can be drawn by means of String objects.- Parameters:
aNewPositionList
- the list of Strings denoting the relative positions to be taken into account when placing a label.- See Also:
-
getPositionListAsString
Returns the list of possible relative positions for an objects label as a set of String objects.- Returns:
- the list of possible relative positions for an objects label as a set of String objects.
- See Also:
-
getPositionAsString
Returns an integer code denoting a direction in human readable form.- Parameters:
aPosition
- an integer code denoting a direction.- Returns:
- the String representation of the direction.
-
getDataObjectExpressionLanguage
Returns the data object expression language used by this label painter.- Returns:
- the data object expression language used by this label painter
- See Also:
-
setDataObjectExpressionLanguage
Sets the data object expression language used by this label painter.- Parameters:
aExpressionLanguage
- the data object expression language to be used by this label painter- See Also:
-
setFeatureIndices
Deprecated.Sets the indexes of the features to be used to compose the contents of the label.- Parameters:
aFeatureIndices
- the indexes of the features to be used to compose the labels.- See Also:
-
getFeatureIndices
Deprecated.UsegetExpressions()
Returns the indexes of the features used to compose a label.- Returns:
- the indexes of the features used to compose a label.
- See Also:
-
getExpressions
Returns the expressions used to compose a label.- Returns:
- the expressions used to compose a label.
- See Also:
-
setExpressions
Sets the expressions to be used to compose the contents of the label. The format of the expression depends on the expression language set with the setDataObjectExpressionLanguage(com.luciad.datamodel.expression.ALcdDataObjectExpressionLanguage) method.- Parameters:
aExpressions
- the expressions to be used to compose the labels.- See Also:
-
getGXYLabelPainter
Description copied from interface:ILcdGXYLabelPainterProvider
Finds anILcdGXYLabelPainter
that can be used to label the object passed.The label painter provider is responsible for setting the object to the label painter before returning the label painter. An implementation should therefore have the following structure:
public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject) { ILcdGXYLabelPainter labelPainter = ... // find the label painter for the object if (labelPainter != null) { labelPainter.setObject(aObject); } return labelPainter; }
- Specified by:
getGXYLabelPainter
in interfaceILcdGXYLabelPainterProvider
- Parameters:
aObject
- the object to find a label painter for- Returns:
- a label painter that can be used to label the object; or null if no label painter could be found for the given object, or the object could not be set on the retrieved label painter.
-
clone
Description copied from interface:ILcdGXYLabelPainterProvider
RedefinesObject.clone
to make it public.- Specified by:
clone
in interfaceILcdGXYLabelPainterProvider
- Overrides:
clone
in classObject
-
getExpressions()