Package kiyut.sketsa.canvas.text

## Class TextEditor

- java.lang.Object
- - kiyut.sketsa.canvas.text.TextEditor

- Direct Known Subclasses:
    `DefaultTextEditor`

      public abstract class TextEditor
      extends Object

  Author:
    KIYUT

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected VectorCanvas` | `canvas` |
    `protected TextCaret` | `caret` |
    `protected TextDocument` | `document` |
    `protected boolean` | `editable` |
    `protected org.apache.batik.bridge.TextNode` | `textNode` |

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `TextCaret` | `getCaret()` |
    `TextDocument` | `getDocument()` |
    `boolean` | `isEditable()` |
    `void` | `keyPressed​(KeyEvent evt)` | Invoked when a key has been pressed.
    `void` | `keyReleased​(KeyEvent evt)` | Invoked when a key has been released.
    `void` | `keyTyped​(KeyEvent evt)` | Invoked when a key has been typed.
    `void` | `mouseClicked​(MouseEvent evt)` | Invoked when the mouse button has been clicked (pressed and released) on a component.
    `void` | `mouseDragged​(MouseEvent evt)` | Invoked when a mouse button is pressed on a component and then dragged.
    `void` | `mouseEntered​(MouseEvent evt)` | Invoked when the mouse enters a component.
    `void` | `mouseExited​(MouseEvent evt)` | Invoked when the mouse exits a component.
    `void` | `mouseMoved​(MouseEvent evt)` | Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
    `void` | `mousePressed​(MouseEvent evt)` | Invoked when a mouse button has been pressed on a component.
    `void` | `mouseReleased​(MouseEvent evt)` | Invoked when a mouse button has been released on a component.
    `void` | `paint​(Graphics2D g2d)` |
    `void` | `setSVGTextElement​(org.w3c.dom.svg.SVGTextElement element)` |
    `void` | `setVectorCanvas​(VectorCanvas canvas)` |
    `abstract void` | `startEdit()` |
    `abstract void` | `stopEdit()` |

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

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

- - ### Field Detail

    - #### canvas

          protected VectorCanvas canvas

    - #### textNode

          protected org.apache.batik.bridge.TextNode textNode

    - #### caret

          protected TextCaret caret

    - #### document

          protected TextDocument document

    - #### editable

          protected boolean editable

  - ### Constructor Detail

    - #### TextEditor

          public TextEditor()

  - ### Method Detail

    - #### paint

          public void paint​(Graphics2D g2d)

    - #### setVectorCanvas

          public void setVectorCanvas​(VectorCanvas canvas)

    - #### setSVGTextElement

          public void setSVGTextElement​(org.w3c.dom.svg.SVGTextElement element)

    - #### getDocument

          public TextDocument getDocument()

    - #### getCaret

          public TextCaret getCaret()

    - #### isEditable

          public boolean isEditable()

    - #### stopEdit

          public abstract void stopEdit()

    - #### startEdit

          public abstract void startEdit()

    - #### keyPressed

          public void keyPressed​(KeyEvent evt)

      Invoked when a key has been pressed. See the class description for `KeyEvent` for a definition of a key pressed event.
      Parameters:
        `evt` - KeyEvent object

    - #### keyReleased

          public void keyReleased​(KeyEvent evt)

      Invoked when a key has been released. See the class description for `KeyEvent` for a definition of a key released event.
      Parameters:
        `evt` - KeyEvent object

    - #### keyTyped

          public void keyTyped​(KeyEvent evt)

      Invoked when a key has been typed. See the class description for `KeyEvent` for a definition of a key typed event.
      Parameters:
        `evt` - KeyEvent object

    - #### mouseClicked

          public void mouseClicked​(MouseEvent evt)

      Invoked when the mouse button has been clicked (pressed and released) on a component.
      Parameters:
        `evt` - MouseEvent object

    - #### mouseDragged

          public void mouseDragged​(MouseEvent evt)

      Invoked when a mouse button is pressed on a component and then dragged. `MOUSE_DRAGGED` events will continue to be delivered to the component where the drag originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

      Due to platform-dependent Dra and Drop implementations, `MOUSE_DRAGGED` events may not be delivered during a native Drag&Drop operation.

      Parameters:
        `evt` - MouseEvent object

    - #### mouseEntered

          public void mouseEntered​(MouseEvent evt)

      Invoked when the mouse enters a component.
      Parameters:
        `evt` - MouseEvent object

    - #### mouseExited

          public void mouseExited​(MouseEvent evt)

      Invoked when the mouse exits a component.
      Parameters:
        `evt` - MouseEvent object

    - #### mouseMoved

          public void mouseMoved​(MouseEvent evt)

      Invoked when the mouse cursor has been moved onto a component but no buttons have been pushed.
      Parameters:
        `evt` - MouseEvent object

    - #### mousePressed

          public void mousePressed​(MouseEvent evt)

      Invoked when a mouse button has been pressed on a component.
      Parameters:
        `evt` - MouseEvent object

    - #### mouseReleased

          public void mouseReleased​(MouseEvent evt)

      Invoked when a mouse button has been released on a component.
      Parameters:
        `evt` - MouseEvent object