Package teamwork :: Package widgets :: Module fsa :: Class GraphWidget
[hide private]
[frames] | no frames]

Class GraphWidget

source code

bigwidgets.CanvasWidget --+
                          |
                         GraphWidget

Connect nodes and GraphEdgeWidgets into a graph.

Instance Methods [hide private]
 
__init__(self, canvas, nodes, edges, **attrs)
Create a new canvas widget.
source code
list of int
_tags(self)
Returns: a list of canvas tags for all graphical elements managed by this canvas widget, not including graphical elements managed by its child widgets.
source code
None
_update(self, child)
Make sure all edges/nodes are connected correctly.
source code
None
_manage(self)
Arrange the child widgets of this canvas widget.
source code
 
arrange(self, arrange_algorithm=None)
Set the node positions.
source code
 
_arrange_levels(self)
Re-arrange each level to (locally) minimize the number of crossing edges.
source code
 
_arrange_level(self, levelnum)
Arrange a given level..
source code
 
_arrange_into_levels(self)
Assign a level to each node.
source code
 
_reachable(self, node, reached=None)
How many *unexpanded* nodes can be reached from the given node?
source code
 
_add_descendants(self, parent_level, levelnum)
Add all the descendants of the nodes in the list parent_level to the structures self._level and self._nodelevel.
source code
 
_add_descendants_dfs(self, parent_level, levelnum) source code
 
_add_descendants_bfs(self, parent_level, levelnum) source code
 
_add_descendants_bfs2(self, parent_level, levelnum) source code

Inherited from bigwidgets.CanvasWidget: __getitem__, __repr__, __setitem__, bbox, bind_click, bind_drag, canvas, child_widgets, destroy, height, hidden, hide, manage, move, parent, show, tags, unbind_click, unbind_drag, update, width

Method Details [hide private]

__init__(self, canvas, nodes, edges, **attrs)
(Constructor)

source code 

Create a new canvas widget. This constructor should only be called by subclass constructors; and it should be called only after the subclass has constructed all graphical canvas objects and registered all child widgets.

Parameters:
  • canvas - This canvas widget's canvas.
  • parent - This canvas widget's hierarchical parent.
  • attribs - The new canvas widget's attributes.
  • edges (dictionary from (node, node) to label.)
Overrides: bigwidgets.CanvasWidget.__init__

_tags(self)

source code 
Returns: list of int
a list of canvas tags for all graphical elements managed by this canvas widget, not including graphical elements managed by its child widgets.
Overrides: bigwidgets.CanvasWidget._tags
(inherited documentation)

_update(self, child)

source code 

Make sure all edges/nodes are connected correctly.

Parameters:
  • child - The child that changed.
Returns: None
Overrides: bigwidgets.CanvasWidget._update

_manage(self)

source code 

Arrange the child widgets of this canvas widget. This method is called when the canvas widget is initially created. It is also called if the user calls the manage method on this canvas widget or any of its ancestors.

Returns: None
Overrides: bigwidgets.CanvasWidget._manage
(inherited documentation)

arrange(self, arrange_algorithm=None)

source code 

Set the node positions. This routine should attempt to minimize the number of crossing edges, in order to make the graph easier to read.

_arrange_level(self, levelnum)

source code 

Arrange a given level.. This algorithm is simple and pretty heuristic..