Connector
The connector class defines how an output can be connected to an input. It appears on the screen as a black line extending from an output to an input.
Constructor Summary
Public Constructor | ||
public |
constructor(values: object) The constructor function. |
Member Summary
Public Members | ||
public |
[key]: * Assign each of the values in values as this.key |
|
public |
The type of this connector |
|
public |
The first attachment point this connector is connected to (an ouput) |
|
public |
The second attachment point this connector is connected to (an input) |
|
public |
The connectors current color |
|
public |
endX: * The s cordinate of the end of the connector. |
|
public |
endY: * The y cordinate of the end of the connector. |
|
public |
True if the connector is currently being created and is in the process of extending |
|
public |
True if this connector has been selected |
|
public |
The starting X cordinate for the connector. |
|
public |
The starting Y cordinate for the connector. |
Method Summary
Public Methods | ||
public |
clickMove runs while the connector is being created. |
|
public |
clickUp checks to see if the mouse button has been released over an input attachment point. |
|
public |
deleteSelf(silent: boolean) Deletes the connector by calling its attachmentPoints to tell them to delete their references to this connector. |
|
public |
draw() Draw the connector as a bezier curve on the screen |
|
public |
Called when any key is pressed. |
|
public |
loadTree(): * Sets all the input and output values to match their associated atoms. |
|
public |
Pass the value of the attached output to the attached input |
|
public |
serialize(): * Generates an object used to save the connector. |
|
public |
update() Computes the connectors position and draw it to the screen. |
|
public |
Passes a lock call to the connected input. |
|
public |
walkBackForConstants(callback: *) Used to walk back out the tree generating a list of constants...used for evolve |
Public Constructors
Public Members
public attachmentPoint1: object source
The first attachment point this connector is connected to (an ouput)
public attachmentPoint2: object source
The second attachment point this connector is connected to (an input)
public isMoving: boolean source
True if the connector is currently being created and is in the process of extending
Public Methods
public clickMove(x: number, y: number) source
clickMove runs while the connector is being created. As long as the mouse is pressed down, the end of the connector stays attached to the mouse.
public clickUp(x: number, y: number) source
clickUp checks to see if the mouse button has been released over an input attachment point. If it has then the connector is created there. If not, then the connector is deleted.
public deleteSelf(silent: boolean) source
Deletes the connector by calling its attachmentPoints to tell them to delete their references to this connector.
Params:
Name | Type | Attribute | Description |
silent | boolean |
|
public keyPress(key: string) source
Called when any key is pressed. If the key is delete or backspace and the connector is selected then the connector is deleted.
Params:
Name | Type | Attribute | Description |
key | string | The key which was pressed |
public loadTree(): * source
Sets all the input and output values to match their associated atoms.
Return:
* |
public walkBackForConstants(callback: *) source
Used to walk back out the tree generating a list of constants...used for evolve
Params:
Name | Type | Attribute | Description |
callback | * |