[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] navidoc doc/syntax.rst navidoc/mp/uml.mp navido...
From: |
Asko Soukka |
Subject: |
[Gzz-commits] navidoc doc/syntax.rst navidoc/mp/uml.mp navido... |
Date: |
Fri, 13 Jun 2003 03:34:28 -0400 |
CVSROOT: /cvsroot/navidoc
Module name: navidoc
Branch:
Changes by: Asko Soukka <address@hidden> 03/06/13 03:34:28
Modified files:
doc : syntax.rst
navidoc/mp : uml.mp uml.py
Log message:
tidying uml
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/doc/syntax.rst.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/mp/uml.mp.diff?tr1=1.11&tr2=1.12&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/navidoc/navidoc/navidoc/mp/uml.py.diff?tr1=1.19&tr2=1.20&r1=text&r2=text
Patches:
Index: navidoc/doc/syntax.rst
diff -u navidoc/doc/syntax.rst:1.7 navidoc/doc/syntax.rst:1.8
--- navidoc/doc/syntax.rst:1.7 Thu Jun 12 05:06:35 2003
+++ navidoc/doc/syntax.rst Fri Jun 13 03:34:27 2003
@@ -189,7 +189,7 @@
.. UML:: elements-dep
class foo
- dep "use" bar
+ dep "uasdfsadfds" bar
class bar
---
horizontally(100, hor_c, foo, bar);
@@ -229,7 +229,7 @@
.. UML:: elements-assoc
class (fooA) foo1
- assoc - barA
+ assoc barA
class (fooB) foo2
assoc role(foo) multi(1) - barB
class (fooC) foo3
@@ -250,7 +250,7 @@
Syntax::
class (fooA) foo1
- assoc - barA
+ assoc barA
class (fooB) foo2
assoc role(foo) multi(1) - barB
class (fooC) foo3
@@ -366,7 +366,7 @@
Syntax::
class foo
- vobin bar
+ vobin - bar
class bar
---
horizontally(50, hor_c, foo, bar);
Index: navidoc/navidoc/mp/uml.mp
diff -u navidoc/navidoc/mp/uml.mp:1.11 navidoc/navidoc/mp/uml.mp:1.12
--- navidoc/navidoc/mp/uml.mp:1.11 Fri Jun 6 16:04:24 2003
+++ navidoc/navidoc/mp/uml.mp Fri Jun 13 03:34:28 2003
@@ -19,7 +19,7 @@
% MA 02111-1307 USA
%
-% $Id: uml.mp,v 1.11 2003/06/06 20:04:24 tjl Exp $
+% $Id: uml.mp,v 1.12 2003/06/13 07:34:28 humppake Exp $
%
% Written by Tuomas Lukka
@@ -327,7 +327,8 @@
vardef dep(expr p, ster) =
drawarrow p dashed evenly;
addto currentpicture also stereotype(ster)
- shifted point length(p)/2 of p;
+ shifted point(0.35) of p;
+% shifted point length(p) / 2 of p;
enddef;
%%%%%%%%%%%%%%%%%%%
@@ -379,7 +380,11 @@
ctr = 0.5[urcorner b, llcorner b];
wid := xpart(urcorner b - ulcorner b);
if (wid < w) and (wid > 0):
- setbounds b to (bbox b shifted -ctr xscaled (w/wid) shifted ctr);
+ numeric margin;
+ margin := bboxmargin;
+ bboxmargin := 0;
+ setbounds b to (bbox b shifted -ctr xscaled (w/wid) shifted ctr);
+ bboxmargin := margin;
fi
enddef;
Index: navidoc/navidoc/mp/uml.py
diff -u navidoc/navidoc/mp/uml.py:1.19 navidoc/navidoc/mp/uml.py:1.20
--- navidoc/navidoc/mp/uml.py:1.19 Thu Jun 12 05:06:35 2003
+++ navidoc/navidoc/mp/uml.py Fri Jun 13 03:34:28 2003
@@ -19,7 +19,7 @@
# MA 02111-1307 USA
#
-# $Id: uml.py,v 1.19 2003/06/12 09:06:35 humppake Exp $
+# $Id: uml.py,v 1.20 2003/06/13 07:34:28 humppake Exp $
#
# Written by Tuomas Lukka, Asko Soukka
@@ -216,9 +216,22 @@
maxwidctr(%%.maxwid, %%.cls);
%%.sep = nullpicture;
- addto %%.sep doublepath (0,0)--(%%.maxwid,0) withpen currentpen;
- %%.pict = stackpics(%%.stereo, %%.cls, %%.sep, %%.meth, %%.sep,
%%.fiel);
-
+ addto %%.sep doublepath (0,0)--(%%.maxwid,0) withpen currentpen;
+ """
+ if self.fields and self.methods:
+ s = s + """
+ %%.pict = stackpics(%%.stereo, %%.cls, %%.sep, %%.meth, %%.sep,
%%.fiel);
+ """
+ elif self.fields or self.methods:
+ s = s + """
+ %%.pict = stackpics(%%.stereo, %%.cls, %%.sep, %%.meth, %%.fiel);
+ """
+ else:
+ s = s + """
+ %%.pict = stackpics(%%.stereo, %%.cls, %%.meth, %%.fiel);
+ """
+ s = s + """
+ setbounds %%.pict to bbox %%.pict;
picmeasurements(%%);
"""
s = s.replace("FIELDS", ", ".join(
@@ -252,6 +265,7 @@
s = """
picture %%.pict;
%%.pict = classTitle("%name%");
+ setbounds %%.pict to bbox %%.pict;
picmeasurements(%%);
"""
return self.repl(s)
@@ -296,10 +310,15 @@
%%.titl = classTitle("%name%");
%%.pict = %%.titl;
addto %%.pict doublepath bbox %%.titl;
-
+ setbounds %%.pict to bbox %%.pict;
picmeasurements(%%);
"""
return self.repl(s)
+ def draw_code(self):
+ s = """
+ drawmeasuredpic(%%);
+ """
+ return self.repl(s)
class mpinterface(navidoc.mp.SimpleElement):
key = 'interface'
@@ -359,6 +378,7 @@
s = """
picture %%.titl.pict;
%%.titl.pict = classTitle("%name%");
+ setbounds %%.titl.pict to bbox %%.titl.pict;
addto %%.titl.pict doublepath
(urcorner(%%.titl.pict)--lrcorner(%%.titl.pict)) withpen currentpen;
addto %%.titl.pict doublepath
(ulcorner(%%.titl.pict)--llcorner(%%.titl.pict)) withpen currentpen;
addto %%.titl.pict doublepath
(ulcorner(%%.titl.pict)--urcorner(%%.titl.pict)) withpen currentpen;
@@ -437,6 +457,10 @@
if mat:
self.role = mat.group(1)
continue
+ mat = re.match("^multi\((.*)\)$", el)
+ if mat:
+ self.multi = mat.group(1)
+ continue
raise UMLException("Invalid assoc adorn "+el)
def setup_code(self):
s = """
@@ -460,6 +484,12 @@
self.var = var or random_var()
self.name = ""
+ # XXX This might not be a good idea. Anyway, the point is to allow
+ # creating very simple assoc with only "assoc foo" without '-' at
start.
+ # as in "assoc - foo".
+ if toks.count('-') == 0:
+ toks.insert(1, '-')
+
self.a = self.end(self.var+".a", toks)
toks.reverse()
self.b = self.end(self.var+".b", toks)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] navidoc doc/syntax.rst navidoc/mp/uml.mp navido...,
Asko Soukka <=