File Coverage

blib/lib/Chart/Graph/Xmgrace/Grace.pm
Criterion Covered Total %
statement 39 56 69.6
branch n/a
condition n/a
subroutine 11 19 57.8
pod 0 16 0.0
total 50 91 54.9


line stmt bran cond sub pod time code
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             $VERSION = 3.2;
40              
41             package Chart::Graph::Xmgrace::Grace;
42 4     4   15185 use Chart::Graph::Xmgrace::Graph_Options;
  4         15  
  4         235  
43 4     4   2710 use Chart::Graph::Xmgrace::Axes;
  4         14  
  4         3068  
44             @ISA = qw(Chart::Graph::Xmgrace::Base_Option);
45              
46             sub _init {
47 3     3   4 my $self = shift;
48 3         5 my $graph_number = shift;
49 3         19 $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         7 $self->{output_type} = undef;
54 3         4 $self->{output_file} = undef;
55 3         5 $self->{grace_output_file} = undef;
56 3         8 $self->{auto_color} = undef;
57 3         5 $self->{length} = 0;
58 3         33 $self->{options} = {
59             "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             sub print ($$ ) {
74 1     1 0 1 my $self = shift;
75 1         3 my ($handle) = @_;
76             #my @cum_data_set_objects = @{$cum_data_set_objects};
77              
78 1         23 print $handle "# Grace project file\n# \n";
79 1         2 foreach $option (@{ $self->{"print_order"} }) {
  1         5  
80 11         19 my $option_ref = $self->{"options"};
81              
82             # call each objects own print function
83 11         97 $option_ref->{$option}->print($handle);
84             }
85             }
86              
87             sub graph_global_options ($) {
88 2     2 0 3 my $self = shift;
89 2         26 return $self->{options}->{"graph global options"};
90             }
91              
92             sub global_options ($) {
93 0     0 0 0 my $self = shift;
94 0         0 return $self->{options}->{"global options"};
95             }
96              
97             sub world_options ($) {
98 0     0 0 0 my $self = shift;
99 0         0 return $self->{options}->{"world options"};
100             }
101              
102             sub stack_options ($) {
103 0     0 0 0 my $self = shift;
104 0         0 return $self->{options}->{"stack options"};
105             }
106              
107             sub view_options ($) {
108 0     0 0 0 my $self = shift;
109 0         0 return $self->{options}->{"view options"};
110             }
111              
112             sub axes_options ($) {
113 2     2 0 2 my $self = shift;
114 2         24 return $self->{options}->{"axes options"};
115             }
116              
117             sub title_options ($$) {
118 1     1 0 4 my $self = shift;
119 1         12 return $self->{options}->{"title options"};
120             }
121              
122             sub subtitle_options ($) {
123 1     1 0 2 my $self = shift;
124 1         14 return $self->{options}->{"subtitle options"};
125             }
126              
127             sub legend_options ($) {
128 0     0 0 0 my $self = shift;
129 0         0 return $self->{options}->{"legend options"};
130             }
131             sub frame_options ($) {
132 0     0 0 0 my $self = shift;
133 0         0 return $self->{options}->{"frame options"};
134             }
135             sub extra_options ($) {
136 0     0 0 0 my $self = shift;
137 0         0 return $self->{options}->{"extra options"};
138             }
139             sub output_file ($$) {
140 1     1 0 2 my $self = shift;
141 1         3 my $value = shift;
142 1         3 $self->{output_file} = $value;
143             }
144             sub output_type ($$) {
145 1     1 0 2 my $self = shift;
146 1         3 my $value= shift;
147 1         3 $self->{output_type} = $value;
148             }
149             sub grace_output_file ($$) {
150 1     1 0 2 my $self = shift;
151 1         2 my $value = shift;
152 1         5 $self->{grace_output_file} = $value;
153             }
154             sub autocolor ($$) {
155 0     0 0   my $self = shift;
156 0           my $value = shift;
157 0           $self->{autocolor} = $value;
158             }
159              
160             1;