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

« back to all changes in this revision

Viewing changes to Bio/Graphics/Glyph/christmas_arrow.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::christmas_arrow;
2
 
 
3
 
use strict;
4
 
use base qw(Bio::Graphics::Glyph::generic);
5
 
 
6
 
use Math::Trig;
7
 
 
8
 
sub default_radius
9
 
{
10
 
  return 4;  
11
 
}
12
 
 
13
 
sub default_length
14
 
{
15
 
  return 20;  
16
 
}
17
 
 
18
 
sub draw_component {
19
 
  my $self = shift;
20
 
  my $gd = shift;
21
 
  my ($x1,$y1,$x2,$y2) = $self->calculate_boundaries(@_);
22
 
  
23
 
  my $fg = $self->fgcolor;
24
 
  
25
 
  my $radius = defined $self->option('radius') ? $self->option('radius') : $self->default_radius ();
26
 
  
27
 
  $gd->filledEllipse($x1+$radius, $y2-$radius, 2*$radius, 2*$radius, $fg);
28
 
  
29
 
  my $length = defined $self->option('length') ? $self->option('length') : $self->default_length();
30
 
 
31
 
  my $angle = deg2rad(30);
32
 
  my $dx = 6;
33
 
  my $dy = 4;
34
 
  my $midX = $x2-$dx;
35
 
  my $midY = $y1+$dy;
36
 
 
37
 
  $gd->line($x1+$radius, $y2-$radius, $x1+$radius, $y1+$dy, $fg);
38
 
 
39
 
  return if ($x2-$x1 <= $radius);
40
 
  
41
 
  $x2 = $x1+$radius+$length;
42
 
  $gd->line($x1+$radius, $midY, $x2, $midY, $fg);
43
 
  $gd->line($x2, $midY, $x2-$dx, $y1, $fg);
44
 
  $gd->line($x2, $midY, $x2-$dx, $y1+2*$dy, $fg);
45
 
   
46
 
}
47
 
 
48
 
 
49
 
1;
50
 
 
51
 
__END__
52
 
 
53
 
=head1 NAME
54
 
 
55
 
Bio::Graphics::Glyph::christmas_arrow - The "christmas arrow" glyph
56
 
 
57
 
=head1 SYNOPSIS
58
 
 
59
 
  See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
60
 
 
61
 
=head1 DESCRIPTION
62
 
 
63
 
This glyph draws an arrow which has a circle ("christmas ball")
64
 
dangling at one end.
65
 
 
66
 
=head2 OPTIONS
67
 
 
68
 
In addition to the common options, the following glyph-specific
69
 
options are recognized:
70
 
 
71
 
  Option      Description                  Default
72
 
  ------      -----------                  -------
73
 
 
74
 
  -radius     Radius of the circle          4
75
 
              glyph
76
 
 
77
 
  -length     Length of the arrow           20
78
 
 
79
 
  -height     Standard option, but          10
80
 
              important here
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
 
Vsevolod (Simon) Ilyushchenko E<lt>simonf@cshl.eduE<gt>.
121
 
 
122
 
Copyright (c) 2004 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