line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
################################################################ |
2
|
|
|
|
|
|
|
# AutoDIAL - Automatic Dia XML. (C)Copyright 2001 A Trevena # |
3
|
|
|
|
|
|
|
# # |
4
|
|
|
|
|
|
|
# AutoDIAL comes with ABSOLUTELY NO WARRANTY; see COPYING file # |
5
|
|
|
|
|
|
|
# This is free software, and you are welcome to redistribute # |
6
|
|
|
|
|
|
|
# it under certain conditions; see COPYING file for details # |
7
|
|
|
|
|
|
|
################################################################ |
8
|
|
|
|
|
|
|
package Autodia::Diagram::Dependancy; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
5
|
use vars qw($VERSION @ISA @EXPORT); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
66
|
|
13
|
1
|
|
|
1
|
|
5
|
use Exporter; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
14
|
1
|
|
|
1
|
|
5
|
use Autodia::Diagram::Object; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
42
|
|
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
6
|
use Data::Dumper; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
860
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
@ISA = qw(Autodia::Diagram::Object); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $dependancy_count = 0; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#--------------------------------------------------------------------- |
23
|
|
|
|
|
|
|
# Constructor Methods |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new |
26
|
|
|
|
|
|
|
{ |
27
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
28
|
0
|
|
|
|
|
|
my $child = shift; |
29
|
0
|
|
|
|
|
|
my $parent = shift; |
30
|
0
|
|
|
|
|
|
my $DiagramDependancy = {}; |
31
|
0
|
|
0
|
|
|
|
bless ($DiagramDependancy, ref($class) || $class); |
32
|
0
|
|
|
|
|
|
$DiagramDependancy->_initialise($child, $parent); |
33
|
0
|
|
|
|
|
|
return $DiagramDependancy; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#----------------------------------------------------------------------- |
37
|
|
|
|
|
|
|
# Access Methods |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
sub Parent |
40
|
|
|
|
|
|
|
{ |
41
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
42
|
0
|
|
|
|
|
|
my $parent = shift; |
43
|
0
|
|
|
|
|
|
my $return_val = 1; |
44
|
|
|
|
|
|
|
|
45
|
0
|
0
|
|
|
|
|
if (defined $parent) |
46
|
0
|
|
|
|
|
|
{ $self->{"parent"} = $parent; } |
47
|
|
|
|
|
|
|
else |
48
|
0
|
|
|
|
|
|
{ $return_val = $self->{"parent"}; } |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $return_val; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub Child |
54
|
|
|
|
|
|
|
{ |
55
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
56
|
0
|
|
|
|
|
|
my $child = shift; |
57
|
0
|
|
|
|
|
|
my $return_val = 1; |
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
|
|
|
|
if (defined $child) |
60
|
0
|
|
|
|
|
|
{ $self->{"child"} = $child; } |
61
|
|
|
|
|
|
|
else |
62
|
0
|
|
|
|
|
|
{ $return_val = $self->{"child"}; } |
63
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
return $return_val; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub Name |
68
|
|
|
|
|
|
|
{ |
69
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
70
|
0
|
|
|
|
|
|
my $name = shift; |
71
|
|
|
|
|
|
|
|
72
|
0
|
0
|
|
|
|
|
if (defined $name) |
73
|
|
|
|
|
|
|
{ |
74
|
0
|
|
|
|
|
|
$self->{"name"} = $name; |
75
|
0
|
|
|
|
|
|
return 1; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
else |
78
|
0
|
|
|
|
|
|
{ return $self->{"name"}; } |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub Orth_Top_Right |
82
|
|
|
|
|
|
|
{ |
83
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
84
|
0
|
|
|
|
|
|
return $self->{"top_connection"}; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub Orth_Bottom_Left |
88
|
|
|
|
|
|
|
{ |
89
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
90
|
0
|
|
|
|
|
|
return $self->{"bottom_connection"}; |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
sub Orth_Mid_Left |
94
|
|
|
|
|
|
|
{ |
95
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
96
|
0
|
|
|
|
|
|
my $return = ($self->{"left_x"}). "," . $self->{"mid_y"}; |
97
|
|
|
|
|
|
|
|
98
|
0
|
|
|
|
|
|
return $return; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub Orth_Mid_Right |
102
|
|
|
|
|
|
|
{ |
103
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
104
|
0
|
|
|
|
|
|
my $return = ($self->{"right_x"}). "," . $self->{"mid_y"}; |
105
|
|
|
|
|
|
|
|
106
|
0
|
|
|
|
|
|
return $return; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub Reposition |
110
|
|
|
|
|
|
|
{ |
111
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
112
|
|
|
|
|
|
|
|
113
|
0
|
|
|
|
|
|
my $child = $self->{"_child"}; |
114
|
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
my ($left_x,$bottom_y) = split (",",$child->TopLeftPos); |
116
|
0
|
|
|
|
|
|
my $mid_y = $bottom_y - 1.5; |
117
|
0
|
|
|
|
|
|
my $top_y= $mid_y - 1.5; |
118
|
0
|
|
|
|
|
|
$left_x += 2 + ($child->Width / 2); |
119
|
0
|
|
|
|
|
|
my $right_x = $left_x + 5; |
120
|
|
|
|
|
|
|
|
121
|
0
|
|
|
|
|
|
$self->{"left_x"} = $left_x; |
122
|
0
|
|
|
|
|
|
($self->{"right_x"}, $self->{"top_y"}, |
123
|
|
|
|
|
|
|
$self->{"mid_y"}, $self->{"bottom_y"}) = ($right_x, $top_y, $mid_y, $bottom_y); |
124
|
0
|
|
|
|
|
|
$self->{"top_connection"} = $self->{right_x} . "," . $self->{"top_y"}; |
125
|
0
|
|
|
|
|
|
$self->{"bottom_connection"} = $left_x . "," . $bottom_y; |
126
|
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
|
return 1; |
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
#----------------------------------------------------------- |
131
|
|
|
|
|
|
|
# Internal Methods |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
sub _initialise # over-rides method in DiagramObject |
134
|
|
|
|
|
|
|
{ |
135
|
0
|
|
|
0
|
|
|
my $self = shift; |
136
|
0
|
|
|
|
|
|
my $child = shift; |
137
|
0
|
|
|
|
|
|
my $parent = shift; |
138
|
|
|
|
|
|
|
|
139
|
0
|
|
|
|
|
|
$self->{"_child"} = $child; |
140
|
0
|
|
|
|
|
|
$self->{"child"} = $child->Id; |
141
|
0
|
|
|
|
|
|
$self->{"type"} = "dependancy"; |
142
|
0
|
|
|
|
|
|
$self->{"_parent"} = $parent; |
143
|
0
|
|
|
|
|
|
$self->{"parent"} = $parent->Id; |
144
|
0
|
|
|
|
|
|
$self->{"name"} = $self->{"parent"}."-".$self->{"child"}; |
145
|
|
|
|
|
|
|
|
146
|
0
|
|
|
|
|
|
return 1; |
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
sub _update # over-rides method in DiagramObject |
150
|
|
|
|
|
|
|
{ |
151
|
0
|
|
|
0
|
|
|
my $self = shift; |
152
|
0
|
|
|
|
|
|
$self->Reposition(); |
153
|
0
|
|
|
|
|
|
return 1; |
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
1; |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
############################################################################ |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head1 |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
=cut |