public class ThemeLabel extends Theme
Label theme graph.
Label theme graph uses theme value objects to mark (also called label) point, line, surface and other objects, mostly uses characters or numeric fields, such as marking place name, name of the road, river levels, width and other information. It's important to note that the maps are usually illustrated with illustrations, names, scale, and so on, these are drawing elements but not marking the label theme graph.
In label theme graph, user can set the display style and location of the label, or you can use range(using range expression, which is rangeExpression
)to individually set the style of single label or the labels in each range.
The graph below shows a schematic graph of a label theme graph:
The following codes shows how to build a simple label theme graph object:
ThemeLabel themeLabel = new ThemeLabel(); // Uses name fields as label expressions themeLabel.labelExpression = "name"; // Sets a unified text style TextStyle uniformStyle = new TextStyle(); uniformStyle.fontName ="Song typeface"; uniformStyle.fontWidth = 2; uniformStyle.fontHeight = 2; themeLabel.uniformStyle = uniformStyle;
Modifier and Type | Field and Description |
---|---|
boolean |
alongLine
${services_components_commontypes_ThemeLabel_attribute_alongLine_Title}
|
AlongLineDirection |
alongLineDirection
${services_components_commontypes_ThemeLabel_attribute_alongLineDirection_Title}
|
boolean |
angleFixed
${services_components_commontypes_ThemeLabel_attribute_angleFixed_Title}
|
Style |
backStyle
Label background style of label theme graph.
|
boolean |
flowEnabled
${services_components_commontypes_ThemeLabel_attribute_flowEnabled_Title}
|
ThemeLabelItem[] |
items
${services_components_commontypes_ThemeLabel_attribute_items_Title}
|
LabelBackShape |
labelBackShape
The shape type of background of label theme graph.
|
java.lang.String |
labelExpression
${services_components_commontypes_ThemeLabel_attribute_labelEexpression_Title}
|
LabelOverLengthMode |
labelOverLengthMode
Overlong label processing mode.
|
double |
labelRepeatInterval
The interval of the cyclic annotation when marking along the line.
|
boolean |
leaderLineDisplayed
Whether to show the leader line between the label and the object it marks.
|
Style |
leaderLineStyle
${services_components_commontypes_ThemeLabel_attribute_leaderLineStyle_Title}
|
LabelMatrixCell[][] |
matrixCells
${services_components_commontypes_ThemeLabel_attribute_matrixCells_Title}
|
int |
maxLabelLength
${services_components_commontypes_ThemeLabel_attribute_maxLabelLength_Title}
|
int |
maxTextHeight
${services_components_commontypes_ThemeLabel_attribute_maxTextHeight_Title}
|
int |
maxTextWidth
${services_components_commontypes_ThemeLabel_attribute_maxTextWidth_Title}
|
int |
minTextHeight
${services_components_commontypes_ThemeLabel_attribute_minTextHeight_Title}
|
int |
minTextWidth
${services_components_commontypes_ThemeLabel_attribute_minTextWidth_Title}
|
int |
numericPrecision
${services_components_commontypes_ThemeLabel_attribute_numericPrecision_Title}
|
boolean |
offsetFixed
${services_components_commontypes_ThemeLabel_attribute_offsetFixed_Title}
|
java.lang.String |
offsetX
${services_components_commontypes_ThemeLabel_attribute_offsetX_Title}
|
java.lang.String |
offsetY
${services_components_commontypes_ThemeLabel_attribute_offsetY_Title}
|
boolean |
overlapAvoided
${services_components_commontypes_ThemeLabel_attribute_overlapAvoided_Title}
|
java.lang.String |
rangeExpression
${services_components_commontypes_ThemeLabel_attribute_rangeExpression_Title}
|
boolean |
repeatedLabelAvoided
Returns whether to avoid repeated marker of map.
|
boolean |
repeatIntervalFixed
${services_components_commontypes_ThemeLabel_attribute_repeatIntervalFixed_Title}
|
boolean |
smallGeometryLabeled
${services_components_commontypes_ThemeLabel_attribute_smallGeometryLabeled_Title}
|
double |
textSpace
Marking along the line, the spacing between the two characters, the current unit is font height.
|
LabelMixedTextStyle |
uniformMixedStyle
${services_components_commontypes_ThemeLabel_attribute_uniformMixedSytle_Title}
|
TextStyle |
uniformStyle
${services_components_commontypes_ThemeLabel_attribute_uniformStyle_Title}
|
java.lang.String |
uniqueExpression
Single value filed expression
|
ThemeLabelUniqueItem[] |
uniqueItems
Unique label theme graph subitem collection
|
memoryData, type
Constructor and Description |
---|
ThemeLabel() |
ThemeLabel(ThemeLabel themeLabel)
${services_components_commontypes_ThemeLabel_method_constructorByThemeLabel_Title}
|
Modifier and Type | Method and Description |
---|---|
Theme |
copy()
${services_components_commontypes_ThemeLabel_method_copy_Title}
|
boolean |
equals(java.lang.Object obj)
${services_components_commontypes_ThemeLabel_method_equals_Title}
|
int |
hashCode()
${services_components_commontypes_ThemeLabel_method_hashCode_Title}
|
boolean |
isHavingValidItems()
${services_components_commontypes_ThemeLabel_method_isHavingValidItems_Title}
|
boolean |
isHavingValidUniqueItems() |
public ThemeLabelItem[] items
${services_components_commontypes_ThemeLabel_attribute_items_Title}
The elements in each subitem displays labels according to the style of the subitem.
public ThemeLabelUniqueItem[] uniqueItems
public Style backStyle
Label background style of label theme graph.
When sets the back shape labelBackShape
attribute as default NONE, that is, when not displaying any style, backStyle attribute is invalid.
public LabelBackShape labelBackShape
The shape type of background of label theme graph.
Background types can be rectangles, rounded rectangles, rhomboids, ellipses, triangles, symbols, etc., and default to NONE, i.e. not using any shape as the background of the label.
public LabelOverLengthMode labelOverLengthMode
Overlong label processing mode.
The length of a label that exceeds the set maximum length of the label is called a super long label, and the maximum length of the label can be set by maxLabelLength
.
SuperMap provides three ways to deal with the overlong labels: NewLine, Omit, and None.
public boolean flowEnabled
${services_components_commontypes_ThemeLabel_attribute_flowEnabled_Title}
For the geometric objects which crosses large area and line, in a case that a map window can't fully display, if the label position is fixed, the label of the object in the current map window is not visible, And needs to view the label information of the object by a panning map. If the effect of the flow display is used, even if the object is partly displayed in the current map window, and its label is displayed in the current map window. When panning map, the label of object will move, in order to make sure the object partly or fully displayed in the current, its label is visible, which can easily view the label information of each element.
The graph below shows the effect schematic graph of the non-flow display and flow display.
![]() |
![]() |
non-flow display | flow display |
${services_components_commontypes_ThemeLabel_attribute_flowEnabled_Description}
public boolean alongLine
${services_components_commontypes_ThemeLabel_attribute_alongLine_Title}
${services_components_commontypes_ThemeLabel_attribute_alongLine_Description}
public boolean angleFixed
${services_components_commontypes_ThemeLabel_attribute_angleFixed_Title}
${services_components_commontypes_ThemeLabel_attribute_angleFixed_Description}
If angle is fixed, all the labels are displayed according to the rotation angle of the front set in the text style, not to consider the direction of marking along the line. If it is not fixed, it will consider the rotation angle of the font and the direction of marking along the line. The schematic graph is below:
![]() |
![]() |
public boolean overlapAvoided
${services_components_commontypes_ThemeLabel_attribute_overlapAvoided_Title}
${services_components_commontypes_ThemeLabel_attribute_overlapAvoided_Description}
public boolean repeatedLabelAvoided
Returns whether to avoid repeated marker of map.
For the line data representing the Beijing subway line 4, if it is composed of 4 subsegments, when using the name field (the field value is: subway line 4) as the theme variable to draw label theme graph, If user does not choose to avoid repeated marker of map, the display effect is as left graph, if user chooses to avoid repeated marker of map, system will regard 4 sub-lines of this broken line as a line to mark, the display effect is shown in the figure below.
public double labelRepeatInterval
The interval of the cyclic annotation when marking along the line.
The unit of length is consistent with the geographical unit of the map. The labelRepeatInterval attribute works only when setting repeatedLabelAvoided
to be true.
public java.lang.String offsetX
${services_components_commontypes_ThemeLabel_attribute_offsetX_Title}
${services_components_commontypes_ThemeLabel_attribute_offsetX_Description}
public java.lang.String offsetY
${services_components_commontypes_ThemeLabel_attribute_offsetY_Title}
${services_components_commontypes_ThemeLabel_attribute_offsetY_Description}
public int maxLabelLength
${services_components_commontypes_ThemeLabel_attribute_maxLabelLength_Title}
${services_components_commontypes_ThemeLabel_attribute_maxLabelLength_Description}
public Style leaderLineStyle
${services_components_commontypes_ThemeLabel_attribute_leaderLineStyle_Title}
${services_components_commontypes_ThemeLabel_attribute_leaderLineStyle_Description}
public boolean leaderLineDisplayed
Whether to show the leader line between the label and the object it marks.
Default is false, that is, not showing the leader line between the label and the object it marks. When the label flow is displayed, its position is not fixed, as the leader line always points to the inner point of the element, so the display function of the leader line can be used to find the actually corresponding elements of the flowing label.
The following graph shows the drawn label theme graph in the condition of displaying the leader line:
Note: The leader line works only when setting flowEnabled
to be true.
public java.lang.String uniqueExpression
Single value filed expression
Expression can be a field, but also can be constructed by multiple fields, controls the style of object label by the value of expression, the object labels with same expression values are displayed using the same style.
public java.lang.String rangeExpression
${services_components_commontypes_ThemeLabel_attribute_rangeExpression_Title}
${services_components_commontypes_ThemeLabel_attribute_rangeExpression_Description}
public java.lang.String labelExpression
${services_components_commontypes_ThemeLabel_attribute_labelEexpression_Title}
The system displays the fields or values of the field expression corresponding to the labelExpression in the form of label.
public TextStyle uniformStyle
${services_components_commontypes_ThemeLabel_attribute_uniformStyle_Title}
${services_components_commontypes_ThemeLabel_attribute_uniformStyle_Description}
public LabelMixedTextStyle uniformMixedStyle
${services_components_commontypes_ThemeLabel_attribute_uniformMixedSytle_Title}
${services_components_commontypes_ThemeLabel_attribute_uniformMixedSytle_Description}
public LabelMatrixCell[][] matrixCells
${services_components_commontypes_ThemeLabel_attribute_matrixCells_Title}
${services_components_commontypes_ThemeLabel_attribute_matrixCells_Description}
public AlongLineDirection alongLineDirection
${services_components_commontypes_ThemeLabel_attribute_alongLineDirection_Title}
${services_components_commontypes_ThemeLabel_attribute_alongLineDirection_Description}
public int maxTextHeight
${services_components_commontypes_ThemeLabel_attribute_maxTextHeight_Title}
${services_components_commontypes_ThemeLabel_attribute_maxTextHeight_Description}
public int maxTextWidth
${services_components_commontypes_ThemeLabel_attribute_maxTextWidth_Title}
${services_components_commontypes_ThemeLabel_attribute_maxTextWidth_Description}
public int minTextHeight
${services_components_commontypes_ThemeLabel_attribute_minTextHeight_Title}
${services_components_commontypes_ThemeLabel_attribute_minTextHeight_Description}
public int minTextWidth
${services_components_commontypes_ThemeLabel_attribute_minTextWidth_Title}
${services_components_commontypes_ThemeLabel_attribute_minTextWidth_Description}
public int numericPrecision
${services_components_commontypes_ThemeLabel_attribute_numericPrecision_Title}
${services_components_commontypes_ThemeLabel_attribute_numericPrecision_Description}
public boolean offsetFixed
${services_components_commontypes_ThemeLabel_attribute_offsetFixed_Title}
${services_components_commontypes_ThemeLabel_attribute_offsetFixed_Description}
public boolean repeatIntervalFixed
${services_components_commontypes_ThemeLabel_attribute_repeatIntervalFixed_Title}
${services_components_commontypes_ThemeLabel_attribute_repeatIntervalFixed_Description}
public boolean smallGeometryLabeled
${services_components_commontypes_ThemeLabel_attribute_smallGeometryLabeled_Title}
${services_components_commontypes_ThemeLabel_attribute_smallGeometryLabeled_Description}
public double textSpace
public ThemeLabel()
public ThemeLabel(ThemeLabel themeLabel)
${services_components_commontypes_ThemeLabel_method_constructorByThemeLabel_Title}
${services_components_commontypes_ThemeLabel_method_constructorByThemeLabel_Description}
themeLabel
- ${services_components_commontypes_ThemeLabel_constructorByThemeLabel_param_themeLabel }public boolean equals(java.lang.Object obj)
${services_components_commontypes_ThemeLabel_method_equals_Title}
${services_components_commontypes_ThemeLabel_method_equals_Description}
public int hashCode()
${services_components_commontypes_ThemeLabel_method_hashCode_Title}
${services_components_commontypes_ThemeLabel_method_hashCode_Description}
public Theme copy()
${services_components_commontypes_ThemeLabel_method_copy_Title}
${services_components_commontypes_ThemeLabel_method_copy_Description}
public boolean isHavingValidItems()
${services_components_commontypes_ThemeLabel_method_isHavingValidItems_Title}
${services_components_commontypes_ThemeLabel_method_isHavingValidItems_Description}
public boolean isHavingValidUniqueItems()