Package kiyut.sketsa.canvas

## Class CanvasUtilities

- java.lang.Object
- - kiyut.sketsa.canvas.CanvasUtilities

-     public class CanvasUtilities
      extends Object

  Collection of Canvas Utilities
  Author:
    Kiyut

- - ### Constructor Summary

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

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static List<org.w3c.dom.svg.SVGElement>` | `getGraphicsElement​(List<org.w3c.dom.svg.SVGElement> source)` | This methods traverse the givent Element list, to find the child which is selectable Graphics Element.
    `static List<org.w3c.dom.svg.SVGElement>` | `getSVGElementAt​(VectorCanvas canvas, Point2D point, boolean direct)` | Return List of Selectable SVGElement.
    `static List<org.w3c.dom.svg.SVGElement>` | `getSVGElementAt​(VectorCanvas canvas, Shape shape, boolean direct)` | Return List of Selectable SVGElement.
    `static org.w3c.dom.svg.SVGTextElement` | `getSVGTextElementAt​(VectorCanvas canvas, Point2D point)` | Return SVGTextElement the most front or the most bottom (SVG z-order).
    `static boolean` | `isSelectableContainerElement​(Element elt)` | Check whether the node is selectable Container Element by canvas or not.
    `static boolean` | `isSelectableElement​(Element elt)` | Simple wrapper for isSelectableGraphicsElement(Element) and isSelectableContainerElement(Element).
    `static boolean` | `isSelectableGraphicsElement​(Element elt)` | Check whether the node is selectable Graphics Element by canvas or not.

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

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

- - ### Constructor Detail

    - #### CanvasUtilities

          public CanvasUtilities()

  - ### Method Detail

    - #### isSelectableGraphicsElement

          public static boolean isSelectableGraphicsElement​(Element elt)

      Check whether the node is selectable Graphics Element by canvas or not.
      Parameters:
        `elt` - Element
      Returns:
        true if selectable otherwise false

    - #### isSelectableContainerElement

          public static boolean isSelectableContainerElement​(Element elt)

      Check whether the node is selectable Container Element by canvas or not.
      Parameters:
        `elt` - Element
      Returns:
        true if selectable otherwise false

    - #### isSelectableElement

          public static boolean isSelectableElement​(Element elt)

      Simple wrapper for isSelectableGraphicsElement(Element) and isSelectableContainerElement(Element).
      Parameters:
        `elt` - Element
      Returns:
        true if selectable otherwise false
      See Also:
        `isSelectableGraphicsElement(Element)`, `isSelectableContainerElement(Element)`

    - #### getSVGElementAt

          public static List<org.w3c.dom.svg.SVGElement> getSVGElementAt​(VectorCanvas canvas,
                                                                         Shape shape,
                                                                         boolean direct)

      Return List of Selectable SVGElement. It does not return null instead it return empty List. It search from bottom to top because the bottom is the front on the canvas (SVG z-order).
      Parameters:
        `canvas` - the `VectorCanvas`
        `shape` - selection shape
        `direct` - true for direct selection
      Returns:
        List of Selectable SVGElement

    - #### getSVGElementAt

          public static List<org.w3c.dom.svg.SVGElement> getSVGElementAt​(VectorCanvas canvas,
                                                                         Point2D point,
                                                                         boolean direct)

      Return List of Selectable SVGElement. It does not return null instead it return empty List It search from bottom to top because the bottom is the front on the canvas (SVG z-order).
      Parameters:
        `canvas` - VectorCanvas
        `point` - selection point
        `direct` - true for direct selection
      Returns:
        List of Selectable SVGElement

    - #### getGraphicsElement

          public static List<org.w3c.dom.svg.SVGElement> getGraphicsElement​(List<org.w3c.dom.svg.SVGElement> source)

      This methods traverse the givent Element list, to find the child which is selectable Graphics Element. If nothings found, it return empty list instead of null
      Parameters:
        `source` - list of Element
      Returns:
        list of GraphicsElement
      See Also:
        `isSelectableGraphicsElement(Element)`, `isSelectableContainerElement(Element)`

    - #### getSVGTextElementAt

          public static org.w3c.dom.svg.SVGTextElement getSVGTextElementAt​(VectorCanvas canvas,
                                                                           Point2D point)

      Return SVGTextElement the most front or the most bottom (SVG z-order).
      Parameters:
        `canvas` - VectorCanvas
        `point` - Point2D
      Returns:
        SVGTextElement or null