Package com.massifmaps.styles
Class LabelStyleBuilder
java.lang.Object
com.massifmaps.styles.StyleBuilder
com.massifmaps.styles.BillboardStyleBuilder
com.massifmaps.styles.LabelStyleBuilder
- Direct Known Subclasses:
TextStyleBuilder
A builder class for LabelStyle.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a LabelStyleBuilder object with all parameters set to defaults. -
Method Summary
Modifier and TypeMethodDescriptionBuilds a new instance of the LabelStyle object using previously set parameters.floatReturns the horizontal anchor point of the label.floatReturns the vertical anchor point of the label.intReturns the orientation mode of the label.floatReturns the relative rendering scale for the label.intReturns the scaling mode of the label.booleanReturns the state of the flippable flag.voidsetAnchorPoint(float anchorPointX, float anchorPointY) Sets the anchor point for the label.voidsetAnchorPointX(float anchorPointX) Sets the horizontal anchor point of the label.voidsetAnchorPointY(float anchorPointY) Sets the vertical anchor point of the label.voidsetFlippable(boolean flippable) Sets the state of the flippable flag.voidsetOrientationMode(int orientationMode) Sets the orientation mode for the label.voidsetRenderScale(float renderScale) Sets the relative rendering scale for the label.voidsetScalingMode(int scalingMode) Sets the scaling mode for the label.Methods inherited from class com.massifmaps.styles.BillboardStyleBuilder
getAnimationStyle, getAttachAnchorPointX, getAttachAnchorPointY, getHorizontalOffset, getPlacementPriority, getVerticalOffset, isCausesOverlap, isHideIfOverlapped, isScaleWithDPI, setAnimationStyle, setAttachAnchorPoint, setAttachAnchorPointX, setAttachAnchorPointY, setCausesOverlap, setHideIfOverlapped, setHorizontalOffset, setPlacementPriority, setScaleWithDPI, setVerticalOffsetMethods inherited from class com.massifmaps.styles.StyleBuilder
equals, getColor, hashCode, setColor
-
Constructor Details
-
LabelStyleBuilder
public LabelStyleBuilder()Constructs a LabelStyleBuilder object with all parameters set to defaults.
-
-
Method Details
-
getAnchorPointX
public float getAnchorPointX()Returns the horizontal anchor point of the label.- Returns:
- The horizontal anchor point of the label.
-
setAnchorPointX
public void setAnchorPointX(float anchorPointX) Sets the horizontal anchor point of the label.- Parameters:
anchorPointX- The new horizontal anchor point for the label. -1 means the left side,
0 the center and 1 the right side of the label. The default is 0.
-
getAnchorPointY
public float getAnchorPointY()Returns the vertical anchor point of the label.- Returns:
- The vertical anchor point of the label.
-
setAnchorPointY
public void setAnchorPointY(float anchorPointY) Sets the vertical anchor point of the label.- Parameters:
anchorPointY- The vertical anchor point for the label. -1 means the bottom,
0 the center and 1 the top of the label. The default is -1.
-
setAnchorPoint
public void setAnchorPoint(float anchorPointX, float anchorPointY) Sets the anchor point for the label. Values will be clamped to [-1, 1] range.- Parameters:
anchorPointX- The new horizontal anchor point for the label. -1 means the left side,
0 the center and 1 the right side of the label. The default is 0.anchorPointY- The vertical anchor point for the label. -1 means the bottom,
0 the center and 1 the top of the label. The default is -1.
-
isFlippable
public boolean isFlippable()Returns the state of the flippable flag.- Returns:
- True if the label is flippable.
-
setFlippable
public void setFlippable(boolean flippable) Sets the state of the flippable flag. If set to true and the orientation mode is set to
GROUND the label is allowed to flip 180 degrees to try and face the camera better. This is
useful for street names and some other texts. The default is true.- Parameters:
flippable- The new state of the flippable flag.
-
getOrientationMode
public int getOrientationMode()Returns the orientation mode of the label.- Returns:
- The orientation mode of the label.
-
setOrientationMode
public void setOrientationMode(int orientationMode) Sets the orientation mode for the label. The default is BillboardOrientation::FACE_CAMERA_BILLBOARD.- Parameters:
orientationMode- The new orientation mode for the label.
-
getScalingMode
public int getScalingMode()Returns the scaling mode of the label.- Returns:
- The scaling mode of the label.
-
setScalingMode
public void setScalingMode(int scalingMode) Sets the scaling mode for the label. The default is BillboardScaling::CONST_SCREEN_SIZE.- Parameters:
scalingMode- The new scaling mode for the label.
-
getRenderScale
public float getRenderScale()Returns the relative rendering scale for the label.- Returns:
- The relative rendering scale for the label.
-
setRenderScale
public void setRenderScale(float renderScale) Sets the relative rendering scale for the label. The default is 1.0. For sharper labels, this should be larger.- Parameters:
renderScale- The new rendering scale value.
-
buildStyle
Builds a new instance of the LabelStyle object using previously set parameters.- Returns:
- A new LabelStyle object.
-