1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
|
4
|
|
|
namespace SRF\Graph; |
5
|
|
|
|
6
|
|
|
/** |
7
|
|
|
* Represents a set of Options for the Graph Printer |
8
|
|
|
* |
9
|
|
|
* |
10
|
|
|
* @license GNU GPL v2+ |
11
|
|
|
* @since 3.2 |
12
|
|
|
* |
13
|
|
|
* @author Sebastian Schmid (gesinn.it) |
14
|
|
|
* |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
class GraphOptions { |
18
|
|
|
|
19
|
|
|
private $graphName; |
20
|
|
|
|
21
|
|
|
private $graphSize; |
22
|
|
|
|
23
|
|
|
private $nodeShape; |
24
|
|
|
|
25
|
|
|
private $nodeLabel; |
26
|
|
|
|
27
|
|
|
private $rankDir; |
28
|
|
|
|
29
|
|
|
private $arrowHead; |
30
|
|
|
|
31
|
|
|
private $wordWrapLimit; |
32
|
|
|
|
33
|
|
|
private $parentRelation; |
34
|
|
|
|
35
|
|
|
private $enableGraphLink; |
36
|
|
|
|
37
|
|
|
private $showGraphLabel; |
38
|
|
|
|
39
|
|
|
private $showGraphColor; |
40
|
|
|
|
41
|
|
|
private $showGraphLegend; |
42
|
|
|
|
43
|
|
|
public function __construct( $options ) { |
44
|
|
|
|
45
|
|
|
$this->graphName = trim( $options['graphname'] ); |
46
|
|
|
$this->graphSize = trim( $options['graphsize'] ); |
47
|
|
|
$this->nodeShape = trim( $options['nodeshape'] ); |
48
|
|
|
$this->nodeLabel = trim( $options['nodelabel'] ); |
49
|
|
|
$this->rankDir = strtoupper( trim( $options['arrowdirection'] ) ); |
50
|
|
|
$this->arrowHead = trim( $options['arrowhead'] ); |
51
|
|
|
$this->wordWrapLimit = trim( $options['wordwraplimit'] ); |
52
|
|
|
$this->parentRelation = strtolower( trim( $options['relation'] ) ) == 'parent'; |
53
|
|
|
$this->enableGraphLink = trim($options['graphlink']); |
54
|
|
|
$this->showGraphLabel = trim($options['graphlabel']); |
55
|
|
|
$this->showGraphColor = trim($options['graphcolor']); |
56
|
|
|
$this->showGraphLegend = trim( $options['graphlegend'] ); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @return string |
61
|
|
|
*/ |
62
|
|
|
public function getGraphName(): string { |
63
|
|
|
return $this->graphName; |
64
|
|
|
} |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @return string |
68
|
|
|
*/ |
69
|
|
|
public function getGraphSize(): string { |
70
|
|
|
return $this->graphSize; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** |
74
|
|
|
* @return string |
75
|
|
|
*/ |
76
|
|
|
public function getNodeShape(): string { |
77
|
|
|
return $this->nodeShape; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @return string |
82
|
|
|
*/ |
83
|
|
|
public function getNodeLabel(): string { |
84
|
|
|
return $this->nodeLabel; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @return string |
89
|
|
|
*/ |
90
|
|
|
public function getRankDir(): string { |
91
|
|
|
return $this->rankDir; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return string |
96
|
|
|
*/ |
97
|
|
|
public function getArrowHead(): string { |
98
|
|
|
return $this->arrowHead; |
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @return int |
103
|
|
|
*/ |
104
|
|
|
public function getWordWrapLimit(): int { |
105
|
|
|
return $this->wordWrapLimit; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return string |
110
|
|
|
*/ |
111
|
|
|
public function getParentRelation(): string { |
112
|
|
|
return $this->parentRelation; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @return bool |
117
|
|
|
*/ |
118
|
|
|
public function isGraphLink(): bool { |
119
|
|
|
return $this->enableGraphLink; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @return bool |
124
|
|
|
*/ |
125
|
|
|
public function isGraphLabel(): bool { |
126
|
|
|
return $this->showGraphLabel; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @return bool |
131
|
|
|
*/ |
132
|
|
|
public function isGraphColor(): bool { |
133
|
|
|
return $this->showGraphColor; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @return bool |
138
|
|
|
*/ |
139
|
|
|
public function isGraphLegend(): bool { |
140
|
|
|
return $this->showGraphLegend; |
141
|
|
|
} |
142
|
|
|
} |