Class MegaCreateTool

All Implemented Interfaces:
MouseListener, MouseMotionListener, MouseWheelListener, EventListener, MouseInputListener, Tool, SelectionListener, SessionListener, Undoable
Direct Known Subclasses:
IPK_MegaCreateTool

public class MegaCreateTool
extends MegaTools
A tool for creating and editing a graph.
Author:
Holleis
  • Constructor Details

    • MegaCreateTool

      public MegaCreateTool()
      Constructor for this tool. Registers a key used to delete graph elements.
  • Method Details

    • getNormCursor

      public Cursor getNormCursor()
    • getEdgeCursor

      public Cursor getEdgeCursor()
    • getNodeCursor

      public Cursor getNodeCursor()
    • activate

      public void activate()
      The method additionally registers a key used to delete graph elements.
      Specified by:
      activate in interface Tool
      Overrides:
      activate in class AbstractTool
      See Also:
      AbstractTool.activate()
    • deactivate

      public void deactivate()
      This method additionaly unregisters the key used for deleting graph elements.
      Specified by:
      deactivate in interface Tool
      Overrides:
      deactivate in class AbstractTool
      See Also:
      AbstractTool.deactivate()
    • mousePressed

      public void mousePressed​(MouseEvent e)
      Invoked when the mouse button has been pressed inside the editor panel and handles what has to happen. Is actually empty since all functionality is put into mousePressed etc.
      Specified by:
      mousePressed in interface MouseListener
      Overrides:
      mousePressed in class MouseAdapter
      Parameters:
      e - the mouse event
    • mouseDragged

      public void mouseDragged​(MouseEvent e)
      Invoked when the mouse button has been pressed and dragged inside the editor panel and handles what has to happen.
      Specified by:
      mouseDragged in interface MouseMotionListener
      Overrides:
      mouseDragged in class MouseAdapter
      Parameters:
      e - the mouse event
    • mouseMoved

      public void mouseMoved​(MouseEvent e)
      Temporarily marks the component under cursor.
      Specified by:
      mouseMoved in interface MouseMotionListener
      Overrides:
      mouseMoved in class MegaTools
      Parameters:
      e - the mouse event
    • mouseClicked

      public void mouseClicked​(MouseEvent e)
      Invoked when the mouse button has been clicked (pressed and released) inside the editor panel and handles what has to happen.
      Specified by:
      mouseClicked in interface MouseListener
      Overrides:
      mouseClicked in class MouseAdapter
      Parameters:
      e - the mouse event
    • isTemporaryNode

      public static boolean isTemporaryNode​(Node n)
    • isCreatingEdge

      public boolean isCreatingEdge()
    • mouseReleased

      public void mouseReleased​(MouseEvent e)
      Invoked when the mouse button has been released inside the editor panel and handles what has to happen.
      Specified by:
      mouseReleased in interface MouseListener
      Overrides:
      mouseReleased in class MouseAdapter
      Parameters:
      e - the mouse event
    • reset

      public void reset()
      Resets the tool to initial values.
    • getToolName

      public String getToolName()