Debian Codegraph @

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

raw
1 % Part of the MetaUML manual.
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 input metauml;
19
20 beginfig(1);
21 EntryPoint.entry;
22 ExitPoint.exit;
23
24 entry.nw = (0,0);
25 exit.nw = (50,50);
26
27 drawObjects(entry, exit);
28 clink(transition)(entry, exit);
29 endfig;
30
31 beginfig(2);
32 EState.myState(iState)("The light is", "visibly on")();
33 drawObject(myState);
34
35 State.anotherState("Another nice state")();
36 anotherState.info.drawNameLine := 1;
37 drawObjectAt(anotherState)(anotherState.nw = (0,50));
38 endfig;
39
40 beginfig(3);
41 State.interesting("Interesting state")();
42 State_internalTransitions.interesting("OnEntry / doVeryHappy", "OnExit / doSomewhatSad");
43 interesting.info.drawNameLine := 1;
44
45 drawObject(interesting);
46 endfig;
47
48 beginfig(4);
49 Begin.b;
50 End.e;
51 State.sa("A state")();
52 State.sb("Another state")();
53 setObjectJoin(pb.w = pa.e + (40, 0));
54 joinObjects(b, sa, sb, e);
55
56 State.composite("Composite state")(b, e, sa, sb);
57 drawObject(composite);
58
59 clink(transition)(b, sa);
60 clink(transition)(sa, sb);
61 clink(transition)(sb, e);
62 endfig;
63
64 beginfig(5);
65 endfig;
66
67 beginfig(6);
68 endfig;
69
70 beginfig(7);
71 endfig;
72
73 end