Package org.geotools.mbstyle.layer
Enum Class SymbolMBLayer.TextAnchor
- All Implemented Interfaces:
Serializable
,Comparable<SymbolMBLayer.TextAnchor>
,Constable
- Enclosing class:
- SymbolMBLayer
Text justification options.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe bottom of the text is placed closest to the anchor.The bottom left corner of the text is placed closest to the anchor.The bottom right corner of the text is placed closest to the anchor.The center of the text is placed closest to the anchor.The left side of the text is placed closest to the anchor.The right side of the text is placed closest to the anchor.The top of the text is placed closest to the anchor.The top left corner of the text is placed closest to the anchor.The top right corner of the text is placed closest to the anchor. -
Method Summary
Modifier and TypeMethodDescriptionstatic double
getAnchorX
(String jsonString) Quickly grab x justification for jsonString.static double
getAnchorY
(String jsonString) Quickly grab y justification for jsonString.double
getX()
Horizontal justification.double
getY()
Vertical justification.json()
The json representation of this TextAnchor.static SymbolMBLayer.TextAnchor
Parse provided jsonString as a TextAnchor.static SymbolMBLayer.TextAnchor
Returns the enum constant of this class with the specified name.static SymbolMBLayer.TextAnchor[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
CENTER
The center of the text is placed closest to the anchor. -
LEFT
The left side of the text is placed closest to the anchor. -
RIGHT
The right side of the text is placed closest to the anchor. -
TOP
The top of the text is placed closest to the anchor. -
BOTTOM
The bottom of the text is placed closest to the anchor. -
TOP_LEFT
The top left corner of the text is placed closest to the anchor. -
TOP_RIGHT
The top right corner of the text is placed closest to the anchor. -
BOTTOM_LEFT
The bottom left corner of the text is placed closest to the anchor. -
BOTTOM_RIGHT
The bottom right corner of the text is placed closest to the anchor.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getX
public double getX()Horizontal justification.- Returns:
- horizontal alignment between 0.0 and 1.0.
-
getY
public double getY()Vertical justification.- Returns:
- vertical alignment between 0.0 and 1.0.
-
parse
Parse provided jsonString as a TextAnchor.One of center, left, right, top, bottom, top-left, top-right, bottom-left, bottom-right. Defaults to center.
- Parameters:
jsonString
- text anchor definition- Returns:
- TextAnchor, defaults TextAnchor#CENTER if undefined
-
json
The json representation of this TextAnchor.- Returns:
- json representation
-
getAnchorY
Quickly grab y justification for jsonString.- Parameters:
jsonString
- text anchor definition- Returns:
- vertical anchor, defaults to 0.5
-
getAnchorX
Quickly grab x justification for jsonString.- Parameters:
jsonString
- text anchor definition- Returns:
- horizontal anchor, defaults to 0.5
-