Configurator
Public Member Functions | List of all members
data_structures.Node Class Reference

Base class for tree displayable objects. More...

Inheritance diagram for data_structures.Node:
data_structures.Function data_structures.Module data_structures.Module_Use data_structures.Project data_structures.Register data_structures.Selection

Public Member Functions

def __init__
 Node Constructor
 
def parent_index_find
 Recursively find parent of self starting from root_node.
 
def show
 Method print self indented by indent.
 
def sub_node_append
 Append sub_node to the children sub nodes of self.
 
def xml_write
 Method writes self to out_stream indented by indent.
 

Detailed Description

Base class for tree displayable objects.

The Node class is a common base class used for sub-classes that need to be displayable in the GUI as a part of a tree widget.

Constructor & Destructor Documentation

def data_structures.Node.__init__ (   self,
  class_name,
  text,
  icon_name,
  sub_nodes,
  style 
)

Node Constructor

Parameters
selfNode object being initialized.
class_namestr The textual name of the sub-class.
textstr Text to show on tree widget
icon_namestr Name of the icon to show next to object (or None).
sub_nodeslist The list of sub-class object under this Node.
styleStyle object used for formatting.

This method initializes Node with the class_name (e.g. "Module_Use", "Selection", etc.), the icon name from the Icons directory, sub_nodes which is a list of Node object that constitute the children of self, and style which is a Style object that specifies the format of generated code.

Member Function Documentation

def data_structures.Node.parent_index_find (   self,
  root_node 
)

Recursively find parent of self starting from root_node.

Parameters
selfNode object to find parent of.
root_nodeNode object to start search from
Returns
The parent Node object (or None if not found.)

Since the Node class does not maintain parent back pointers, finding a parent object actually requires a recursive search from the top most root Node.

def data_structures.Node.show (   self,
  indent 
)

Method print self indented by indent.

Parameters
selfNode object to write out.
indentint that specifies how much to indent by.

This provides a quick and dirty interface for debugging.

def data_structures.Node.sub_node_append (   self,
  sub_node 
)

Append sub_node to the children sub nodes of self.

Parameters
selfNode to whose children to append to
sub_nodeNode to append children sub nodes

This method will append sub_node to the end of the list of children sub nodes of self.

def data_structures.Node.xml_write (   self,
  indent,
  out_stream 
)

Method writes self to out_stream indented by indent.

Parameters
selfNode object to write out.
indentint that specifies how much to indent by.
out_streamFile that specifies an output stream to write to.

This method will write self in XML format to out_stream indented by indent. This method should be overridden to provide the correct tags and attributes .


The documentation for this class was generated from the following file: