Debian Codegraph @

texmf-dist/doc/metapost/metauml/manual/fig/state.mp

raw
1 % Sample MetaUML figures.
2 % Copyright (C) 2005 Ovidiu Gheorghies
3 %
4 % This program is free software; you can redistribute it and/or
5 % modify it under the terms of the GNU General Public License
6 % as published by the Free Software Foundation; either version 2
7 % of the License, or (at your option) any later version.
8 %
9 % This program is distributed in the hope that it will be useful,
10 % but WITHOUT ANY WARRANTY; without even the implied warranty of
11 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 % GNU General Public License for more details.
13 %
14 % You should have received a copy of the GNU General Public License
15 % along with this program; if not, write to the Free Software
16 % Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18
19 input metauml;
20
21 beginfig(1);
22 State.s("Take order")();
23 drawObject(s);
24 endfig;
25
26 beginfig(2);
27 Begin.b;
28 End.e;
29 State.c("Component")();
30 State.composite("Composite")(b, e, c);
31
32 b.midx = e.midx = c.midx;
33 c.top = b.bottom - 20;
34 e.top = c.bottom - 20;
35
36 composite.info.drawNameLine := 1;
37 drawObject(composite);
38
39 link(transition)(b.s -- c.n);
40 link(transition)(c.s -- e.n);
41 endfig;
42
43 beginfig(3);
44 save s;
45 State.s("An interesting state",
46 "which is worth mentioning")();
47 stateTransitions.s(
48 "OnEntry / Open eyes",
49 "OnExit / Sleep well");
50 s.info.drawNameLine := 1;
51
52 drawObject(s);
53 endfig;
54
55 end