Debian Codegraph @

texmf-dist/doc/metapost/metauml/manual/fig/class_customization.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 iClass.foreColor := (.9, .9, 0);
22
23 Class.A("A")()();
24 Class.B("B")()();
25 Class.C("C")()();
26
27 B.w = A.e + (20,0);
28 C.n = .5[A.se, B.sw] + (0, -10);
29
30 drawObjects(A, B, C);
31 endfig;
32
33 beginfig(2);
34 save A, B, C;
35 iClass.foreColor := (.9, .9, 0);
36
37 Class.A("A")()();
38 Class.B("B")()();
39 Class.C("C")()();
40 C.info.foreColor := (.7, .7, .9);
41 C.info.borderColor := blue;
42 C.info.iName.iFont.scale := 2;
43
44 B.w = A.e + (20,0);
45 C.n = .5[A.se, B.sw] + (0, -10);
46
47 drawObjects(A, B, C);
48 endfig;
49
50 beginfig(3);
51 ClassInfoCopy.iHome(iClass);
52 iHome.foreColor := (0, .9, .9);
53
54 ClassInfo.iRemote;
55 iRemote.foreColor := (.9, .9, 0);
56 iRemote.borderColor := (0, 0, .9);
57
58 save A, B, C, D;
59
60 EClass.A(iHome)("UserHome")()();
61 EClass.B(iRemote)("UserRemote")()();
62 EClass.C(iHome)("CartHome")()();
63 EClass.D(iRemote)("CartRemote")()();
64
65
66 B.nw = A.ne + (20,0);
67 D.nw = C.ne + (20,0);
68 A.bottom - C.top = 10;
69 A.left = C.left;
70
71 drawObjects(A, B, C, D);
72 endfig;
73
74 beginfig(4);
75 iClass.foreColor := .9white;
76 save A;
77
78 Class.A("Foo")
79 ("a: int", "b: int")
80 ("foo()", "bar()", "gar()");
81 A.info.iName.iFont.name := metauml_defaultFontBold;
82 A.info.iName.iFont.scale := 1.2;
83
84 A.info.iAttributeStack.iPict.iFont.scale := 0.8;
85 A.info.iAttributeStack.top := 10;
86 A.info.iAttributeStack.spacing := 11;
87
88 A.info.iMethodStack.iPict.iFont.scale := 2;
89 A.info.iMethodStack.spacing := 17;
90 A.info.iMethodStack.bottom := 10;
91 drawObject(A);
92 endfig;
93
94 end