1
# $Id: ConfiguratorI.pm,v 1.3 2003/03/25 14:41:52 heikki Exp $
3
# BioPerl module for Bio::Graphics::ConfiguratorI
5
# Cared for by Robert Hubley <rhubley@systemsbiology.org>
7
# Copyright Robert Hubley
9
# You may distribute this module under the same terms as perl itself
11
# POD documentation - main docs before the code
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).
23
# get a ConfiguratorI somehow
24
my $fg_color = $configurator->get('fgcolor');
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.
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.
42
bioperl-l@bioperl.org - General discussion
43
http://bioperl.org/MailList.shtml - About the mailing lists
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
51
bioperl-bugs@bioperl.org
52
http://bugzilla.bioperl.org/
54
=head1 AUTHOR - Robert Hubley
56
Email rhubley@systemsbiology.org
60
Paul Edlefsen, pedlefsen@systemsbiology.org
61
Lincoln Stein, lstein@cshl.org
62
Heikki Lehvaslaiho, heikki@ebi.ac.uk
66
The rest of the documentation details each of the object methods.
67
Internal methods are usually preceded with a _
71
# Let the code begin...
73
package Bio::Graphics::ConfiguratorI;
79
@ISA = qw( Bio::Root::RootI );
84
Usage : my @values = $configurator->get_sections();
85
Function: Returns a list of the valid sections except
87
Returns : A list of the sections which can be queried.
88
Args : (optional section as string, tag as string)
94
$self->throw_not_implemented();
100
Usage : my @values = $configurator->get_tags();
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
106
Returns : A scalar list of tags
113
$self->throw_not_implemented();
119
Usage : my $value = $configurator->get('height');
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)
132
$self->throw_not_implemented();
138
Usage : $configurator->set('fgcolor','chartreuse');
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)
149
$self->throw_not_implemented();
156
Usage : my $value = $configurator->get_and_eval('height');
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)
171
$self->throw_not_implemented();