Home Reference Source
public class | source

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

attach(connector: object)

Attaches a new connector to this ap

public

Starts propagation from this attachmentPoint if it is not waiting for anything up stream.

public

clickDown(x: number, y: number, clickProcessed: boolean): boolean

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

expandOut(cursorDistance: number)

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

Can be called to see if the target coordinates are within this ap.

Public Constructors

public constructor(values: object) source

The constructor function.

Params:

NameTypeAttributeDescription
values object

An array of values passed in which will be assigned to the class as this.x

Public Members

public [key]: * source

Assign values in values as this.x

public atomType: string source

The attachment point type.

public connectors: object source

A list of all of the connectors attached to this attachment point

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 defaultRadius: number source

This atom's default radius (non hover)

public defaultValue: string source

The default value to be used by the ap when nothing is attached

public expandedRadius: boolean source

A flag to indicate if this attachment point is currently expanded.

public hoverOffsetX: number source

When the mouse is hovering where should the AP move in X

public hoverOffsetY: number source

When the mouse is hovering where should the AP move in Y

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 radius: number source

This atom's current radius as displayed.

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 type: string source

The attachment point type. Options are input, output.

public uniqueID: number source

A unique identifying number for this attachment point

public value: number source

The attachment point current value.

public valueType: string source

The attachment point value type. Options are number, geometry, array.

public x: number source

The attachment points X position

public y: number source

The attachment point's Y position

Public Methods

public attach(connector: object) source

Attaches a new connector to this ap

Params:

NameTypeAttributeDescription
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.

Params:

NameTypeAttributeDescription
x number

The x coordinate of the click

y number

The y coordinate of the click

clickProcessed boolean

Has the click already been handled

Return:

boolean

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?

Params:

NameTypeAttributeDescription
x number

The x coordinate of the click

y number

The y coordinate of the click

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

Params:

NameTypeAttributeDescription
x number

The x coordinate of the click

y number

The y coordinate of the click

public deleteConnector(connector: string) source

Delete a target connector which is passed in. The default option is to delete all of the connectors.

Params:

NameTypeAttributeDescription
connector string
  • optional
  • default: all

public deleteSelf(silent: boolean) source

Delete any connectors attached to this ap

Params:

NameTypeAttributeDescription
silent boolean
  • optional
  • default: false

public draw() source

Draws the attachment point on the screen. Called with each frame.

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:

NameTypeAttributeDescription
cursorDistance number

The distance the cursor is from the attachment point.

public getValue(): * source

Reads and returns the current value of the ap.

Return:

*

public keyPress(key: string) source

Just passes a key press to the attached connectors. No impact on the connector.

Params:

NameTypeAttributeDescription
key string

The key which was pressed

public loadTree(): * source

Sets all the input and output values to match their associated atoms.

Return:

*

public reset() source

I'm not sure what this does. Can it be deleted?

public setDefault() source

Restores the ap to it's default value.

public setValue(newValue: *) source

Sets the current value of the ap. Force forces an update even if the value hasn't changed.

Params:

NameTypeAttributeDescription
newValue *

public update() source

Computes the curent position and then draws the ap on the screen.

public updateDefault(newDefault: *) source

Updates the default value for the ap.

Params:

NameTypeAttributeDescription
newDefault *

public waitOnComingInformation() source

Passes a lock command to the parent molecule, or to the attached connector depending on input/output.

public wasConnectionMade(x: number, y: number): boolean source

Can be called to see if the target coordinates are within this ap. Returns true/false.

Params:

NameTypeAttributeDescription
x number

The x coordinate of the target

y number

The y coordinate of the target

Return:

boolean