Class MixedTextStyle
- java.lang.Object
- 
- com.supermap.mapping.MixedTextStyle
 
- 
 
 public class MixedTextStyle extends java.lang.ObjectThe text composite style class.This class is mainly used to set the text content of the label in the label map. Through this type of user can make the label text display different styles, such as the text "Himalayas", through this class can be the first three words in red, the latter two words in blue. Setting different styles for the same text is essentially segmenting the characters of the text, and the characters in the same segment have the same display style. There are two ways to segment characters, one is to use the delimiter to segment the text; the other is segmented according to the segmented index value. 
- 
- 
Constructor SummaryConstructors Constructor and Description MixedTextStyle()The default constructor for constructing a new object.MixedTextStyle(TextStyle[] styles, int[] startIndexes)Initializes a new instance of the MixedTextStyle class according to the specified text styles and the split indexes.MixedTextStyle(TextStyle[] styles, java.lang.String separator)Initializes a new instance of the MixedTextStyle class according to the specified text styles and the separator.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddispose()Releases the resources that the object occupies.TextStylegetDefaultStyle()Returns the default style.java.lang.StringgetSeparator()Returns the text separator, the style of which employs the default style.int[]getSplitIndexes()Returns the split index values used to separate text.TextStyle[]getStyles()Returns the text style collection.booleanisSeparatorEnabled()Returns whether the text delimiter is valid or not.voidsetDefaultStyle(TextStyle style)Sets the default style.voidsetSeparator(java.lang.String value)Sets the text separator, the style of which employs the default style.voidsetSeparatorEnabled(boolean value)Sets whether the text delimiter is valid or not.voidsetSplitIndexes(int[] indexes)Sets the split index values used to separate text.voidsetStyles(TextStyle[] styles)Sets the text style collection.
 
- 
- 
- 
Constructor Detail- 
MixedTextStylepublic MixedTextStyle() The default constructor for constructing a new object.
 - 
MixedTextStylepublic MixedTextStyle(TextStyle[] styles, java.lang.String separator) Initializes a new instance of the MixedTextStyle class according to the specified text styles and the separator.- Parameters:
- styles- specify the text style.
- separator- Specifies the delimiter.
 
 - 
MixedTextStylepublic MixedTextStyle(TextStyle[] styles, int[] startIndexes) Initializes a new instance of the MixedTextStyle class according to the specified text styles and the split indexes.- Parameters:
- styles- specify the text style.
- startIndexes- Specifies the segmented index value.
 
 
- 
 - 
Method Detail- 
getDefaultStylepublic TextStyle getDefaultStyle() Returns the default style.- Returns:
- default style.defaults to {Alignment=TopLeft,BackColor=Color [A=255, R=0, G=0, B=0],BackOpaque=False,Bold=False,FontHeight=6,FontWidth=0,ForeColor=Color [A=255, R=0, G=0, B=0],IsSizeFixed=True,Italic=False,Outline=False,Rotation=0,Shadow=False,Strikeout=False,Underline=False,Weight=400}.
 
 - 
setDefaultStylepublic void setDefaultStyle(TextStyle style) Sets the default style.- Parameters:
- style- Specifies the default style.
 
 - 
getSeparatorpublic java.lang.String getSeparator() Returns the text separator, the style of which employs the default style. The separator can be only one character.The delimiter of text is a symbol that separates the text, such as "_" as a delimiter, which divides the text "5_109" into "5" and "109", assuming a style array: style1, style2 and default text style DefaultStyle. In the display, "5" using Style1 style display, the separator "_" using the default style (DefaultStyle), the characters "1", "0", "9" use Style2 style. - Returns:
- text delimiter.defaults to an empty string.
 
 - 
setSeparatorpublic void setSeparator(java.lang.String value) Sets the text separator, the style of which employs the default style. The separator can be only one character.The delimiter of text is a symbol that separates the text, such as "_" as a delimiter, which divides the text "5_109" into "5" and "109", assuming a style array: style1, style2 and default text style DefaultStyle. In the display, "5" using Style1 style display, the separator "_" using the default style (DefaultStyle), the characters "1", "0", "9" use Style2 style. - Parameters:
- value- Specifies the delimiter of the text.
 
 - 
isSeparatorEnabledpublic boolean isSeparatorEnabled() Returns whether the text delimiter is valid or not.When the delimiter is valid, the text is segmented with a delimiter; it is segmented according to the position of the character in the text when it is invalid. After segmenting, the characters in the same segment have the same display style. - Returns:
- The separator returns true if true; otherwise, it returns false.The default value is false.
 
 - 
setSeparatorEnabledpublic void setSeparatorEnabled(boolean value) Sets whether the text delimiter is valid or not.When the delimiter is valid, the text is segmented with a delimiter; it is segmented according to the position of the character in the text when it is invalid. After segmenting, the characters in the same segment have the same display style. - Parameters:
- value- A Boolean value specifies whether the text's delimiter is valid.
 
 - 
getStylespublic TextStyle[] getStyles() Returns the text style collection. Styles in the text style collection are used for characters in different segments.- Returns:
- Text style collection.The default value is TextStyle [] object with length 0.
 
 - 
setStylespublic void setStyles(TextStyle[] styles) Sets the text style collection. Styles in the text style set are used for characters in different segments.- Parameters:
- styles- Text style collection.
 
 - 
getSplitIndexespublic int[] getSplitIndexes() Returns the split index values used to separate text.- Returns:
- Segmented index value.The default is an integer array object of length 0.
 
 - 
setSplitIndexespublic void setSplitIndexes(int[] indexes) Sets the split index values used to separate text.- Parameters:
- indexes- Specifies the segmentation index value.
 
 - 
disposepublic void dispose() Releases the resources that the object occupies. This object is no longer available when the method is called.
 
- 
 
-