The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Gtk2::Ex::MindMapView::Graph - Manages a directed graph.

VERSION

This document describes Gtk2::Ex::MindMapView::Graph

SYNOPSIS

use Gtk2::Ex::MindMapView::Graph;

DESCRIPTION

This is internal to Gtk2::Ex::MindMapView. It's a wrapper around Jarkko Heitaniemi's nice Graph module. This module is instantiated by Gtk2::Ex::MindMapView.

INTERFACE

Gtk2::Ex::MindMapView::Graph->new()

Create a Gtk2::Ex::MindMapView::Graph.

add ($item)

Add a root Gtk2::Ex::MindMapView::Item to the graph. Only one of these may be added, or you will get an error.

add ($predecessor_item, $item)

Add a Gtk2::Ex::MindMapView::Item to the graph. Attach the item to the predecessor item.

get_root()

Return the root item of the graph.

has_item($item)

Return true if the graph contains the item.

num_items($item)

Return the number of items in the graph.

predecessors($item)

Return the predecessor items of a given Gtk2::Ex::MindMapView::Item.

remove ($item)

Remove a Gtk2::Ex::MindMapView::Item from the graph. Attach any successor items that the item may have had to the items predecessor.

set_root ($item)

Change the root item in the graph. An new graph is created with the new root.

successors ($item)

Return the successor items of a given Gtk2::Ex::MindMapView::Item.

traverse_DFS ($item, $callback)

Perform a depth-first traversal of the graph, repeatedly calling the callback.

The traversal algorithm given in Graph.pm returns items in an unpredictable order which causes the items in the mind map to be placed differently each time the map is redrawn. So we use our own method that returns items in the same order. Need to do something about all these traversal routines.

traverse_BFS ($item, $callback)

Perform a breadth-first traversal of the graph, repeatedly calling the callback.

The traversal algorithm given in Graph.pm returns items in an unpredictable order which causes the items in the mind map to be placed differently each time the map is redrawn. So we use our own method that returns items in the same order. Need to do something about all these traversal routines.

traverse_preorder_edge($predecessor_item, $item, $callback)

Perform a depth first traversal and pass back the predecessor item as well as the item to the callback. Need to do something about all these traversal routines.

traverse_postorder_edge($predecessor_item, $item, $callback)

Perform a depth first traversal and pass back the predecessor item as well as the item to the callback. Need to do something about all these traversal routines.

DIAGNOSTICS

A root has already been defined. Use set_root to change the root

The add() method may only be used to set the root when the first Gtk2::Ex::MindMapView::Item is added to the graph.

You must remove the successors of this item prior to removing this item.

The remove() method will only remove items that have no successor items.

You must pass in both the predecessor and the item you wish to remove.

The remove() method tries to remove an edge from the graph. You need to specify the predecessor item because each Gtk2::Ex::MindMapView::Item may have more that one predecessor.

AUTHOR

James Muir <hemlock@vtlink.net>

LICENCE AND COPYRIGHT

Copyright (c) 2006, James Muir <hemlock@vtlink.net>. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

DISCLAIMER OF WARRANTY

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.