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

NAME

Gtk2::Ex::MindMapView::Item: The border and text entered into the map.

VERSION

This document describes Gtk2::Ex::MindMapView::Item version 0.0.1

HEIRARCHY

 Glib::Object
 +----Gtk2::Object
      +----Gnome2::Canvas::Item
           +----Gnome2::Canvas::Group
                +----Gtk2::Ex::MindMapView::Item

SYNOPSIS

use Gtk2::Ex::MindMapView::Item;

DESCRIPTION

Gtk2::Ex::MindMapView::Item items contain the border and content that is displayed in the mind map. They may be created using Gtk2::Ex::MindMapView::ItemFactory and may be placed into Gtk2::Ex::MindMapView.

INTERFACE

Properties

graph (Gtk2::Ex::MindMapView::Graph)

A reference to the Gtk2::Ex::MindMapView::Graph that contains all the Gtk2::Ex::MindMapView::Item items.

column (Gtk2::Ex::MindMapView::Layout::Column)

A reference to a Gtk2::Ex::MindMapView::Layout::Column that contains this item. The column is used to place the item on the Gtk2::Ex::MindMapView canvas.

border (Gtk2::Ex::MindMapView::Border)

A reference to the Gtk2::Ex::MindMapView::Border that is drawn on the canvas. The border contains a reference to the content.

visible (boolean)

A flag indicating whether or not this item is visible.

x (double)

The upper left x-coordinate of the item.

y (double)

The upper left y-coordinate of the item.

height (double)

The height of the item.

width (double)

The width of the item.

Methods

INIT_INSTANCE

This subroutine is called by Glib::Object::Subclass whenever a Gtk2::Ex::MindMapView::Item is instantiated. It initialized the internal variables used by this object. This subroutine should not be called by you. Leave it alone.

SET_PROPERTY

This subroutine is called by Glib::Object::Subclass whenever a property value is being set. Property values may be set using the set() method. For example, to set the width of an item to 100 pixels you would call set as follows: $item->set(width=>100);

add_hotspot ($hotspot_type, $hotspot)

Add a Gtk2::Ex::MindMapView::ItemHotSpot to an item. There are four types of hotspots ('lower_left', 'lower_right', 'toggle_left', 'toggle_right').

The "toggle" hotspots correspond to the small circles you see on a view item that allow for expansion or collapse of the mind map view.

The "lower" (or "resize") hotspots correspond to the hot spots that allow you to resize an item.

You should add a hotspot for each hotspot type to an item. If you use the Gtk2::Ex::MindMapView::ItemFactory to create items, this will be done for you.

When you add a hotspot the hotspot type is used to position the hotspot on the item. You may only add one hotspot of each type.

disable_hotspots ()

This method is used to disable and hide the "toggle" hotspots, which only appear on an item if they are needed.

enable_hotspots ($successor_item)

This method enables and shows the "toggle" hotspots provided that they are needed by the item. In item needs a toggle hotspot if it has successor items attached to it.

get_column_no

Return the column number that this item belongs to. The column number is used to determine the relative position of items in the layout.

get_connection_point ($side)

Return the x,y coordinates of the point at which a Gtk2::Ex::MindMapView::Connection may connect to. This coordinate is also used to detemine where to place the "toggle" hotspots.

get_insets ()

Return the ($top, $left, $bottom, $right) border insets. The insets are used by the Grips and Toggles to position themselves.

get_min_height()

Return the minimum height of this item.

get_min_width()

Return the minimum width of this item.

get_weight ()

Return the "weight" of a view item. The weight is the product of the item height and width. The weight is used by Gtk2::Ex::MindMapView::Layout::Balanced to determine the side of the mind map on which to place the item.

is_visible ()

Return true if this item is visible.

predecessors ()

Return an array of predecessor items of this item.

resize ()

Adjust the height and width of the item, and then signal to the toggles, grips and connections to redraw themselves.

successors ()

Return an array of successor items of this item.

successors ($side)

Return an array of items that are on one side of this item. The side may be 'left' or 'right'.

toggle ()

Either expand or collapse a subtree of the mind map. Toggle uses a time stamp to decide how much of the tree to expand.

DIAGNOSTICS

Unexpected border value. You may only assign a Gtk2::Ex::MindMapView::Border::RoundedRect as a border at this time.

For the alpha release, only Gtk2::Ex::MindMapView::Border::RoundedRect objects may be used.

Cannot set border, no content defined.

You must supply a Gtk2::Ex::MindMapView::Content::EllipsisText object as content to be placed inside the border.

Unexpected column value. You may only assign a Gtk2::Ex::MindMapView::Layout::Column as a column.

A Gtk2::Ex::MindMapView::Item may only belong to a Gtk2::Ex::MindMapView::Layout::Column. Don't try to use anything else.

Unexpected hotspot type: $hotspot_type. Valid are: 'toggle_right', 'toggle_left', 'lower_left', 'lower_right'

There are currently four possible hotspot types. These are: 'toggle_right', 'toggle_left', 'lower_left', 'lower_right'. Use these names when referring to the hotspots created by the Gtk2::Ex::MindMapView::ItemFactory.

Attempt to get column_no on undefined column

An item is created, and then it is placed in a column. You have called get_column_no() on an item that has not yet been placed into a column.

DEPENDENCIES

This module depends on the following modules:

Gnome2::Canvas::Group
Gtk2::Ex::MindMapView::ItemHotSpot
Gtk2::Ex::MindMapView::Border::RoundedRect
Gtk2::Ex::MindMapView::Content::EllipsisText

BUGS AND LIMITATIONS

No bugs have been reported.

Please report any bugs or feature requests to bug-gtk2-ex-mindmapview@rt.cpan.org, or through the web interface at http://rt.cpan.org.

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.