Class IconStyle
- All Implemented Interfaces:
Serializable
For more details see: Icon 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 Anchor
protected IconOrigin
protected IconAnchorUnits
protected IconAnchorUnits
protected String
protected String
protected Integer
protected Offset
protected IconOrigin
protected com.vaadin.flow.server.StreamResource
protected Size
protected String
protected Integer
Fields inherited from class io.jmix.mapsflowui.kit.component.model.style.image.ImageStyle
declutterMode, displacement, opacity, rotateWithView, rotation, scale, scaleSize
Fields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
children, dirty, eventBus, listener, metaProperties, removedChildren, syncId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetColor()
com.vaadin.flow.server.StreamResource
getScale()
getSize()
getSrc()
protected String
getType()
getWidth()
void
Sets the icon anchor.void
setAnchorOrigin
(IconOrigin anchorOrigin) Sets the origin of the anchor.void
setAnchorXUnits
(IconAnchorUnits anchorXUnits) Sets units in which the anchor X value is specified.void
setAnchorYUnits
(IconAnchorUnits anchorYUnits) Sets units in which the anchor Y value is specified.void
Sets the color to tint the icon.void
setCrossOrigin
(String crossOrigin) Sets the cross-origin attribute for loaded images.void
setDeclutterMode
(DeclutterMode declutterMode) Sets declutter mode.void
setDisplacement
(Displacement displacement) Sets the displacement of the icon in pixels.void
Sets the height of the icon in pixels.void
Sets offset which, together withsetSize(Size)
andsetOffsetOrigin(IconOrigin)
, defines the sub-rectangle to use from the original (sprite) image.void
setOffsetOrigin
(IconOrigin offsetOrigin) Sets the origin of the offset.void
setOpacity
(Double opacity) Sets the opacity.void
setResource
(com.vaadin.flow.server.StreamResource resource) Sets stream resource.void
setRotateWithView
(Boolean rotateWithView) Sets whether the styled image should be rotated with the map view rotation.void
setRotation
(Double rotation) Sets the rotation value.void
Sets the scale.void
setScaleSize
(Size scaleSize) Sets the scale size.void
Sets the icon size in pixels.void
Sets the image source URI.void
Sets the width of the icon in pixels.withAnchor
(Anchor anchor) SeesetAnchor(Anchor)
.withAnchorOrigin
(IconOrigin anchorOrigin) withAnchorXUnits
(IconAnchorUnits anchorXUnits) withAnchorYUnits
(IconAnchorUnits anchorYUnits) SeesetColor(String)
.withCrossOrigin
(String crossOrigin) withDeclutterMode
(DeclutterMode declutterMode) withDisplacement
(Displacement displacement) withHeight
(Integer height) SeesetHeight(Integer)
.withOffset
(Offset offset) SeesetOffset(Offset)
.withOffsetOrigin
(IconOrigin offsetOrigin) withOpacity
(Double opacity) withResource
(com.vaadin.flow.server.StreamResource resource) withRotateWithView
(Boolean rotateWithView) withRotation
(Double rotation) SeesetRotation(Double)
.SeesetScale(Double)
.withScaleSize
(Size scaleSize) SeesetScaleSize(Size)
.SeesetSize(Size)
.SeesetSrc(String)
.SeesetWidth(Integer)
.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, unmarkDirtyInDepth
-
Field Details
-
anchor
-
anchorOrigin
-
anchorXUnits
-
anchorYUnits
-
color
-
crossOrigin
-
resource
protected com.vaadin.flow.server.StreamResource resource -
width
-
height
-
offset
-
offsetOrigin
-
size
-
src
-
-
Constructor Details
-
IconStyle
public IconStyle()
-
-
Method Details
-
getType
- Specified by:
getType
in classMapObservableObject
-
getAnchor
- Returns:
- anchor value or
null
if not set
-
setAnchor
Sets the icon anchor. The default value is the icon center ([0.5, 0,5]
).For more details see: setAnchor() docs
- Parameters:
anchor
- anchor value
-
withAnchor
SeesetAnchor(Anchor)
.- Parameters:
anchor
- anchor value- Returns:
- current instance
-
getAnchorOrigin
-
setAnchorOrigin
Sets the origin of the anchor.Note, anchor origin attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
anchorOrigin
- origin of the anchor
-
withAnchorOrigin
- Parameters:
anchorOrigin
- origin of the anchor- Returns:
- current instance
-
getAnchorXUnits
- Returns:
- units or
null
if not set
-
setAnchorXUnits
Sets units in which the anchor X value is specified. A value ofIconAnchorUnits.FRACTION
indicates the X value is a fraction of the icon. A value ofIconAnchorUnits.PIXELS
indicates the X value in pixels. The default value isIconAnchorUnits.FRACTION
.Note, anchor X units attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
anchorXUnits
- units to set
-
withAnchorXUnits
- Parameters:
anchorXUnits
- units to set- Returns:
- current instance
-
getAnchorYUnits
- Returns:
- units or
null
if not set
-
setAnchorYUnits
Sets units in which the anchor Y value is specified. A value ofIconAnchorUnits.FRACTION
indicates the Y value is a fraction of the icon. A value ofIconAnchorUnits.PIXELS
indicates the Y value in pixels. The default value isIconAnchorUnits.FRACTION
.Note, anchor Y units attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
anchorYUnits
- units to set
-
withAnchorYUnits
- Parameters:
anchorYUnits
- units to set- Returns:
- current instance
-
getColor
- Returns:
- color of the icon or
null
if not set
-
setColor
Sets the color to tint the icon. If not specified, the icon will be left as is.Note, color attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
color
- color to set
-
withColor
SeesetColor(String)
.- Parameters:
color
- color to set- Returns:
- current instance
-
getCrossOrigin
- Returns:
- cross-origin value or
null
if not set
-
setCrossOrigin
Sets the cross-origin attribute for loaded images.Note, cross-origin attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
crossOrigin
- cross-origin value
-
withCrossOrigin
- Parameters:
crossOrigin
- cross-origin value- Returns:
- current instance
-
getResource
public com.vaadin.flow.server.StreamResource getResource()- Returns:
- stream resource or
null
if not set
-
setResource
public void setResource(com.vaadin.flow.server.StreamResource resource) Sets stream resource. It takes precedence over thesetSrc(String)
.Note, resource attribute is set only at creation time and cannot be changed at runtime.
- Parameters:
resource
- stream resource
-
withResource
- Parameters:
resource
- stream resource- Returns:
- current instance
-
getWidth
- Returns:
- width value in pixels or
null
if not set
-
setWidth
Sets the width of the icon in pixels. Width can't be used together withsetScale(Double)
orsetScaleSize(Size)
.Note, width attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
width
- width of the icon
-
withWidth
SeesetWidth(Integer)
.- Parameters:
width
- width of the icon- Returns:
- current instance
-
getHeight
- Returns:
- height value in pixels or
null
if not set
-
setHeight
Sets the height of the icon in pixels. Height can't be used together withsetScale(Double)
orsetScaleSize(Size)
.Note, height attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
height
- height of the icon
-
withHeight
SeesetHeight(Integer)
.- Parameters:
height
- height of the icon- Returns:
- current instance
-
getOffset
- Returns:
- offset value or
null
if not set
-
setOffset
Sets offset which, together withsetSize(Size)
andsetOffsetOrigin(IconOrigin)
, defines the sub-rectangle to use from the original (sprite) image. The default value is[0, 0]
.Note, offset attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
offset
- offset value
-
withOffset
SeesetOffset(Offset)
.- Parameters:
offset
- offset value- Returns:
- current instance
-
getOffsetOrigin
- Returns:
- origin of the offset or
null
if not set
-
setOffsetOrigin
Sets the origin of the offset. The default value isIconOrigin.TOP_LEFT
.Note, offset origin attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
offsetOrigin
- origin of the offset
-
withOffsetOrigin
- Parameters:
offsetOrigin
- origin of the offset- Returns:
- current instance
-
getSize
- Returns:
- icon size in pixels or
null
if not set
-
setSize
Sets the icon size in pixels. Used together withsetOffset(Offset)
to define the sub-rectangle to use from the original (sprite) image.Note, size attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
size
- icon size in pixels
-
withSize
SeesetSize(Size)
.- Parameters:
size
- icon size in pixels- Returns:
- current instance
-
getSrc
- Returns:
- source URI or
null
if not set
-
setSrc
Sets the image source URI. Note, ifsetResource(StreamResource)
is defined, it will take precedence over src attribute.Note, src attribute is set only at creation time and cannot be changed at runtime.
For more details see: Icon docs
- Parameters:
src
- source URI
-
withSrc
SeesetSrc(String)
.- Parameters:
src
- source URI- Returns:
- current instance
-
getOpacity
- Overrides:
getOpacity
in classImageStyle
- Returns:
- opacity or
null
if not set
-
setOpacity
Sets the opacity.For more details see: setOpacity() docs
- Overrides:
setOpacity
in classImageStyle
- Parameters:
opacity
- opacity to set
-
withOpacity
- Parameters:
opacity
- opacity to set- Returns:
- current instance
-
getRotateWithView
- Overrides:
getRotateWithView
in classImageStyle
- Returns:
- whether the image should get rotated with the map view or
null
if not set
-
setRotateWithView
Sets whether the styled image should be rotated with the map view rotation.For more details see: setRotateWithView() docs
Default value is
false
. For more details see: setRotateWithView() docs- Overrides:
setRotateWithView
in classImageStyle
- Parameters:
rotateWithView
- whether the styled image should be rotated
-
withRotateWithView
- Parameters:
rotateWithView
-- Returns:
- current instance
-
getRotation
- Overrides:
getRotation
in classImageStyle
- Returns:
- rotation value or
null
if not set
-
setRotation
Sets the rotation value.For more details see: setRotation() docs
The default value is
0
.For more details see: setRotateWithView() docs
- Overrides:
setRotation
in classImageStyle
- Parameters:
rotation
- rotation value
-
withRotation
SeesetRotation(Double)
.- Parameters:
rotation
- rotation value- Returns:
- current instance
-
getScale
- Overrides:
getScale
in classImageStyle
- Returns:
- scale value or
null
if not set
-
setScale
Sets the scale. Note, ifsetScaleSize(Size)
is set, it will take precedence over the scale. The default value is1
.For more details see: setScale() docs
- Overrides:
setScale
in classImageStyle
- Parameters:
scale
- scale value
-
withScale
SeesetScale(Double)
.- Parameters:
scale
- scale value- Returns:
- current instance
-
getScaleSize
- Overrides:
getScaleSize
in classImageStyle
- Returns:
- scale size or
null
if not set
-
setScaleSize
Sets the scale size. Note, it takes precedence over theImageStyle.setScale(Double)
.For more details see: setScale() docs
- Overrides:
setScaleSize
in classImageStyle
- Parameters:
scaleSize
- scale size
-
withScaleSize
SeesetScaleSize(Size)
.- Parameters:
scaleSize
- scale size- Returns:
- current instance
-
getDisplacement
- Overrides:
getDisplacement
in classImageStyle
- Returns:
- displacement value or
null
if not set
-
setDisplacement
Sets the displacement of the icon in pixels. Positive values will shift the icon right and up. The default value is[0, 0]
.For more details see: setDisplacement() docs
- Overrides:
setDisplacement
in classImageStyle
- Parameters:
displacement
- displacement value
-
withDisplacement
- Parameters:
displacement
- displacement value- Returns:
- current instance
-
getDeclutterMode
- Overrides:
getDeclutterMode
in classImageStyle
- Returns:
- declutter mode or
null
if not set
-
setDeclutterMode
Sets declutter mode.Note, declutter mode attribute is set only at creation time and cannot be changed at runtime.
For more details see: ImageStyle docs
- Overrides:
setDeclutterMode
in classImageStyle
- Parameters:
declutterMode
- declutter mode value
-
withDeclutterMode
- Parameters:
declutterMode
- declutter mode value- Returns:
- current instance
-