Package net.pl3x.map.core.markers.marker
Class Marker<T extends Marker<@NotNull T>>
java.lang.Object
net.pl3x.map.core.Keyed
net.pl3x.map.core.markers.marker.Marker<T>
- All Implemented Interfaces:
JsonSerializable
- Direct Known Subclasses:
Circle
,Ellipse
,Icon
,MultiPolygon
,MultiPolyline
,Polygon
,Polyline
,Rectangle
public abstract class Marker<T extends Marker<@NotNull T>>
extends Keyed
implements JsonSerializable
Represents a map marker.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Circle
Create a new circle.static @NotNull Circle
Create a new circle.static @NotNull Ellipse
Create a new ellipse.static @NotNull Ellipse
ellipse
(@NotNull String key, double centerX, double centerZ, double radiusX, double radiusZ, double tilt) Create a new ellipse.static @NotNull Ellipse
Create a new ellipse.static @NotNull Ellipse
Create a new ellipse.static @NotNull Ellipse
Create a new ellipse.static @NotNull Ellipse
Create a new ellipse.static @NotNull Ellipse
Create a new ellipse.static @NotNull Ellipse
Create a new ellipse.static @NotNull Marker
<?> fromJson
(@NotNull com.google.gson.JsonObject obj) @Nullable Options
Get the options of this marker.@Nullable String
getPane()
Get the map pane where the marker will be added.@NotNull String
getType()
Get the type identifier of this marker.static @NotNull Icon
Create a new icon.static @NotNull Icon
Create a new icon.static @NotNull Icon
Create a new icon.static @NotNull Icon
Create a new icon.static @NotNull Icon
Create a new icon.static @NotNull Icon
Create a new icon.static @NotNull Icon
Create a new icon.static @NotNull MultiPolygon
multiPolygon
(@NotNull String key, @NotNull List<@NotNull Polygon> polygons) Create a new multi-polygon.static @NotNull MultiPolygon
multiPolygon
(@NotNull String key, @NotNull Polygon polygon) Create a new multi-polygon.static @NotNull MultiPolygon
multiPolygon
(@NotNull String key, @NotNull Polygon @NotNull ... polygons) Create a new multi-polygon.static @NotNull MultiPolyline
multiPolyline
(@NotNull String key, @NotNull List<@NotNull Polyline> polylines) Create a new multi-polyline.static @NotNull MultiPolyline
multiPolyline
(@NotNull String key, @NotNull Polyline polyline) Create a new multi-polyline.static @NotNull MultiPolyline
multiPolyline
(@NotNull String key, @NotNull Polyline @NotNull ... polylines) Create a new multi-polyline.static @NotNull Polygon
Create a new polygon.static @NotNull Polygon
Create a new polygon.static @NotNull Polygon
Create a new polygon.static @NotNull Polyline
Create a new polyline.static @NotNull Polyline
Create a new polyline.static @NotNull Polyline
Create a new polyline.static @NotNull Rectangle
Create a new rectangle.static @NotNull Rectangle
Create a new rectangle.setOptions
(@Nullable Options options) Set new options for this marker.setOptions
(@Nullable Options.Builder builder) Set new options for this marker.Set the map pane where the marker will be added.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.pl3x.map.core.markers.JsonSerializable
toJson
-
Constructor Details
-
Marker
Create a new marker.- Parameters:
type
- type of markerkey
- identifying key
-
-
Method Details
-
circle
@NotNull public static @NotNull Circle circle(@NotNull @NotNull String key, double centerX, double centerZ, double radius) Create a new circle.- Parameters:
key
- identifying keycenterX
- center x locationcenterZ
- center z locationradius
- circle radius- Returns:
- a new circle
-
circle
@NotNull public static @NotNull Circle circle(@NotNull @NotNull String key, @NotNull @NotNull Point center, double radius) Create a new circle.- Parameters:
key
- identifying keycenter
- center locationradius
- circle radius- Returns:
- a new circle
-
ellipse
@NotNull public static @NotNull Ellipse ellipse(@NotNull @NotNull String key, double centerX, double centerZ, double radiusX, double radiusZ) Create a new ellipse.- Parameters:
key
- identifying keycenterX
- center x locationcenterZ
- center z locationradiusX
- x radiusradiusZ
- z radius- Returns:
- a new ellipse
-
ellipse
@NotNull public static @NotNull Ellipse ellipse(@NotNull @NotNull String key, @NotNull @NotNull Point center, double radiusX, double radiusZ) Create a new ellipse.- Parameters:
key
- identifying keycenter
- center locationradiusX
- x radiusradiusZ
- z radius- Returns:
- a new ellipse
-
ellipse
@NotNull public static @NotNull Ellipse ellipse(@NotNull @NotNull String key, double centerX, double centerZ, @NotNull @NotNull Vector radius) Create a new ellipse.- Parameters:
key
- identifying keycenterX
- center x locationcenterZ
- center z locationradius
- radius- Returns:
- a new ellipse
-
ellipse
@NotNull public static @NotNull Ellipse ellipse(@NotNull @NotNull String key, @NotNull @NotNull Point center, @NotNull @NotNull Vector radius) Create a new ellipse.- Parameters:
key
- identifying keycenter
- center locationradius
- radius- Returns:
- a new ellipse
-
ellipse
@NotNull public static @NotNull Ellipse ellipse(@NotNull @NotNull String key, double centerX, double centerZ, double radiusX, double radiusZ, double tilt) Create a new ellipse.- Parameters:
key
- identifying keycenterX
- center x locationcenterZ
- center z locationradiusX
- x radiusradiusZ
- z radiustilt
- tilt- Returns:
- a new ellipse
-
ellipse
@NotNull public static @NotNull Ellipse ellipse(@NotNull @NotNull String key, @NotNull @NotNull Point center, double radiusX, double radiusZ, double tilt) Create a new ellipse.- Parameters:
key
- identifying keycenter
- center locationradiusX
- x radiusradiusZ
- z radiustilt
- tilt- Returns:
- a new ellipse
-
ellipse
@NotNull public static @NotNull Ellipse ellipse(@NotNull @NotNull String key, double centerX, double centerZ, @NotNull @NotNull Vector radius, double tilt) Create a new ellipse.- Parameters:
key
- identifying keycenterX
- center x locationcenterZ
- center z locationradius
- radiustilt
- tilt- Returns:
- a new ellipse
-
ellipse
@NotNull public static @NotNull Ellipse ellipse(@NotNull @NotNull String key, @NotNull @NotNull Point center, @NotNull @NotNull Vector radius, double tilt) Create a new ellipse.- Parameters:
key
- identifying keycenter
- center locationradius
- radiustilt
- tilt- Returns:
- a new ellipse
-
icon
@NotNull public static @NotNull Icon icon(@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
-
icon
@NotNull public static @NotNull Icon 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- Returns:
- a new icon
-
icon
@NotNull public static @NotNull Icon 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- Returns:
- a new icon
-
icon
@NotNull public static @NotNull Icon 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- Returns:
- a new icon
-
icon
@NotNull public static @NotNull Icon 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- Returns:
- a new icon
-
icon
@NotNull public static @NotNull Icon 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- Returns:
- a new icon
-
icon
@NotNull public static @NotNull Icon 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- Returns:
- a new icon
-
multiPolygon
@NotNull public static @NotNull MultiPolygon multiPolygon(@NotNull @NotNull String key, @NotNull @NotNull Polygon polygon) Create a new multi-polygon.- Parameters:
key
- identifying keypolygon
- polygon to add- Returns:
- a new multi-polygon
-
multiPolygon
@NotNull public static @NotNull MultiPolygon multiPolygon(@NotNull @NotNull String key, @NotNull @NotNull Polygon @NotNull ... polygons) Create a new multi-polygon.- Parameters:
key
- identifying keypolygons
- polygons to add- Returns:
- a new multi-polygon
-
multiPolygon
@NotNull public static @NotNull MultiPolygon multiPolygon(@NotNull @NotNull String key, @NotNull @NotNull List<@NotNull Polygon> polygons) Create a new multi-polygon.- Parameters:
key
- identifying keypolygons
- polygons to add- Returns:
- a new multi-polygon
-
multiPolyline
@NotNull public static @NotNull MultiPolyline multiPolyline(@NotNull @NotNull String key, @NotNull @NotNull Polyline polyline) Create a new multi-polyline.- Parameters:
key
- identifying keypolyline
- polyline to add- Returns:
- a new multi-polyline
-
multiPolyline
@NotNull public static @NotNull MultiPolyline multiPolyline(@NotNull @NotNull String key, @NotNull @NotNull Polyline @NotNull ... polylines) Create a new multi-polyline.- Parameters:
key
- identifying keypolylines
- polylines to add- Returns:
- a new multi-polyline
-
multiPolyline
@NotNull public static @NotNull MultiPolyline multiPolyline(@NotNull @NotNull String key, @NotNull @NotNull List<@NotNull Polyline> polylines) Create a new multi-polyline.- Parameters:
key
- identifying keypolylines
- polylines to add- Returns:
- a new multi-polyline
-
polygon
@NotNull public static @NotNull Polygon polygon(@NotNull @NotNull String key, @NotNull @NotNull Polyline polyline) Create a new polygon.- Parameters:
key
- identifying keypolyline
- polyline to add- Returns:
- a new polygon
-
polygon
@NotNull public static @NotNull Polygon polygon(@NotNull @NotNull String key, @NotNull @NotNull Polyline @NotNull ... polylines) Create a new polygon.- Parameters:
key
- identifying keypolylines
- polylines to add- Returns:
- a new polygon
-
polygon
@NotNull public static @NotNull Polygon polygon(@NotNull @NotNull String key, @NotNull @NotNull List<@NotNull Polyline> polylines) Create a new polygon.- Parameters:
key
- identifying keypolylines
- polylines to add- Returns:
- a new polygon
-
polyline
@NotNull public static @NotNull Polyline polyline(@NotNull @NotNull String key, @NotNull @NotNull Point point) Create a new polyline.- Parameters:
key
- identifying keypoint
- point to add- Returns:
- a new polyline
-
polyline
@NotNull public static @NotNull Polyline polyline(@NotNull @NotNull String key, @NotNull @NotNull Point @NotNull ... points) Create a new polyline.- Parameters:
key
- identifying keypoints
- points to add- Returns:
- a new polyline
-
polyline
@NotNull public static @NotNull Polyline polyline(@NotNull @NotNull String key, @NotNull @NotNull List<@NotNull Point> points) Create a new polyline.- Parameters:
key
- identifying keypoints
- points to add- Returns:
- a new polyline
-
rectangle
@NotNull public static @NotNull Rectangle rectangle(@NotNull @NotNull String key, double x1, double z1, double x2, double z2) Create a new rectangle.- Parameters:
key
- identifying keyx1
- first x pointz1
- first z pointx2
- second x pointz2
- second z point- Returns:
- a new rectangle
-
rectangle
@NotNull public static @NotNull Rectangle rectangle(@NotNull @NotNull String key, @NotNull @NotNull Point point1, @NotNull @NotNull Point point2) Create a new rectangle.- Parameters:
key
- identifying keypoint1
- first pointpoint2
- second point- Returns:
- a new rectangle
-
getType
Get the type identifier of this marker.Used in the serialized json for the frontend.
- Returns:
- marker type
-
getPane
Get the map pane where the marker will be added.Defaults to the overlay pane if null.
- Returns:
- map pane
-
setPane
Set the map pane where the marker will be added.If the pane does not exist, it will be created the first time it is used.
Defaults to the overlay pane if null.
- Parameters:
pane
- map pane- Returns:
- this marker
-
getOptions
Get the options of this marker.Null options represents "default" values. See wiki about defaults.
- Returns:
- marker options
-
setOptions
Set new options for this marker.Null options represents "default" values. See wiki about defaults.
- Parameters:
options
- new options or null- Returns:
- this marker
-
setOptions
Set new options for this marker.Null options represents "default" values. See wiki about defaults.
- Parameters:
builder
- new options builder or null- Returns:
- this marker
-
fromJson
@NotNull public static @NotNull Marker<?> fromJson(@NotNull @NotNull com.google.gson.JsonObject obj)
-