~ubuntu-branches/ubuntu/oneiric/bioperl/oneiric

« back to all changes in this revision

Viewing changes to Bio/Graphics/Glyph/anchored_arrow.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:
2
2
# package to use for drawing an arrow
3
3
 
4
4
use strict;
5
 
use vars '@ISA','$VERSION';
 
5
use vars '@ISA';
6
6
use Bio::Graphics::Glyph::arrow;
7
7
@ISA = 'Bio::Graphics::Glyph::arrow';
8
 
$VERSION = 1.01;
9
8
 
10
9
sub draw_label {
11
10
  my $self = shift;
26
25
          $x = $new_x if ($new_x > $x);
27
26
      }
28
27
      $x = $self->panel->left + 1 if $x <= $self->panel->left;
29
 
      #detect collision (mostlikely no bump when want centering label)
 
28
      #detect collision (most likely no bump when want centering label)
30
29
      #lay down all features on one line e.g. cyto bands
31
30
      return if (!$self->option('bump') && ($label_width + $x) > $self->right);
32
31
      $gd->string($font,
50
49
  my $pstart  = $self->panel->left;
51
50
  my $pend    = $self->panel->right-1;
52
51
 
53
 
  if ($gstart < $pstart) {  # off left end
 
52
  if ($gstart <= $pstart) {  # off left end
54
53
    $sw = 1;
55
54
  }
56
 
  if ($gend > $pend) { # off right end
 
55
  if ($gend >= $pend) { # off right end
57
56
    $ne = 1;
58
57
  }
59
58
  return ($sw,$ne,!$sw,!$ne);
60
59
}
61
60
 
 
61
sub no_trunc {
 
62
  !shift->option('no_arrows');
 
63
}
 
64
 
62
65
1;
63
66
 
64
67
__END__
83
86
         |---------------------------->      right end off picture
84
87
 <------------------------------------>      both ends off picture
85
88
 
 
89
You can also set the glyph so that the end is just truncated at the
 
90
end of the picture.
 
91
 
 
92
         |-----------------------------
86
93
 
87
94
=head2 OPTIONS
88
95
 
115
122
 
116
123
  -description  Whether to draw a description  0 (false)
117
124
 
 
125
  -hilite       Highlight color                undef (no color)
 
126
 
118
127
In addition to the standard options, this glyph recognizes the following:
119
128
 
120
129
  Option         Description                Default
121
130
 
122
 
  -tick          draw a scale               0
 
131
  -tick          draw a scale               0 (false)
123
132
 
124
 
  -rel_coords    use relative coordinates   false
 
133
  -rel_coords    use relative coordinates   0 (false)
125
134
                 for scale
126
135
 
 
136
  -no_arrows     don't draw an arrow when   0 (false)
 
137
                 glyph is partly offscreen
 
138
 
127
139
The argument for B<-tick> is an integer between 0 and 2 and has the same
128
140
interpretation as the B<-tick> option in Bio::Graphics::Glyph::arrow.
129
141
 
137
149
 
138
150
=head1 SEE ALSO
139
151
 
140
 
L<Ace::Sequence>, L<Ace::Sequence::Feature>, L<Bio::Graphics::Panel>,
141
 
L<Bio::Graphics::Track>, L<Bio::Graphics::Glyph::anchored_arrow>,
 
152
L<Bio::Graphics::Panel>,
 
153
L<Bio::Graphics::Glyph>,
142
154
L<Bio::Graphics::Glyph::arrow>,
143
 
L<Bio::Graphics::Glyph::box>,
 
155
L<Bio::Graphics::Glyph::cds>,
 
156
L<Bio::Graphics::Glyph::crossbox>,
 
157
L<Bio::Graphics::Glyph::diamond>,
 
158
L<Bio::Graphics::Glyph::dna>,
 
159
L<Bio::Graphics::Glyph::dot>,
 
160
L<Bio::Graphics::Glyph::ellipse>,
 
161
L<Bio::Graphics::Glyph::extending_arrow>,
 
162
L<Bio::Graphics::Glyph::generic>,
 
163
L<Bio::Graphics::Glyph::graded_segments>,
 
164
L<Bio::Graphics::Glyph::heterogeneous_segments>,
 
165
L<Bio::Graphics::Glyph::line>,
 
166
L<Bio::Graphics::Glyph::pinsertion>,
144
167
L<Bio::Graphics::Glyph::primers>,
 
168
L<Bio::Graphics::Glyph::rndrect>,
145
169
L<Bio::Graphics::Glyph::segments>,
 
170
L<Bio::Graphics::Glyph::ruler_arrow>,
146
171
L<Bio::Graphics::Glyph::toomany>,
147
172
L<Bio::Graphics::Glyph::transcript>,
 
173
L<Bio::Graphics::Glyph::transcript2>,
 
174
L<Bio::Graphics::Glyph::translation>,
 
175
L<Bio::Graphics::Glyph::triangle>,
 
176
L<Bio::DB::GFF>,
 
177
L<Bio::SeqI>,
 
178
L<Bio::SeqFeatureI>,
 
179
L<Bio::Das>,
 
180
L<GD>
148
181
 
149
182
=head1 AUTHOR
150
183