WireItLibrary

WireIt  0.6.0

WireItLibrary > WireIt > WireIt.Terminal
Search:
 
Filters

Class WireIt.Terminal

Known Subclasses:
WireIt.util.TerminalOutput WireIt.util.TerminalInput
Terminals represent the end points of the "wires"

Constructor

WireIt.Terminal ( parentEl , options , container )
Parameters:
parentEl <HTMLElement> Element that will contain the terminal
options <Object> Configuration object
container <WireIt.Container> (Optional) Container containing this terminal

Properties

alwaysSrc - Boolean

forces this terminal to be the src terminal in the wire config
Default Value: false

className - String

CSS class name for the terminal element
Default Value: "WireIt-Terminal"

connectedClassName - String

CSS class added to the terminal when it is connected
Default Value: "WireIt-connected"

container - WireIt.Container

Container (optional). Parent container of this terminal

ddConfig - Object

configuration of the WireIt.TerminalProxy object
Default Value: {}

direction - Array

direction vector of the wires when connected to this terminal
Default Value: [0,1]

dropinviteClassName - String

CSS class added for drop invitation
Default Value: "WireIt-dropinvite"

editable - Boolean

boolean that makes the terminal editable
Default Value: true

editingWireConfig - Object

Options for the wires connected to this terminal
Default Value: {}

el - {HTMLElement}

DIV dom element that will display the Terminal

fakeDirection - Array

direction vector of the "editing" wire when it started from this terminal
Default Value: [0,-1]

name - String

Name of the terminal
Default Value: null

nMaxWires - Integer

maximum number of wires for this terminal
Default Value: Infinity

offsetPosition - Array

offset position from the parentEl position. Can be an array [top,left] or an object {left: 100, bottom: 20} or {right: 10, top: 5} etc...
Default Value: null

parentEl - DOMElement

DOM parent element

wireConfig - Object

Options for the wires connected to this terminal
Default Value: {}

wires - Array

List of the associated wires

xtype - String

String representing this class for exporting as JSON
Default Value: "WireIt.Terminal"

Methods

addWire

void addWire ( wire )
Add a wire to this terminal.
Parameters:
wire <WireIt.Wire> Wire instance to add

getConnectedTerminals

Array getConnectedTerminals ( )
Returns a list of all the terminals connecter to this terminal through its wires.
Returns: Array
List of all connected terminals

getXY

void getXY ( )
This function is a temporary test. I added the border width while traversing the DOM and I calculated the offset to center the wire in the terminal just after its creation

redrawAllWires

void redrawAllWires ( )
Redraw all the wires connected to this terminal

remove

void remove ( )
Remove the terminal from the DOM

removeAllWires

void removeAllWires ( )
Remove all wires

removeWire

void removeWire ( wire )
Remove a wire
Parameters:
wire <WireIt.Wire> Wire instance to remove

render

void render ( )
Render the DOM of the terminal

setDropInvitation

void setDropInvitation ( display )
Show or hide the drop invitation. (by adding/removing this.options.dropinviteClassName CSS class)
Parameters:
display <Boolean> Show the invitation if true, hide it otherwise

setOptions

void setOptions ( )
Set the options by putting them in this (so it overrides the prototype default)

setPosition

void setPosition ( )
TODO

Events

eventAddWire

eventAddWire ( )
Event that is fired when a wire is added You can register this event with myTerminal.eventAddWire.subscribe(function(e,params) { var wire=params[0];}, scope);

eventRemoveWire

eventRemoveWire ( )
Event that is fired when a wire is removed You can register this event with myTerminal.eventRemoveWire.subscribe(function(e,params) { var wire=params[0];}, scope);


Copyright © 2010 Eric Abouaf All rights reserved.