Graph/Xmgrace/Grace.pm

filter: Statementstmt 71.1% 42 / 59 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.8% 11 / 19 Podpod 0.0% 0 / 16 totaltotal 56.3% 53 / 94 CC 2 SCAR 4.1
CC
2
Cov
71%
print
2.0
global_options
2.0
world_options
2.0
CRAP 1.5
« Graph/Xmgrace/World_Option.pm ↑ Summary Graph/Xmgrace/Axes.pm »
1 #
2 # Grace.pm is the grace object that holds ALL options
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 package Chart::Graph::Xmgrace::Grace;
42 4 ▶use Chart::Graph::Xmgrace::Graph_Options;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 4 ▶use Chart::Graph::Xmgrace::Axes;
Subroutine BEGIN: called CC=1 SCAR=0.0
44 4 @ISA = qw(Chart::Graph::Xmgrace::Base_Option);
45  
46 3 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
47 3 my $self = shift;
48 3 my $graph_number = shift;
49 3 $self->{print_order} = ["global options","graph global options","world options",
50 "stack options","view options","title options",
51 "subtitle options","axes options","legend options",
52 "frame options", "extra options"];
53 3 $self->{output_type} = undef;
54 3 $self->{output_file} = undef;
55 3 $self->{grace_output_file} = undef;
56 3 $self->{auto_color} = undef;
57 3 $self->{length} = 0;
58 $self->{options} = {
59 3 "global options" => new Chart::Graph::Xmgrace::Global_Options,
60 "graph global options" => new Chart::Graph::Xmgrace::Graph_Global_Options($graph_number),
61 "world options" => new Chart::Graph::Xmgrace::World_Options,
62 "stack options" => new Chart::Graph::Xmgrace::Stack_Options,
63 "view options" => new Chart::Graph::Xmgrace::View_Options,
64 "title options" => new Chart::Graph::Xmgrace::Title_Options,
65 "subtitle options" => new Chart::Graph::Xmgrace::Subtitle_Options,
66 "axes options" => new Chart::Graph::Xmgrace::Axes,
67 "legend options" => new Chart::Graph::Xmgrace::Legend_Options,
68 "frame options" => new Chart::Graph::Xmgrace::Frame_Options,
69 "extra options" => new Chart::Graph::Xmgrace::Extra_Options,
70 };
71 }
72  
73 1 ▶sub print ($$ ) {
Subroutine print: called CC=2 SCAR=6.9
Pod undocumented
74 1 my $self = shift;
75 1 my ($handle) = @_;
76 #my @cum_data_set_objects = @{$cum_data_set_objects};
77  
78 1 print $handle "# Grace project file\n# \n";
79 1 foreach $option (@{ $self->{"print_order"} }) {
80 11 my $option_ref = $self->{"options"};
81  
82 # call each objects own print function
83 11 $option_ref->{$option}->print($handle);
84 }
85 }
86  
87 2 ▶sub graph_global_options ($) {
Subroutine graph_global_options: called CC=1 SCAR=0.0
Pod undocumented
88 2 my $self = shift;
89 2 return $self->{options}->{"graph global options"};
90 }
91  
92 0 ▶sub global_options ($) {
Subroutine global_options: not called CC=1 SCAR=6.9
Pod undocumented
93 0 my $self = shift;
94 0 return $self->{options}->{"global options"};
95 }
96  
97 0 ▶sub world_options ($) {
Subroutine world_options: not called CC=1 SCAR=6.9
Pod undocumented
98 0 my $self = shift;
99 0 return $self->{options}->{"world options"};
100 }
101  
102 0 ▶sub stack_options ($) {
Subroutine stack_options: not called CC=1 SCAR=6.9
Pod undocumented
103 0 my $self = shift;
104 0 return $self->{options}->{"stack options"};
105 }
106  
107 0 ▶sub view_options ($) {
Subroutine view_options: not called CC=1 SCAR=6.9
Pod undocumented
108 0 my $self = shift;
109 0 return $self->{options}->{"view options"};
110 }
111  
112 2 ▶sub axes_options ($) {
Subroutine axes_options: called CC=1 SCAR=0.0
Pod undocumented
113 2 my $self = shift;
114 2 return $self->{options}->{"axes options"};
115 }
116  
117 1 ▶sub title_options ($$) {
Subroutine title_options: called CC=1 SCAR=0.0
Pod undocumented
118 1 my $self = shift;
119 1 return $self->{options}->{"title options"};
120 }
121  
122 1 ▶sub subtitle_options ($) {
Subroutine subtitle_options: called CC=1 SCAR=0.0
Pod undocumented
123 1 my $self = shift;
124 1 return $self->{options}->{"subtitle options"};
125 }
126  
127 0 ▶sub legend_options ($) {
Subroutine legend_options: not called CC=1 SCAR=6.9
Pod undocumented
128 0 my $self = shift;
129 0 return $self->{options}->{"legend options"};
130 }
131 0 ▶sub frame_options ($) {
Subroutine frame_options: not called CC=1 SCAR=6.9
Pod undocumented
132 0 my $self = shift;
133 0 return $self->{options}->{"frame options"};
134 }
135 0 ▶sub extra_options ($) {
Subroutine extra_options: not called CC=1 SCAR=6.9
Pod undocumented
136 0 my $self = shift;
137 0 return $self->{options}->{"extra options"};
138 }
139 1 ▶sub output_file ($$) {
Subroutine output_file: called CC=1 SCAR=0.0
Pod undocumented
140 1 my $self = shift;
141 1 my $value = shift;
142 1 $self->{output_file} = $value;
143 }
144 1 ▶sub output_type ($$) {
Subroutine output_type: called CC=1 SCAR=0.0
Pod undocumented
145 1 my $self = shift;
146 1 my $value= shift;
147 1 $self->{output_type} = $value;
148 }
149 1 ▶sub grace_output_file ($$) {
Subroutine grace_output_file: called CC=1 SCAR=0.0
Pod undocumented
150 1 my $self = shift;
151 1 my $value = shift;
152 1 $self->{grace_output_file} = $value;
153 }
154 0 ▶sub autocolor ($$) {
Subroutine autocolor: not called CC=1 SCAR=6.9
Pod undocumented
155 0 my $self = shift;
156 0 my $value = shift;
157 0 $self->{autocolor} = $value;
158 }
159  
160 4 1;
« Graph/Xmgrace/World_Option.pm ↑ Summary Graph/Xmgrace/Axes.pm »