| 1 | package GraphViz::Diagram::ClassDiagram::Node_; | ||
| 2 | #_{ use | ||
| 3 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use Carp; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use GraphViz::Diagram::ClassDiagram; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 0 | ▶ | use GraphViz::Graph::Node; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 9 | |||
| 10 | our @ISA=qw(GraphViz::Graph::Node); | ||
| 11 | our $VERSION=$GraphViz::Diagram::ClassDiagram::VERSION; | ||
| 12 | |||
| 13 | #_{ POD | ||
| 14 | =encoding utf8 | ||
| 15 | =head1 NAME | ||
| 16 | |||
| 17 | GraphViz::Diagram::ClassDiagram::Node_ is a base class for all class diagram objects that are rendered in graphviz as a C<GraphViz::Graph::Node>, | ||
| 18 | such as L<GraphViz::Graph::GlobalVar> or L<GraphViz::Graph::Class>. | ||
| 19 | |||
| 20 | =cut | ||
| 21 | =head1 USAGE | ||
| 22 | |||
| 23 | This class should not be used by a user of C<GraphViz::Diagram::ClassDiagram>. | ||
| 24 | |||
| 25 | At the time of this writing, there are two classes that derive from GraphViz::Diagram::ClassDiagram::Node_: | ||
| 26 | L<GraphViz::Diagram::ClassDiagram::Class> and L<GraphViz::Diagram::ClassDiagram::GlobalVar>. | ||
| 27 | |||
| 28 | =cut | ||
| 29 | |||
| 30 | #_} | ||
| 31 | |||
| 32 | sub new { | ||
| 33 | |||
| 34 | #_{ POD | ||
| 35 | =head2 new | ||
| 36 | |||
| 37 | Creates a C<GraphViz::Diagram::ClassDiagram::Node_>. | ||
| 38 | |||
| 39 | =cut | ||
| 40 | #_} | ||
| 41 | |||
| 42 | my $class = shift; | ||
| 43 | my $name = shift; | ||
| 44 | my $class_diagram = shift; # The class diagram on which this class should be drawn | ||
| 45 | |||
| 46 | croak "GraphViz::Diagram::ClassDiagram::Node_ - new: class_diagram $class_diagram is not a GraphViz::Diagram::ClassDiagram" unless $class_diagram->isa('GraphViz::Diagram::ClassDiagram'); | ||
| 47 | |||
| 48 | my $self = $class_diagram->node(); | ||
| 49 | |||
| 50 | $self->{name} = $name; | ||
| 51 | $self->{class_diagram } = $class_diagram; | ||
| 52 | |||
| 53 | $self->{comments } = []; | ||
| 54 | |||
| 55 | bless $self, $class; | ||
| 56 | |||
| 57 | return $self; | ||
| 58 | |||
| 59 | } | ||
| 60 | |||
| 61 | 'tq84' | ||