diff --git a/src/main/java/de/bluecolored/bluemap/api/BlueMapAPI.java b/src/main/java/de/bluecolored/bluemap/api/BlueMapAPI.java index 16e6fb4..2df8c85 100644 --- a/src/main/java/de/bluecolored/bluemap/api/BlueMapAPI.java +++ b/src/main/java/de/bluecolored/bluemap/api/BlueMapAPI.java @@ -38,251 +38,251 @@ /** * An API to control the running instance of BlueMap. - *
This API is thread-save, so you can use it async, off the main-server-thread, to save performance!
+ *This API is thread-save, so you can use it async, off the main-server-thread, to save performance!
*/ public abstract class BlueMapAPI { - private static BlueMapAPI instance; + private static BlueMapAPI instance; - @Deprecated - private static final CollectionSee the documentation of {@link BlueMapWorld#getUuid()} for more information about the nature of the worlds {@link UUID}s!
- * - * @see BlueMapWorld#getUuid() - * - * @param uuid the {@link UUID} of the world - * - * @return an {@link Optional} with the {@link BlueMapWorld} if it exists - */ - public abstract OptionalThe given path
is used as file-name and (separated with '/') optional folders to organize the image-files. Do NOT include the file-ending! (e.g. "someFolder/somePOIIcon"
will result in a file "somePOIIcon.png" in a folder "someFolder").
If the image file with the given path already exists, it will be replaced.
- * - * @param image the image to create - * @param path the path/name of this image, the separator-char is '/' - * @return the relative address of the image in the web-app, - * which can be used as it is e.g. in the {@link de.bluecolored.bluemap.api.marker.POIMarker#setIcon(String, Vector2i)} method - * @throws IOException If an {@link IOException} is thrown while writing the image - */ - public abstract String createImage(BufferedImage image, String path) throws IOException; + private static final Collectiontrue
if a listener was removed as a result of this call
- *
- * @deprecated Implementing {@link BlueMapAPIListener} can cause a ClassNotFoundException when you soft-depend on BlueMap and your plugin/mod gets used without BlueMap.
- * Use {@link BlueMapAPI#onEnable(Consumer)} and {@link BlueMapAPI#onDisable(Consumer)} instead.
- */
- @Deprecated
- public static synchronized boolean unregisterListener(BlueMapAPIListener listener) {
- return BlueMapAPI.listener.remove(listener);
- }
-
- /**
- * Returns an instance of {@link BlueMapAPI} if it is currently enabled, else an empty {@link Optional} is returned.
- * @return an {@link Optional}<{@link BlueMapAPI}>
- */
- public static synchronized OptionalThe {@link Consumer} can be called multiple times if BlueMap disables and enables again, e.g. if BlueMap gets reloaded!
- *(Note: The consumer will likely be called asynchronously, not on the server-thread!)
- *Remember to unregister the consumer when you no longer need it using {@link #unregisterListener(Consumer)}.
- * @param consumer the {@link Consumer} - */ - public static synchronized void onEnable(ConsumerThe {@link Consumer} can be called multiple times if BlueMap disables and enables again, e.g. if BlueMap gets reloaded!
- *(Note: The consumer will likely be called asynchronously, not on the server-thread!)
- *Remember to unregister the consumer when you no longer need it using {@link #unregisterListener(Consumer)}.
- * @param consumer the {@link Consumer} - */ - public static synchronized void onDisable(Consumertrue
if a listener was removed as a result of this call
- */
- public static synchronized boolean unregisterListener(ConsumerSee the documentation of {@link BlueMapWorld#getUuid()} for more information about the nature of the worlds {@link UUID}s!
+ * + * @see BlueMapWorld#getUuid() + * + * @param uuid the {@link UUID} of the world + * + * @return an {@link Optional} with the {@link BlueMapWorld} if it exists + */ + public abstract Optionaltrue
if the instance has been registered, false
if there already was an instance registered
- * @throws ExecutionException if a {@link BlueMapAPIListener} threw an exception during the registration
- */
- @SuppressWarnings("deprecation")
- protected static synchronized boolean registerInstance(BlueMapAPI instance) throws ExecutionException {
- if (BlueMapAPI.instance != null) return false;
-
- BlueMapAPI.instance = instance;
+ /**
+ * Getter for a {@link BlueMapMap} loaded by BlueMap with the given id.
+ * @param id the map id (equivalent to the id configured in BlueMap's config
+ * @return an {@link Optional} with the {@link BlueMapMap} if it exists
+ */
+ public abstract OptionalThe given path
is used as file-name and (separated with '/') optional folders to organize the image-files. Do NOT include the file-ending! (e.g. "someFolder/somePOIIcon"
will result in a file "somePOIIcon.png" in a folder "someFolder").
If the image file with the given path already exists, it will be replaced.
+ * + * @param image the image to create + * @param path the path/name of this image, the separator-char is '/' + * @return the relative address of the image in the web-app, + * which can be used as it is e.g. in the {@link de.bluecolored.bluemap.api.marker.POIMarker#setIcon(String, Vector2i)} method + * @throws IOException If an {@link IOException} is thrown while writing the image + */ + public abstract String createImage(BufferedImage image, String path) throws IOException; - return true; - } - - /** - * Used by BlueMap to unregister the API and call the listeners properly. - * @param instance the {@link BlueMapAPI} instance - * @returntrue
if the instance was unregistered, false
if there was no or an other instance registered
- * @throws ExecutionException if a {@link BlueMapAPIListener} threw an exception during the un-registration
- */
- @SuppressWarnings("deprecation")
- protected static synchronized boolean unregisterInstance(BlueMapAPI instance) throws ExecutionException {
- if (BlueMapAPI.instance != instance) return false;
+ /**
+ * Lists all images that are available. This includes all images previously created with the {@link #createImage(BufferedImage, String)}
+ * function, but might include more.
+ * @return A map of available images where:
+ * true
if a listener was removed as a result of this call
+ *
+ * @deprecated Implementing {@link BlueMapAPIListener} can cause a ClassNotFoundException when you soft-depend on BlueMap and your plugin/mod gets used without BlueMap.
+ * Use {@link BlueMapAPI#onEnable(Consumer)} and {@link BlueMapAPI#onDisable(Consumer)} instead.
+ */
+ @Deprecated
+ public static synchronized boolean unregisterListener(BlueMapAPIListener listener) {
+ return BlueMapAPI.listener.remove(listener);
+ }
+
+ /**
+ * Returns an instance of {@link BlueMapAPI} if it is currently enabled, else an empty {@link Optional} is returned.
+ * @return an {@link Optional}<{@link BlueMapAPI}>
+ */
+ public static synchronized OptionalThe {@link Consumer} can be called multiple times if BlueMap disables and enables again, e.g. if BlueMap gets reloaded!
+ *(Note: The consumer will likely be called asynchronously, not on the server-thread!)
+ *Remember to unregister the consumer when you no longer need it using {@link #unregisterListener(Consumer)}.
+ * @param consumer the {@link Consumer} + */ + public static synchronized void onEnable(ConsumerThe {@link Consumer} can be called multiple times if BlueMap disables and enables again, e.g. if BlueMap gets reloaded!
+ *(Note: The consumer will likely be called asynchronously, not on the server-thread!)
+ *Remember to unregister the consumer when you no longer need it using {@link #unregisterListener(Consumer)}.
+ * @param consumer the {@link Consumer} + */ + public static synchronized void onDisable(Consumertrue
if a listener was removed as a result of this call
+ */
+ public static synchronized boolean unregisterListener(Consumertrue
if the instance has been registered, false
if there already was an instance registered
+ * @throws ExecutionException if a {@link BlueMapAPIListener} threw an exception during the registration
+ */
+ @SuppressWarnings("deprecation")
+ protected static synchronized boolean registerInstance(BlueMapAPI instance) throws ExecutionException {
+ if (BlueMapAPI.instance != null) return false;
+
+ BlueMapAPI.instance = instance;
+
+ Listtrue
if the instance was unregistered, false
if there was no or an other instance registered
+ * @throws ExecutionException if a {@link BlueMapAPIListener} threw an exception during the un-registration
+ */
+ @SuppressWarnings("deprecation")
+ protected static synchronized boolean unregisterInstance(BlueMapAPI instance) throws ExecutionException {
+ if (BlueMapAPI.instance != instance) return false;
+
+ List(Note: This method will likely be called asynchronously, not on the server-thread!
- * @param blueMapApi the {@link BlueMapAPI} - */ - default void onEnable(BlueMapAPI blueMapApi) {} - - /** - * Called before BlueMap is being unloaded and stopped, after this method returns the API is no longer usable!(Note: This method will likely be called asynchronously, not on the server-thread!
- * @param blueMapApi the {@link BlueMapAPI} - */ - default void onDisable(BlueMapAPI blueMapApi) {} - + /** + * Called when BlueMap has been loaded and started and the API is ready to use.(Note: This method will likely be called asynchronously, not on the server-thread!
+ * @param blueMapApi the {@link BlueMapAPI} + */ + default void onEnable(BlueMapAPI blueMapApi) {} + + /** + * Called before BlueMap is being unloaded and stopped, after this method returns the API is no longer usable!(Note: This method will likely be called asynchronously, not on the server-thread!
+ * @param blueMapApi the {@link BlueMapAPI} + */ + default void onDisable(BlueMapAPI blueMapApi) {} + } diff --git a/src/main/java/de/bluecolored/bluemap/api/BlueMapMap.java b/src/main/java/de/bluecolored/bluemap/api/BlueMapMap.java index a715530..bd4dd0b 100644 --- a/src/main/java/de/bluecolored/bluemap/api/BlueMapMap.java +++ b/src/main/java/de/bluecolored/bluemap/api/BlueMapMap.java @@ -37,99 +37,99 @@ */ public interface BlueMapMap { - /** - * Returns this maps id, this is equal to the id configured in bluemap's config for this map. - * @return the id of this map - */ - String getId(); + /** + * Returns this maps id, this is equal to the id configured in bluemap's config for this map. + * @return the id of this map + */ + String getId(); - /** - * Returns this maps display-name, this is equal to the name configured in bluemap's config for this map. - * @return the name of this map - */ - String getName(); - - /** - * Getter for the {@link BlueMapWorld} of this map. - * @return the {@link BlueMapWorld} of this map - */ - BlueMapWorld getWorld(); + /** + * Returns this maps display-name, this is equal to the name configured in bluemap's config for this map. + * @return the name of this map + */ + String getName(); - /** - * Getter for the size of all tiles on this map in blocks. - * @return the tile-size in blocks - */ - Vector2i getTileSize(); - - /** - * Getter for the offset of the tile-grid on this map.Sets a filter that determines if a specific (hires) tile of this map should be updated or not. - * If this filter returns false for a tile, the "render"-process of this tile will be cancelled and the tile will be left untouched.
- *Warning: Using this method will harm the integrity of the map! Since BlueMap will still assume that the tile got updated properly.
- *Any previously set filters will get overwritten with the new one. You can get the current filter using {@link #getTileFilter()} and combine them if you wish.
- * @param filter The filter that will be used from now on. - */ - void setTileFilter(PredicateSets a filter that determines if a specific (hires) tile of this map should be updated or not. + * If this filter returns false for a tile, the "render"-process of this tile will be cancelled and the tile will be left untouched.
+ *Warning: Using this method will harm the integrity of the map! Since BlueMap will still assume that the tile got updated properly.
+ *Any previously set filters will get overwritten with the new one. You can get the current filter using {@link #getTileFilter()} and combine them if you wish.
+ * @param filter The filter that will be used from now on. + */ + void setTileFilter(Predicatet -> true
.
- */
- Predicatet -> true
.
+ */
+ PredicateGetter for the {@link UUID} of the world.
- *- * The {@link UUID}s of this worlds are not guaranteed to be consistent across reloads/restarts! - *
- *
- * Implementation notes:
- * The used UUID highly depends on the implementation
- *
Sponge | The UUID is equal to the returned UUID by world-instances of the Sponge-API, so you can just use spongeWorld.getUniqueId() |
---|---|
Bukkit | The UUID is equal to the returned UUID by world-instances of the Bukkit-API, so you can just use bukkitWorld.getUID() |
Forge | The UUID is randomly generated, and changes on each reload/restart |
CLI | The UUID is randomly generated, and changes on each reload/restart |
world:
).
- * @return the save-folder of this world.
- */
- Path getSaveFolder();
-
- /**
- * Getter for all {@link BlueMapMap}s for this world
- * @return an unmodifiable {@link Collection} of all {@link BlueMapMap}s for this world
- */
- CollectionGetter for the {@link UUID} of the world.
+ *+ * The {@link UUID}s of this worlds are not guaranteed to be consistent across reloads/restarts! + *
+ *
+ * Implementation notes:
+ * The used UUID highly depends on the implementation
+ *
Sponge | The UUID is equal to the returned UUID by world-instances of the Sponge-API, so you can just use spongeWorld.getUniqueId() |
---|---|
Bukkit | The UUID is equal to the returned UUID by world-instances of the Bukkit-API, so you can just use bukkitWorld.getUID() |
Forge | The UUID is randomly generated, and changes on each reload/restart |
CLI | The UUID is randomly generated, and changes on each reload/restart |
world:
).
+ * @return the save-folder of this world.
+ */
+ Path getSaveFolder();
+
+ /**
+ * Getter for all {@link BlueMapMap}s for this world
+ * @return an unmodifiable {@link Collection} of all {@link BlueMapMap}s for this world
+ */
+ CollectionThe shape is placed on the xz-plane of the map, so the y-coordinates of the {@link Shape}'s points are the z-coordinates in the map.
- * @return the {@link Shape} - */ - Shape getShape(); + /** + * Getter for {@link Shape} of this {@link ExtrudeMarker}. + *The shape is placed on the xz-plane of the map, so the y-coordinates of the {@link Shape}'s points are the z-coordinates in the map.
+ * @return the {@link Shape} + */ + Shape getShape(); - /** - * Getter for the minimum height (y-coordinate) of where the shape is displayed on the map.The shape is placed on the xz-plane of the map, so the y-coordinates of the {@link Shape}'s points will be the z-coordinates in the map.
- * (The shape will be extruded from minY to maxY on the map) - * @param shape the new {@link Shape} - * @param minY the new min-height (y-coordinate) of the shape on the map - * @param maxY the new max-height (y-coordinate) of the shape on the map - */ - void setShape(Shape shape, float minY, float maxY); + /** + * Getter for the maximum height (y-coordinate) of where the shape is displayed on the map. + * (The shape will be extruded from {@link #getShapeMinY()} to this value on the map) + * @return the max-height of the shape on the map + */ + float getShapeMaxY(); - /** - * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything. - * @returntrue
if the depthTest is enabled
- */
- boolean isDepthTestEnabled();
-
- /**
- * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything.
- * @param enabled if the depth-test should be enabled for this {@link ExtrudeMarker}
- */
- void setDepthTestEnabled(boolean enabled);
+ /**
+ * Sets the {@link Shape} of this {@link ExtrudeMarker}.
+ * The shape is placed on the xz-plane of the map, so the y-coordinates of the {@link Shape}'s points will be the z-coordinates in the map.
+ * (The shape will be extruded from minY to maxY on the map) + * @param shape the new {@link Shape} + * @param minY the new min-height (y-coordinate) of the shape on the map + * @param maxY the new max-height (y-coordinate) of the shape on the map + */ + void setShape(Shape shape, float minY, float maxY); - /** - * Getter for the width of the lines of this {@link ExtrudeMarker}. - * @return the width of the lines in pixels - */ - int getLineWidth(); + /** + * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything. + * @returntrue
if the depthTest is enabled
+ */
+ boolean isDepthTestEnabled();
- /**
- * Sets the width of the lines for this {@link ExtrudeMarker}.
- * @param width the new width in pixels
- */
- void setLineWidth(int width);
+ /**
+ * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything.
+ * @param enabled if the depth-test should be enabled for this {@link ExtrudeMarker}
+ */
+ void setDepthTestEnabled(boolean enabled);
- /**
- * Getter for the {@link Color} of the border-line of the shape.
- * @return the line-color
- */
- Color getLineColor();
+ /**
+ * Getter for the width of the lines of this {@link ExtrudeMarker}.
+ * @return the width of the lines in pixels
+ */
+ int getLineWidth();
- /**
- * Sets the {@link Color} of the border-line of the shape.
- * @param color the new line-color
- */
- void setLineColor(Color color);
+ /**
+ * Sets the width of the lines for this {@link ExtrudeMarker}.
+ * @param width the new width in pixels
+ */
+ void setLineWidth(int width);
+
+ /**
+ * Getter for the {@link Color} of the border-line of the shape.
+ * @return the line-color
+ */
+ Color getLineColor();
+
+ /**
+ * Sets the {@link Color} of the border-line of the shape.
+ * @param color the new line-color
+ */
+ void setLineColor(Color color);
+
+ /**
+ * Getter for the fill-{@link Color} of the shape.
+ * @return the fill-color
+ */
+ Color getFillColor();
+
+ /**
+ * Sets the fill-{@link Color} of the shape.
+ * @param color the new fill-color
+ */
+ void setFillColor(Color color);
+
+ /**
+ * Sets the border- and fill- color.
+ * @param lineColor the new border-color
+ * @param fillColor the new fill-color
+ * @see #setLineColor(Color)
+ * @see #setFillColor(Color)
+ */
+ default void setColors(Color lineColor, Color fillColor) {
+ setLineColor(lineColor);
+ setFillColor(fillColor);
+ }
- /**
- * Getter for the fill-{@link Color} of the shape.
- * @return the fill-color
- */
- Color getFillColor();
-
- /**
- * Sets the fill-{@link Color} of the shape.
- * @param color the new fill-color
- */
- void setFillColor(Color color);
-
- /**
- * Sets the border- and fill- color.
- * @param lineColor the new border-color
- * @param fillColor the new fill-color
- * @see #setLineColor(Color)
- * @see #setFillColor(Color)
- */
- default void setColors(Color lineColor, Color fillColor) {
- setLineColor(lineColor);
- setFillColor(fillColor);
- }
-
}
diff --git a/src/main/java/de/bluecolored/bluemap/api/marker/HtmlMarker.java b/src/main/java/de/bluecolored/bluemap/api/marker/HtmlMarker.java
index 11b7042..fb111d1 100644
--- a/src/main/java/de/bluecolored/bluemap/api/marker/HtmlMarker.java
+++ b/src/main/java/de/bluecolored/bluemap/api/marker/HtmlMarker.java
@@ -29,43 +29,43 @@
public interface HtmlMarker extends Marker, DistanceRangedMarker {
- /**
- * Getter for the position (in pixels) where the html-element is anchored to the map.
- * @return the anchor-position in pixels
- */
- Vector2i getAnchor();
+ /**
+ * Getter for the position (in pixels) where the html-element is anchored to the map.
+ * @return the anchor-position in pixels
+ */
+ Vector2i getAnchor();
- /**
- * Sets the position (in pixels) where the html-element is anchored to the map.
- * @param anchor the anchor-position in pixels
- */
- void setAnchor(Vector2i anchor);
+ /**
+ * Sets the position (in pixels) where the html-element is anchored to the map.
+ * @param anchor the anchor-position in pixels
+ */
+ void setAnchor(Vector2i anchor);
- /**
- * Sets the position (in pixels) where the html-element is anchored to the map.
- * @param x the anchor-x-position in pixels
- * @param y the anchor-y-position in pixels
- */
- default void setAnchor(int x, int y) {
- setAnchor(new Vector2i(x, y));
- }
+ /**
+ * Sets the position (in pixels) where the html-element is anchored to the map.
+ * @param x the anchor-x-position in pixels
+ * @param y the anchor-y-position in pixels
+ */
+ default void setAnchor(int x, int y) {
+ setAnchor(new Vector2i(x, y));
+ }
- /**
- * Getter for the html-code of this HTML marker
- * @return the html-code
- */
- String getHtml();
+ /**
+ * Getter for the html-code of this HTML marker
+ * @return the html-code
+ */
+ String getHtml();
+
+ /**
+ * Sets the html for this {@link HtmlMarker}.
+ *
+ *
+ * Important:
+ * Make sure you escape all html-tags from possible user inputs to prevent possible XSS-Attacks on the web-client!
+ *
- * Important:
- * Make sure you escape all html-tags from possible user inputs to prevent possible XSS-Attacks on the web-client!
- *
true
if the depthTest is enabled
- */
- boolean isDepthTestEnabled();
-
- /**
- * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything.
- * @param enabled if the depth-test should be enabled for this {@link LineMarker}
- */
- void setDepthTestEnabled(boolean enabled);
+ /**
+ * Sets the {@link Line} of this {@link LineMarker}.
+ * @param line the new {@link Line}
+ */
+ void setLine(Line line);
- /**
- * Getter for the width of the lines of this {@link LineMarker}.
- * @return the width of the lines in pixels
- */
- int getLineWidth();
+ /**
+ * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything.
+ * @return true
if the depthTest is enabled
+ */
+ boolean isDepthTestEnabled();
- /**
- * Sets the width of the lines for this {@link LineMarker}.
- * @param width the new width in pixels
- */
- void setLineWidth(int width);
+ /**
+ * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything.
+ * @param enabled if the depth-test should be enabled for this {@link LineMarker}
+ */
+ void setDepthTestEnabled(boolean enabled);
- /**
- * Getter for the {@link Color} of the border-line of the shape.
- * @return the line-color
- */
- Color getLineColor();
+ /**
+ * Getter for the width of the lines of this {@link LineMarker}.
+ * @return the width of the lines in pixels
+ */
+ int getLineWidth();
+
+ /**
+ * Sets the width of the lines for this {@link LineMarker}.
+ * @param width the new width in pixels
+ */
+ void setLineWidth(int width);
+
+ /**
+ * Getter for the {@link Color} of the border-line of the shape.
+ * @return the line-color
+ */
+ Color getLineColor();
+
+ /**
+ * Sets the {@link Color} of the border-line of the shape.
+ * @param color the new line-color
+ */
+ void setLineColor(Color color);
- /**
- * Sets the {@link Color} of the border-line of the shape.
- * @param color the new line-color
- */
- void setLineColor(Color color);
-
}
diff --git a/src/main/java/de/bluecolored/bluemap/api/marker/LinkMarker.java b/src/main/java/de/bluecolored/bluemap/api/marker/LinkMarker.java
index eb8f653..9a6604e 100644
--- a/src/main/java/de/bluecolored/bluemap/api/marker/LinkMarker.java
+++ b/src/main/java/de/bluecolored/bluemap/api/marker/LinkMarker.java
@@ -28,33 +28,33 @@
public interface LinkMarker extends Marker {
- /**
- * Gets the link-address of this {@link Marker}.true
the link ({@link #getLink()}) will be opened in a new tab.
- * @return whether the link will be opened in a new tab
- * @see #getLink()
- */
- boolean isNewTab();
+ /**
+ * If this is true
the link ({@link #getLink()}) will be opened in a new tab.
+ * @return whether the link will be opened in a new tab
+ * @see #getLink()
+ */
+ boolean isNewTab();
- /**
- * Sets the link-address of this {@link Marker}.null
to disable the link
- * @param newTab whether the link should be opened in a new tab
- */
- void setLink(String link, boolean newTab);
+ /**
+ * Sets the link-address of this {@link Marker}.null
to disable the link
+ * @param newTab whether the link should be opened in a new tab
+ */
+ void setLink(String link, boolean newTab);
- /**
- * Removes the link of this {@link Marker}.
- */
- void removeLink();
+ /**
+ * Removes the link of this {@link Marker}.
+ */
+ void removeLink();
}
diff --git a/src/main/java/de/bluecolored/bluemap/api/marker/Marker.java b/src/main/java/de/bluecolored/bluemap/api/marker/Marker.java
index 04fa0dd..6fb21a6 100644
--- a/src/main/java/de/bluecolored/bluemap/api/marker/Marker.java
+++ b/src/main/java/de/bluecolored/bluemap/api/marker/Marker.java
@@ -31,129 +31,129 @@
/**
* A marker that is displayed on one of the maps in the web-app.
- * Each marker has an id that is unique in the {@link MarkerSet} that it is in.
+ *Each marker has an id that is unique in the {@link MarkerSet} that it is in.
*/ public interface Marker { - /** - * Getter for the id of this {@link Marker}. - *The id is unique in the {@link MarkerSet} that this marker is in.
- * @return the id of this {@link Marker} - */ - String getId(); - - /** - * Getter for the {@link BlueMapMap} this {@link Marker} lives in. - * @return the {@link BlueMapMap} this {@link Marker} lives in - */ - BlueMapMap getMap(); - - /** - * Sets the {@link BlueMapMap} this {@link Marker} lives in - * @param map the new {@link BlueMapMap} - */ - void setMap(BlueMapMap map); - - /** - * Getter for the position of where this {@link Marker} lives on the map. - * @return the position of this {@link Marker} - */ - Vector3d getPosition(); - - /** - * Sets the position of where this {@link Marker} lives on the map. - * @param position the new position - */ - void setPosition(Vector3d position); - - /** - * Getter for the label of this marker. - * @return the label of this {@link Marker} - */ - String getLabel(); - - /** - * Sets the label of this {@link Marker}. - *- * Using html-tags in the label is possible but deprecated! - *
- *
- * Important:
- * Html-tags in the label will not be escaped, so you can use them to style the {@link Marker}-labels.
- * Make sure you escape all html-tags from possible user inputs to prevent possible XSS-Attacks on the web-client!
- *
The id is unique in the {@link MarkerSet} that this marker is in.
+ * @return the id of this {@link Marker} + */ + String getId(); - /** - * Getter for the minimum distance of the camera to the position ({@link #getPosition()} of the {@link Marker} for it to be displayed.true
the link ({@link #getLink()}) will be opened in a new tab.
- * @return whether the link will be opened in a new tab
- * @see #getLink()
- * @deprecated Not all marker-types support this
- */
- boolean isNewTab();
-
- /**
- * Sets the link-address of this {@link Marker}.null
to disable the link
- * @param newTab whether the link should be opened in a new tab
- * @deprecated Not all marker-types support this
- */
- void setLink(String link, boolean newTab);
+ /**
+ * Sets the label of this {@link Marker}.
+ * + * Using html-tags in the label is possible but deprecated! + *
+ *
+ * Important:
+ * Html-tags in the label will not be escaped, so you can use them to style the {@link Marker}-labels.
+ * Make sure you escape all html-tags from possible user inputs to prevent possible XSS-Attacks on the web-client!
+ *
true
the link ({@link #getLink()}) will be opened in a new tab.
+ * @return whether the link will be opened in a new tab
+ * @see #getLink()
+ * @deprecated Not all marker-types support this
+ */
+ boolean isNewTab();
+
+ /**
+ * Sets the link-address of this {@link Marker}.null
to disable the link
+ * @param newTab whether the link should be opened in a new tab
+ * @deprecated Not all marker-types support this
+ */
+ void setLink(String link, boolean newTab);
+
+ /**
+ * Removes the link of this {@link Marker}.
+ * @deprecated Not all marker-types support this
+ */
+ void removeLink();
- /**
- * Removes the link of this {@link Marker}.
- * @deprecated Not all marker-types support this
- */
- void removeLink();
-
}
diff --git a/src/main/java/de/bluecolored/bluemap/api/marker/MarkerAPI.java b/src/main/java/de/bluecolored/bluemap/api/marker/MarkerAPI.java
index 2119830..aef1f44 100644
--- a/src/main/java/de/bluecolored/bluemap/api/marker/MarkerAPI.java
+++ b/src/main/java/de/bluecolored/bluemap/api/marker/MarkerAPI.java
@@ -36,69 +36,69 @@
* Important:To avoid any concurrent modifications to the markers.json
, make sure your {@link MarkerAPI} is always loaded before making any changes, and saved right after the changes.
To avoid any concurrent modifications to the markers.json
, make sure your {@link MarkerAPI} is always loaded before making any changes, and saved right after the changes.
removeMarkerSet(markerSet.getId())
.
- *
- * @param markerSet the {@link MarkerSet} to be removed
- * @return true
if the {@link MarkerSet} was removed, false
if that {@link MarkerSet} didn't exist
- */
- default boolean removeMarkerSet(MarkerSet markerSet) {
- return removeMarkerSet(markerSet.getId());
- }
-
- /**
- * Removes the {@link MarkerSet} with the given id.
- *
- * @param id the id of the {@link MarkerSet} to be removed
- * @return true
if the {@link MarkerSet} was removed, false
if there was no {@link MarkerSet} with that id
- */
- boolean removeMarkerSet(String id);
-
- /**
- * Loads changes made by others, changes could be from other plugin's using the API or external changes to the markers.json
.markers.json
- */
- void load() throws IOException;
-
- /**
- * Saves all changes made with this instance to the markers.json
.markers.json
- */
- void save() throws IOException;
-
+ /**
+ * Getter for an unmodifiable {@link Collection} containing all {@link MarkerSet}s that are currently loaded with BlueMap.
+ *
+ * @return a {@link Collection} with all loaded {@link MarkerSet}s
+ */
+ CollectionremoveMarkerSet(markerSet.getId())
.
+ *
+ * @param markerSet the {@link MarkerSet} to be removed
+ * @return true
if the {@link MarkerSet} was removed, false
if that {@link MarkerSet} didn't exist
+ */
+ default boolean removeMarkerSet(MarkerSet markerSet) {
+ return removeMarkerSet(markerSet.getId());
+ }
+
+ /**
+ * Removes the {@link MarkerSet} with the given id.
+ *
+ * @param id the id of the {@link MarkerSet} to be removed
+ * @return true
if the {@link MarkerSet} was removed, false
if there was no {@link MarkerSet} with that id
+ */
+ boolean removeMarkerSet(String id);
+
+ /**
+ * Loads changes made by others, changes could be from other plugin's using the API or external changes to the markers.json
.markers.json
+ */
+ void load() throws IOException;
+
+ /**
+ * Saves all changes made with this instance to the markers.json
.markers.json
+ */
+ void save() throws IOException;
+
}
diff --git a/src/main/java/de/bluecolored/bluemap/api/marker/MarkerSet.java b/src/main/java/de/bluecolored/bluemap/api/marker/MarkerSet.java
index 5e08730..d20cfee 100644
--- a/src/main/java/de/bluecolored/bluemap/api/marker/MarkerSet.java
+++ b/src/main/java/de/bluecolored/bluemap/api/marker/MarkerSet.java
@@ -33,313 +33,313 @@
/**
* A set of {@link Marker}s that are displayed on the maps in the web-app.
- *
- * Each {@link MarkerSet} has an unique id.
+ * + *Each {@link MarkerSet} has an unique id.
*/ public interface MarkerSet { - /** - * Getter for the id of this {@link MarkerSet}. - * @return the id of this {@link MarkerSet} - */ - String getId(); - - /** - * Getter for the label of this {@link MarkerSet}. - *The label is used in the web-app to name the toggle-button of this {@link MarkerSet} if it is toggleable. ({@link #isToggleable()})
- * @return the label of this {@link MarkerSet} - */ - String getLabel(); - - /** - * Sets the label of this {@link MarkerSet}. - *The label is used in the web-app to name the toggle-button of this {@link MarkerSet} if it is toggleable. ({@link #isToggleable()})
- * @param label the new label - */ - void setLabel(String label); - - /** - * Checks if the {@link MarkerSet} is toggleable. - *If this is true
, the web-app will display a toggle-button for this {@link MarkerSet} so the user can choose to enable/disable all markers of this set.
If this is true
, the web-app will display a toggle-button for this {@link MarkerSet} so the user can choose to enable/disable all markers of this set.
The label is used in the web-app to name the toggle-button of this {@link MarkerSet} if it is toggleable. ({@link #isToggleable()})
+ * @return the label of this {@link MarkerSet} + */ + String getLabel(); - /** - * Checks if this {@link MarkerSet} is hidden by default. - *This is basically the default-state of the toggle-button from {@link #isToggleable()}. If this is true
the markers of this marker set will initially be hidden and can be displayed using the toggle-button.
This is basically the default-state of the toggle-button from {@link #isToggleable()}. If this is true
the markers of this marker set will initially be hidden and can be displayed using the toggle-button.
The label is used in the web-app to name the toggle-button of this {@link MarkerSet} if it is toggleable. ({@link #isToggleable()})
+ * @param label the new label + */ + void setLabel(String label); - /** - * Creates a {@link POIMarker} with the given id and adds it to this {@link MarkerSet}.If this is true
, the web-app will display a toggle-button for this {@link MarkerSet} so the user can choose to enable/disable all markers of this set.
If this is true
, the web-app will display a toggle-button for this {@link MarkerSet} so the user can choose to enable/disable all markers of this set.
This is basically the default-state of the toggle-button from {@link #isToggleable()}. If this is true
the markers of this marker set will initially be hidden and can be displayed using the toggle-button.
This is basically the default-state of the toggle-button from {@link #isToggleable()}. If this is true
the markers of this marker set will initially be hidden and can be displayed using the toggle-button.
(Since the shape has its own positions, the position is only used to determine e.g. the distance to the camera)
- * - * @param id the id of the new marker - * @param map the {@link BlueMapMap} of the new marker - * @param position the position of the new marker - * @param shape the Shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) - * @param y the height (y-position on the map) of shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) - * @return the created {@link ShapeMarker} - */ - ShapeMarker createShapeMarker(String id, BlueMapMap map, Vector3d position, Shape shape, float y); - - /** - * Creates a {@link ShapeMarker} with the given id and adds it to this {@link MarkerSet}.(Since the shape has its own positions, the position is only used to determine e.g. the distance to the camera)
- * - * @param id the id of the new marker - * @param map the {@link BlueMapMap} of the new marker - * @param posX the x-position of the new marker - * @param posY the y-position of the new marker - * @param posZ the z-position of the new marker - * @param shape the Shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) - * @param y the height (y-position on the map) of shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) - * @return the created {@link ShapeMarker} - */ - default ShapeMarker createShapeMarker(String id, BlueMapMap map, double posX, double posY, double posZ, Shape shape, float y) { - return createShapeMarker(id, map, new Vector3d(posX, posY, posZ), shape, y); - } - - /** - * Creates a {@link ShapeMarker} with the given id and adds it to this {@link MarkerSet}.(The position of the marker will be the center of the shape (it's bounding box))
- * - * @param id the id of the new marker - * @param map the {@link BlueMapMap} of the new marker - * @param shape the Shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) - * @param y the height of shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) - * @return the created {@link ShapeMarker} - */ - default ShapeMarker createShapeMarker(String id, BlueMapMap map, Shape shape, float y) { - Vector2d center = shape.getMin().add(shape.getMax()).div(2); - return createShapeMarker(id, map, new Vector3d(center.getX(), y, center.getY()), shape, y); - } + /** + * Creates a {@link HtmlMarker} with the given id and adds it to this {@link MarkerSet}.(Since the shape has its own positions, the position is only used to determine e.g. the distance to the camera)
- * - * @param id the id of the new marker - * @param map the {@link BlueMapMap} of the new marker - * @param position the position of the new marker - * @param shape the {@link Shape} of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) - * @param minY the min-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) - * @param maxY the max-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) - * @return the created {@link ExtrudeMarker} - */ - ExtrudeMarker createExtrudeMarker(String id, BlueMapMap map, Vector3d position, Shape shape, float minY, float maxY); + /** + * Creates a {@link ShapeMarker} with the given id and adds it to this {@link MarkerSet}.(Since the shape has its own positions, the position is only used to determine e.g. the distance to the camera)
+ * + * @param id the id of the new marker + * @param map the {@link BlueMapMap} of the new marker + * @param position the position of the new marker + * @param shape the Shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) + * @param y the height (y-position on the map) of shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) + * @return the created {@link ShapeMarker} + */ + ShapeMarker createShapeMarker(String id, BlueMapMap map, Vector3d position, Shape shape, float y); - /** - * Creates a {@link ExtrudeMarker} with the given id and adds it to this {@link MarkerSet}.(Since the shape has its own positions, the position is only used to determine e.g. the distance to the camera)
- * - * @param id the id of the new marker - * @param map the {@link BlueMapMap} of the new marker - * @param posX the x-position of the new marker - * @param posY the y-position of the new marker - * @param posZ the z-position of the new marker - * @param shape the {@link Shape} of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) - * @param minY the min-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) - * @param maxY the max-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) - * @return the created {@link ExtrudeMarker} - */ - default ExtrudeMarker createExtrudeMarker(String id, BlueMapMap map, double posX, double posY, double posZ, Shape shape, float minY, float maxY) { - return createExtrudeMarker(id, map, new Vector3d(posX, posY, posZ), shape, minY, maxY); - } + /** + * Creates a {@link ShapeMarker} with the given id and adds it to this {@link MarkerSet}.(Since the shape has its own positions, the position is only used to determine e.g. the distance to the camera)
+ * + * @param id the id of the new marker + * @param map the {@link BlueMapMap} of the new marker + * @param posX the x-position of the new marker + * @param posY the y-position of the new marker + * @param posZ the z-position of the new marker + * @param shape the Shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) + * @param y the height (y-position on the map) of shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) + * @return the created {@link ShapeMarker} + */ + default ShapeMarker createShapeMarker(String id, BlueMapMap map, double posX, double posY, double posZ, Shape shape, float y) { + return createShapeMarker(id, map, new Vector3d(posX, posY, posZ), shape, y); + } - /** - * Creates a {@link ExtrudeMarker} with the given id and adds it to this {@link MarkerSet}.(The position of the marker will be the center of the shape (it's bounding box))
- * - * @param id the id of the new marker - * @param map the {@link BlueMapMap} of the new marker - * @param shape the {@link Shape} of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) - * @param minY the min-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) - * @param maxY the max-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) - * @return the created {@link ExtrudeMarker} - */ - default ExtrudeMarker createExtrudeMarker(String id, BlueMapMap map, Shape shape, float minY, float maxY) { - Vector2d center = shape.getMin().add(shape.getMax()).div(2f); - float y = (minY + maxY)/2f; - return createExtrudeMarker(id, map, new Vector3d(center.getX(), y, center.getY()), shape, minY, maxY); - } + /** + * Creates a {@link ShapeMarker} with the given id and adds it to this {@link MarkerSet}.(The position of the marker will be the center of the shape (it's bounding box))
+ * + * @param id the id of the new marker + * @param map the {@link BlueMapMap} of the new marker + * @param shape the Shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) + * @param y the height of shape of the marker (See: {@link ShapeMarker#setShape(Shape, float)}) + * @return the created {@link ShapeMarker} + */ + default ShapeMarker createShapeMarker(String id, BlueMapMap map, Shape shape, float y) { + Vector2d center = shape.getMin().add(shape.getMax()).div(2); + return createShapeMarker(id, map, new Vector3d(center.getX(), y, center.getY()), shape, y); + } - /** - * Creates a {@link LineMarker} with the given id and adds it to this {@link MarkerSet}.(Since the line has its own positions, the position is only used to determine e.g. the distance to the camera)
- * - * @param id the id of the new marker - * @param map the {@link BlueMapMap} of the new marker - * @param position the position of the new marker - * @param line the {@link Line} of the marker (See: {@link LineMarker#setLine(Line)}) - * @return the created {@link LineMarker} - */ - LineMarker createLineMarker(String id, BlueMapMap map, Vector3d position, Line line); + /** + * Creates a {@link ExtrudeMarker} with the given id and adds it to this {@link MarkerSet}.(Since the shape has its own positions, the position is only used to determine e.g. the distance to the camera)
+ * + * @param id the id of the new marker + * @param map the {@link BlueMapMap} of the new marker + * @param position the position of the new marker + * @param shape the {@link Shape} of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) + * @param minY the min-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) + * @param maxY the max-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) + * @return the created {@link ExtrudeMarker} + */ + ExtrudeMarker createExtrudeMarker(String id, BlueMapMap map, Vector3d position, Shape shape, float minY, float maxY); - /** - * Creates a {@link LineMarker} with the given id and adds it to this {@link MarkerSet}.(Since the line has its own positions, the position is only used to determine e.g. the distance to the camera)
- * - * @param id the id of the new marker - * @param map the {@link BlueMapMap} of the new marker - * @param posX the x-position of the new marker - * @param posY the y-position of the new marker - * @param posZ the z-position of the new marker - * @param line the {@link Line} of the marker (See: {@link LineMarker#setLine(Line)}) - * @return the created {@link LineMarker} - */ - default LineMarker createLineMarker(String id, BlueMapMap map, double posX, double posY, double posZ, Line line) { - return createLineMarker(id, map, new Vector3d(posX, posY, posZ), line); - } + /** + * Creates a {@link ExtrudeMarker} with the given id and adds it to this {@link MarkerSet}.(Since the shape has its own positions, the position is only used to determine e.g. the distance to the camera)
+ * + * @param id the id of the new marker + * @param map the {@link BlueMapMap} of the new marker + * @param posX the x-position of the new marker + * @param posY the y-position of the new marker + * @param posZ the z-position of the new marker + * @param shape the {@link Shape} of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) + * @param minY the min-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) + * @param maxY the max-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) + * @return the created {@link ExtrudeMarker} + */ + default ExtrudeMarker createExtrudeMarker(String id, BlueMapMap map, double posX, double posY, double posZ, Shape shape, float minY, float maxY) { + return createExtrudeMarker(id, map, new Vector3d(posX, posY, posZ), shape, minY, maxY); + } + + /** + * Creates a {@link ExtrudeMarker} with the given id and adds it to this {@link MarkerSet}.(The position of the marker will be the center of the shape (it's bounding box))
+ * + * @param id the id of the new marker + * @param map the {@link BlueMapMap} of the new marker + * @param shape the {@link Shape} of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) + * @param minY the min-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) + * @param maxY the max-height (y-position on the map) of the shape of the marker (See: {@link ExtrudeMarker#setShape(Shape, float, float)}) + * @return the created {@link ExtrudeMarker} + */ + default ExtrudeMarker createExtrudeMarker(String id, BlueMapMap map, Shape shape, float minY, float maxY) { + Vector2d center = shape.getMin().add(shape.getMax()).div(2f); + float y = (minY + maxY)/2f; + return createExtrudeMarker(id, map, new Vector3d(center.getX(), y, center.getY()), shape, minY, maxY); + } + + /** + * Creates a {@link LineMarker} with the given id and adds it to this {@link MarkerSet}.(Since the line has its own positions, the position is only used to determine e.g. the distance to the camera)
+ * + * @param id the id of the new marker + * @param map the {@link BlueMapMap} of the new marker + * @param position the position of the new marker + * @param line the {@link Line} of the marker (See: {@link LineMarker#setLine(Line)}) + * @return the created {@link LineMarker} + */ + LineMarker createLineMarker(String id, BlueMapMap map, Vector3d position, Line line); + + /** + * Creates a {@link LineMarker} with the given id and adds it to this {@link MarkerSet}.(Since the line has its own positions, the position is only used to determine e.g. the distance to the camera)
+ * + * @param id the id of the new marker + * @param map the {@link BlueMapMap} of the new marker + * @param posX the x-position of the new marker + * @param posY the y-position of the new marker + * @param posZ the z-position of the new marker + * @param line the {@link Line} of the marker (See: {@link LineMarker#setLine(Line)}) + * @return the created {@link LineMarker} + */ + default LineMarker createLineMarker(String id, BlueMapMap map, double posX, double posY, double posZ, Line line) { + return createLineMarker(id, map, new Vector3d(posX, posY, posZ), line); + } + + /** + * Creates a {@link LineMarker} with the given id and adds it to this {@link MarkerSet}.(The position of the marker will be the center of the line (it's bounding box))
+ * + * @param id the id of the new marker + * @param map the {@link BlueMapMap} of the new marker + * @param line the {@link Line} of the marker (See: {@link LineMarker#setLine(Line)}) + * @return the created {@link LineMarker} + */ + default LineMarker createLineMarker(String id, BlueMapMap map, Line line) { + Vector3d center = line.getMin().add(line.getMax()).div(2f); + return createLineMarker(id, map, center, line); + } + + /** + * Removes the given Marker from this {@link MarkerSet}.removeMarker(marker.getId())
.
+ *
+ * @param marker the {@link Marker} to be removed
+ * @return true
if the {@link Marker} was removed, false
if that {@link Marker} didn't exist
+ */
+ default boolean removeMarker(Marker marker) {
+ return removeMarker(marker.getId());
+ }
+
+ /**
+ * Removes the {@link Marker} with the given id.
+ *
+ * @param id the id of the {@link Marker} to be removed
+ * @return true
if the {@link Marker} was removed, false
if there was no {@link Marker} with that id
+ */
+ boolean removeMarker(String id);
- /**
- * Creates a {@link LineMarker} with the given id and adds it to this {@link MarkerSet}.(The position of the marker will be the center of the line (it's bounding box))
- * - * @param id the id of the new marker - * @param map the {@link BlueMapMap} of the new marker - * @param line the {@link Line} of the marker (See: {@link LineMarker#setLine(Line)}) - * @return the created {@link LineMarker} - */ - default LineMarker createLineMarker(String id, BlueMapMap map, Line line) { - Vector3d center = line.getMin().add(line.getMax()).div(2f); - return createLineMarker(id, map, center, line); - } - - /** - * Removes the given Marker from this {@link MarkerSet}.removeMarker(marker.getId())
.
- *
- * @param marker the {@link Marker} to be removed
- * @return true
if the {@link Marker} was removed, false
if that {@link Marker} didn't exist
- */
- default boolean removeMarker(Marker marker) {
- return removeMarker(marker.getId());
- }
-
- /**
- * Removes the {@link Marker} with the given id.
- *
- * @param id the id of the {@link Marker} to be removed
- * @return true
if the {@link Marker} was removed, false
if there was no {@link Marker} with that id
- */
- boolean removeMarker(String id);
-
}
diff --git a/src/main/java/de/bluecolored/bluemap/api/marker/ObjectMarker.java b/src/main/java/de/bluecolored/bluemap/api/marker/ObjectMarker.java
index c2da249..c58cba3 100644
--- a/src/main/java/de/bluecolored/bluemap/api/marker/ObjectMarker.java
+++ b/src/main/java/de/bluecolored/bluemap/api/marker/ObjectMarker.java
@@ -26,23 +26,23 @@
public interface ObjectMarker extends Marker, LinkMarker {
- /**
- * Getter for the detail of this marker. The label can include html-tags.
- * @return the detail of this {@link ObjectMarker}
- */
- String getDetail();
+ /**
+ * Getter for the detail of this marker. The label can include html-tags.
+ * @return the detail of this {@link ObjectMarker}
+ */
+ String getDetail();
- /**
- * Sets the detail of this {@link ObjectMarker}. The detail can include html-tags.
- * Important:
- * Html-tags in the label will not be escaped, so you can use them to style the {@link ObjectMarker}-detail.
- * Make sure you escape all html-tags from possible user inputs to prevent possible XSS-Attacks on the web-client!
- *
+ * Important:
+ * Html-tags in the label will not be escaped, so you can use them to style the {@link ObjectMarker}-detail.
+ * Make sure you escape all html-tags from possible user inputs to prevent possible XSS-Attacks on the web-client!
+ *
The shape is placed on the xz-plane of the map, so the y-coordinates of the {@link Shape}'s points are the z-coordinates in the map.
- * @return the {@link Shape} - */ - Shape getShape(); - - /** - * Getter for the height (y-coordinate) of where the shape is displayed on the map. - * @return the height of the shape on the map - * @deprecated Use {@link #getShapeY()} instead - */ - default float getHeight() { - return getShapeY(); - } + /** + * Getter for {@link Shape} of this {@link ShapeMarker}. + *The shape is placed on the xz-plane of the map, so the y-coordinates of the {@link Shape}'s points are the z-coordinates in the map.
+ * @return the {@link Shape} + */ + Shape getShape(); - /** - * Getter for the height (y-coordinate) of where the shape is displayed on the map. - * @return the height of the shape on the map - */ - float getShapeY(); - - /** - * Sets the {@link Shape} of this {@link ShapeMarker}. - *The shape is placed on the xz-plane of the map, so the y-coordinates of the {@link Shape}'s points will be the z-coordinates in the map.
- * @param shape the new {@link Shape} - * @param y the new height (y-coordinate) of the shape on the map - */ - void setShape(Shape shape, float y); + /** + * Getter for the height (y-coordinate) of where the shape is displayed on the map. + * @return the height of the shape on the map + * @deprecated Use {@link #getShapeY()} instead + */ + default float getHeight() { + return getShapeY(); + } - /** - * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything. - * @returntrue
if the depthTest is enabled
- */
- boolean isDepthTestEnabled();
-
- /**
- * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything.
- * @param enabled if the depth-test should be enabled for this {@link ShapeMarker}
- */
- void setDepthTestEnabled(boolean enabled);
+ /**
+ * Getter for the height (y-coordinate) of where the shape is displayed on the map.
+ * @return the height of the shape on the map
+ */
+ float getShapeY();
- /**
- * Getter for the width of the border-line of this {@link ShapeMarker}.
- * @return the width of the line in pixels
- */
- int getLineWidth();
+ /**
+ * Sets the {@link Shape} of this {@link ShapeMarker}.
+ * The shape is placed on the xz-plane of the map, so the y-coordinates of the {@link Shape}'s points will be the z-coordinates in the map.
+ * @param shape the new {@link Shape} + * @param y the new height (y-coordinate) of the shape on the map + */ + void setShape(Shape shape, float y); - /** - * Sets the width of the border-line for this {@link ShapeMarker}. - * @param width the new width in pixels - */ - void setLineWidth(int width); + /** + * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything. + * @returntrue
if the depthTest is enabled
+ */
+ boolean isDepthTestEnabled();
- /**
- * Getter for the {@link Color} of the border of the shape.
- * @return the border-color
- * @deprecated Use {@link #getLineColor()} instead
- */
- default Color getBorderColor() {
- return getLineColor();
- }
-
- /**
- * Sets the {@link Color} of the border of the shape.
- * @param color the new border-color
- * @deprecated Use {@link #setLineColor(Color)} instead
- */
- default void setBorderColor(Color color){
- setLineColor(color);
- }
+ /**
+ * If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything.
+ * @param enabled if the depth-test should be enabled for this {@link ShapeMarker}
+ */
+ void setDepthTestEnabled(boolean enabled);
- /**
- * Getter for the {@link Color} of the border-line of the shape.
- * @return the line-color
- */
- Color getLineColor();
+ /**
+ * Getter for the width of the border-line of this {@link ShapeMarker}.
+ * @return the width of the line in pixels
+ */
+ int getLineWidth();
- /**
- * Sets the {@link Color} of the border-line of the shape.
- * @param color the new line-color
- */
- void setLineColor(Color color);
+ /**
+ * Sets the width of the border-line for this {@link ShapeMarker}.
+ * @param width the new width in pixels
+ */
+ void setLineWidth(int width);
+
+ /**
+ * Getter for the {@link Color} of the border of the shape.
+ * @return the border-color
+ * @deprecated Use {@link #getLineColor()} instead
+ */
+ default Color getBorderColor() {
+ return getLineColor();
+ }
+
+ /**
+ * Sets the {@link Color} of the border of the shape.
+ * @param color the new border-color
+ * @deprecated Use {@link #setLineColor(Color)} instead
+ */
+ default void setBorderColor(Color color){
+ setLineColor(color);
+ }
+
+ /**
+ * Getter for the {@link Color} of the border-line of the shape.
+ * @return the line-color
+ */
+ Color getLineColor();
+
+ /**
+ * Sets the {@link Color} of the border-line of the shape.
+ * @param color the new line-color
+ */
+ void setLineColor(Color color);
+
+ /**
+ * Getter for the fill-{@link Color} of the shape.
+ * @return the fill-color
+ */
+ Color getFillColor();
+
+ /**
+ * Sets the fill-{@link Color} of the shape.
+ * @param color the new fill-color
+ */
+ void setFillColor(Color color);
+
+ /**
+ * Sets the border- and fill- color.
+ * @param lineColor the new border-color
+ * @param fillColor the new fill-color
+ * @see #setLineColor(Color)
+ * @see #setFillColor(Color)
+ */
+ default void setColors(Color lineColor, Color fillColor) {
+ setLineColor(lineColor);
+ setFillColor(fillColor);
+ }
- /**
- * Getter for the fill-{@link Color} of the shape.
- * @return the fill-color
- */
- Color getFillColor();
-
- /**
- * Sets the fill-{@link Color} of the shape.
- * @param color the new fill-color
- */
- void setFillColor(Color color);
-
- /**
- * Sets the border- and fill- color.
- * @param lineColor the new border-color
- * @param fillColor the new fill-color
- * @see #setLineColor(Color)
- * @see #setFillColor(Color)
- */
- default void setColors(Color lineColor, Color fillColor) {
- setLineColor(lineColor);
- setFillColor(fillColor);
- }
-
}
diff --git a/src/main/java/de/bluecolored/bluemap/api/renderer/RenderAPI.java b/src/main/java/de/bluecolored/bluemap/api/renderer/RenderAPI.java
index e860cc3..060b9b1 100644
--- a/src/main/java/de/bluecolored/bluemap/api/renderer/RenderAPI.java
+++ b/src/main/java/de/bluecolored/bluemap/api/renderer/RenderAPI.java
@@ -38,140 +38,140 @@
*/
public interface RenderAPI {
- /**
- * Schedules the render of the map-tile at this block position for all maps of this world.true
if this renderer is running
- */
- boolean isRunning();
-
- /**
- * Starts the renderer if it is not already running.
- */
- void start();
+ /**
+ * Schedules a task to purge the given map.
+ * An update-task will be scheduled right after the purge, to get the map up-to-date again.
+ * @param map the map to be purged
+ * @return true if a new task has been scheduled, false if not (usually because there is already an update-task for this map scheduled)
+ * @throws IOException if an IOException occurs while trying to create the task.
+ */
+ boolean scheduleMapPurgeTask(BlueMapMap map) throws IOException;
+
+ /**
+ * Getter for the current size of the render-queue.
+ * @return the current size of the render-queue
+ */
+ int renderQueueSize();
+
+ /**
+ * Getter for the count of render threads.
+ * @return the count of render threads
+ */
+ int renderThreadCount();
+
+ /**
+ * Whether this {@link RenderAPI} is currently running or paused.
+ * @return true
if this renderer is running
+ */
+ boolean isRunning();
+
+ /**
+ * Starts the renderer if it is not already running.
+ */
+ void start();
+
+ /**
+ * Pauses the renderer if it currently is running.
+ */
+ void pause();
- /**
- * Pauses the renderer if it currently is running.
- */
- void pause();
-
}