Edge/PolyLineEdge.pm

filter: Statementstmt 100% 23 / 23 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 100% 2 / 2 totaltotal 97.1% 34 / 35 CC 2 SCAR 2.1
CC
2
Cov
96%
_addAdditionalNodes
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Edge/ArcEdge.pm ↑ Summary Edge/BezierEdge.pm »
1 package yEd::Edge::PolyLineEdge;
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  
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 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod documented
48 1 my ($class, @args) = @_;
49 1 my $self = bless {}, $class;
50 1 return $self->_init(@args);
51 }
52  
53 1 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
54 1 my ($self, @args) = @_;
55 1 $self->smoothBend(0);
56 1 $self->SUPER::_init(@args);
57 1 return $self;
58 }
59  
60 2 ▶sub smoothBend {
Subroutine smoothBend: called CC=1 SCAR=0.0
Pod documented
61 2 return _PROPERTY('bool', @_);
62 }
63  
64 1 ▶sub _addTypeNode {
Subroutine _addTypeNode: called CC=1 SCAR=0.0
65 1 my ($self, $node) = @_;
66 1 return $node->addNewChild('', 'y:PolyLineEdge');
67 }
68 1 ▶sub _addAdditionalNodes {
Subroutine _addAdditionalNodes: called CC=2 SCAR=7.1
69 1 my ($self, $node) = @_;
70 1 my $bs = $node->addNewChild('', 'y:BendStyle');
71 1 ▶ $bs->setAttribute('smoothed', $self->smoothBend() ? 'true' : 'false');
Branch: 1 branch
BranchTrueFalseTotal
$self->smoothBend ? : 0 1 1
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 3 1;
« Edge/ArcEdge.pm ↑ Summary Edge/BezierEdge.pm »