Graph/Xmgrace/Dataset_Options.pm

filter: Statementstmt 63.1% 60 / 95 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 52.6% 10 / 19 Podpod n/a totaltotal 60.3% 70 / 116 CC 3 SCAR 10.8
CC
3
Cov
62%
print
12.0
fill_color
2.0
symbol_char
2.0
CRAP 3.0
« Graph/Xmgrace/Graph_Presentation_Type.pm ↑ Summary Graph/Xmgrace/Graph_Options.pm »
1 #
2 # Dataset_Options.pm
3 #
4 ## This software product is developed by Esmond Lee and David Moore,
5 ## and copyrighted(C) 1998 by the University of California, San Diego
6 ## (UCSD), with all rights reserved. UCSD administers the CAIDA grant,
7 ## NCR-9711092, under which part of this code was developed.
8 ##
9 ## There is no charge for this software. You can redistribute it and/or
10 ## modify it under the terms of the GNU General Public License, v. 2 dated
11 ## June 1991 which is incorporated by reference herein. This software is
12 ## distributed WITHOUT ANY WARRANTY, IMPLIED OR EXPRESS, OF MERCHANTABILITY
13 ## OR FITNESS FOR A PARTICULAR PURPOSE or that the use of it will not
14 ## infringe on any third party's intellectual property rights.
15 ##
16 ## You should have received a copy of the GNU GPL along with this program.
17 ##
18 ##
19 ## IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY
20 ## PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
21 ## DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS
22 ## SOFTWARE, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF
23 ## THE POSSIBILITY OF SUCH DAMAGE.
24 ##
25 ## THE SOFTWARE PROVIDED HEREIN IS ON AN "AS IS" BASIS, AND THE
26 ## UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
27 ## SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. THE UNIVERSITY
28 ## OF CALIFORNIA MAKES NO REPRESENTATIONS AND EXTENDS NO WARRANTIES
29 ## OF ANY KIND, EITHER IMPLIED OR EXPRESS, INCLUDING, BUT NOT LIMITED
30 ## TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
31 ## PARTICULAR PURPOSE, OR THAT THE USE OF THE SOFTWARE WILL NOT INFRINGE
32 ## ANY PATENT, TRADEMARK OR OTHER RIGHTS.
33 ##
34 ##
35 ## Contact: graph-dev@caida.org
36 ##
37 ##
38  
39 4 $VERSION = 3.2;
40  
41 4 ▶use Chart::Graph::Xmgrace::Base_Dataset_Option;
Subroutine BEGIN: called CC=1 SCAR=0.0
42 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
43  
44 package Chart::Graph::Xmgrace::Symbol_Options;
45 4 @ISA= qw(Chart::Graph::Xmgrace::Base_Dataset_Option);
46  
47 60 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
48 60 my $self = shift;
49 60 my $color = shift;
50  
51 60 $self->{name} = "symbol";
52 60 $self->{print_order} = ["symbol type","size","color","pattern","fill color",
53 "fill pattern","linewidth","linestyle","char",
54 "char font","skip"];
55 60 $self->{length} = 4;
56 $self->{options} = {
57 60 "symbol type" => "0",
58 "size" => "1.000000",
59 "color" => $color,
60 "pattern" => "1",
61 "fill color" => $color,
62 "fill pattern" => "0",
63 "linewidth" => "1.0",
64 "linestyle" => "1",
65 "char" => "65",
66 "char font" => "0",
67 "skip" => "0",
68 };
69 }
70  
71 0 ▶sub fill_color ($$) {
Subroutine fill_color: not called CC=1 SCAR=6.9
72 0 my $self = shift;
73 0 my $val = shift;
74 0 $self->{options}->{"fill color"} = $val;
75 }
76  
77 30 ▶sub fill_pattern ($$) {
Subroutine fill_pattern: called CC=1 SCAR=0.0
78 30 my $self = shift;
79 30 my $val = shift;
80 30 $self->{options}->{"fill pattern"} = $val;
81 }
82  
83 0 ▶sub symbol_char ($$) {
Subroutine symbol_char: not called CC=1 SCAR=6.9
84 0 my $self = shift;
85 0 my $val = shift;
86 0 $self->{options}->{"symbol char"} = $val;
87 }
88  
89 0 ▶sub char_font ($$) {
Subroutine char_font: not called CC=1 SCAR=6.9
90 0 my $self = shift;
91 0 my $val = shift;
92 0 $self->{options}->{"char font"} = $val;
93 }
94  
95 0 ▶sub print($$$ ) {
Subroutine print: not called CC=3 SCAR=24.8
96 0 my $self = shift;
97 0 my ($handle, $set) = @_;
98 0 my $string = "";
99
100 0 foreach $option (@{ $self->{"print_order"} }) {
101 0 my $option_ref = $self->{"options"};
102  
103 0 ▶ if ($option eq "symbol type") {
Branch: 1 branch
BranchTrueFalseTotal
if ($option eq 'symbol type') { } 0 0 0
104 0 $string = "$set $self->{name} $option_ref->{$option}\n";
105 } else {
106 0 $string = "$set $self->{name} $option $option_ref->{$option}\n";
107 }
108
109 0 $self->_printline($handle, $string, $self->{"length"});
110 0 $string = "";
111 }
112 }
113  
114 package Chart::Graph::Xmgrace::Line_Options;
115 4 @ISA= qw(Chart::Graph::Xmgrace::Base_Dataset_Option);
116  
117 60 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
118 60 my $self = shift;
119 60 my $color = shift;
120 60 $self->{name} = "line";
121 60 $self->{print_order} = ["type","linestyle","linewidth","color","pattern"];
122 60 $self->{length} = 4;
123 $self->{options} = {
124 60 "type" => "1", # straight, left stairs, right stairs, segs, 3-segs
125 "linestyle" => "1", # solid, 7 other variations of dotted lines
126 "linewidth" => "1.0",
127 "color" => $color,
128 "pattern" => "1",
129 };
130 }
131  
132 package Chart::Graph::Xmgrace::Baseline_Options;
133 4 @ISA= qw(Chart::Graph::Xmgrace::Base_Dataset_Option);
134  
135 60 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
136 60 my $self = shift;
137 60 my $color = shift;
138 60 $self->{name} = "baseline";
139 60 $self->{print_order} = ["type","status"];
140 60 $self->{length} = 4;
141 $self->{options} = {
142 60 "type" => "0",
143 "status" => "off",
144 };
145  
146 }
147  
148 package Chart::Graph::Xmgrace::Dropline_Options;
149 4 @ISA= qw(Chart::Graph::Xmgrace::Base_Dataset_Option);
150  
151 60 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
152 60 my $self = shift;
153 60 my $color = shift;
154 60 $self->{name} = "dropline";
155 60 $self->{print_order} = ["status"];
156 60 $self->{length} = 4;
157 $self->{options} = {
158 60 "status" => "off",
159 };
160  
161 }
162  
163 package Chart::Graph::Xmgrace::Fill_Options;
164 4 @ISA= qw(Chart::Graph::Xmgrace::Base_Dataset_Option);
165  
166 60 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
167 60 my $self = shift;
168 60 my $color = shift;
169 60 $self->{name} = "fill";
170 60 $self->{print_order} = ["type","rule","color","pattern"];
171 60 $self->{length} = 4;
172 $self->{options} = {
173 60 "type" => "0",
174 "rule" => "0",
175 "color" => $color,
176 "pattern" => "1",
177 };
178 }
179
180  
181 package Chart::Graph::Xmgrace::Avalue_Options;
182 4 @ISA= qw(Chart::Graph::Xmgrace::Base_Dataset_Option);
183  
184 60 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
185 60 my $self = shift;
186 60 my $color = shift;
187 60 $self->{name} = "avalue";
188 60 $self->{print_order} = ["status","type","char size","font","color",
189 "rot","format","prec","prepend","append","offset"];
190 60 $self->{length} = 4;
191 $self->{options} = {
192 60 "status" => "off",
193 "type" => "2",
194 "char size" => "1.000000",
195 "font" => "0",
196 "color" => $color, # used to be "auto"
197 "rot" => "0",
198 "format" => "general",
199 "prec" => "3",
200 "prepend" => "",
201 "append" => "",
202 "offset" => ["0.000000", "0.000000"],
203 };
204  
205 }
206  
207 0 ▶sub char_size ($$) {
Subroutine char_size: not called CC=1 SCAR=6.9
208 0 my $self = shift;
209 0 my $val = shift;
210 0 $self->{options}->{"char size"} = $val;
211 }
212  
213  
214 package Chart::Graph::Xmgrace::Errorbar_Options;
215 4 @ISA= qw(Chart::Graph::Xmgrace::Base_Dataset_Option);
216  
217 60 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
218 60 my $self = shift;
219 60 my $color = shift;
220 60 $self->{name} = "errorbar";
221 60 $self->{print_order} = ["status","place","color","pattern","size","linewidth",
222 "linestyle","riser linewidth","riser linestyle",
223 "riser clip", "riser clip length"];
224 60 $self->{length} = 4;
225 $self->{options} = {
226 60 "status" => "on",
227 "place" => "normal",
228 "color" => $color,
229 "pattern" => "1",
230 "size" => "1.000000",
231 "linewidth" => "1.0",
232 "linestyle" => "1",
233 "riser linewidth" => "1.0",
234 "riser linestyle" => "1",
235 "riser clip" => "off",
236 "riser clip length" => "0.100000",
237 };
238 }
239  
240 0 ▶sub riser_linewidth ($$) {
Subroutine riser_linewidth: not called CC=1 SCAR=6.9
241 0 my $self = shift;
242 0 my $val = shift;
243 0 $self->{options}->{"riser linewidth"} = $val;
244 }
245  
246 0 ▶sub riser_linestyle ($$) {
Subroutine riser_linestyle: not called CC=1 SCAR=6.9
247 0 my $self = shift;
248 0 my $val = shift;
249 0 $self->{options}->{"riser linestyle"} = $val;
250 }
251  
252 0 ▶sub riser_clip_status ($$) {
Subroutine riser_clip_status: not called CC=1 SCAR=6.9
253 0 my $self = shift;
254 0 my $val = shift;
255 0 $self->{options}->{"riser clip status"} = $val;
256 }
257  
258 0 ▶sub riser_clip_length ($$) {
Subroutine riser_clip_length: not called CC=1 SCAR=6.9
259 0 my $self = shift;
260 0 my $val = shift;
261 0 $self->{options}->{"riser clip length"} = $val;
262 }
263  
264 4 1;
265  
266  
267  
268  
269  
« Graph/Xmgrace/Graph_Presentation_Type.pm ↑ Summary Graph/Xmgrace/Graph_Options.pm »