Skip to content

Commit

Permalink
Static, abstract class features based on style suppliers.
Browse files Browse the repository at this point in the history
  • Loading branch information
ogheorghies committed Jul 29, 2015
1 parent 15bc536 commit da512f6
Show file tree
Hide file tree
Showing 8 changed files with 270 additions and 146 deletions.
4 changes: 2 additions & 2 deletions manual/fig/test_class.mp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ beginfig(5);
save P, Q;

Class.P("AAA")()();
Class_stereotypes.P("<<ooo>>","<<home>>", "<<interface>>");
Class_stereotypes.P("ooo", "home", "interface");
Class_setDebugMode.P;
P.nw=(0,0);
Class_draw.P;

Class.Q("AAA")()();
Class_stereotypes.Q("<<ooo>>","<<home>>", "<<interface>>");
Class_stereotypes.Q("ooo", "home", "interface");
Q.nw=P.ne + (20,0);
Class_draw.Q;
endfig;
Expand Down
34 changes: 34 additions & 0 deletions manual/fig/test_class_feature_types.mp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
% Copyright 2015 Ovidiu Gheorghies
% Licensed under the Apache License, Version 2.0.

input metauml;

beginfig(1);
if not metauml_private_isAbstract(abstract "foo"):
1 = 2;
fi;

if metauml_private_isAbstract("@abstracp"):
1 = 2;
fi;
endfig;

beginfig(2);
if not metauml_private_isStatic(static "bar"):
1 = 2;
fi;

if metauml_private_isStatic("@statique"):
1 = 2;
fi;
endfig;

beginfig(3);
Class.A("A")
("+a:int+", static "+b:int")
("+f+():int", static "+g+():int", abstract "+h():int");
Class_setDebugMode.A;
drawObjects(A);
endfig;

end
24 changes: 16 additions & 8 deletions manual/fig/test_picture.mp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ beginfig(3);
A0.nw=(50,0);
drawboxed(A0,A1,A2,A3,A4);

show A[1].nw;

myy := 10;

bboxmargin := 0;
Expand All @@ -102,9 +100,6 @@ beginfig(3);
draw bbox(x) shifted p;
draw x shifted p;

show "LLCORNER P";
show llcorner x;

pair q;
q := (70,myy);
dotlabel.lrt(".", q);
Expand All @@ -121,9 +116,6 @@ beginfig(3);
draw bbox(y) shifted qq;
draw y shifted qq;

show "LLCORNER q";
show llcorner y;

draw (0,myy)--(150, myy) dashed evenly;

myyb := 30;
Expand Down Expand Up @@ -262,4 +254,20 @@ beginfig(10);
drawObjects(a, b, c, d, e);
endfig;

beginfig(11);
save a, b, c;
Picture.a("goo");
a.info.textDecoration := "underline";

Picture.b("foo()");
b.info.textDecoration := "underline";

Picture.c("x");
c.info.textDecoration := "underline";

topToBottom(5)(a, b, c);

drawObjects(a, b, c);
endfig;

end
4 changes: 2 additions & 2 deletions manual/fig/test_picture_stack.mp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ beginfig(7);

PictureStackInfoCopy.stylePictureStack(iStack);

def styleSelector(expr i)= if i mod 2 = 0: stylePA else: stylePB fi enddef;
def styleSupplier(expr i)= if i mod 2 = 0: stylePA else: stylePB fi enddef;

stylePictureStack.itemStyleCallback := "styleSelector";
stylePictureStack.childStyleSupplier := "styleSupplier";

EPictureStack.stackX(stylePictureStack)("a","b","c","d","e")("vcenter");

Expand Down
163 changes: 82 additions & 81 deletions manual/test-suite.tex
Original file line number Diff line number Diff line change
@@ -1,81 +1,82 @@
% Part of the MetaUML manual
% Copyright (c) 2005 Ovidiu Gheorghies
%
% Permission is granted to copy, distribute and/or modify this document
% under the terms of the GNU Free Documentation License, Version 1.2
% or any later version published by the Free Software Foundation;
% with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
% A copy of the license is included in the section entitled "GNU
% Free Documentation License".

\newcommand{\metaumltest}[2]{Test #2 --- \\ \includegraphics{fig/test_#1.#2} \\ }
\newcommand{\metaumltests}[2]{\multido{\iA=1+1}{#2}{\metaumltest{#1}{\iA}}}

\section{Test suite}

\subsection{Low-level}
\metaumltests{lowlevel}{2}

\subsection{Fonts}
\metaumltests{font}{3}

\subsection{Util library}
\subsubsection{Picture tests}
\metaumltests{picture}{10}

\subsubsection{Picture tests - TeX rendering}
\metaumltests{picture_tex_rendering}{1}

\subsubsection{Group tests}
\metaumltests{group}{2}

\subsubsection{PictureStack tests}
\metaumltests{picture_stack}{7}

\subsubsection{Positioning tests}
\metaumltests{positioning}{6}

\subsection{Class diagram}
\subsubsection{Class tests}
\metaumltests{class}{16}

\subsubsection{Class template tests}
\metaumltests{class_templates}{3}

\subsubsection{Qualified Association tests}
\metaumltests{class_qual_assoc}{2}

\subsection{Package diagram}
\subsubsection{Package tests}
\metaumltests{package}{2}

\subsection{Component diagram}
\subsubsection{Component tests}
\metaumltests{component}{1}

\subsection{Paths}
\metaumltests{paths}{3}

\subsection{Behavioral diagrams}
\subsubsection{Activity tests}
\metaumltests{activity}{2}

\subsubsection{State Machine tests}
\metaumltests{state}{5}

\subsubsection{Usecase tests}
\metaumltests{usecase}{9}

\subsection{Miscelaneous}
\subsubsection{Notes}
\metaumltests{note}{2}
\subsubsection{Objects (Class Instances)}
\metaumltests{instance}{1}

\subsection{User requests}
Test 1 --- \\ \includegraphics[scale=.2]{fig/test_lars_issues.1} \\
\metaumltest{lars_issues}{2}

\subsection{Skins}
\metaumltests{skins}{1}
\metaumltests{skins_global_defaults}{1}
% Part of the MetaUML manual
% Copyright (c) 2005 Ovidiu Gheorghies
%
% Permission is granted to copy, distribute and/or modify this document
% under the terms of the GNU Free Documentation License, Version 1.2
% or any later version published by the Free Software Foundation;
% with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
% A copy of the license is included in the section entitled "GNU
% Free Documentation License".

\newcommand{\metaumltest}[2]{Test #2 --- \\ \includegraphics{fig/test_#1.#2} \\ }
\newcommand{\metaumltests}[2]{\multido{\iA=1+1}{#2}{\metaumltest{#1}{\iA}}}

\section{Test suite}

\subsection{Low-level}
\metaumltests{lowlevel}{2}

\subsection{Fonts}
\metaumltests{font}{3}

\subsection{Util library}
\subsubsection{Picture tests}
\metaumltests{picture}{10}

\subsubsection{Picture tests - TeX rendering}
\metaumltests{picture_tex_rendering}{1}

\subsubsection{Group tests}
\metaumltests{group}{2}

\subsubsection{PictureStack tests}
\metaumltests{picture_stack}{7}

\subsubsection{Positioning tests}
\metaumltests{positioning}{6}

\subsection{Class diagram}
\subsubsection{Class tests}
\metaumltests{class}{16}
\subsubsection{Class feature types tests}
\metaumltests{class_feature_types}{3}
\subsubsection{Class template tests}
\metaumltests{class_templates}{3}

\subsubsection{Qualified Association tests}
\metaumltests{class_qual_assoc}{2}

\subsection{Package diagram}
\subsubsection{Package tests}
\metaumltests{package}{2}

\subsection{Component diagram}
\subsubsection{Component tests}
\metaumltests{component}{1}

\subsection{Paths}
\metaumltests{paths}{3}

\subsection{Behavioral diagrams}
\subsubsection{Activity tests}
\metaumltests{activity}{2}

\subsubsection{State Machine tests}
\metaumltests{state}{5}

\subsubsection{Usecase tests}
\metaumltests{usecase}{9}

\subsection{Miscelaneous}
\subsubsection{Notes}
\metaumltests{note}{2}
\subsubsection{Objects (Class Instances)}
\metaumltests{instance}{1}

\subsection{User requests}
Test 1 --- \\ \includegraphics[scale=.2]{fig/test_lars_issues.1} \\
\metaumltest{lars_issues}{2}

\subsection{Skins}
\metaumltests{skins}{1}
\metaumltests{skins_global_defaults}{1}
Loading

0 comments on commit da512f6

Please sign in to comment.