Controller
Controller
Constructors
new Controller()
new Controller(
manipulator
):Controller
Parameters
• manipulator: Manipulator
Returns
Source
Properties
dragPoint
dragPoint:
number
[]
Current drag point in shape’s LCS
Source
dragPointCCS
dragPointCCS:
number
[]
Current drag point in shape’s CCS
Source
dragPointGCS
dragPointGCS:
number
[]
Current drag point in shape’s GCS
Source
dragPrevPoint
dragPrevPoint:
number
[]
Previous drag point in shape’s LCS
Source
dragPrevPointCCS
dragPrevPointCCS:
number
[]
Previous drag point in shape’s CCS
Source
dragPrevPointGCS
dragPrevPointGCS:
number
[]
Previous drag point in shape’s GCS
Source
dragStartPoint
dragStartPoint:
number
[]
Drag start point in shape’s LCS
Source
dragStartPointCCS
dragStartPointCCS:
number
[]
Drag start point in shape’s CCS
Source
dragStartPointGCS
dragStartPointGCS:
number
[]
Drag start point in shape’s GCS
Source
dragging
dragging:
boolean
=false
Indicates whether this controller is dragging or not
Source
dx
dx:
number
=0
X-distance from dragStartPoint to dragPoint in shape’s LCS
Source
dxGCS
dxGCS:
number
=0
X-distance from dragStartPoint to dragPoint in GCS
Source
dxStep
dxStep:
number
=0
X-distance from dragPrevPoint to dragPoint in shape’s LCS
Source
dxStepGCS
dxStepGCS:
number
=0
X-distance from dragPrevPoint to dragPoint in GCS
Source
dy
dy:
number
=0
Y-distance from dragStartPoint to dragPoint in shape’s LCS
Source
dyGCS
dyGCS:
number
=0
Y-distance from dragStartPoint to dragPoint in GCS
Source
dyStep
dyStep:
number
=0
Y-distance from dragPrevPoint to dragPoint in shape’s LCS
Source
dyStepGCS
dyStepGCS:
number
=0
Y-distance from dragPrevPoint to dragPoint in GCS
Source
hasHandle
hasHandle:
boolean
=false
Indicates whether this controller has handles or not
Source
manipulator
manipulator:
Manipulator
Source
Methods
active()
active(
editor
,shape
):boolean
Indicates the controller is active or not
Parameters
• editor: Editor
• shape: Shape
Returns
boolean
Source
draw()
draw(
editor
,shape
):void
Draw controller
Parameters
• editor: Editor
• shape: Shape
Returns
void
Source
drawDragging()
drawDragging(
editor
,shape
,e
):void
Draw on dragging
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
void
Source
drawHovering()
drawHovering(
editor
,shape
,e
):void
Draw on hovering
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
void
Source
finalize()
finalize(
editor
,shape
,e
):void
Finalize shape by ghost
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
void
Source
initialize()
initialize(
editor
,shape
,e
):void
Initialize before dragging
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
void
Source
keyDown()
keyDown(
editor
,shape
,e
):boolean
Handle keydown event
Parameters
• editor: Editor
• shape: Shape
• e: KeyboardEvent
Returns
boolean
handled or not
Source
keyUp()
keyUp(
editor
,shape
,e
):boolean
Handle keyup event
Parameters
• editor: Editor
• shape: Shape
• e: KeyboardEvent
Returns
boolean
handled or not
Source
mouseCursor()
mouseCursor(
editor
,shape
,e
):null
| [string
,number
]
Returns mouse cursor for the controller
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
null
| [string
, number
]
cursor object (null is default cursor)
Source
mouseIn()
mouseIn(
editor
,shape
,e
):boolean
Returns true if mouse cursor is inside the controller. Default implementation returns true if the point inside the shape.
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
boolean
Source
pointerDown()
pointerDown(
editor
,shape
,e
):boolean
Handle pointer down event
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
boolean
handled or not
Source
pointerMove()
pointerMove(
editor
,shape
,e
):boolean
Handle pointer move event
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
boolean
handled or not
Source
pointerUp()
pointerUp(
editor
,shape
,e
):boolean
Handle pointer up event
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
boolean
handled or not
Source
reset()
reset():
void
Returns
void
Source
update()
update(
editor
,shape
,e
):void
Update ghost
Parameters
• editor: Editor
• shape: Shape
• e: CanvasPointerEvent
Returns
void