| 1 | package Bio::Graphics::Glyph::segmented_keyglyph; | ||
| 2 | |||
| 3 | # Don't use this package. It's just for inheriting the segmented glyph in the panel key. | ||
| 4 | |||
| 5 | use strict; | ||
| 6 | use base qw(Bio::Graphics::Glyph::generic); | ||
| 7 | |||
| 8 | sub make_key_feature { | ||
| 9 | my $self = shift; | ||
| 10 | my $scale = 1/$self->scale; # base pairs/pixel | ||
| 11 | # two segments, at pixels 0->50, 60->80 | ||
| 12 | my $offset = $self->panel->offset; | ||
| 13 | my $feature = | ||
| 14 | Bio::Graphics::Feature->new( | ||
| 15 | -segments=>[ [ 0*$scale +$offset,50*$scale+$offset], | ||
| 16 | [60*$scale+$offset, 80*$scale+$offset] | ||
| 17 | ], | ||
| 18 | -name => $self->make_key_name(), | ||
| 19 | -strand => '+1', | ||
| 20 | ); | ||
| 21 | } | ||
| 22 | |||
| 23 | 1; | ||
| 24 | |||
| 25 | __END__ |