Class ShapeMarker

All Implemented Interfaces:
DetailMarker

public class ShapeMarker extends ObjectMarker
  • Constructor Details

  • Method Details

    • getShape

      public Shape getShape()
      Getter for Shape of this ShapeMarker.

      The shape is placed on the xz-plane of the map, so the y-coordinates of the Shape's points are the z-coordinates in the map.

      Returns:
      the Shape
    • getShapeY

      public float getShapeY()
      Getter for the height (y-coordinate) of where the shape is displayed on the map.
      Returns:
      the height of the shape on the map
    • setShape

      public void setShape(Shape shape, float y)
      Sets the Shape of this ShapeMarker.

      The shape is placed on the xz-plane of the map, so the y-coordinates of the Shape's points will be the z-coordinates in the map.

      Parameters:
      shape - the new Shape
      y - the new height (y-coordinate) of the shape on the map
      See Also:
    • getHoles

      public Collection<Shape> getHoles()
      Getter for the mutable collection of holes in this ShapeMarker.

      Any shape in this collection will be a hole in the main Shape of this marker

      Returns:
      A mutable collection of hole-shapes
    • centerPosition

      public void centerPosition()
      Sets the position of this ShapeMarker to the center of the Shape (it's bounding box).

      (Invoke this after changing the Shape to make sure the markers position gets updated as well)

    • isDepthTestEnabled

      public 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.
      Returns:
      true if the depthTest is enabled
    • setDepthTestEnabled

      public void setDepthTestEnabled(boolean enabled)
      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.
      Parameters:
      enabled - if the depth-test should be enabled for this ShapeMarker
    • getLineWidth

      public int getLineWidth()
      Getter for the width of the border-line of this ShapeMarker.
      Returns:
      the width of the line in pixels
    • setLineWidth

      public void setLineWidth(int width)
      Sets the width of the border-line for this ShapeMarker.
      Parameters:
      width - the new width in pixels
    • getLineColor

      public Color getLineColor()
      Getter for the Color of the border-line of the shape.
      Returns:
      the line-color
    • setLineColor

      public void setLineColor(Color color)
      Sets the Color of the border-line of the shape.
      Parameters:
      color - the new line-color
    • getFillColor

      public Color getFillColor()
      Getter for the fill-Color of the shape.
      Returns:
      the fill-color
    • setFillColor

      public void setFillColor(Color color)
      Sets the fill-Color of the shape.
      Parameters:
      color - the new fill-color
    • setColors

      public void setColors(Color lineColor, Color fillColor)
      Sets the border- and fill- color.
      Parameters:
      lineColor - the new border-color
      fillColor - the new fill-color
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class ObjectMarker
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ObjectMarker
    • builder

      public static ShapeMarker.Builder builder()
      Creates a Builder for ShapeMarkers.
      Returns:
      a new Builder