import AttachmentPoint from 'canvas-template/src/js/prototypes/attachmentpoint.js'
AttachmentPoint
This class creates a new attachmentPoint which are the input and output blobs on Atoms
Constructor Summary
Public Constructor | ||
public |
constructor(values: object) The constructor function. |
Member Summary
Public Members | ||
public |
[key]: * Assign values in values as this.x |
|
public |
The attachment point type. |
|
public |
A list of all of the connectors attached to this attachment point |
|
public |
The default offset position in X referenced to the center of the parent atom. |
|
public |
The default offset position in Y referenced to the center of the parent atom. |
|
public |
This atom's default radius (non hover) |
|
public |
The default value to be used by the ap when nothing is attached |
|
public |
A flag to indicate if this attachment point is currently expanded. |
|
public |
When the mouse is hovering where should the AP move in X |
|
public |
When the mouse is hovering where should the AP move in Y |
|
public |
The current offset position in X referenced to the center of the parent atom. |
|
public |
The current offset position in Y referenced to the center of the parent atom. |
|
public |
This is a flag to indicate if the attachment point is of the primary type. |
|
public |
This atom's current radius as displayed. |
|
public |
A flag to indicate if the attachment point is currently ready. |
|
public |
A flag to determine if the hover text is shown next to the attachment point. |
|
public |
The attachment point type. |
|
public |
A unique identifying number for this attachment point |
|
public |
The attachment point current value. |
|
public |
The attachment point value type. |
|
public |
The attachment points X position |
|
public |
The attachment point's Y position |
Method Summary
Public Methods | ||
public |
Attaches a new connector to this ap |
|
public |
Starts propagation from this attachmentPoint if it is not waiting for anything up stream. |
|
public |
Handles mouse click down. |
|
public |
Handles mouse click and move to expand the AP. |
|
public |
Handles mouse click up. |
|
public |
deleteConnector(connector: string) Delete a target connector which is passed in. |
|
public |
deleteSelf(silent: boolean) Delete any connectors attached to this ap |
|
public |
draw() Draws the attachment point on the screen. |
|
public |
Handles mouse click down. |
|
public |
getValue(): * Reads and returns the current value of the ap. |
|
public |
Just passes a key press to the attached connectors. |
|
public |
loadTree(): * Sets all the input and output values to match their associated atoms. |
|
public |
reset() I'm not sure what this does. Can it be deleted? |
|
public |
Restores the ap to it's default value. |
|
public |
setValue(newValue: *) Sets the current value of the ap. |
|
public |
update() Computes the curent position and then draws the ap on the screen. |
|
public |
updateDefault(newDefault: *) Updates the default value for the ap. |
|
public |
Passes a lock command to the parent molecule, or to the attached connector depending on input/output. |
|
public |
wasConnectionMade(x: number, y: number): boolean Can be called to see if the target coordinates are within this ap. |
Public Constructors
Public Members
public defaultOffsetX: number source
The default offset position in X referenced to the center of the parent atom.
public defaultOffsetY: number source
The default offset position in Y referenced to the center of the parent atom.
public expandedRadius: boolean source
A flag to indicate if this attachment point is currently expanded.
public offsetX: number source
The current offset position in X referenced to the center of the parent atom.
public offsetY: number source
The current offset position in Y referenced to the center of the parent atom.
public primary: boolean source
This is a flag to indicate if the attachment point is of the primary type. Primary type inputs are of the form geometry.translate(input2, input3, input4) for example This value is useful for importing molecules into other formats. I don't know if this is used any more. Maybe it can be deleted.
public ready: string source
A flag to indicate if the attachment point is currently ready. Used to order initilization when program is loaded.
public showHoverText: boolean source
A flag to determine if the hover text is shown next to the attachment point.
Public Methods
public attach(connector: object) source
Attaches a new connector to this ap
Params:
Name | Type | Attribute | Description |
connector | object | The connector to attach |
public beginPropagation() source
Starts propagation from this attachmentPoint if it is not waiting for anything up stream.
public clickDown(x: number, y: number, clickProcessed: boolean): boolean source
Handles mouse click down. If the click is inside the AP it's connectors are selected if it is an input.
public clickMove(x: number, y: number) source
Handles mouse click and move to expand the AP. Could this be done with a call to expand out?
public clickUp(x: number, y: number) source
Handles mouse click up. If the click is inside the AP and a connector is currently extending, then a connection is made
public deleteConnector(connector: string) source
Delete a target connector which is passed in. The default option is to delete all of the connectors.
Params:
Name | Type | Attribute | Description |
connector | string |
|
public deleteSelf(silent: boolean) source
Delete any connectors attached to this ap
Params:
Name | Type | Attribute | Description |
silent | boolean |
|
public expandOut(cursorDistance: number) source
Handles mouse click down. If the click is inside the AP it's connectors are selected if it is an input.
Params:
Name | Type | Attribute | Description |
cursorDistance | number | The distance the cursor is from the attachment point. |
public keyPress(key: string) source
Just passes a key press to the attached connectors. No impact on the connector.
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 setValue(newValue: *) source
Sets the current value of the ap. Force forces an update even if the value hasn't changed.
Params:
Name | Type | Attribute | Description |
newValue | * |
public updateDefault(newDefault: *) source
Updates the default value for the ap.
Params:
Name | Type | Attribute | Description |
newDefault | * |
public waitOnComingInformation() source
Passes a lock command to the parent molecule, or to the attached connector depending on input/output.