public class TLcdMIFGXYLabelPainterProvider extends Object implements ILcdGXYLabelPainterProvider
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
.
Constructor and Description |
---|
TLcdMIFGXYLabelPainterProvider()
Creates a new TLcdMIFGXYLabelPainterProvider.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Redefines
Object.clone to make it public. |
Color |
getBackground()
Returns the background color labels are displayed on.
|
ALcdDataObjectExpressionLanguage |
getDataObjectExpressionLanguage()
Returns the data object expression language used by this label painter.
|
String[] |
getExpressions()
Returns the expressions used to compose a label.
|
int[] |
getFeatureIndices()
Deprecated.
Use
getExpressions() |
Font |
getFont()
Returns the font used to display labels.
|
Color |
getForeground()
Returns the color label text is displayed in.
|
ILcdGXYLabelPainter |
getGXYLabelPainter(Object aObject)
Finds an
ILcdGXYLabelPainter that can be used to label the object passed. |
String |
getPositionAsString(int aPosition)
Returns an integer code denoting a direction in human readable form.
|
int[] |
getPositionList()
Returns the list of possible relative positions for an objects label.
|
String[] |
getPositionListAsString()
Returns the list of possible relative positions for an objects label as a set of String objects.
|
Color |
getSelectionColor()
Returns the color used to display label texts of selected objects.
|
int |
getShiftLabelPosition()
Returns an integer code denoting a direction in which the label will be displaced.
|
int |
getVerticalSpacing()
Returns the vertical space between lines in the labels.
|
boolean |
isConsiderPinForBounds()
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 |
isWithAnchorPoint()
Returns whether objects anchor points are painted together with the label.
|
boolean |
isWithPin()
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 |
setFont(Font newFont)
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.
|
public TLcdMIFGXYLabelPainterProvider()
public void setFont(Font newFont)
newFont
- the font to use to display labels.getFont()
public Font getFont()
setFont(java.awt.Font)
public void setForeground(Color newForeground)
newForeground
- the color label text will be displayed in.getForeground()
public Color getForeground()
setForeground(java.awt.Color)
public void setBackground(Color aNewBackgroundColor)
aNewBackgroundColor
- the background color labels are displayed on.getBackground()
public Color getBackground()
setBackground(java.awt.Color)
public void setSelectionColor(Color aNewSelectionColor)
aNewSelectionColor
- the color to use to display label texts of selected objects.getSelectionColor()
public Color getSelectionColor()
setSelectionColor(java.awt.Color)
public void setFrame(boolean newFrame)
newFrame
- true to display the labels in frames.isFrame()
public boolean isFrame()
setFrame(boolean)
public void setFilled(boolean newFilled)
newFilled
- true to embed the labels in filled rectangles.isFilled()
public boolean isFilled()
setFilled(boolean)
public void setShiftLabelPosition(int aNewShift)
aNewShift
- an integer code denoting a direction in which the label will be displaced.TLcdGXYLabelPainter
,
getShiftLabelPosition()
public int getShiftLabelPosition()
TLcdGXYLabelPainter
,
setShiftLabelPosition(int)
public void setVerticalSpacing(int aNewVerticalSpacing)
aNewVerticalSpacing
- the vertical space between lines in the label.getVerticalSpacing()
public int getVerticalSpacing()
setVerticalSpacing(int)
public void setWithAnchorPoint(boolean newWithAnchorPoint)
newWithAnchorPoint
- true to draw the anchor point of the object the label belongs to.isWithAnchorPoint()
public boolean isWithAnchorPoint()
setWithAnchorPoint(boolean)
public void setWithPin(boolean aNewWithPin)
aNewWithPin
- true to draw a line between the object and the objects label.isWithPin()
public boolean isWithPin()
setWithPin(boolean)
public void setConsiderPinForBounds(boolean aNewConsiderPinForBounds)
aNewConsiderPinForBounds
- true to consider the pin calculating the label bounds.isConsiderPinForBounds()
public boolean isConsiderPinForBounds()
setConsiderPinForBounds(boolean)
public void setPositionList(int[] aNewPositionList)
aNewPositionList
- the list of relative positions to draw the objects label.TLcdGXYLabelPainter
,
getPositionList()
public int[] getPositionList()
TLcdGXYLabelPainter
,
setPositionList(int[])
public void setPositionListAsString(String[] aNewPositionList)
aNewPositionList
- the list of Strings denoting the relative positions to be taken into
account when placing a label.TLcdGXYLabelPainter
,
getPositionListAsString()
public String[] getPositionListAsString()
TLcdGXYLabelPainter
,
setPositionListAsString(java.lang.String[])
public String getPositionAsString(int aPosition)
aPosition
- an integer code denoting a direction.public ALcdDataObjectExpressionLanguage getDataObjectExpressionLanguage()
setDataObjectExpressionLanguage(ALcdDataObjectExpressionLanguage)
public void setDataObjectExpressionLanguage(ALcdDataObjectExpressionLanguage aExpressionLanguage)
aExpressionLanguage
- the data object expression language to be used by this label paintergetDataObjectExpressionLanguage()
@Deprecated public void setFeatureIndices(int[] aFeatureIndices)
setExpressions(String[])
aFeatureIndices
- the indexes of the features to be used to compose the labels.getFeatureIndices()
@Deprecated public int[] getFeatureIndices()
getExpressions()
setFeatureIndices(int[])
public String[] getExpressions()
setExpressions(String[])
public void setExpressions(String[] aExpressions)
aExpressions
- the expressions to be used to compose the labels.getExpressions()
,
getDataObjectExpressionLanguage()
,
setDataObjectExpressionLanguage(com.luciad.datamodel.expression.ALcdDataObjectExpressionLanguage)
public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject)
ILcdGXYLabelPainterProvider
ILcdGXYLabelPainter
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;
}
getGXYLabelPainter
in interface ILcdGXYLabelPainterProvider
aObject
- the object to find a label painter forpublic Object clone()
ILcdGXYLabelPainterProvider
Object.clone
to make it public.clone
in interface ILcdGXYLabelPainterProvider
clone
in class Object