| 1 | package yEd::Edge::ArcEdge; | ||||||||||
| 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 | 1 | ▶ | 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 source to target. | ||||||||||
| 15 | |||||||||||
| 16 | It can have no waypoints, thus calls to addWaypoint or 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 | sub new { | ||||||||||
| 66 | 0 | ▶ | my ($class, @args) = @_; | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 67 | 0 | my $self = bless {}, $class; | |||||||||
| 68 | 0 | return $self->_init(@args); | |||||||||
| 69 | } | ||||||||||
| 70 | |||||||||||
| 71 | sub _init { | ||||||||||
| 72 | 0 | ▶ | my ($self, @args) = @_; | ||||||||
|
Subroutine
_init: not called CC=1 SCAR=6.9
| |||||||||||
| 73 | 0 | $self->arcType('fixedRatio'); | |||||||||
| 74 | 0 | $self->arcHeight(90); | |||||||||
| 75 | 0 | $self->arcRatio(1); | |||||||||
| 76 | 0 | $self->SUPER::_init(@args); | |||||||||
| 77 | 0 | return $self; | |||||||||
| 78 | } | ||||||||||
| 79 | |||||||||||
| 80 | sub arcType { | ||||||||||
| 81 | 0 | ▶ | return _PROPERTY($match{'arctype'}, @_); | ||||||||
|
Subroutine
arcType: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 82 | } | ||||||||||
| 83 | sub arcHeight { | ||||||||||
| 84 | 0 | ▶ | return _PROPERTY($match{'float'}, @_); | ||||||||
|
Subroutine
arcHeight: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 85 | } | ||||||||||
| 86 | sub arcRatio { | ||||||||||
| 87 | 0 | ▶ | return _PROPERTY($match{'float'}, @_); | ||||||||
|
Subroutine
arcRatio: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 88 | } | ||||||||||
| 89 | |||||||||||
| 90 | sub addWaypoint { | ||||||||||
| 91 | 0 | ▶ | confess 'setting waypoints is not allowed for edge type ArcEdge'; | ||||||||
|
Subroutine
addWaypoint: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 92 | } | ||||||||||
| 93 | sub waypoints { | ||||||||||
| 94 | 0 | ▶ | my ($self, @wps) = @_; | ||||||||
|
Subroutine
waypoints: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 95 | 0 | ▶ | if (@wps) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 96 | 0 | confess 'setting waypoints is not allowed for edge type ArcEdge'; | |||||||||
| 97 | } else { | ||||||||||
| 98 | 0 | return @{$self->{'waypoints'}}; | |||||||||
| 99 | } | ||||||||||
| 100 | } | ||||||||||
| 101 | |||||||||||
| 102 | sub _addTypeNode { | ||||||||||
| 103 | 0 | ▶ | my ($self, $node) = @_; | ||||||||
|
Subroutine
_addTypeNode: not called CC=1 SCAR=6.9
| |||||||||||
| 104 | 0 | return $node->addNewChild('', 'y:ArcEdge'); | |||||||||
| 105 | } | ||||||||||
| 106 | sub _addAdditionalNodes { | ||||||||||
| 107 | 0 | ▶ | my ($self, $node) = @_; | ||||||||
|
Subroutine
_addAdditionalNodes: not called CC=1 SCAR=6.9
| |||||||||||
| 108 | 0 | my $arc = $node->addNewChild('', 'y:Arc'); | |||||||||
| 109 | 0 | $arc->setAttribute('height', $self->arcHeight()); | |||||||||
| 110 | 0 | $arc->setAttribute('ratio', $self->arcRatio()); | |||||||||
| 111 | 0 | $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 | 1 | 1; | |||||||||