Constructor
new BoxConnector(parent, $canvas)
BoxConnector constructor
Name | Type | Description |
---|---|---|
parent | module:AWT. | The Container to which this BoxConnector belongs |
$canvas | external:jQuery | The HTML |
- Source
Members
DEFAULT_COMPOSITE_OP :string
The default composite operator
("source-over").
- string
- Source
active :boolean
true
while the connector is active
- boolean
- Source
arrow :boolean
When true
, the connector must end on arrowhead
- boolean
- Source
arrowAngle :number
The arrowhead angle
- number
- Source
arrowLength :number
The arrowhead length (in pixels)
- number
- Source
bgImg :external:HTMLImageElement
The background image, saved and redrawn on each movement
- Source
bgRect :module:AWT.Rectangle
The rectangle of ActivityPanel
saved in bgImg
- Source
bx :module:boxes/ActiveBox.ActiveBox
The ActiveBox to connect or move
- Source
compositeOp :string
The global composite operator used when drawing in XOR mode. Default is "difference".
For a list of possible values see:
https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
- string
- Source
ctx :external:CanvasRenderingContext2D
The Graphics context where the BoxConnector will paint
- Source
dest :module:AWT.Point
Current (while moving) and final position of the connector
- Source
dim :module:AWT.Dimension
The dimension of the HTML canvas where to draw
- Source
lineColor :string
The main color used in XOR operations
- string
- Source
linePainted :boolean
true
while the line has already been painted (used for XOR expressions)
- boolean
- Source
lineWidth :number
Width of the connector line
- number
- Source
origin :module:AWT.Point
Initial position of the connector
- Source
parent :module:AWT.Container
The container to which this connector belongs
- Source
relativePos :module:AWT.Point
Relative position of point B regarding A
- Source
xorColor :string
The complementary color used in XOR operations
- string
- Source
Methods
begin(pt, boxopt)
Starts the box connector operation
Name | Type | Attributes | Description |
---|---|---|---|
pt | module:AWT. | Starting point | |
box | module:boxes/ActiveBox. | <optional> | Passed only when the BoxConnector runs in drag&drop mode |
- Source
drawLine()
Strokes a line between origin
and dest
, optionally ended with an arrowhead.
- Source
end()
Finalizes the operation of this box connector until a new call to begin
- Source
moveBy(dx, dy)
Displaces the ending point of the connector
Name | Type | Description |
---|---|---|
dx | number | Displacement on the X axis |
dy | number | Displacement on the Y axis |
- Source
moveTo(pt, forcePaint)
Moves the ending point of the connector to a new position
Name | Type | Description |
---|---|---|
pt | module:AWT. | The new position |
forcePaint | boolean | When |
- Source