Package net.pl3x.map.core.markers.marker
Class Rectangle
java.lang.Object
net.pl3x.map.core.Keyed
net.pl3x.map.core.markers.marker.Marker<@NotNull Rectangle>
net.pl3x.map.core.markers.marker.Rectangle
- All Implemented Interfaces:
JsonSerializable
Represents a rectangle marker.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static @NotNull Rectangle
fromJson
(@NotNull com.google.gson.JsonObject obj) @NotNull Point
Get the firstPoint
of this rectangle.@NotNull Point
Get the secondPoint
of this rectangle.int
hashCode()
static @NotNull Rectangle
Create a new rectangle.static @NotNull Rectangle
Create a new rectangle.@NotNull Rectangle
Set the firstPoint
of this rectangle.@NotNull Rectangle
Set the secondPoint
of this rectangle.@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
-
Rectangle
Create a new rectangle.- Parameters:
key
- identifying keyx1
- first x pointz1
- first z pointx2
- second x pointz2
- second z point
-
Rectangle
public 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
-
-
Method Details
-
of
@NotNull public static @NotNull Rectangle of(@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
-
of
@NotNull public static @NotNull Rectangle of(@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
-
getPoint1
Get the firstPoint
of this rectangle.- Returns:
- first point
-
setPoint1
Set the firstPoint
of this rectangle.- Parameters:
point1
- first point- Returns:
- this rectangle
-
getPoint2
Get the secondPoint
of this rectangle.- Returns:
- second point
-
setPoint2
Set the secondPoint
of this rectangle.- Parameters:
point2
- second point- Returns:
- this rectangle
-
toJson
@NotNull public @NotNull com.google.gson.JsonObject toJson()Description copied from interface:JsonSerializable
Jsonify this object.- Returns:
- object as json element
-
fromJson
@NotNull public static @NotNull Rectangle fromJson(@NotNull @NotNull com.google.gson.JsonObject obj) -
equals
-
hashCode
public int hashCode() -
toString
-