~ubuntu-branches/ubuntu/hoary/bioperl/hoary

« back to all changes in this revision

Viewing changes to Bio/Graphics/ConfiguratorI.pm

  • Committer: Bazaar Package Importer
  • Author(s): Matt Hope
  • Date: 2004-04-18 14:24:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040418142411-gr92uexquw4w8liq
Tags: 1.4-1
* New upstream release
* Examples and working code are installed by default to usr/bin,
  this has been moved to usr/share/doc/bioperl/bin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $Id: ConfiguratorI.pm,v 1.3 2003/03/25 14:41:52 heikki Exp $
 
2
#
 
3
# BioPerl module for Bio::Graphics::ConfiguratorI
 
4
#
 
5
# Cared for by Robert Hubley <rhubley@systemsbiology.org>
 
6
#
 
7
# Copyright Robert Hubley
 
8
#
 
9
# You may distribute this module under the same terms as perl itself
 
10
 
 
11
# POD documentation - main docs before the code
 
12
 
 
13
=head1 NAME
 
14
 
 
15
Bio::Graphics::ConfiguratorI - A sectioned map of configuration
 
16
options (a map of maps), with a default section.  Intended to augment
 
17
existing tag-E<gt>value semantics (ie. of Bio::AnnotationCollectionI) for
 
18
object-representation information (eg. foreground color), and for
 
19
general interface preferences (eg. image width in gbrowse).
 
20
 
 
21
=head1 SYNOPSIS
 
22
 
 
23
    # get a ConfiguratorI somehow
 
24
    my $fg_color = $configurator->get('fgcolor');
 
25
 
 
26
=head1 DESCRIPTION
 
27
 
 
28
This object contains various configuration parameters.  It is divided
 
29
up into sections and tags.  This is essentially a multi-level map
 
30
(section-E<gt>tag-E<gt>value).  There is also the concept of a default
 
31
section which is referenced when no section is passed to the
 
32
ConfiguratorI methods.
 
33
 
 
34
=head1 FEEDBACK
 
35
 
 
36
=head2 Mailing Lists
 
37
 
 
38
User feedback is an integral part of the evolution of this and other
 
39
Bioperl modules. Send your comments and suggestions preferably to
 
40
the Bioperl mailing list.  Your participation is much appreciated.
 
41
 
 
42
  bioperl-l@bioperl.org            - General discussion
 
43
http://bioperl.org/MailList.shtml  - About the mailing lists
 
44
 
 
45
=head2 Reporting Bugs
 
46
 
 
47
Report bugs to the Bioperl bug tracking system to help us keep track
 
48
of the bugs and their resolution. Bug reports can be submitted via
 
49
email or the web:
 
50
 
 
51
  bioperl-bugs@bioperl.org
 
52
  http://bugzilla.bioperl.org/
 
53
 
 
54
=head1 AUTHOR - Robert Hubley
 
55
 
 
56
Email rhubley@systemsbiology.org
 
57
 
 
58
=head1 CONTRIBUTORS
 
59
 
 
60
Paul Edlefsen, pedlefsen@systemsbiology.org
 
61
Lincoln Stein, lstein@cshl.org
 
62
Heikki Lehvaslaiho, heikki@ebi.ac.uk
 
63
 
 
64
=head1 APPENDIX
 
65
 
 
66
The rest of the documentation details each of the object methods.
 
67
Internal methods are usually preceded with a _
 
68
 
 
69
=cut
 
70
 
 
71
# Let the code begin...
 
72
 
 
73
package Bio::Graphics::ConfiguratorI;
 
74
use vars qw( @ISA );
 
75
use strict;
 
76
use Bio::Root::RootI;
 
77
use Carp;
 
78
 
 
79
@ISA = qw( Bio::Root::RootI );
 
80
 
 
81
=head2 get_sections
 
82
 
 
83
 Title   : get_sections
 
84
 Usage   : my @values = $configurator->get_sections();
 
85
 Function: Returns a list of the valid sections except
 
86
           the default or undef.
 
87
 Returns : A list of the sections which can be queried.
 
88
 Args    : (optional section as string, tag as string)
 
89
 
 
90
=cut
 
91
 
 
92
sub get_sections {
 
93
   my ($self) = @_;
 
94
   $self->throw_not_implemented();
 
95
}
 
96
 
 
97
=head2 get_tags
 
98
 
 
99
 Title   : get_tags
 
100
 Usage   : my @values = $configurator->get_tags();
 
101
           or
 
102
           my @values = $configurator->get_tags('dna');
 
103
 Function: Returns a list of tags for a given section
 
104
           or only the default tags section if no section
 
105
           is given.
 
106
 Returns : A scalar list of tags
 
107
 Args    :
 
108
 
 
109
=cut
 
110
 
 
111
sub get_tags {
 
112
   my ($self) = @_;
 
113
   $self->throw_not_implemented();
 
114
}
 
115
 
 
116
=head2 get
 
117
 
 
118
 Title   : get
 
119
 Usage   : my $value = $configurator->get('height');
 
120
           or
 
121
           my $value = $configurator->get('dna','height');
 
122
 Function: Returns a tag value from a configurator from the
 
123
           either the default "_general" section or from
 
124
           a specified section or undef.
 
125
 Returns : A scalar value for the tag
 
126
 Args    : (optional section as string, tag as string)
 
127
 
 
128
=cut
 
129
 
 
130
sub get {
 
131
   my ($self) = @_;
 
132
   $self->throw_not_implemented();
 
133
}
 
134
 
 
135
=head2 set
 
136
 
 
137
 Title   : set
 
138
 Usage   : $configurator->set('fgcolor','chartreuse');
 
139
           or
 
140
           $configurator->set('EST','fgcolor','chartreuse');
 
141
 Function: Set a value for a tag
 
142
 Returns : The old value of the tag
 
143
 Args    : (optional section as string, tag as string, value as scalar)
 
144
 
 
145
=cut
 
146
 
 
147
sub set {
 
148
   my ($self) = @_;
 
149
   $self->throw_not_implemented();
 
150
}
 
151
 
 
152
 
 
153
=head2 get_and_eval
 
154
 
 
155
 Title   : get_and_eval
 
156
 Usage   : my $value = $configurator->get_and_eval('height');
 
157
           or
 
158
           my $value = $configurator->get_and_eval('dna','height');
 
159
 Function: This works like get() except that it is
 
160
           also able to evaluate code references.  These are
 
161
           options whose values begin with the characters
 
162
           "sub {".  In this case the value will be passed to
 
163
           an eval() and the resulting codereference returned.
 
164
 Returns : A value of the tag or undef.
 
165
 Args    : (optional section as string, tag as string)
 
166
 
 
167
=cut
 
168
 
 
169
sub get_and_eval {
 
170
   my ($self) = @_;
 
171
   $self->throw_not_implemented();
 
172
}
 
173
 
 
174
1;