Manipulator

open class Manipulator

Base class for interactive manipulators, which are user interface elements attached to a diagram item. The user can perform various manipulations on objects through their attached manipulators.

  • Initializes a new instance of the Manipulator class related to the specified diagram item.

    Declaration

    Swift

    public init(item: DiagramItem)

    Parameters

    item

    The DiagramItem that uses this Manipulator.

  • Renders the Manipulator at the specified canvas.

    Declaration

    Swift

    open func draw(_ canvas: Canvas)

    Parameters

    canvas

    The canvas where this Manipulator is rendered.

  • Checks if the specified point is within the bounds of this Manipulator.

    Declaration

    Swift

    open func hitTest(_ point: Point) -> Bool

    Parameters

    point

    The point to check.

    Return Value

    true if the point is within this Manipulator; otherwise false.

  • Handles the onClick event.

    Declaration

    Swift

    open func onClick(_ point: Point)

    Parameters

    point

    The point where the user has clicked.

  • Checks if the user action in the point raises drag events.

    Declaration

    Swift

    open func needsDragEvents(_ point: Point) -> Bool

    Parameters

    point

    The point where the user has clicked.

    Return Value

    true if drag events should be raised; otherwise false.

  • Handles the onTouchDown event.

    Declaration

    Swift

    open func onTouchDown(_ point: Point)

    Parameters

    point

    The point where the user has touched the surface.

  • Handles the onTouchMove event.

    Declaration

    Swift

    open func onTouchMove(_ point: Point)

    Parameters

    point

    The point where the user has moved their finger on the surface.

  • Handles the onTouchUp event.

    Declaration

    Swift

    open func onTouchUp(_ point: Point)

    Parameters

    point

    The point where the user has lifted their finger from the surface.