Package NetworkEditor :: Module macros :: Class MacroNode
[hide private]
[frames] | no frames]

Class MacroNode

source code

                            MacroBase --+
                                        |
               object --+               |
                        |               |
itemBase.NetworkItemsBase --+           |
                            |           |
        itemBase.NetworkItems --+       |
                                |       |
            items.NetworkNodeBase --+   |
                                    |   |
                    items.NetworkNode --+
                                        |
                                       MacroNode

Instance Methods [hide private]
  __init__(self, name='NoName', sourceCode=None, originalClass=None, constrkw={}, library=None, progbar=0, **kw)
  isMacro(self)
Returns False if this node is not a MacroNode, returns True if MacroNode
  schedule_cb(self, event=None)
  beforeRemovingFromNetwork(self)
  beforeAddingToNetwork(self, network)
  afterAddingToNetwork(self)
  buildIcons(self, canvas, posx, posy)
Build NODE icon with ports etc
  expand(self, event=None)
  shrink(self, event=None)
  getRootMacro(self)
This method is used to find the root macro node for nested macros
  getNodeDefinitionSourceCode(self, networkName, indent="", ignoreOriginal=False)
This method builds the text-string to describe a macro node in a saved file.
  getNodeSourceCodeForPorts(self, networkName, indent="", full=0)
We need to override the baseclass method since we do not want to save port modifications to a macro node
  getAfterConnectionsSourceCode(self, networkName, indent="", ignoreOriginal=False)
This method allows users to add source code that needs to be generated after nodes were connected, which might trigger the creation of new ports.
  resetTags(self)
This method subclasses NetworkNode.resetTags().
  buildOriginalList(self)
Summary: used to catch delete node and delete connection events in the macro network.
  getNodeSourceCode(self, className, networkName='self.masterNetwork', indent="", dependencies=True)
This method is called through the 'save source code' mechanism.
  getHeaderBlock(self, className, indent="")
Generate source code to import a node from a library or file.
  getInitBlock(self, className, indent="")
Generate source code to define the __init__() method of the node, building the correct constrkw dict, etc.
  getBeforeBlock(self, cache, indent="")
  getAfterBlock(self, cache, networkName, indent="", ignoreOriginal=False)

Inherited from MacroBase: deletePort, updateCode

Inherited from items.NetworkNode: addInputPort, addOutputPort, addSpecialPorts, buildNodeIcon, buildSmallIcon, deletePortByName, deleteSmallIcon, deselect, editorVisible, getColor, getFont, hideSpecialPorts, isExpanded, refreshInputPortData, resizeIcon, select, setColor, setFont, setModifiedTag, setProgressBar, showSpecialPorts, updatePosXPosY

Inherited from items.NetworkNodeBase: addSaveNodeMenuEntries, autoResize, autoResizeX, autoResizeY, checkIfNodeForSavingIsDefined, compareToOrigNodeDescr, computeFunction, configure, cut_cb, delete_cb, edit, editComputeFunction_cb, evalString, getComputeFunctionSourceCode, getConnections, getDescr, getInConnections, getInputPortByName, getNodeSourceCodeForDoit, getNodeSourceCodeForInstanciation, getNodeSourceCodeForModifications, getNodeSourceCodeForNode, getNodeSourceCodeForWidgetValue, getNodeSourceCodeForWidgets, getOutConnections, getOutputPortByName, getOutputPortByType, getPortsCreationSourceCode, getSize, getSourceCode, getSpecialInputPortByName, getSpecialOutputPortByName, getStateDefinitionCode, getUniqueNodeName, getWidgetByName, getWidgetsCreationSourceCode, getWidgetsForMaster, getWidthForLabel, getWidthForNodeWidgets, getWidthForPorts, growDown, growRight, hideInNodeWidgets, isModified, ischild, move, moveSelectedNodeEnd, outputData, rename, resetModifiedTag, safeName, saveSource, saveSource_cb, schedule, scheduleChildren, setFunction, showInNodeWidgets, startMoveOneNode, toggleNodeExpand_cb, toggleParamPanel_cb

Inherited from itemBase.NetworkItems: __repr__, afterRemovingFromNetwork, deleteIcon, editNodeMenu, freeze, gettags, hideParamPanel, highlight, introspect, postItemMenu, run, toggleAutoRun_cb, toggleFrozen_cb, unfreeze, unhighlight

Inherited from itemBase.NetworkItems (private): _introspectCB

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='NoName', sourceCode=None, originalClass=None, constrkw={}, library=None, progbar=0, **kw)
(Constructor)

source code 
None
Overrides: items.NetworkNode.__init__

isMacro(self)

source code 
Returns False if this node is not a MacroNode, returns True if MacroNode
Overrides: items.NetworkNodeBase.isMacro

schedule_cb(self, event=None)

source code 
None
Overrides: items.NetworkNodeBase.schedule_cb

beforeRemovingFromNetwork(self)

source code 
None
Overrides: itemBase.NetworkItems.beforeRemovingFromNetwork

beforeAddingToNetwork(self, network)

source code 
None
Overrides: itemBase.NetworkItems.beforeAddingToNetwork

afterAddingToNetwork(self)

source code 
None
Overrides: itemBase.NetworkItems.afterAddingToNetwork

buildIcons(self, canvas, posx, posy)

source code 
Build NODE icon with ports etc
Overrides: items.NetworkNodeBase.buildIcons
(inherited documentation)

expand(self, event=None)

source code 
None

shrink(self, event=None)

source code 
None

getRootMacro(self)

source code 
This method is used to find the root macro node for nested macros

getNodeDefinitionSourceCode(self, networkName, indent="", ignoreOriginal=False)

source code 
This method builds the text-string to describe a macro node in a saved file.
Overrides: items.NetworkNodeBase.getNodeDefinitionSourceCode

getNodeSourceCodeForPorts(self, networkName, indent="", full=0)

source code 
We need to override the baseclass method since we do not want to save port modifications to a macro node
Overrides: items.NetworkNodeBase.getNodeSourceCodeForPorts

getAfterConnectionsSourceCode(self, networkName, indent="", ignoreOriginal=False)

source code 
This method allows users to add source code that needs to be generated after nodes were connected, which might trigger the creation of new ports.
Overrides: items.NetworkNodeBase.getAfterConnectionsSourceCode

resetTags(self)

source code 
This method subclasses NetworkNode.resetTags(). Used to reset the attributes _modified and _original in node, ports, widgets, conn
Overrides: items.NetworkNodeBase.resetTags

buildOriginalList(self)

source code 
Summary: used to catch delete node and delete connection events in the macro network. Puts nodes and connections into the macronetwork._originalNodes and macronetwork._originalConnections lists. This is used to find out if a node or connection in a macro network of a macro node that came from a node library was deleted.

getNodeSourceCode(self, className, networkName='self.masterNetwork', indent="", dependencies=True)

source code 
This method is called through the 'save source code' mechanism.

The idea here is to generate source code for a macro network that can
be put into a node library. This is not for saving networks

dependencies: True/False
    False: the saved macro node is fully independent from it's original macro (if any). 
    True : if relevant, the macro node is saved as a subclass of an original 
           macro, only modifications from the original are saved (not implemented yet) 

    in both case, saved macros depend as well of other embeded macros and of nodes from libraries. 

Overrides: items.NetworkNodeBase.getNodeSourceCode

getHeaderBlock(self, className, indent="")

source code 
Generate source code to import a node from a library or file.
Overrides: items.NetworkNodeBase.getHeaderBlock
(inherited documentation)

getInitBlock(self, className, indent="")

source code 
Generate source code to define the __init__() method of the node, building the correct constrkw dict, etc.
Overrides: items.NetworkNodeBase.getInitBlock
(inherited documentation)

getBeforeBlock(self, cache, indent="")

source code 
None

getAfterBlock(self, cache, networkName, indent="", ignoreOriginal=False)

source code 
None