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

NAME

Tree::Visualize::ASCII::BoundingBox - A bounding box for ASCII drawings

SYNOPSIS

    use Tree::Visualize::ASCII::BoundingBox;
    
    my $box = Tree::Visualize::ASCII::BoundingBox->new(join "\n" => (
                    '+------+',
                    '| test |',
                    '+------+'
                    ));  
                    
    my $box2 = Tree::Visualize::ASCII::BoundingBox->new(join "\n" => (
                    '+-------+',
                    '| test2 |',
                    '+-------+'
                    ));   
                    
    my $box3 = $box->padRight("  ")->pasteRight($box2);    
    
    print $box3->getAsString();
    
    # will give you:
    # +------+  +-------+
    # | test |  | test2 |
    # +------+  +-------+                                       

DESCRIPTION

METHODS

new ($string)

Accessors

height

Returns the height of the bounding box.

width

Returns the width of the bounding box.

getLinesAsArray

Returns an array of string representing each line of the drawing.

getAsString

Returns the completed drawing as a single string.

getFirstConnectionPointIndex

NOTE: This method is used for particular purpose and will likely be changed.

Mutators

padLeft ($padding)

Given a $padding of spaces, this will add it to the left side of the bounding box.

padRight ($padding)

Given a $padding of spaces, this will add it to the right side of the bounding box.

pasteLeft ($right)

Given another BoundingBox object ($right) this will paste it onto the left of the current bounding box.

pasteRight ($left)

Given another BoundingBox object ($left) this will paste it onto the right of the current bounding box.

pasteTop ($top)

Given another BoundingBox object ($top) this will paste it onto the top of the current bounding box.

pasteBottom ($bottom)

Given another BoundingBox object ($bottom) this will paste it onto the bottom of the current bounding box.

flipHorizontal

This will flip the bounding box horizontally.

flipVertical

This will flip the bounding box vertically.

TO DO

BUGS

None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.

CODE COVERAGE

I use Devel::Cover to test the code coverage of my tests, below is the Devel::Cover report on this module test suite.

SEE ALSO

AUTHOR

stevan little, <stevan@iinteractive.com>

COPYRIGHT AND LICENSE

Copyright 2004 by Infinity Interactive, Inc.

http://www.iinteractive.com

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