Bio::Graphics::Glyph dashed_line
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Summary
Bio::Graphics::Glyph::dashed_line - The "dashed line" glyph
Package variables
No package variables defined.
Inherit
Bio::Graphics::Glyph::generic
Synopsis
  See Bio::Graphics::Panel and Bio::Graphics::Glyph.
Description
This glyph draws a dashed line. The lengths of the dash and the space are configurable.
The space can be filled with a different color, thus making a two-colored line.
Also, the two colors can be "sheared". In addition to the common options, the following glyph-specific
options are recognized:
  Option      Description                  Default
------ ----------- -------
-dash_size Width of one dash 6 -space_size Width of one space 3 between dashes -space_color Color of the space none between dashes -shear Whether to use shearing 0 (1 or 0) -linewidth Standard option, but 1 important here
Methods
default_linewidth
No description
Code
default_dash_size
No description
Code
default_space_size
No description
Code
draw_component
No description
Code
Methods description
None available.
Methods code
default_linewidthdescriptionprevnextTop
sub default_linewidth {
  return 1;
}
default_dash_sizedescriptionprevnextTop
sub default_dash_size {
  return 6;
}
default_space_sizedescriptionprevnextTop
sub default_space_size {
  return 3;
}
draw_componentdescriptionprevnextTop
sub draw_component {
  my $self = shift;
  my $gd = shift;
  my ($x1,$y1,$x2,$y2) = $self->calculate_boundaries(@_);

  my $fg = $self->fgcolor;
  
  my $midY = ($y1+$y2) / 2;
my $linewidth = defined $self->option('linewidth') ? $self->option('linewidth') : $self->default_linewidth(); my $dash_size = defined $self->option('dash_size') ? $self->option('dash_size') : $self->default_dash_size(); my $space_size = defined $self->option('space_size') ? $self->option('space_size') : $self->default_space_size(); my $space_color = $self->option('space_color'); my $shear = $self->option('shear') || ""; $space_color = $self->factory->translate_color($space_color) if $space_color; my ($x, $_y1, $_y2); $x = $x1; while ($x<$x2) { my $newX = $x+$dash_size; $newX = $x2 if $newX > $x2; if ($shear == 1) { $_y1 = $midY-$linewidth; $_y2 = $midY; } else { $_y1 = $midY - $linewidth/2;
$_y2 = $midY + $linewidth/2;
} $self->filled_box($gd,$x,$_y1,$newX,$_y2,$fg,$fg); last if $newX >= $x2; $x = $newX; $newX = $x+$space_size; $newX = $x2 if $newX > $x2; if ($space_color) { if ($shear == 1) { $_y1 = $midY; $_y2 = $midY+$linewidth; } else { $_y1 = $midY - $linewidth/2;
$_y2 = $midY + $linewidth/2;
} $self->filled_box($gd, $x,$_y1,$newX,$_y2,$space_color,$space_color); } $x = $newX; }
}
General documentation
BUGSTop
Please report them.
SEE ALSOTop
Bio::Graphics::Panel,
Bio::Graphics::Glyph,
Bio::Graphics::Glyph::arrow,
Bio::Graphics::Glyph::cds,
Bio::Graphics::Glyph::crossbox,
Bio::Graphics::Glyph::diamond,
Bio::Graphics::Glyph::dna,
Bio::Graphics::Glyph::dot,
Bio::Graphics::Glyph::ellipse,
Bio::Graphics::Glyph::extending_arrow,
Bio::Graphics::Glyph::generic,
Bio::Graphics::Glyph::graded_segments,
Bio::Graphics::Glyph::heterogeneous_segments,
Bio::Graphics::Glyph::line,
Bio::Graphics::Glyph::pinsertion,
Bio::Graphics::Glyph::primers,
Bio::Graphics::Glyph::rndrect,
Bio::Graphics::Glyph::segments,
Bio::Graphics::Glyph::ruler_arrow,
Bio::Graphics::Glyph::toomany,
Bio::Graphics::Glyph::transcript,
Bio::Graphics::Glyph::transcript2,
Bio::Graphics::Glyph::translation,
Bio::Graphics::Glyph::triangle,
Bio::DB::GFF,
Bio::SeqI,
Bio::SeqFeatureI,
Bio::Das,
GD
AUTHORTop
Vsevolod (Simon) Ilyushchenko <simonf@cshl.edu>.
Copyright (c) 2004 Cold Spring Harbor Laboratory
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself. See DISCLAIMER.txt for
disclaimers of warranty.