Class Icon
- All Implemented Interfaces:
JsonSerializable
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new icon.Create a new icon.Create a new icon.Create a new icon.Create a new icon.Create a new icon.Create a new icon. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic @NotNull IconfromJson(@NotNull com.google.gson.JsonObject obj) @Nullable VectorGet the coordinates of the "tip" of the icon (relative to its top left corner).@NotNull StringgetImage()Get the image to use for this icon.@NotNull PointgetPoint()Get thePointon the map for this icon.@Nullable StringGet the retina sized image to use for this icon.@Nullable DoubleGet the rotation angle, in degrees, clockwise.@Nullable StringGet the rotation origin, as a transform-origin CSS rule.@Nullable StringGet shadow image of this icon.@Nullable VectorGet the coordinates of the "tip" of the shadow image (relative to its top left corner).@Nullable StringGet the retina sized shadow image to use for this icon.@Nullable VectorGet the size of the shadow image in pixels.@Nullable VectorgetSize()Get the size of the image, in pixels.inthashCode()static @NotNull IconCreate a new icon.static @NotNull IconCreate a new icon.static @NotNull IconCreate a new icon.static @NotNull IconCreate a new icon.static @NotNull IconCreate a new icon.static @NotNull IconCreate a new icon.static @NotNull IconCreate a new icon.@NotNull IconSet the coordinates of the "tip" of the icon (relative to its top left corner).@NotNull IconSet the image to use for this icon.@NotNull IconSet a newPointon the map for this icon.@NotNull IconSet the retina sized image to use for this icon.@NotNull IconsetRotationAngle(@Nullable Double rotationAngle) Set the rotation angle, in degrees, clockwise.@NotNull IconsetRotationOrigin(@Nullable String rotationOrigin) Set the rotation origin, as a transform-origin CSS rule.@NotNull IconSet the shadow image to use for this icon.@NotNull IconsetShadowAnchor(@Nullable Vector shadowAnchor) Set the coordinates of the "tip" of the shadow image (relative to its top left corner).@NotNull IconsetShadowRetina(@Nullable String shadowRetina) Set the retina sized shadow image to use for this icon.@NotNull IconsetShadowSize(@Nullable Vector shadowSize) Set the size of the shadow image in pixels.@NotNull IconSet the size of the image, in pixels.@NotNull com.google.gson.JsonObjecttoJson()Jsonify this object.@NotNull StringtoString()Methods inherited from class net.pl3x.map.core.markers.marker.Marker
circle, circle, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, ellipse, getOptions, getPane, getType, icon, icon, icon, icon, icon, icon, icon, multiPolygon, multiPolygon, multiPolygon, multiPolyline, multiPolyline, multiPolyline, polygon, polygon, polygon, polyline, polyline, polyline, rectangle, rectangle, setOptions, setOptions, setPane
-
Constructor Details
-
Icon
Create a new icon.- Parameters:
key- identifying keyx- icon x location on mapz- icon z location on mapimage- image key
-
Icon
public Icon(@NotNull @NotNull String key, @NotNull @NotNull Point point, @NotNull @NotNull String image) Create a new icon.- Parameters:
key- identifying keypoint- icon location on mapimage- image key
-
Icon
public Icon(@NotNull @NotNull String key, double x, double z, @NotNull @NotNull String image, double size) Create a new icon.- Parameters:
key- identifying keyx- icon x location on mapz- icon z location on mapimage- image keysize- size of image
-
Icon
public Icon(@NotNull @NotNull String key, double x, double z, @NotNull @NotNull String image, double width, double height) Create a new icon.- Parameters:
key- identifying keyx- icon x location on mapz- icon z location on mapimage- image keywidth- width of imageheight- height of image
-
Icon
public Icon(@NotNull @NotNull String key, @NotNull @NotNull Point point, @NotNull @NotNull String image, double size) Create a new icon.- Parameters:
key- identifying keypoint- icon location on mapimage- image keysize- size of image
-
Icon
public Icon(@NotNull @NotNull String key, @NotNull @NotNull Point point, @NotNull @NotNull String image, double width, double height) Create a new icon.- Parameters:
key- identifying keypoint- icon location on mapimage- image keywidth- width of imageheight- height of image
-
Icon
public Icon(@NotNull @NotNull String key, @NotNull @NotNull Point point, @NotNull @NotNull String image, @Nullable @Nullable Vector size) Create a new icon.- Parameters:
key- identifying keypoint- icon location on mapimage- image keysize- size of image
-
-
Method Details
-
of
@NotNull public static @NotNull Icon of(@NotNull @NotNull String key, double x, double z, @NotNull @NotNull String image) Create a new icon.- Parameters:
key- identifying keyx- icon x location on mapz- icon z location on mapimage- image key- Returns:
- a new icon
-
of
@NotNull public static @NotNull Icon of(@NotNull @NotNull String key, @NotNull @NotNull Point point, @NotNull @NotNull String image) Create a new icon.- Parameters:
key- identifying keypoint- icon location on mapimage- image key- Returns:
- a new icon
-
of
@NotNull public static @NotNull Icon of(@NotNull @NotNull String key, double x, double z, @NotNull @NotNull String image, double size) Create a new icon.- Parameters:
key- identifying keyx- icon x location on mapz- icon z location on mapimage- image keysize- size of image- Returns:
- a new icon
-
of
@NotNull public static @NotNull Icon of(@NotNull @NotNull String key, double x, double z, @NotNull @NotNull String image, double width, double height) Create a new icon.- Parameters:
key- identifying keyx- icon x location on mapz- icon z location on mapimage- image keywidth- width of imageheight- height of image- Returns:
- a new icon
-
of
@NotNull public static @NotNull Icon of(@NotNull @NotNull String key, @NotNull @NotNull Point point, @NotNull @NotNull String image, double size) Create a new icon.- Parameters:
key- identifying keypoint- icon location on mapimage- image keysize- size of image- Returns:
- a new icon
-
of
@NotNull public static @NotNull Icon of(@NotNull @NotNull String key, @NotNull @NotNull Point point, @NotNull @NotNull String image, double width, double height) Create a new icon.- Parameters:
key- identifying keypoint- icon location on mapimage- image keywidth- width of imageheight- height of image- Returns:
- a new icon
-
of
@NotNull public static @NotNull Icon of(@NotNull @NotNull String key, @NotNull @NotNull Point point, @NotNull @NotNull String image, @Nullable @Nullable Vector size) Create a new icon.- Parameters:
key- identifying keypoint- icon location on mapimage- image keysize- size of image- Returns:
- a new icon
-
getPoint
Get thePointon the map for this icon.- Returns:
- point on map
-
setPoint
Set a newPointon the map for this icon.- Parameters:
point- new point on map- Returns:
- this icon
-
getImage
Get the image to use for this icon.- Returns:
- image
- See Also:
-
setImage
Set the image to use for this icon.Key must be registered with the icon registry.
- Parameters:
image- new image- Returns:
- this icon
- See Also:
-
getRetina
Get the retina sized image to use for this icon.This image will be used on retina devices.
Defaults to '
' if null.getImage()- Returns:
- retina image
- See Also:
-
setRetina
Set the retina sized image to use for this icon.This image will be used on retina devices.
Key must be registered with the icon registry.
Defaults to '
' if null.getImage()- Parameters:
retina- new retina image- Returns:
- this icon
- See Also:
-
getSize
Get the size of the image, in pixels.Used for auto centering the image on '
' if set.getPoint()- Returns:
- image size
-
setSize
Set the size of the image, in pixels.Used for auto centering the image on '
' if set.getPoint()- Parameters:
size- new image size- Returns:
- this icon
-
getAnchor
Get the coordinates of the "tip" of the icon (relative to its top left corner).The icon will be aligned so that this point is at
getPoint().Centered by default if '
' is also set.getSize()- Returns:
- icon anchor
-
setAnchor
Set the coordinates of the "tip" of the icon (relative to its top left corner).The icon will be aligned so that this point is at
getPoint().Centered by default if '
' is also set.getSize()- Parameters:
anchor- new anchor- Returns:
- this icon
-
getRotationAngle
Get the rotation angle, in degrees, clockwise.Defaults to '
0' if null.- Returns:
- angle of rotation
-
setRotationAngle
Set the rotation angle, in degrees, clockwise.Defaults to '
0' if null.- Parameters:
rotationAngle- angle of rotation- Returns:
- this icon
-
getRotationOrigin
Get the rotation origin, as a transform-origin CSS rule.Defaults to '
bottom center' if null.- Returns:
- origin of rotation
- See Also:
-
setRotationOrigin
Set the rotation origin, as a transform-origin CSS rule.Defaults to '
bottom center' if null.- Parameters:
rotationOrigin- origin of rotation- Returns:
- this icon
- See Also:
-
getShadow
Get shadow image of this icon.No shadow image will be shown, if null.
- Returns:
- shadow image
-
setShadow
Set the shadow image to use for this icon.Key must be registered with the icon registry.
No shadow image will be shown, if null.
- Parameters:
shadow- new shadow image- Returns:
- this icon
- See Also:
-
getShadowRetina
Get the retina sized shadow image to use for this icon.This shadow image will be used on retina devices.
Key must be registered with the icon registry.
Defaults to '
' if null.getShadow()- Returns:
- retina shadow image
- See Also:
-
setShadowRetina
Set the retina sized shadow image to use for this icon.This shadow image will be used on retina devices.
Key must be registered with the icon registry.
Defaults to '
' if null.getShadow()- Parameters:
shadowRetina- new retina shadow image- Returns:
- this icon
- See Also:
-
getShadowSize
Get the size of the shadow image in pixels.Used for auto centering the shadow image on '
' if set.getPoint()- Returns:
- shadow image size
-
setShadowSize
Set the size of the shadow image in pixels.Used for auto centering the shadow image on '
' if set.getPoint()- Parameters:
shadowSize- new shadow image size- Returns:
- this icon
-
getShadowAnchor
Get the coordinates of the "tip" of the shadow image (relative to its top left corner).The icon will be aligned so that this point is at
getPoint().The same as
getAnchor()if null.- Returns:
- icon anchor
-
setShadowAnchor
Set the coordinates of the "tip" of the shadow image (relative to its top left corner).The shadow image will be aligned so that this point is at
getPoint().The same as
getAnchor()if null.- Parameters:
shadowAnchor- new anchor- Returns:
- this icon
-
toJson
@NotNull public @NotNull com.google.gson.JsonObject toJson()Description copied from interface:JsonSerializableJsonify this object.- Returns:
- object as json element
-
fromJson
-
equals
-
hashCode
public int hashCode() -
toString
-