~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to Bio/Graphics/Glyph/line.pm

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
package Bio::Graphics::Glyph::line;
2
 
# an arrow without the arrowheads
3
 
 
4
 
use strict;
5
 
use base qw(Bio::Graphics::Glyph::generic);
6
 
 
7
 
sub bottom {
8
 
  my $self = shift;
9
 
  my $val = $self->SUPER::bottom(@_);
10
 
  $val += $self->font->height if $self->option('tick');
11
 
  $val += $self->labelheight if $self->option('label');
12
 
  $val;
13
 
}
14
 
 
15
 
sub draw_component {
16
 
  my $self = shift;
17
 
  my $gd = shift;
18
 
  my ($x1,$y1,$x2,$y2) = $self->calculate_boundaries(@_);
19
 
 
20
 
  my $fg = $self->fgcolor;
21
 
  my $a2 = $self->SUPER::height/2;
22
 
  my $center = $y1+$a2;
23
 
 
24
 
  $gd->line($x1,$center,$x2,$center,$fg);
25
 
  # add a label if requested
26
 
  $self->draw_label($gd,@_) if $self->option('label');
27
 
 
28
 
}
29
 
 
30
 
1;
31
 
 
32
 
__END__
33
 
 
34
 
=head1 NAME
35
 
 
36
 
Bio::Graphics::Glyph::line - The "line" glyph
37
 
 
38
 
=head1 SYNOPSIS
39
 
 
40
 
  See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
41
 
 
42
 
=head1 DESCRIPTION
43
 
 
44
 
This glyph draws a line parallel to the sequence segment.
45
 
 
46
 
=head2 OPTIONS
47
 
 
48
 
This glyph takes only the standard options. See
49
 
L<Bio::Graphics::Glyph> for a full explanation.
50
 
 
51
 
  Option      Description                      Default
52
 
  ------      -----------                      -------
53
 
 
54
 
  -fgcolor      Foreground color               black
55
 
 
56
 
  -outlinecolor Synonym for -fgcolor
57
 
 
58
 
  -bgcolor      Background color               turquoise
59
 
 
60
 
  -fillcolor    Synonym for -bgcolor
61
 
 
62
 
  -linewidth    Line width                     1
63
 
 
64
 
  -height       Height of glyph                10
65
 
 
66
 
  -font         Glyph font                     gdSmallFont
67
 
 
68
 
  -connector    Connector type                 0 (false)
69
 
 
70
 
  -connector_color
71
 
                Connector color                black
72
 
 
73
 
  -label        Whether to draw a label        0 (false)
74
 
 
75
 
  -description  Whether to draw a description  0 (false)
76
 
 
77
 
  -strand_arrow Whether to indicate            0 (false)
78
 
                 strandedness
79
 
 
80
 
  -hilite       Highlight color                undef (no color)
81
 
 
82
 
=head1 BUGS
83
 
 
84
 
Please report them.
85
 
 
86
 
=head1 SEE ALSO
87
 
 
88
 
L<Bio::Graphics::Panel>,
89
 
L<Bio::Graphics::Glyph>,
90
 
L<Bio::Graphics::Glyph::arrow>,
91
 
L<Bio::Graphics::Glyph::cds>,
92
 
L<Bio::Graphics::Glyph::crossbox>,
93
 
L<Bio::Graphics::Glyph::diamond>,
94
 
L<Bio::Graphics::Glyph::dna>,
95
 
L<Bio::Graphics::Glyph::dot>,
96
 
L<Bio::Graphics::Glyph::ellipse>,
97
 
L<Bio::Graphics::Glyph::extending_arrow>,
98
 
L<Bio::Graphics::Glyph::generic>,
99
 
L<Bio::Graphics::Glyph::graded_segments>,
100
 
L<Bio::Graphics::Glyph::heterogeneous_segments>,
101
 
L<Bio::Graphics::Glyph::line>,
102
 
L<Bio::Graphics::Glyph::pinsertion>,
103
 
L<Bio::Graphics::Glyph::primers>,
104
 
L<Bio::Graphics::Glyph::rndrect>,
105
 
L<Bio::Graphics::Glyph::segments>,
106
 
L<Bio::Graphics::Glyph::ruler_arrow>,
107
 
L<Bio::Graphics::Glyph::toomany>,
108
 
L<Bio::Graphics::Glyph::transcript>,
109
 
L<Bio::Graphics::Glyph::transcript2>,
110
 
L<Bio::Graphics::Glyph::translation>,
111
 
L<Bio::Graphics::Glyph::triangle>,
112
 
L<Bio::DB::GFF>,
113
 
L<Bio::SeqI>,
114
 
L<Bio::SeqFeatureI>,
115
 
L<Bio::Das>,
116
 
L<GD>
117
 
 
118
 
=head1 AUTHOR
119
 
 
120
 
Allen Day E<lt>day@cshl.orgE<gt>.
121
 
 
122
 
Copyright (c) 2001 Cold Spring Harbor Laboratory
123
 
 
124
 
This library is free software; you can redistribute it and/or modify
125
 
it under the same terms as Perl itself.  See DISCLAIMER.txt for
126
 
disclaimers of warranty.
127
 
 
128
 
=cut