Class GridManager

java.lang.Object
com.j3d.gen.grid.GridManager
All Implemented Interfaces:
EventListener

public class GridManager extends Object implements EventListener
  • Field Details

  • Constructor Details

  • Method Details

    • getObjects

      public ArrayList<GridObject<?>> getObjects()
    • isDeleteMode

      public boolean isDeleteMode()
    • setDeleteMode

      public void setDeleteMode(boolean deleteMode)
    • getTemporaryDrawConsumers

      public HashMap<UUID,Consumer<Graphics2D>> getTemporaryDrawConsumers()
    • repaint

      public void repaint()
    • addExistingPoints

      public void addExistingPoints()
    • invalidateAndRemoveAllReactive

      public void invalidateAndRemoveAllReactive()
    • removeReactivePoint

      public void removeReactivePoint(ReactivePoint point)
    • onEvent

      public <K> void onEvent(EventType event, EventPayload<K> properties)
      Description copied from interface: EventListener
      onEvent is called by EventEmitter via EventEmitter.broadcast(EventType, EventPayload). Allowing the emitter to call any other object that implements this.
      Specified by:
      onEvent in interface EventListener
      Type Parameters:
      K - The type of the emitter of this event
      Parameters:
      event - The type of event
      properties - The given event payload
    • getAxisPlane

      public AxisPlane getAxisPlane()
    • init

      private void init()
      initialises all the drawing shenanigans we need to do being:
      • The origin point
      • The grid lines
      • Temporary consumers
    • regInGrid

      private void regInGrid(CartesianPoint p, CartesianPoint s)
      Register a grid line to draw on the grid
      Parameters:
      p - Point A
      s - Point B
    • grid

      private void grid()
      Draws the grid with all scaling applied.
    • existing

      public void existing(Supplier<Point> p)
      If the given point's coordinates dont already exist within objects, add it.
      Parameters:
      p - The point supplier (why the fuck is this a supplier)
    • delete

      public void delete(CartesianPoint cartesianPoint)
      Delete a point at the given coordinates.
      Parameters:
      cartesianPoint - The position of the point to delete at.
    • delete

      public void delete(Line l)
      Delete any point or line which intersects with the given line
      Parameters:
      l - The query line. usually drawn by the user.
    • drawMouse

      public static void drawMouse(Graphics2D g, CartesianPoint mousePos, AxisPlane plane)
      Draws the mouse in the world on the actual 3D plane
      Parameters:
      g - Graphics bro.
      mousePos - The position of the mouse in cartesian terms according to the plane
      plane - The plane in question
    • drawDirArr

      public static void drawDirArr(Graphics2D g, CartesianPoint pos, AxisPlane plane, boolean xDir)
    • fromMut

      public static Offset fromMut()