1
package Bio::Graphics::Glyph::dashed_line;
4
use base qw(Bio::Graphics::Glyph::generic);
16
sub default_space_size
24
my ($x1,$y1,$x2,$y2) = $self->calculate_boundaries(@_);
26
my $fg = $self->fgcolor;
28
my $midY = ($y1+$y2) / 2;
30
my $linewidth = defined $self->option('linewidth') ? $self->option('linewidth') : $self->default_linewidth();
31
my $dash_size = defined $self->option('dash_size') ? $self->option('dash_size') : $self->default_dash_size();
32
my $space_size = defined $self->option('space_size') ? $self->option('space_size') : $self->default_space_size();
33
my $space_color = $self->option('space_color');
34
my $shear = $self->option('shear') || "";
35
$space_color = $self->factory->translate_color($space_color) if $space_color;
41
my $newX = $x+$dash_size;
42
$newX = $x2 if $newX > $x2;
45
$_y1 = $midY-$linewidth;
50
$_y1 = $midY - $linewidth/2;
51
$_y2 = $midY + $linewidth/2;
53
$self->filled_box($gd,$x,$_y1,$newX,$_y2,$fg,$fg);
57
$newX = $x+$space_size;
58
$newX = $x2 if $newX > $x2;
64
$_y2 = $midY+$linewidth;
68
$_y1 = $midY - $linewidth/2;
69
$_y2 = $midY + $linewidth/2;
71
$self->filled_box($gd, $x,$_y1,$newX,$_y2,$space_color,$space_color);
83
Bio::Graphics::Glyph::dashed_line - The "dashed line" glyph
87
See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.
91
This glyph draws a dashed line. The lengths of the dash and the space are configurable.
92
The space can be filled with a different color, thus making a two-colored line.
93
Also, the two colors can be "sheared".
97
In addition to the common options, the following glyph-specific
98
options are recognized:
100
Option Description Default
101
------ ----------- -------
103
-dash_size Width of one dash 6
105
-space_size Width of one space 3
108
-space_color Color of the space none
111
-shear Whether to use shearing 0
114
-linewidth Standard option, but 1
123
L<Bio::Graphics::Panel>,
124
L<Bio::Graphics::Glyph>,
125
L<Bio::Graphics::Glyph::arrow>,
126
L<Bio::Graphics::Glyph::cds>,
127
L<Bio::Graphics::Glyph::crossbox>,
128
L<Bio::Graphics::Glyph::diamond>,
129
L<Bio::Graphics::Glyph::dna>,
130
L<Bio::Graphics::Glyph::dot>,
131
L<Bio::Graphics::Glyph::ellipse>,
132
L<Bio::Graphics::Glyph::extending_arrow>,
133
L<Bio::Graphics::Glyph::generic>,
134
L<Bio::Graphics::Glyph::graded_segments>,
135
L<Bio::Graphics::Glyph::heterogeneous_segments>,
136
L<Bio::Graphics::Glyph::line>,
137
L<Bio::Graphics::Glyph::pinsertion>,
138
L<Bio::Graphics::Glyph::primers>,
139
L<Bio::Graphics::Glyph::rndrect>,
140
L<Bio::Graphics::Glyph::segments>,
141
L<Bio::Graphics::Glyph::ruler_arrow>,
142
L<Bio::Graphics::Glyph::toomany>,
143
L<Bio::Graphics::Glyph::transcript>,
144
L<Bio::Graphics::Glyph::transcript2>,
145
L<Bio::Graphics::Glyph::translation>,
146
L<Bio::Graphics::Glyph::triangle>,
155
Vsevolod (Simon) Ilyushchenko E<lt>simonf@cshl.eduE<gt>.
157
Copyright (c) 2004 Cold Spring Harbor Laboratory
159
This library is free software; you can redistribute it and/or modify
160
it under the same terms as Perl itself. See DISCLAIMER.txt for
161
disclaimers of warranty.