Edge/ArcEdge.pm

filter: Statementstmt 94.7% 36 / 38 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 92.3% 12 / 13 Podpod 100% 6 / 6 totaltotal 93.2% 55 / 59 CC 2 SCAR 2.1
CC
2
Cov
92%
waypoints
2.1
addWaypoint
2.0
BEGIN
1.0
CRAP 1.2
« Node/ShapeNode.pm ↑ Summary Edge/PolyLineEdge.pm »
1 package yEd::Edge::ArcEdge;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use yEd::PropertyBasedObject;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use base qw(yEd::Edge);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 =head1 NAME
9  
10 yEd::Edge::ArcEdge - spans an arc from source to target
11  
12 =head1 DESCRIPTION
13  
14 This Edge spans an arc from C<source> to C<target>.
15  
16 It can have no waypoints, thus calls to C<addWaypoint()> or C<waypoints()>> will result in error.
17  
18 Make sure to have a look at L<yEd::Edge>, the properties and functions described there will not be repeated here.
19  
20 =head1 SUPPORTED FEATURES
21  
22 The type specific features are fully supported.
23  
24 For basic Edge type feature support and which Edge types are supported see L<yEd::Edge>.
25  
26 =head1 PROPERTIES
27  
28 =head2 all properties from base class
29  
30 L<yEd::Edge>
31  
32 =head2 arcType
33  
34 Type: descrete values ( fixedRatio | fixedHeight )
35  
36 Default: 'fixedRatio'
37  
38 Defines the mode for arc shaping.
39  
40 =head2 arcHeight
41  
42 Type: float
43  
44 Default: 90
45  
46 Defines arc shape in mode fixedRatio.
47  
48 =head2 arcRatio
49  
50 Type: float
51  
52 Default: 1
53  
54 Defines arc shape in mode fixedHeight.
55  
56 =head1 SUBROUTINES/METHODS
57  
58 =head2 all functions from base class
59  
60 L<yEd::Edge>
61  
62 =cut
63  
64  
65 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
66 1 my ($class, @args) = @_;
67 1 my $self = bless {}, $class;
68 1 return $self->_init(@args);
69 }
70  
71 1 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
72 1 my ($self, @args) = @_;
73 1 $self->arcType('fixedRatio');
74 1 $self->arcHeight(90);
75 1 $self->arcRatio(1);
76 1 $self->SUPER::_init(@args);
77 1 return $self;
78 }
79  
80 2 ▶sub arcType {
Subroutine arcType: called CC=1 SCAR=0.0
Pod documented
81 2 return _PROPERTY($match{'arctype'}, @_);
82 }
83 2 ▶sub arcHeight {
Subroutine arcHeight: called CC=1 SCAR=0.0
Pod documented
84 2 return _PROPERTY($match{'float'}, @_);
85 }
86 2 ▶sub arcRatio {
Subroutine arcRatio: called CC=1 SCAR=0.0
Pod documented
87 2 return _PROPERTY($match{'float'}, @_);
88 }
89  
90 0 ▶sub addWaypoint {
Subroutine addWaypoint: not called CC=1 SCAR=6.9
Pod documented
91 0 confess 'setting waypoints is not allowed for edge type ArcEdge';
92 }
93 1 ▶sub waypoints {
Subroutine waypoints: called CC=2 SCAR=7.4
Pod documented
94 1 my ($self, @wps) = @_;
95 1 ▶ if (@wps) {
Branch: 1 branch
BranchTrueFalseTotal
if (@wps) { } 0 1 1
96 0 confess 'setting waypoints is not allowed for edge type ArcEdge';
97 } else {
98 1 return @{$self->{'waypoints'}};
99 }
100 }
101  
102 1 ▶sub _addTypeNode {
Subroutine _addTypeNode: called CC=1 SCAR=0.0
103 1 my ($self, $node) = @_;
104 1 return $node->addNewChild('', 'y:ArcEdge');
105 }
106 1 ▶sub _addAdditionalNodes {
Subroutine _addAdditionalNodes: called CC=1 SCAR=0.0
107 1 my ($self, $node) = @_;
108 1 my $arc = $node->addNewChild('', 'y:Arc');
109 1 $arc->setAttribute('height', $self->arcHeight());
110 1 $arc->setAttribute('ratio', $self->arcRatio());
111 1 $arc->setAttribute('type', $self->arcType());
112 }
113  
114 =head1 SEE ALSO
115  
116 L<yEd::Document> for further informations about the whole package
117  
118 L<yEd::PropertyBasedObject> for further basic information about properties and their additional functions
119  
120 L<yEd::Edge> for information about the Edge base class and which other Edge types are currently supported
121  
122 =cut
123  
124 3 1;
« Node/ShapeNode.pm ↑ Summary Edge/PolyLineEdge.pm »