Package net.pl3x.map.core.markers.marker
Class Polygon
- All Implemented Interfaces:
JsonSerializable
Represents a polygon marker.
A polygon requires at least one Polyline
for the
outer polygon shape. Any additional polylines will be used
to cut out "holes" in the outer polygon shape.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull Polygon
addPolyline
(@NotNull Collection<@NotNull Polyline> polylines) Add polylines to this polygon.@NotNull Polygon
addPolyline
(@NotNull Polyline polyline) Add a polyline to this polygon.@NotNull Polygon
addPolyline
(@NotNull Polyline @NotNull ... polylines) Add polylines to this polygon.@NotNull Polygon
Clear the list of polylines in this polygon.boolean
static @NotNull Polygon
fromJson
(@NotNull com.google.gson.JsonObject obj) Get the list of polylines in this polygon.int
hashCode()
static @NotNull Polygon
of
(@NotNull String key, @NotNull Collection<@NotNull Polyline> polylines) Create a new polygon.static @NotNull Polygon
Create a new polygon.static @NotNull Polygon
Create a new polygon.@NotNull Polygon
removeLine
(@NotNull Collection<@NotNull Polyline> polylines) Remove polylines from this polygon.@NotNull Polygon
removeLine
(@NotNull Polyline polyline) Remove a polyline from this polygon.@NotNull Polygon
removeLine
(@NotNull Polyline @NotNull ... polylines) Remove polylines from this polygon.@NotNull com.google.gson.JsonObject
toJson()
Jsonify this object.@NotNull String
toString()
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
-
Polygon
Create a new polygon.- Parameters:
key
- identifying keypolyline
- polyline to add
-
Polygon
Create a new polygon.- Parameters:
key
- identifying keypolylines
- polylines to add
-
Polygon
public Polygon(@NotNull @NotNull String key, @NotNull @NotNull Collection<@NotNull Polyline> polylines) Create a new polygon.- Parameters:
key
- identifying keypolylines
- polylines to add
-
-
Method Details
-
of
@NotNull public static @NotNull Polygon of(@NotNull @NotNull String key, @NotNull @NotNull Polyline polyline) Create a new polygon.- Parameters:
key
- identifying keypolyline
- polyline to add- Returns:
- a new polygon
-
of
@NotNull public static @NotNull Polygon of(@NotNull @NotNull String key, @NotNull @NotNull Polyline @NotNull ... polylines) Create a new polygon.- Parameters:
key
- identifying keypolylines
- polylines to add- Returns:
- a new polygon
-
of
@NotNull public static @NotNull Polygon of(@NotNull @NotNull String key, @NotNull @NotNull Collection<@NotNull Polyline> polylines) Create a new polygon.- Parameters:
key
- identifying keypolylines
- polylines to add- Returns:
- a new polygon
-
getPolylines
Get the list of polylines in this polygon.- Returns:
- list of polylines
-
clearPolylines
Clear the list of polylines in this polygon.- Returns:
- this polygon
-
addPolyline
Add a polyline to this polygon.- Parameters:
polyline
- polyline to remove- Returns:
- this polygon
-
addPolyline
Add polylines to this polygon.- Parameters:
polylines
- polylines to remove- Returns:
- this polygon
-
addPolyline
@NotNull public @NotNull Polygon addPolyline(@NotNull @NotNull Collection<@NotNull Polyline> polylines) Add polylines to this polygon.- Parameters:
polylines
- polylines to remove- Returns:
- this polygon
-
removeLine
Remove a polyline from this polygon.- Parameters:
polyline
- polyline to remove- Returns:
- this polygon
-
removeLine
Remove polylines from this polygon.- Parameters:
polylines
- polylines to remove- Returns:
- this polygon
-
removeLine
@NotNull public @NotNull Polygon removeLine(@NotNull @NotNull Collection<@NotNull Polyline> polylines) Remove polylines from this polygon.- Parameters:
polylines
- polylines to remove- Returns:
- this polygon
-
toJson
@NotNull public @NotNull com.google.gson.JsonObject toJson()Description copied from interface:JsonSerializable
Jsonify this object.- Returns:
- object as json element
-
fromJson
-
equals
-
hashCode
public int hashCode() -
toString
-