Class TextStyle
- All Implemented Interfaces:
Serializable
For more details see: Text docs
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
MapObservableObject.ObjectChangeEvent -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Fillprotected Strokeprotected Fillprotected Stringprotected TextJustifyprotected Doubleprotected Integerprotected Integerprotected Booleanprotected Paddingprotected TextPlacementprotected Integerprotected Booleanprotected Doubleprotected Doubleprotected Sizeprotected Strokeprotected Stringprotected TextAlignprotected TextBaselineFields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
children, dirty, eventBus, listener, metaProperties, parent, removedChildren, syncId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFill()getFont()getScale()getText()protected StringgetType()voidsetBackgroundFill(Fill backgroundFill) Sets fill object that describes color for text background whenTextPlacement.POINT.voidsetBackgroundStroke(Stroke backgroundStroke) Sets stroke object for text background whenTextPlacement.POINT.voidSets fill object that describes which color should be used for filling text.voidSets font style as CSS font.voidsetJustify(TextJustify justify) Sets the text justification within the text box.voidsetMaxAngle(Double maxAngle) Sets maximum angle between adjacent characters.voidsetOffsetX(Integer offsetX) Sets the horizontal text offset in pixels.voidsetOffsetY(Integer offsetY) Sets the vertical text offset in pixels.voidsetOverflow(Boolean overflow) Sets the overflow.voidsetPadding(Padding padding) Sets the padding in pixels around the text for decluttering and background.voidsetPlacement(TextPlacement placement) Sets text placement.voidSets the repeat interval of text.voidsetRotateWithView(Boolean rotateWithView) Sets whether to rotate the text with the map view.voidsetRotation(Double rotation) Sets the rotation in radians (positive rotation clockwise).voidSets text scale.voidsetScaleSize(Size scaleSize) Sets scale size.voidSets stroke style for text.voidSets text content.voidsetTextAlign(TextAlign textAlign) Sets text alignment.voidsetTextBaseline(TextBaseline textBaseline) Sets the text baseline.withBackgroundFill(Fill backgroundFill) withBackgroundStroke(Stroke backgroundStroke) SeesetFill(Fill).SeesetFont(String).withJustify(TextJustify justify) withMaxAngle(Double maxAngle) SeesetMaxAngle(Double).withOffsetX(Integer offsetX) SeesetOffsetX(Integer).withOffsetY(Integer offsetY) SeesetOffsetY(Integer).withOverflow(Boolean overflow) SeesetOverflow(Boolean).withPadding(Padding padding) SeesetPadding(Padding).withPlacement(TextPlacement placement) withRepeat(Integer repeat) SeesetRepeat(Integer).withRotateWithView(Boolean rotateWithView) withRotation(Double rotation) SeesetRotation(Double).SeesetScale(Double).withScaleSize(Size scaleSize) SeesetScaleSize(Size).withStroke(Stroke stroke) SeesetStroke(Stroke).SeesetText(String).withTextAlign(TextAlign textAlign) withTextBaseline(TextBaseline textBaseline) Methods inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
addChild, addListener, clearRemovedChildren, clearRemovedChildrenInDepth, equals, fireChangeEvent, getChildren, getEventBus, getMetaProperties, getRemovedChildren, getSyncId, hashCode, isDirty, isDirtyInDepth, markAsDirty, markAsDirtyInDepth, removeChild, setMapObjectChangeListener, setMetaProperty, setParent, unmarkDirtyInDepth
-
Field Details
-
font
-
maxAngle
-
offsetX
-
offsetY
-
overflow
-
placement
-
repeat
-
scale
-
scaleSize
-
rotateWithView
-
rotation
-
text
-
textAlign
-
justify
-
textBaseline
-
fill
-
stroke
-
backgroundFill
-
backgroundStroke
-
padding
-
-
Constructor Details
-
TextStyle
public TextStyle()
-
-
Method Details
-
getType
- Specified by:
getTypein classMapObservableObject
-
getFont
- Returns:
- font value or
nullif not set
-
setFont
Sets font style as CSS font. The default value is"10px sans-serif".For more details see: setFont() docs
- Parameters:
font- font value
-
withFont
SeesetFont(String).- Parameters:
font- font value- Returns:
- current instance
-
getMaxAngle
- Returns:
- maximum angle or
nullif not set
-
setMaxAngle
Sets maximum angle between adjacent characters. It is enabled whensetPlacement(TextPlacement)is set toTextPlacement.LINE. The default value is45degrees (PI/4).For more details see: setMaxAngle() docs
- Parameters:
maxAngle- maximum angle in radians
-
withMaxAngle
SeesetMaxAngle(Double).- Parameters:
maxAngle- maximum angle in radians- Returns:
- current instance
-
getOffsetX
- Returns:
- horizontal text offset or
nullif not set
-
setOffsetX
Sets the horizontal text offset in pixels. A positive will shift the text right. The default value is0.For more details see: setOffsetX() docs
- Parameters:
offsetX- horizontal text offset
-
withOffsetX
SeesetOffsetX(Integer).- Parameters:
offsetX- horizontal text offset- Returns:
- current instance
-
getOffsetY
- Returns:
- vertical text offset or
nullif not set
-
setOffsetY
Sets the vertical text offset in pixels. A positive will shift the text down. The default value is0.For more details see: setOffsetY() docs
- Parameters:
offsetY- vertical text offset
-
withOffsetY
SeesetOffsetY(Integer).- Parameters:
offsetY- vertical text offset- Returns:
- current instance
-
getOverflow
- Returns:
- is overflow enabled or
nullif not set
-
setOverflow
Sets the overflow. Is used for polygon labels or whensetPlacement(TextPlacement)is set toTextPlacement.LINE. Enables text to exceed the width of the polygon at the label position or the length of the path that it follows. The default value isfalse.For more details see: setOverflow() docs
- Parameters:
overflow- whether overflow enabled
-
withOverflow
SeesetOverflow(Boolean).- Parameters:
overflow- whether overflow enabled- Returns:
- current instance
-
getPlacement
-
setPlacement
Sets text placement. The default value isTextPlacement.POINT.For more details see: setPlacement() docs
- Parameters:
placement- text placement
-
withPlacement
- Parameters:
placement- text placement- Returns:
- current instance
-
getRepeat
- Returns:
- repeat interval or
nullif not set
-
setRepeat
Sets the repeat interval of text. If repeat is set, the text will be repeated at this interval, which specifies the distance between two text anchors in pixels. Only available whensetPlacement(TextPlacement)is set toTextPlacement.LINE. OverridessetTextAlign(TextAlign).For more details see: setRepeat() docs
- Parameters:
repeat- repeat interval
-
withRepeat
SeesetRepeat(Integer).- Parameters:
repeat- repeat interval- Returns:
- current instance
-
getScale
- Returns:
- text scale or
nullif not set
-
setScale
Sets text scale. Note, ifsetScaleSize(Size)is defined, it will take precedence over scale.For more details see: setScale() docs
- Parameters:
scale- text scale
-
withScale
SeesetScale(Double).- Parameters:
scale- text scale- Returns:
- current instance
-
getScaleSize
- Returns:
- text scale size or
nullif not set
-
setScaleSize
Sets scale size. It takes precedence oversetScale(Double).For more details see: setScale() docs
- Parameters:
scaleSize- text scale size
-
withScaleSize
SeesetScaleSize(Size).- Parameters:
scaleSize- text scale size- Returns:
- current instance
-
getRotateWithView
- Returns:
- whether to rotate the text with the map view or
nullif not set
-
setRotateWithView
Sets whether to rotate the text with the map view. The default value isfalse.For more details see: setRotateWithView() docs
- Parameters:
rotateWithView- rotateWithView option
-
withRotateWithView
- Parameters:
rotateWithView- rotateWithView option- Returns:
- current instance
-
getRotation
- Returns:
- text rotation or
nullif not set
-
setRotation
Sets the rotation in radians (positive rotation clockwise).For more details see: setRotation() docs
- Parameters:
rotation- text rotation
-
withRotation
SeesetRotation(Double).- Parameters:
rotation- text rotation- Returns:
- current instance
-
getText
- Returns:
- text content or
nullif not set
-
setText
Sets text content. Text may contains line breaks "\n".For more details see: setText() docs
- Parameters:
text- text content
-
withText
SeesetText(String).- Parameters:
text- text content- Returns:
- current instance
-
getTextAlign
- Returns:
- text alignment or
nullif not set
-
setTextAlign
Sets text alignment. For placementTextPlacement.POINT, the default value isTextAlign.CENTER. For placementTextPlacement.LINE, the default is to let the renderer choose a placement wheresetMaxAngle(Double)is not exceeded.For more details see: setTextAlign() docs
- Parameters:
textAlign- text alignment
-
withTextAlign
- Parameters:
textAlign- text alignment- Returns:
- current instance
-
getJustify
- Returns:
- text justify option or
null if not set
-
setJustify
Sets the text justification within the text box. If not set, text is justified towards thesetTextAlign(TextAlign)anchor. Otherwise, useTextJustifyoptions to justify the text within the text box. Note, justify is ignored for immediate rendering and also forTextPlacement.LINE.For more details see: setJustify() docs
- Parameters:
justify- text justify option
-
withJustify
- Parameters:
justify- text justify option- Returns:
- current instance
-
getTextBaseline
- Returns:
- text baseline or
null if not set
-
setTextBaseline
Sets the text baseline. The default value isTextBaseline.MIDDLE.For more details see: setTextBaseline() docs
- Parameters:
textBaseline- text baseline
-
withTextBaseline
- Parameters:
textBaseline- text baseline- Returns:
- current instance
-
getFill
- Returns:
- fill style or
nullif not set
-
setFill
Sets fill object that describes which color should be used for filling text.For more details see: setFill() docs
- Parameters:
fill- fill to set
-
withFill
SeesetFill(Fill).- Parameters:
fill- fill to set- Returns:
- current instance
-
getStroke
- Returns:
- stroke style or
nullif not set
-
setStroke
Sets stroke style for text. It describes line styling: width, color, dash, etc.For more details see: setStroke() docs
- Parameters:
stroke- stroke style
-
withStroke
SeesetStroke(Stroke).- Parameters:
stroke- stroke style- Returns:
- current instance
-
getBackgroundFill
- Returns:
- background fill style or
nullif not set
-
setBackgroundFill
Sets fill object that describes color for text background whenTextPlacement.POINT. Default is no fill.For more details see: setBackgroundFill() docs
- Parameters:
backgroundFill- background fill style
-
withBackgroundFill
- Parameters:
backgroundFill- background fill style- Returns:
- current instance
-
getBackgroundStroke
- Returns:
- background stroke style
nullif not set
-
setBackgroundStroke
Sets stroke object for text background whenTextPlacement.POINT. Default is no stroke.For more details see: setBackgroundStroke() docs
- Parameters:
backgroundStroke- background stroke style
-
withBackgroundStroke
- Parameters:
backgroundStroke- background stroke style- Returns:
- current instance
-
getPadding
- Returns:
- padding or
nullif not set
-
setPadding
Sets the padding in pixels around the text for decluttering and background. The default value is[0, 0, 0, 0].For more details see: setPadding() docs
- Parameters:
padding- padding to set
-
withPadding
SeesetPadding(Padding).- Parameters:
padding- padding to set- Returns:
- current instance
-