Package NetworkEditor :: Module ports :: Class Port
[hide private]
[frames] | no frames]

Class Port

source code

               object --+        
                        |        
itemBase.NetworkItemsBase --+    
                            |    
        itemBase.NetworkItems --+
                                |
                               Port
Known Subclasses:
InputPort, OutputPort, SpecialInputPort, SpecialOutputPort

base class for input/output ports of network nodes

Instance Methods [hide private]
  __init__(self, name, node, datatype='None', balloon=None, width=None, height=None, beforeConnect=None, afterConnect=None, beforeDisconnect=None, afterDisconnect=None, hasHiddenConnections=False, shape=None, color=None, originalDatatype=None)
  setCallback(self, code, key)
set callbacks for connect & disconnect evens.
  editorVisible(self)
returns True if the port's Editor is visible
  getDatatypeObjectFromDatatype(self, datatype)
  setDataType(self, datatype, tagModified=True, makeOriginal=False)
set the port's data type.
  __repr__(self)
repr(x)
  getColor(self)
  setColor(self, color)
  getCenterCoords(self)
  buildIcons(self, resize=True)
method to be implmented by subclass this method should create the geometric primitives for this item and tag them all with self.iconTag define its uniqueTag set its tags
  showData(self)
  openDataViewer(self)
  dismiss(self, event=None)
  clearDataView(self)
  getDataStr(self, maxLen=None)
  updateDataView(self)
  browseData(self)
open introspect GUI
  _introspectCB(self)
helper method used for the introspect data GUI
  edit(self, event=None)
  typeName(self, t)
  deleteIcon(self)
deleting the port's icon
  datatypeStr(self)
  createIcon(self, pcx=None, pcy=None)
  destroyIcon(self)
called by net.deleteNodes(): delete port menu, delete port icon
  computePortPosX(self)
compute offset from left.
  destinationPortsCoords(self, tag)
  getDescr(self)
Returns a dictionnary providing the port's configuration.
  configure(self, redo=1, **kw)
configure a Port object.
  updateIconPosition(self)
move this icon to new location, also update connections
  startConnectRubberBand(self, event)
  drawRubberBand(self, event=None)
  connectNodesEnd(self, event=None)
  createConnection(self, port1, port2, **kw)
  compareToOrigPortDescr(self)
Compare this port to the original portDescr defined in a given network node base class and return a dictionary with the differences

Inherited from itemBase.NetworkItems: afterAddingToNetwork, afterRemovingFromNetwork, beforeAddingToNetwork, beforeRemovingFromNetwork, deletePort, deselect, editNodeMenu, freeze, gettags, hideParamPanel, highlight, introspect, postItemMenu, rename, run, schedule_cb, select, toggleAutoRun_cb, toggleFrozen_cb, unfreeze, unhighlight

Inherited from itemBase.NetworkItemsBase: delEditor, getEditor, setEditor

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__


Properties [hide private]

Inherited from itemBase.NetworkItemsBase: editor

Inherited from object: __class__


Method Details [hide private]

__init__(self, name, node, datatype='None', balloon=None, width=None, height=None, beforeConnect=None, afterConnect=None, beforeDisconnect=None, afterDisconnect=None, hasHiddenConnections=False, shape=None, color=None, originalDatatype=None)
(Constructor)

source code 
None
Overrides: itemBase.NetworkItems.__init__

setCallback(self, code, key)

source code 
set callbacks for connect & disconnect evens. The dictionary self.callbacks holds the various callback methods key: name of the callback (such as 'beforeConnect') code: source code of the callback

editorVisible(self)

source code 
returns True if the port's Editor is visible

getDatatypeObjectFromDatatype(self, datatype)

source code 
None

setDataType(self, datatype, tagModified=True, makeOriginal=False)

source code 
set the port's data type. Update Port's icon if visible

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: itemBase.NetworkItems.__repr__

getColor(self)

source code 
None

setColor(self, color)

source code 
None

getCenterCoords(self)

source code 
None

buildIcons(self, resize=True)

source code 
method to be implmented by subclass this method should create the geometric primitives for this item and tag them all with self.iconTag define its uniqueTag set its tags
Overrides: itemBase.NetworkItems.buildIcons
(inherited documentation)

showData(self)

source code 
None

openDataViewer(self)

source code 
None

dismiss(self, event=None)

source code 
None

clearDataView(self)

source code 
None

getDataStr(self, maxLen=None)

source code 
None

updateDataView(self)

source code 
None

browseData(self)

source code 
open introspect GUI

_introspectCB(self)

source code 
helper method used for the introspect data GUI
Overrides: itemBase.NetworkItems._introspectCB

edit(self, event=None)

source code 
None

typeName(self, t)

source code 
None

deleteIcon(self)

source code 
deleting the port's icon
Overrides: itemBase.NetworkItems.deleteIcon

datatypeStr(self)

source code 
None

createIcon(self, pcx=None, pcy=None)

source code 
None

destroyIcon(self)

source code 
called by net.deleteNodes(): delete port menu, delete port icon

computePortPosX(self)

source code 
compute offset from left. Convention: if a port is invisible, we set this port's relposx to the values of the last visible port left of this port, or to 0 and 0, if all ports left of it are invisible Note: relposx is the center of a port icon, not the left or right edge

destinationPortsCoords(self, tag)

source code 
None

getDescr(self)

source code 
Returns a dictionnary providing the port's configuration.

configure(self, redo=1, **kw)

source code 
configure a Port object. This also sets the port's attribute
        _modified=True. Supports the folloing keywords:
width     : icon width (int)
height    : icon on height (int)
name      : port name (string)
balloon   : tooltip describing data (string)
datatype  : datatype (string or data type object)

updateIconPosition(self)

source code 
move this icon to new location, also update connections

startConnectRubberBand(self, event)

source code 
None

drawRubberBand(self, event=None)

source code 
None

connectNodesEnd(self, event=None)

source code 
None

createConnection(self, port1, port2, **kw)

source code 
None

compareToOrigPortDescr(self)

source code 
Compare this port to the original portDescr defined in a given network node base class and return a dictionary with the differences