Edge/PolyLineEdge.pm

filter: Statementstmt 43.4% 10 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 37.5% 3 / 8 Podpod 100% 2 / 2 totaltotal 42.8% 15 / 35 SCAR 10.5
CC
2
Cov
40%
_addAdditionalNodes
6.0
new
2.0
_init
2.0
CRAP 2.9
« Edge/ArcEdge.pm ↑ Summary Edge/QuadCurveEdge.pm »
1 package yEd::Edge::PolyLineEdge;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use yEd::PropertyBasedObject;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use base qw(yEd::Edge);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 yEd::Edge::PolyLineEdge - straight point to point Edge
10  
11 =head1 DESCRIPTION
12  
13 A straight point to point Edge which can have multiple waypoints.
14  
15 The bends have hard edging by default, but can be smoothend slightly.
16  
17 Make sure to have a look at L<yEd::Edge>, the properties and functions described there will not be repeated here.
18  
19 =head1 SUPPORTED FEATURES
20  
21 The type specific features are fully supported.
22  
23 For basic Edge type feature support and which Edge types are supported see L<yEd::Edge>.
24  
25 =head1 PROPERTIES
26  
27 =head2 all properties from base class
28  
29 L<yEd::Edge>
30  
31 =head2 smoothBend
32  
33 Type: bool
34  
35 Default: false
36  
37 Slightly smoothen waypoint bends.
38  
39 =head1 SUBROUTINES/METHODS
40  
41 =head2 all functions from base class
42  
43 L<yEd::Edge>
44  
45 =cut
46  
47 sub new {
48 0 ▶ my ($class, @args) = @_;
Subroutine new: not called CC=1 SCAR=6.9
Pod documented
49 0 my $self = bless {}, $class;
50 0 return $self->_init(@args);
51 }
52  
53 sub _init {
54 0 ▶ my ($self, @args) = @_;
Subroutine _init: not called CC=1 SCAR=6.9
55 0 $self->smoothBend(0);
56 0 $self->SUPER::_init(@args);
57 0 return $self;
58 }
59  
60 sub smoothBend {
61 0 ▶ return _PROPERTY('bool', @_);
Subroutine smoothBend: not called CC=1 SCAR=6.9
Pod documented
62 }
63  
64 sub _addTypeNode {
65 0 ▶ my ($self, $node) = @_;
Subroutine _addTypeNode: not called CC=1 SCAR=6.9
66 0 return $node->addNewChild('', 'y:PolyLineEdge');
67 }
68 sub _addAdditionalNodes {
69 0 ▶ my ($self, $node) = @_;
Subroutine _addAdditionalNodes: not called CC=2 SCAR=17.9
70 0 my $bs = $node->addNewChild('', 'y:BendStyle');
71 0 ▶ $bs->setAttribute('smoothed', $self->smoothBend() ? 'true' : 'false');
Branch: 1 branch
BranchTrueFalseTotal
$self->smoothBend ? : 0 0 0
72 }
73  
74 =head1 SEE ALSO
75  
76 L<yEd::Document> for further informations about the whole package
77  
78 L<yEd::PropertyBasedObject> for further basic information about properties and their additional functions
79  
80 L<yEd::Edge> for information about the Edge base class and which other Edge types are currently supported
81  
82 =cut
83  
84  
85 1 1;
« Edge/ArcEdge.pm ↑ Summary Edge/QuadCurveEdge.pm »