module:Connector(appInstance, gridSize, left, top)

parent class for input and output connectors

new module:Connector(appInstance, gridSize, left, top)

Parameters:
Name Type Description
appInstance App

link to the App instance that this connector will belong to

gridSize number

size of the grid in SVG pixels

left number

horizontal position defined in grid units (SVG pixels divided by the grid size)

top number

vertical position defined in grid units (SVG pixels divided by the grid size)

Extends

  • NetworkElement

Members

connectorOffset :number

offset of the connector from the grid in SVG pixels

connectorSize :number

size of the connector in SVG pixels

elementState :Logic.state

current logical state of this connector

gridSize :number

size of the grid in SVG pixels

isInputConnector :Boolean

this flag describes whether this connector is an input connector

isOutputConnector

whether this connector is an output connector

isOutputConnector

whether this connector is an output connector

state

get state of this connector

svgObj :svgObj

instance of svgObjects.svgObj that holds all SVG information about this connector

wireIds :Set

set of ids of all wires connected to this connector

Methods

addWireId(wireId)

add a wire id to the list of wire ids

Parameters:
Name Type Description
wireId string

get() → {svgObjects.Rectangle}

get svgObj instance content of this connector

Returns:
svgObjects.Rectangle

onMouseUp()

call wireCreationHelper on mouse up

removeWireId(wireId)

remove a wire id from the list of wire ids

Parameters:
Name Type Description
wireId string

removeWireIdAndUpdate(wireId)

remove a wire specified by ID and update the connector

Parameters:
Name Type Description
wireId string

ID of the wire to be removed

setState(state)

set logical state of the connector

Parameters:
Name Type Description
state Logic.state

new state of the connector