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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090310071911-ever3si2bbzx1iks
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::ex;
2
 
 
3
 
# $Id: ex.pm,v 1.5.8.1 2006/10/02 23:10:19 sendu Exp $
4
 
# Non object-oriented utilities used here-and-there in Bio::Graphics modules
5
 
 
6
 
=head1 NAME
7
 
 
8
 
Bio::Graphics::Glyph::ex - the "ex", or "crossed box" glyph
9
 
 
10
 
=cut
11
 
 
12
 
use strict;
13
 
use base 'Bio::Graphics::Glyph::generic';
14
 
 
15
 
# override draw_component to draw a crossed box rather than empty
16
 
sub draw_component {
17
 
  my $self = shift;
18
 
  my $gd = shift;
19
 
  my $fg = $self->fgcolor;
20
 
  my ($left,$top) = @_;
21
 
  my($x1,$y1,$x2,$y2) = $self->bounds(@_);
22
 
 
23
 
  #if widthless
24
 
  if($self->option('point')){
25
 
    my $arm = int($self->height/2);
26
 
    my $minx    = $x2 > $x1 ? $x1 : $x2;
27
 
    my $centerx = abs($x2 - $x1) + $minx;
28
 
    my $miny    = $y2 > $y1 ? $y1 : $y2;
29
 
    my $centery = abs($y2 - $y1) + $miny;
30
 
    $gd->line($centerx-$arm, $centery-$arm, $centerx+$arm, $centery+$arm, $fg);
31
 
    $gd->line($centerx-$arm, $centery+$arm, $centerx+$arm, $centery-$arm, $fg);
32
 
    return;
33
 
  } else {
34
 
    $gd->line($x1,$y1,$x2,$y2,$fg);
35
 
    $gd->line($x1,$y2,$x2,$y1,$fg);
36
 
  }
37
 
}
38
 
 
39
 
 
40
 
1;
41
 
 
42
 
__END__
43
 
 
44
 
=head1 NAME
45
 
 
46
 
Bio::Graphics::Glyph::crossbox - The "crossbox" glyph
47
 
 
48
 
=head1 SYNOPSIS
49
 
 
50
 
  See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
51
 
 
52
 
=head1 DESCRIPTION
53
 
 
54
 
This is a box with an 'X' inside glyph.
55
 
 
56
 
=head2 OPTIONS
57
 
 
58
 
 
59
 
The following options are standard among all Glyphs.  See
60
 
L<Bio::Graphics::Glyph> for a full explanation.
61
 
 
62
 
  Option      Description                      Default
63
 
  ------      -----------                      -------
64
 
 
65
 
  -fgcolor      Foreground color               black
66
 
 
67
 
  -outlinecolor Synonym for -fgcolor
68
 
 
69
 
  -bgcolor      Background color               turquoise
70
 
 
71
 
  -fillcolor    Synonym for -bgcolor
72
 
 
73
 
  -linewidth    Line width                     1
74
 
 
75
 
  -height       Height of glyph                10
76
 
 
77
 
  -font         Glyph font                     gdSmallFont
78
 
 
79
 
  -connector    Connector type                 0 (false)
80
 
 
81
 
  -connector_color
82
 
                Connector color                black
83
 
 
84
 
  -label        Whether to draw a label        0 (false)
85
 
 
86
 
  -description  Whether to draw a description  0 (false)
87
 
 
88
 
  -hilite       Highlight color                undef (no color)
89
 
 
90
 
=head1 BUGS
91
 
 
92
 
Please report them.
93
 
 
94
 
=head1 SEE ALSO
95
 
 
96
 
L<Bio::Graphics::Panel>,
97
 
L<Bio::Graphics::Glyph>,
98
 
L<Bio::Graphics::Glyph::arrow>,
99
 
L<Bio::Graphics::Glyph::cds>,
100
 
L<Bio::Graphics::Glyph::crossbox>,
101
 
L<Bio::Graphics::Glyph::diamond>,
102
 
L<Bio::Graphics::Glyph::dna>,
103
 
L<Bio::Graphics::Glyph::dot>,
104
 
L<Bio::Graphics::Glyph::ellipse>,
105
 
L<Bio::Graphics::Glyph::extending_arrow>,
106
 
L<Bio::Graphics::Glyph::generic>,
107
 
L<Bio::Graphics::Glyph::graded_segments>,
108
 
L<Bio::Graphics::Glyph::heterogeneous_segments>,
109
 
L<Bio::Graphics::Glyph::line>,
110
 
L<Bio::Graphics::Glyph::pinsertion>,
111
 
L<Bio::Graphics::Glyph::primers>,
112
 
L<Bio::Graphics::Glyph::rndrect>,
113
 
L<Bio::Graphics::Glyph::segments>,
114
 
L<Bio::Graphics::Glyph::ruler_arrow>,
115
 
L<Bio::Graphics::Glyph::toomany>,
116
 
L<Bio::Graphics::Glyph::transcript>,
117
 
L<Bio::Graphics::Glyph::transcript2>,
118
 
L<Bio::Graphics::Glyph::translation>,
119
 
L<Bio::Graphics::Glyph::triangle>,
120
 
L<Bio::DB::GFF>,
121
 
L<Bio::SeqI>,
122
 
L<Bio::SeqFeatureI>,
123
 
L<Bio::Das>,
124
 
L<GD>
125
 
 
126
 
=head1 AUTHOR
127
 
 
128
 
Allen Day E<lt>day@cshl.orgE<gt>.
129
 
 
130
 
Copyright (c) 2001 Cold Spring Harbor Laboratory
131
 
 
132
 
This library is free software; you can redistribute it and/or modify
133
 
it under the same terms as Perl itself.  See DISCLAIMER.txt for
134
 
disclaimers of warranty.
135
 
 
136
 
=cut