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
Modifier and TypeFieldDescriptionprotected Fill
protected Stroke
protected Fill
protected String
protected TextJustify
protected Double
protected Integer
protected Integer
protected Boolean
protected Padding
protected TextPlacement
protected Integer
protected Boolean
protected Double
protected Double
protected Size
protected Stroke
protected String
protected TextAlign
protected TextBaseline
Fields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
children, dirty, eventBus, listener, metaProperties, parent, removedChildren, syncId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFill()
getFont()
getScale()
getText()
protected String
getType()
void
setBackgroundFill
(Fill backgroundFill) Sets fill object that describes color for text background whenTextPlacement.POINT
.void
setBackgroundStroke
(Stroke backgroundStroke) Sets stroke object for text background whenTextPlacement.POINT
.void
Sets fill object that describes which color should be used for filling text.void
Sets font style as CSS font.void
setJustify
(TextJustify justify) Sets the text justification within the text box.void
setMaxAngle
(Double maxAngle) Sets maximum angle between adjacent characters.void
setOffsetX
(Integer offsetX) Sets the horizontal text offset in pixels.void
setOffsetY
(Integer offsetY) Sets the vertical text offset in pixels.void
setOverflow
(Boolean overflow) Sets the overflow.void
setPadding
(Padding padding) Sets the padding in pixels around the text for decluttering and background.void
setPlacement
(TextPlacement placement) Sets text placement.void
Sets the repeat interval of text.void
setRotateWithView
(Boolean rotateWithView) Sets whether to rotate the text with the map view.void
setRotation
(Double rotation) Sets the rotation in radians (positive rotation clockwise).void
Sets text scale.void
setScaleSize
(Size scaleSize) Sets scale size.void
Sets stroke style for text.void
Sets text content.void
setTextAlign
(TextAlign textAlign) Sets text alignment.void
setTextBaseline
(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:
getType
in classMapObservableObject
-
getFont
- Returns:
- font value or
null
if 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
null
if not set
-
setMaxAngle
Sets maximum angle between adjacent characters. It is enabled whensetPlacement(TextPlacement)
is set toTextPlacement.LINE
. The default value is45
degrees (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
null
if 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
null
if 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
null
if 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
null
if 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
null
if 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
null
if 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
null
if 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
null
if 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
null
if 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
null
if 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, useTextJustify
options 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
null
if 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
null
if 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
null
if 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
null
if 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
null
if 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
-