Package kiyut.sketsa.canvas.tool

## Class AbstractTool

- java.lang.Object
- - kiyut.sketsa.canvas.tool.AbstractTool

- All Implemented Interfaces:
    `KeyListener`, `MouseListener`, `MouseMotionListener`, `EventListener`, `MouseInputListener`, `Tool`
  Direct Known Subclasses:
    `AbstractPointTool`, `AbstractSelectionTool`, `DefaultMoveTool`, `DefaultResizeTool`, `DropperTool`, `EllipseTool`, `ImageTool`, `LineTool`, `PanTool`, `PencilTool`, `PenTool`, `PolyTool`, `RectangleTool`, `RotateTool`, `ScaleTool`, `SkewTool`, `TextTool`, `TranslateTool`, `ZoomTool`

      public abstract class AbstractTool
      extends Object
      implements Tool

  An abstract class for Tool. The methods in this class are empty. Only the messageListener related function is implemented. This class exists as convenience for implementing Tool objects.
  Author:
    KIYUT

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AbstractTool()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addMessageListener​(MessageListener l)` | Add listener to the tool that notifies about message
    `void` | `endTool()` | Invoked when the tool is ended
    `protected void` | `fireMessageReceived​(int type, String message)` | Notifies all listeners that have registered interest for notification on this event type.
    `void` | `keyPressed​(KeyEvent evt)` |
    `void` | `keyReleased​(KeyEvent evt)` |
    `void` | `keyTyped​(KeyEvent evt)` |
    `void` | `mouseClicked​(MouseEvent evt)` |
    `void` | `mouseDragged​(MouseEvent evt)` |
    `void` | `mouseEntered​(MouseEvent evt)` |
    `void` | `mouseExited​(MouseEvent evt)` |
    `void` | `mouseMoved​(MouseEvent evt)` |
    `void` | `mousePressed​(MouseEvent evt)` |
    `void` | `mouseReleased​(MouseEvent evt)` |
    `void` | `paint​(Graphics2D g2d)` | Invoked by canvas to draw tool.
    `void` | `removeMessageListener​(MessageListener l)` | remove listener to the tool that notifies about message
    `void` | `setVectorCanvas​(VectorCanvas canvas)` | set the canvas for the tool
    `void` | `startTool()` | Invoked when the tool is started

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractTool

          public AbstractTool()

  - ### Method Detail

    - #### paint

          public void paint​(Graphics2D g2d)

      Description copied from interface: `Tool`
      Invoked by canvas to draw tool.
      Specified by:
        `paint` in interface `Tool`
      Parameters:
        `g2d` - the Graphics2D context in which to paint

    - #### setVectorCanvas

          public void setVectorCanvas​(VectorCanvas canvas)

      Description copied from interface: `Tool`
      set the canvas for the tool
      Specified by:
        `setVectorCanvas` in interface `Tool`
      Parameters:
        `canvas` - VectorCanvas

    - #### startTool

          public void startTool()

      Description copied from interface: `Tool`
      Invoked when the tool is started
      Specified by:
        `startTool` in interface `Tool`

    - #### endTool

          public void endTool()

      Description copied from interface: `Tool`
      Invoked when the tool is ended
      Specified by:
        `endTool` in interface `Tool`

    - #### keyPressed

          public void keyPressed​(KeyEvent evt)

      Specified by:
        `keyPressed` in interface `KeyListener`

    - #### keyReleased

          public void keyReleased​(KeyEvent evt)

      Specified by:
        `keyReleased` in interface `KeyListener`

    - #### keyTyped

          public void keyTyped​(KeyEvent evt)

      Specified by:
        `keyTyped` in interface `KeyListener`

    - #### mouseClicked

          public void mouseClicked​(MouseEvent evt)

      Specified by:
        `mouseClicked` in interface `MouseListener`

    - #### mouseDragged

          public void mouseDragged​(MouseEvent evt)

      Specified by:
        `mouseDragged` in interface `MouseMotionListener`

    - #### mouseEntered

          public void mouseEntered​(MouseEvent evt)

      Specified by:
        `mouseEntered` in interface `MouseListener`

    - #### mouseExited

          public void mouseExited​(MouseEvent evt)

      Specified by:
        `mouseExited` in interface `MouseListener`

    - #### mouseMoved

          public void mouseMoved​(MouseEvent evt)

      Specified by:
        `mouseMoved` in interface `MouseMotionListener`

    - #### mousePressed

          public void mousePressed​(MouseEvent evt)

      Specified by:
        `mousePressed` in interface `MouseListener`

    - #### mouseReleased

          public void mouseReleased​(MouseEvent evt)

      Specified by:
        `mouseReleased` in interface `MouseListener`

    - #### addMessageListener

          public void addMessageListener​(MessageListener l)

      Description copied from interface: `Tool`
      Add listener to the tool that notifies about message
      Specified by:
        `addMessageListener` in interface `Tool`
      Parameters:
        `l` - `MessageListener`

    - #### removeMessageListener

          public void removeMessageListener​(MessageListener l)

      Description copied from interface: `Tool`
      remove listener to the tool that notifies about message
      Specified by:
        `removeMessageListener` in interface `Tool`
      Parameters:
        `l` - `MessageListener`

    - #### fireMessageReceived

          protected void fireMessageReceived​(int type,
                                             String message)

      Notifies all listeners that have registered interest for notification on this event type.
      Parameters:
        `type` - the type
        `message` - the message