|
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
|
|
|
private $graphName; |
|
19
|
|
|
private $graphSize; |
|
20
|
|
|
private $graphFontSize; |
|
21
|
|
|
private $nodeShape; |
|
22
|
|
|
private $nodeLabel; |
|
23
|
|
|
private $rankDir; |
|
24
|
|
|
private $arrowHead; |
|
25
|
|
|
private $wordWrapLimit; |
|
26
|
|
|
private $parentRelation; |
|
27
|
|
|
private $enableGraphLink; |
|
28
|
|
|
private $showGraphLabel; |
|
29
|
|
|
private $showGraphColor; |
|
30
|
|
|
private $showGraphLegend; |
|
31
|
|
|
|
|
32
|
|
|
public function __construct( $options ) { |
|
33
|
|
|
$this->graphName = trim( $options['graphname'] ); |
|
34
|
|
|
$this->graphSize = trim( $options['graphsize'] ); |
|
35
|
|
|
$this->graphFontSize = trim( $options['graphfontsize'] ); |
|
36
|
|
|
$this->nodeShape = trim( $options['nodeshape'] ); |
|
37
|
|
|
$this->nodeLabel = trim( $options['nodelabel'] ); |
|
38
|
|
|
$this->rankDir = strtoupper( trim( $options['arrowdirection'] ) ); |
|
39
|
|
|
$this->arrowHead = trim( $options['arrowhead'] ); |
|
40
|
|
|
$this->wordWrapLimit = trim( $options['wordwraplimit'] ); |
|
41
|
|
|
$this->parentRelation = strtolower( trim( $options['relation'] ) ) == 'parent'; |
|
42
|
|
|
$this->enableGraphLink = trim( $options['graphlink'] ); |
|
43
|
|
|
$this->showGraphLabel = trim( $options['graphlabel'] ); |
|
44
|
|
|
$this->showGraphColor = trim( $options['graphcolor'] ); |
|
45
|
|
|
$this->showGraphLegend = trim( $options['graphlegend'] ); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public function getGraphName(): string { |
|
49
|
|
|
return $this->graphName; |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
public function getGraphSize(): string { |
|
53
|
|
|
return $this->graphSize; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
public function getGraphFontSize(): int { |
|
57
|
|
|
return $this->graphFontSize; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
public function getNodeShape(): string { |
|
61
|
|
|
return $this->nodeShape; |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
public function getNodeLabel(): string { |
|
65
|
|
|
return $this->nodeLabel; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function getRankDir(): string { |
|
69
|
|
|
return $this->rankDir; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
public function getArrowHead(): string { |
|
73
|
|
|
return $this->arrowHead; |
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
public function getWordWrapLimit(): int { |
|
77
|
|
|
return $this->wordWrapLimit; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
public function getParentRelation(): string { |
|
81
|
|
|
return $this->parentRelation; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
|
|
public function isGraphLink(): bool { |
|
85
|
|
|
return $this->enableGraphLink; |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
public function isGraphLabel(): bool { |
|
89
|
|
|
return $this->showGraphLabel; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
public function isGraphColor(): bool { |
|
93
|
|
|
return $this->showGraphColor; |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
public function isGraphLegend(): bool { |
|
97
|
|
|
return $this->showGraphLegend; |
|
98
|
|
|
} |
|
99
|
|
|
} |