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
FieldsModifier and TypeFieldDescriptionprotected Anchorprotected IconOriginprotected IconAnchorUnitsprotected IconAnchorUnitsprotected Stringprotected Stringprotected Integerprotected Offsetprotected IconOriginprotected com.vaadin.flow.server.StreamResourceprotected Sizeprotected Stringprotected IntegerFields inherited from class io.jmix.mapsflowui.kit.component.model.style.image.ImageStyle
declutterMode, displacement, opacity, rotateWithView, rotation, scale, scaleSizeFields inherited from class io.jmix.mapsflowui.kit.component.model.MapObservableObject
children, dirty, eventBus, metaProperties, parent, removedChildren, syncId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetColor()com.vaadin.flow.server.StreamResourcegetScale()getSize()getSrc()protected StringgetType()getWidth()voidSets the icon anchor.voidsetAnchorOrigin(IconOrigin anchorOrigin) Sets the origin of the anchor.voidsetAnchorXUnits(IconAnchorUnits anchorXUnits) Sets units in which the anchor X value is specified.voidsetAnchorYUnits(IconAnchorUnits anchorYUnits) Sets units in which the anchor Y value is specified.voidSets the color to tint the icon.voidsetCrossOrigin(String crossOrigin) Sets the cross-origin attribute for loaded images.voidsetDeclutterMode(DeclutterMode declutterMode) Sets declutter mode.voidsetDisplacement(Displacement displacement) Sets the displacement of the icon in pixels.voidSets the height of the icon in pixels.voidSets offset which, together withsetSize(Size)andsetOffsetOrigin(IconOrigin), defines the sub-rectangle to use from the original (sprite) image.voidsetOffsetOrigin(IconOrigin offsetOrigin) Sets the origin of the offset.voidsetOpacity(Double opacity) Sets the opacity.voidsetResource(com.vaadin.flow.server.StreamResource resource) Sets stream resource.voidsetRotateWithView(Boolean rotateWithView) Sets whether the styled image should be rotated with the map view rotation.voidsetRotation(Double rotation) Sets the rotation value.voidSets the scale.voidsetScaleSize(Size scaleSize) Sets the scale size.voidSets the icon size in pixels.voidSets the image source URI.voidSets 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, getSuperParent, getSyncId, hashCode, isAttachedToMap, isDirty, isDirtyInDepth, markAsDirty, markAsDirtyInDepth, removeChild, setMetaProperty, setParent, 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:
getTypein classMapObservableObject
-
getAnchor
- Returns:
- anchor value or
nullif 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
nullif not set
-
setAnchorXUnits
Sets units in which the anchor X value is specified. A value ofIconAnchorUnits.FRACTIONindicates the X value is a fraction of the icon. A value ofIconAnchorUnits.PIXELSindicates 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
nullif not set
-
setAnchorYUnits
Sets units in which the anchor Y value is specified. A value ofIconAnchorUnits.FRACTIONindicates the Y value is a fraction of the icon. A value ofIconAnchorUnits.PIXELSindicates 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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
nullif 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:
getOpacityin classImageStyle- Returns:
- opacity or
nullif not set
-
setOpacity
Sets the opacity.For more details see: setOpacity() docs
- Overrides:
setOpacityin classImageStyle- Parameters:
opacity- opacity to set
-
withOpacity
- Parameters:
opacity- opacity to set- Returns:
- current instance
-
getRotateWithView
- Overrides:
getRotateWithViewin classImageStyle- Returns:
- whether the image should get rotated with the map view or
nullif 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:
setRotateWithViewin classImageStyle- Parameters:
rotateWithView- whether the styled image should be rotated
-
withRotateWithView
- Parameters:
rotateWithView-- Returns:
- current instance
-
getRotation
- Overrides:
getRotationin classImageStyle- Returns:
- rotation value or
nullif 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:
setRotationin classImageStyle- Parameters:
rotation- rotation value
-
withRotation
SeesetRotation(Double).- Parameters:
rotation- rotation value- Returns:
- current instance
-
getScale
- Overrides:
getScalein classImageStyle- Returns:
- scale value or
nullif 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:
setScalein classImageStyle- Parameters:
scale- scale value
-
withScale
SeesetScale(Double).- Parameters:
scale- scale value- Returns:
- current instance
-
getScaleSize
- Overrides:
getScaleSizein classImageStyle- Returns:
- scale size or
nullif not set
-
setScaleSize
Sets the scale size. Note, it takes precedence over theImageStyle.setScale(Double).For more details see: setScale() docs
- Overrides:
setScaleSizein classImageStyle- Parameters:
scaleSize- scale size
-
withScaleSize
SeesetScaleSize(Size).- Parameters:
scaleSize- scale size- Returns:
- current instance
-
getDisplacement
- Overrides:
getDisplacementin classImageStyle- Returns:
- displacement value or
nullif 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:
setDisplacementin classImageStyle- Parameters:
displacement- displacement value
-
withDisplacement
- Parameters:
displacement- displacement value- Returns:
- current instance
-
getDeclutterMode
- Overrides:
getDeclutterModein classImageStyle- Returns:
- declutter mode or
nullif 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:
setDeclutterModein classImageStyle- Parameters:
declutterMode- declutter mode value
-
withDeclutterMode
- Parameters:
declutterMode- declutter mode value- Returns:
- current instance
-