Bio::Graphics::Glyph::track - The "track" glyph


Bio-Graphics documentation Contained in the Bio-Graphics distribution.

Index


Code Index:

NAME

Top

Bio::Graphics::Glyph::track - The "track" glyph

SYNOPSIS

Top

  See L<Bio::Graphics::Panel> and L<Bio::Graphics::Glyph>.

DESCRIPTION

Top

This glyph is used internally by Bio::Graphics::Panel for laying out tracks. It should not be used explicitly.

BUGS

Top

Please report them.

SEE ALSO

Top

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

AUTHOR

Top

Lincoln Stein <lstein@cshl.org>

Copyright (c) 2001 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.


Bio-Graphics documentation Contained in the Bio-Graphics distribution.

package Bio::Graphics::Glyph::track;

use strict;
use base qw(Bio::Graphics::Glyph);

# track sets connector to empty
sub connector {
  my $self = shift;
  return $self->SUPER::connector(@_) if $self->all_callbacks;
  return 'none';
}

sub draw {
  my $self = shift;
  my ($gd,$left,$top,$partno,$total_parts) = @_;

  # the clipping code here prevents poorly-behaving glyphs from
  # drawing outside the track
  my @clip;
  if ($gd->can('clip')) {
    @clip = $gd->clip();
    # glyphs are allowed a slop area of ~3 on either side and 6 on the top and bottom
    # in order to spill out over their boundaries.  Beyond this they start overlapping
    # with other glyphs in an ugly way.
    my @cliprect = ($left-$self->panel->pad_left,
		    $top-6,
		    $self->panel->right+$self->panel->pad_right,
		    $top+$self->layout_height+6);
    $gd->clip(@cliprect);
  }

  my @parts = $self->parts;
  for (my $i=0; $i<@parts; $i++) {
    $parts[$i]->draw_highlight($gd,$left,$top);
    $parts[$i]->draw($gd,$left,$top,0,1);
  }

  $gd->clip(@clip) if @clip;
}

# do nothing for components
# sub draw_component { }

sub bump { 
    my $self = shift;
    return 1 if $self->option('group_subtracks');
    my $bump = $self->SUPER::bump;
    return 1  if $bump eq 'fast' or $bump == 3;
    return $bump;
}

1;


__END__