summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/metauml/manual/fig/class_customization.mp
blob: 980915ea00e8444d0a579216bebb574bdb9dd111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
% Part of the MetaUML manual.
% Copyright (C) 2005 Ovidiu Gheorghies
%
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

input metauml;

beginfig(1);
  iClass.foreColor := (.9, .9, 0);

  Class.A("A")()();
  Class.B("B")()();
  Class.C("C")()();

  B.w = A.e + (20,0);
  C.n = .5[A.se, B.sw] + (0, -10);

  drawObjects(A, B, C);
endfig;

beginfig(2);
  save A, B, C;
  iClass.foreColor := (.9, .9, 0);

  Class.A("A")()();
  Class.B("B")()();
  Class.C("C")()();
  C.info.foreColor := (.7, .7, .9);
  C.info.borderColor := blue;
  C.info.iName.iFont.scale := 2;

  B.w = A.e + (20,0);
  C.n = .5[A.se, B.sw] + (0, -10);

  drawObjects(A, B, C);
endfig;

beginfig(3);
  ClassInfoCopy.iHome(iClass);
  iHome.foreColor := (0, .9, .9);

  ClassInfo.iRemote;
  iRemote.foreColor := (.9, .9, 0);
  iRemote.borderColor := (0, 0, .9);

  save A, B, C, D;

  EClass.A(iHome)("UserHome")()();
  EClass.B(iRemote)("UserRemote")()();
  EClass.C(iHome)("CartHome")()();
  EClass.D(iRemote)("CartRemote")()();


  B.nw = A.ne + (20,0);
  D.nw = C.ne + (20,0);
  A.bottom - C.top = 10;
  A.left = C.left;

  drawObjects(A, B, C, D);
endfig;

beginfig(4);
  iClass.foreColor := .9white;
  save A;

  Class.A("Foo")
    ("a: int", "b: int")
    ("foo()", "bar()", "gar()");
  A.info.iName.iFont.name := metauml_defaultFontBold;
  A.info.iName.iFont.scale := 1.2;

  A.info.iAttributeStack.iPict.iFont.scale := 0.8;
  A.info.iAttributeStack.top := 10;
  A.info.iAttributeStack.spacing := 11;

  A.info.iMethodStack.iPict.iFont.scale := 2;
  A.info.iMethodStack.spacing    := 17;
  A.info.iMethodStack.bottom := 10;
  drawObject(A);
endfig;

end