| 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 |
input TEX; |
| 20 |
|
| 21 |
beginfig(1); |
| 22 |
Note.A("This note", "has two lines."); |
| 23 |
drawObject(A); |
| 24 |
endfig; |
| 25 |
|
| 26 |
beginfig(2); |
| 27 |
save A, C; |
| 28 |
Note.A("This is a class"); |
| 29 |
Class.C("Object")()(); |
| 30 |
|
| 31 |
A.sw = C.ne + (20, 20); |
| 32 |
|
| 33 |
drawObjects(A, C); |
| 34 |
|
| 35 |
clink(dashedLink)(A, C); |
| 36 |
endfig; |
| 37 |
|
| 38 |
beginfig(3); |
| 39 |
save C; |
| 40 |
Note.nA("This is the class name"); |
| 41 |
Note.nB("This is a key attribute"); |
| 42 |
Note.nC("This is a nice method"); |
| 43 |
|
| 44 |
Class.C("Object")("+id:int") |
| 45 |
("+clone()", "+serialize()"); |
| 46 |
|
| 47 |
topToBottom.left(10)(nA, nB, nC); |
| 48 |
leftToRight(10)(C, nB); |
| 49 |
|
| 50 |
drawObjects(C, nA, nB, nC); |
| 51 |
|
| 52 |
clink(dashedLink)(C.namePict, nA); |
| 53 |
clink(dashedLink)(C.attributeStack.pict[0], nB); |
| 54 |
clink(dashedLink)(C.methodStack.pict[1], nC); |
| 55 |
endfig; |
| 56 |
|
| 57 |
beginfig(4); |
| 58 |
save A; |
| 59 |
Note.A("This class implements the formula:", |
| 60 |
TEX("$\sum_1^n f(x)\cdot dx$")); |
| 61 |
drawObjects(A); |
| 62 |
endfig; |
| 63 |
|
| 64 |
beginfig(5); |
| 65 |
save A; |
| 66 |
Note.A("Can you do it?", |
| 67 |
TEX("$\sum_1^n f(x) \cdot dx " & |
| 68 |
"\over \sum_1^m g(y) \cdot dy$")); |
| 69 |
A.stack.info.spacing := 30; |
| 70 |
A.stack.pict[1].info.ignoreNegativeBase := 0; |
| 71 |
drawObjects(A); |
| 72 |
endfig; |
| 73 |
|
| 74 |
end |