|
NAMEUML::State - an object oriented module which draws simple state diagramsVERSIONThis documentation covers version 0.01, the initial release made in May 2003.SYNOPSISuse UML::State; my $diagram = UML::State->new( $node_array, $start_list, $accept_list, $edges ); # You may change these defaults (doing so may even work): $UML::State::ROW_SPACING = 75; # all numbers are in pixels $UML::State::LEFT_MARGIN = 20; $UML::State::WIDTH = 800; $UML::State::HEIGHT = 800; print $diagram->draw(); ABSTRACTAre you tired of pointing and clicking to make simple diagrams? Do your wrists hurt thinking about making the pretty UML your boss likes so well? Consider using UML::State and UML::Sequence to make your life easier.UML::State together with drawstate.pl allows you to easily generate state diagrams. You enter them in something like a cross between ASCII art and school room algebra. They come out looking like something from a drawing program like Visio. See drawstate.pl in the distribution for details about the input format and the samples directory for some examples of input and output. DESCRIPTIONYou will probably use this class by running drawstate.pl or drawstatexml.pl which are included in the distribution. But you can use this package directly to gain control over the appearance of your pictures.The two methods you need are new and draw (see below). If you want, you may change the dimensions by setting the package global variables as shown in the SYNOPSIS. Obviously, no error checking is done, so be careful to use reasonable values (positive numbers are good). All numbers are in pixels (sorry by Bezier's in SVG seem to require pixels). I have not tried changing the numbers, so I don't have any idea if doing so makes reasonable changes to the output. EXPORTNothing, this module is object oriented.METHODSnewThis constructor expects the following things:
drawThis method can be called any time after the constructor. It returns a string containing the svg for your state graph. You can print that, or parse it with standard XML techniques.BUGSSelf reference edges are just circles, they don't have arrows.There is no way to control the placement of labels. Only one letter labels look good. Resizing (changing the class constants) is unreliable. AUTHORPhil Crow <philcrow2000@yahoo.com<gt>COPYRIGHT AND LICENSECopyright 2003 by Phil Crow. All rights reserved. This is free software. You may modify and/or redistribute it under the same terms as Perl 5.8.0.
Visit the GSP FreeBSD Man Page Interface. |