Class MoveVertexTool

All Implemented Interfaces:
CursorTool, MouseListener, MouseMotionListener, EventListener

public class MoveVertexTool extends DragTool
  • Field Details

  • Constructor Details

  • Method Details

    • getCursor

      public Cursor getCursor()
      Specified by:
      getCursor in interface CursorTool
      Overrides:
      getCursor in class AbstractCursorTool
    • getIcon

      public Icon getIcon()
      Returns:
      null to use a default icon
    • gestureFinished

      protected void gestureFinished() throws Exception
      Specified by:
      gestureFinished in class AbstractCursorTool
      Throws:
      Exception
    • mousePressed

      public void mousePressed(MouseEvent e)
      Description copied from class: DragTool
      Begins handling of the drag. Subclasses can prevent handling of the drag by overriding this method and not calling it.
      Specified by:
      mousePressed in interface MouseListener
      Overrides:
      mousePressed in class DragTool
    • moveVertices

      public void moveVertices(org.locationtech.jts.geom.Coordinate initialLocation, org.locationtech.jts.geom.Coordinate finalLocation) throws Exception
      Throws:
      Exception
    • getShape

      protected Shape getShape(Point2D source, Point2D destination) throws Exception
      Overrides:
      getShape in class DragTool
      Parameters:
      source - initial position
      destination - final position
      Returns:
      a Rectangle defined by the initial and final position or null if nothing should be drawn
      Throws:
      Exception - if an Exception occurs during the Rectangle construction