File Coverage

blib/lib/Tree/Visualize/Layout/ILayout.pm
Criterion Covered Total %
statement 20 25 80.0
branch n/a
condition 1 3 33.3
subroutine 5 10 50.0
pod 7 7 100.0
total 33 45 73.3


line stmt bran cond sub pod time code
1              
2             package Tree::Visualize::Layout::ILayout;
3              
4 6     6   32 use strict;
  6         11  
  6         212  
5 6     6   31 use warnings;
  6         13  
  6         140  
6              
7 6     6   33 use Tree::Visualize::Exceptions;
  6         11  
  6         1953  
8              
9             our $VERSION = '0.01';
10              
11             sub new {
12 6     6 1 88606 my ($_class, $options) = @_;
13 6   33     55 my $class = ref($_class) || $_class;
14 6         15 my $layout = {};
15 6         22 bless($layout, $class);
16 6         44 return $layout;
17             }
18              
19             sub draw {
20 46     46 1 1406 my ($self, $tree) = @_;
21             # check the tree, do anything needed on it
22 46         131 $tree = $self->checkTree($tree);
23             # draw the current node
24 46         147 my $current = $self->drawNode($tree);
25             # draw all the children
26 46         158 my @children = $self->drawChildren($tree);
27             # draw all the connections
28 46         190 my @connections = $self->drawConnections($current, @children);
29             # assemble the drawing and return it
30 46         140 return $self->assembleDrawing($current, \@children, \@connections);
31             }
32              
33 0     0 1   sub checkTree { throw Tree::Visualize::MethodNotImplemented }
34 0     0 1   sub drawNode { throw Tree::Visualize::MethodNotImplemented }
35 0     0 1   sub drawChildren { throw Tree::Visualize::MethodNotImplemented }
36 0     0 1   sub drawConnections { throw Tree::Visualize::MethodNotImplemented }
37 0     0 1   sub assembleDrawing { throw Tree::Visualize::MethodNotImplemented }
38              
39             1;
40              
41             __END__