Class ConnectionPoint
Defined in: connections.js.
Constructor Attributes | Constructor Name and Description |
---|---|
ConnectionPoint(parentId, point, id, type)
A connection point that is attached to a figure and can accept connectors
|
Field Attributes | Field Name and Description |
---|---|
Current connection point color
|
|
Connection point id
|
|
<static> |
ConnectionPoint.NORMAL_COLOR
Color used by default to draw the connection point
|
Serialization type
|
|
Parent id (id of the Figure or Connector)
|
|
The {Point} that is behind this ConnectionPoint
|
|
Radius of the connection point
|
|
<static> |
ConnectionPoint.RADIUS
Connection point default radius
|
Type of ConnectionPoint.
|
|
<static> |
ConnectionPoint.TYPE_CONNECTOR
Connection point (liked to)/ type connector
|
<static> |
ConnectionPoint.TYPE_FIGURE
Connection point (liked to)/ type figure
|
Method Attributes | Method Name and Description |
---|---|
contains(x, y)
Tests to see if a point (x, y) is within a range of current ConnectionPoint
|
|
equals(anotherConnectionPoint)
Compares to another ConnectionPoint
|
|
Highlight the connection point
|
|
<static> |
ConnectionPoint.load(o)
Creates a {ConnectionPoint} out of JSON parsed object
|
<static> |
ConnectionPoint.loadArray(v)
Creates a an {Array} of {ConnectionPoint} out of JSON parsed array
|
near(x, y, radius)
Tests to see if a point (x, y) is within a specified range of current ConnectionPoint
|
|
paint(context)
Paints the ConnectionPoint into a Context
|
|
toString()
A String representation of the point
|
|
transform(matrix)
Transform the ConnectionPoint through a Matrix
|
|
Un-highlight the connection point
|
Class Detail
ConnectionPoint(parentId, point, id, type)
A connection point that is attached to a figure and can accept connectors
Author: Zack Newsham, Alex Gheorghiu .
Author: Zack Newsham
- Parameters:
- {Number} parentId
- - the parent to which this ConnectionPoint is attached. It can be either a {Figure} or a {Connector}
- {Point} point
- - coordinate of this connection point, better than using x and y, because when we move "snap to" this connectionPoint the line will follow
- {Number} id
- - unique id to the parent figure
- {String} type
- - the type of the parent. It can be either 'figure' or 'connector'
Field Detail
color
Current connection point color
id
Connection point id
<static>
ConnectionPoint.NORMAL_COLOR
Color used by default to draw the connection point
oType
Serialization type
parentId
Parent id (id of the Figure or Connector)
point
The {Point} that is behind this ConnectionPoint
radius
Radius of the connection point
<static>
ConnectionPoint.RADIUS
Connection point default radius
type
Type of ConnectionPoint. Ex: ConnectionPoint.TYPE_FIGURE
<static>
ConnectionPoint.TYPE_CONNECTOR
Connection point (liked to)/ type connector
<static>
ConnectionPoint.TYPE_FIGURE
Connection point (liked to)/ type figure
Method Detail
{Boolean}
contains(x, y)
Tests to see if a point (x, y) is within a range of current ConnectionPoint
Author: Alex Gheorghiu.
Author: Alex Gheorghiu
- Parameters:
- {Numeric} x
- - the x coordinate of tested point
- {Numeric} y
- - the x coordinate of tested point
- Returns:
- {Boolean} - true if inside, false otherwise
{Boolean}
equals(anotherConnectionPoint)
Compares to another ConnectionPoint
- Parameters:
- {ConnectionPoint} anotherConnectionPoint
- - the other connection point
- Returns:
- {Boolean} - true if equals, false otherwise
highlight()
Highlight the connection point
<static>
{ConnectionPoint}
ConnectionPoint.load(o)
Creates a {ConnectionPoint} out of JSON parsed object
Author: Alex Gheorghiu.
Author: Alex Gheorghiu
- Parameters:
- {JSONObject} o
- - the JSON parsed object
- Returns:
- {ConnectionPoint} a newly constructed ConnectionPoint
<static>
{Array}
ConnectionPoint.loadArray(v)
Creates a an {Array} of {ConnectionPoint} out of JSON parsed array
Author: Alex Gheorghiu.
Author: Alex Gheorghiu
- Parameters:
- {JSONObject} v
- - the JSON parsed {Array}
- Returns:
- {Array} of newly loaded {ConnectionPoint}s
{Boolean}
near(x, y, radius)
Tests to see if a point (x, y) is within a specified range of current ConnectionPoint
Author: Alex Gheorghiu.
Author: Alex Gheorghiu
- Parameters:
- {Numeric} x
- - the x coordinate of tested point
- {Numeric} y
- - the x coordinate of tested point
- {Numeric} radius
- - the radius around this point
- Returns:
- {Boolean} - true if inside, false otherwise
paint(context)
Paints the ConnectionPoint into a Context
- Parameters:
- {Context} context
- - the 2D context
toString()
A String representation of the point
transform(matrix)
Transform the ConnectionPoint through a Matrix
- Parameters:
- {Matrix} matrix
- - the transformation matrix
unhighlight()
Un-highlight the connection point