File Coverage

blib/lib/Chart/Graph/Xmgrace/Axes.pm
Criterion Covered Total %
statement 29 29 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 35 36 97.2


line stmt bran cond sub pod time code
1             #
2             # Axes.pm contains options for the Axes
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             # Included objects:
39             # 1) Chart::Graph::Xmgrace::Axes_Options
40             #
41              
42             $VERSION = 3.2;
43              
44             package Chart::Graph::Xmgrace::Axes;
45             @ISA = qw(Chart::Graph::Xmgrace::Axis_Option);
46 4     4   3238 use Chart::Graph::Xmgrace::Axis;
  4         10  
  4         119  
47 4     4   32 use Carp;
  4         6  
  4         1584  
48              
49             sub _init {
50 3     3   4 my $self = shift;
51 3         16 $self->{print_order} = ["xaxes", "yaxes", "xaxis","yaxis",
52             "altxaxis","altyaxis"];
53 3         5 $self->{length} = 4;
54 3         29 $self->{options} = {
55             "xaxes" => new Chart::Graph::Xmgrace::Axes_Options("xaxes"),
56             "yaxes" => new Chart::Graph::Xmgrace::Axes_Options("yaxes"),
57             "xaxis" => new Chart::Graph::Xmgrace::Axis("xaxis"),
58             "yaxis" => new Chart::Graph::Xmgrace::Axis("yaxis"),
59             "altxaxis" => new Chart::Graph::Xmgrace::Axis("altxaxis"),
60             "altyaxis" => new Chart::Graph::Xmgrace::Axis("altyaxis"),
61             };
62            
63             # by default, the alternate axes are off
64 3         29 $self->altxaxis->status("off");
65 3         14 $self->altxaxis->label_options->place(["0.000000","0.105000"]);
66 3         15 $self->altyaxis->status("off");
67 3         13 $self->altyaxis->label_options->place(["0.000000","0.105000"]);
68             }
69              
70             sub print ($$$$ ) {
71 1     1 0 2 my $self = shift;
72 1         1 my ($handle) = @_;
73            
74 1         3 foreach $option (@{ $self->{"print_order"} }) {
  1         4  
75 6         8 my $option_ref = $self->{"options"};
76            
77             # call each objects own print function
78 6         24 $option_ref->{$option}->print($handle);
79             }
80             }
81              
82             package Chart::Graph::Xmgrace::Axes_Options;
83             @ISA = qw(Chart::Graph::Xmgrace::Base_Option);
84 4     4   30 use Carp;
  4         8  
  4         476  
85              
86             sub _init {
87 6     6   7 my $self = shift;
88 6         18 my $type_of_axes = shift; # xaxes, yaxes
89 6         12 $self->{name} = $type_of_axes;
90 6         11 $self->{print_order} = ["scale","invert"];
91 6         7 $self->{length} = 4;
92 6         22 $self->{options} = {
93             "scale" => "Normal", # Normal, Linear, Reciprocal
94             "invert" => "off",
95             };
96             }
97              
98             1;