AcePerl

 view release on metacpan or  search on metacpan

Ace/Graphics/GlyphFactory.pm  view on Meta::CPAN


=over 4

=item $factory = Ace::Graphics::GlyphFactory->new($glyph_name,@options)

The new() method creates a new factory object.  The object will create
glyphs of type $glyph_name, and using the options specified in
@options.  Generic options are described in L<Ace::Graphics::Panel>,
and specific options are described in each of the
Ace::Graphics::Glyph::* manual pages.
=back

=head2 OBJECT METHODS

Once a track is created, the following methods can be invoked:

=over 4

=item $glyph = $factory->glyph($feature)

Given a sequence feature, creates an Ace::Graphics::Glyph object to
display it.  The various attributes of the glyph are set from the
options provided at factory creation time.

=item $option = $factory->option($option_name [,$new_option])

Given an option name, returns its value.  If a second argument is
provided, sets the option to the new value and returns its previous
one.

=item $index = $factory->fgcolor

Returns the desired foreground color for the glyphs in the form of an
GD::Image color index.  This may be the one of the special colors
gdBrushed and gdStyled.  This is only useful while the enclosing
Ace::Graphics::Panel object is rendering the object.  In other
contexts it returns undef.

=item $scale = $factory->scale([$scale])

Get or set the scale, in pixels/bp, for the glyph.  This is
ordinarily set by the Ace::Graphics::Track object just prior to
rendering, and called by each glyphs' map_pt() method when performing
the rendering.

=item $color = $factory->bgcolor([$color])

Get or set the background color for the glyphs.

=item $color = $factory->fillcolor([$color])

Get or set the fill color for the glyphs.

=item $font = $factory->font([$font])

Get or set the font to use for rendering the glyph.

=item $color = $factory->fontcolor

Get the color for the font (to set it, use fgcolor()).  This is subtly
different from fgcolor() itself, because it will never return a styled
color, such as gdBrushed.

=item $panel = $factory->panel([$panel])

Get or set the panel that contains the GD::Image object used by this
factory.

=item $index = $factory->translate($color)

=item @rgb = $factory->rgb($index)

These are convenience procedures that are passed through to the
enclosing Panel object and have the same effect as the like-named
methods in that class.  See L<Ace::Graphics::Panel>.

=back

=head1 BUGS

Please report them.

=head1 SEE ALSO

L<Ace::Sequence>, L<Ace::Sequence::Feature>, L<Ace::Graphics::Panel>,
L<Ace::Graphics::Track>, L<Ace::Graphics::Glyph>

=head1 AUTHOR

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.

=cut



( run in 1.483 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )