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