Package kiyut.sketsa.canvas.tool.point

## Class PointToolModel

- java.lang.Object
- - kiyut.sketsa.canvas.tool.point.PointToolModel

-     public class PointToolModel
      extends Object

  This is a singleton class. Its use is shared between Point Tool (MovePointTool, AddPointTool, RemovePointTool)
  Author:
    KIYUT

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `add​(org.w3c.dom.svg.SVGElement element)` | Add SVGElement.
    `void` | `clear()` | clear
    `org.w3c.dom.svg.SVGElement` | `get​(int index)` | Return SVGElement.
    `static PointToolModel` | `getInstance()` |
    `Shape` | `getOutline​(int index)` | Return Outline Shape
    `List<PathSegment>` | `getPathSegmentList​(int index)` | Return PathSegmentList
    `org.w3c.dom.svg.SVGElement` | `getSelectedElement()` | Return selected Element
    `Shape` | `getSelectedOutline()` | Return selected Outline
    `PathSegment` | `getSelectedPathSegment()` | Return selectedPathSegment
    `PointShape` | `getSelectedPoint()` | Return selectedPoint
    `int` | `indexOf​(org.w3c.dom.svg.SVGElement element)` | Return indexOf specified SVGElement.
    `void` | `refresh()` | Refresh or reinitialize Points
    `void` | `remove​(org.w3c.dom.svg.SVGElement element)` | Remove SVGElement
    `void` | `setSelectedElement​(org.w3c.dom.svg.SVGElement element)` | Set selected Element
    `void` | `setSelectedPathSegment​(PathSegment pathSegment)` | Set SelectedPathSegment
    `void` | `setSelectedPoint​(PointShape point)` | Set Selected Point
    `void` | `setVectorCanvas​(VectorCanvas canvas)` | If the canvas is different with the currently hold canvas, it call refresh()
    `int` | `size()` | Returns the number of elements.
    `void` | `updateOutline​(int index)` | Update Outline at specified index.
    `void` | `updatePointList​(int index)` | Update PointList at specified index.

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

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

- - ### Method Detail

    - #### getInstance

          public static PointToolModel getInstance()

    - #### setVectorCanvas

          public void setVectorCanvas​(VectorCanvas canvas)

      If the canvas is different with the currently hold canvas, it call refresh()
      Parameters:
        `canvas` - VectorCanvas

    - #### getOutline

          public Shape getOutline​(int index)

      Return Outline Shape
      Parameters:
        `index` - The index
      Returns:
        Outline Shape

    - #### getPathSegmentList

          public List<PathSegment> getPathSegmentList​(int index)

      Return PathSegmentList
      Parameters:
        `index` - The index
      Returns:
        PathSegmentList

    - #### clear

          public void clear()

      clear

    - #### refresh

          public void refresh()

      Refresh or reinitialize Points

    - #### remove

          public void remove​(org.w3c.dom.svg.SVGElement element)

      Remove SVGElement
      Parameters:
        `element` - SVGElement

    - #### updateOutline

          public void updateOutline​(int index)

      Update Outline at specified index.
      Parameters:
        `index` - The index

    - #### updatePointList

          public void updatePointList​(int index)

      Update PointList at specified index.
      Parameters:
        `index` - The index

    - #### add

          public void add​(org.w3c.dom.svg.SVGElement element)

      Add SVGElement.
      Parameters:
        `element` - SVGElement

    - #### indexOf

          public int indexOf​(org.w3c.dom.svg.SVGElement element)

      Return indexOf specified SVGElement.
      Parameters:
        `element` - SVGElement
      Returns:
        indexOf specified SVGElement
      See Also:
        `get(int)`

    - #### get

          public org.w3c.dom.svg.SVGElement get​(int index)

      Return SVGElement.
      Parameters:
        `index` - The index
      Returns:
        SVGElement
      See Also:
        `indexOf(SVGElement)`

    - #### size

          public int size()

      Returns the number of elements.
      Returns:
        the number of elements

    - #### setSelectedPoint

          public void setSelectedPoint​(PointShape point)

      Set Selected Point
      Parameters:
        `point` - PointShape

    - #### getSelectedPoint

          public PointShape getSelectedPoint()

      Return selectedPoint
      Returns:
        PointShape

    - #### setSelectedPathSegment

          public void setSelectedPathSegment​(PathSegment pathSegment)

      Set SelectedPathSegment
      Parameters:
        `pathSegment` - PathSegment

    - #### getSelectedPathSegment

          public PathSegment getSelectedPathSegment()

      Return selectedPathSegment
      Returns:
        PathSegment

    - #### setSelectedElement

          public void setSelectedElement​(org.w3c.dom.svg.SVGElement element)

      Set selected Element
      Parameters:
        `element` - SVGElement

    - #### getSelectedElement

          public org.w3c.dom.svg.SVGElement getSelectedElement()

      Return selected Element
      Returns:
        SVGElement

    - #### getSelectedOutline

          public Shape getSelectedOutline()

      Return selected Outline
      Returns:
        Shape