1
0
mirror of https://github.com/octoleo/plantuml.git synced 2025-02-08 06:58:27 +00:00

version 1.2017.18

This commit is contained in:
Arnaud Roques 2017-10-07 11:46:53 +02:00
parent 53755df6f3
commit a5701fb84b
1372 changed files with 297822 additions and 558 deletions

View File

@ -2,8 +2,6 @@ PlantUML
========
[![Build Status](https://travis-ci.org/plantuml/plantuml.png?branch=master)](https://travis-ci.org/plantuml/plantuml)
**Notice** : Current version is 1.2017.16 (Tag 1.2017.17 is misnamed). Sorry about the confusion
Generate UML diagram from textual description
PlantUML is a component that allows to quickly write :

View File

@ -56,6 +56,11 @@
<include name="*.js" />
</fileset>
</copy>
<copy todir="build/stdlib">
<fileset dir="stdlib">
<include name="**/*.puml" />
</fileset>
</copy>
</target>
<target name="dist" depends="compile">
@ -64,7 +69,7 @@
<jar jarfile="plantuml.jar" basedir="build">
<manifest>
<attribute name="Main-Class" value="net.sourceforge.plantuml.Run" />
<attribute name="Class-Path" value="batik-all-1.7.jar jlatexmath-minimal-1.0.3.jar jlm_cyrillic.jar jlm_greek.jar vizjs.jar j2v8_win32_x86_64-3.1.6.jar j2v8_linux_x86_64-3.1.6.jar j2v8_macosx_x86_64-3.1.6.jar" />
<attribute name="Class-Path" value="avalon-framework-4.2.0.jar batik-all-1.7.jar commons-io-1.3.1.jar commons-logging-1.0.4.jar fop.jar xml-apis-ext-1.3.04.jar xmlgraphics-commons-1.4.jar jlatexmath-minimal-1.0.3.jar jlm_cyrillic.jar jlm_greek.jar vizjs.jar j2v8_win32_x86_64-3.1.6.jar j2v8_linux_x86_64-3.1.6.jar j2v8_macosx_x86_64-3.1.6.jar" />
</manifest>
</jar>
<delete dir="build" />

View File

@ -35,7 +35,7 @@
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2017.17-SNAPSHOT</version>
<version>1.2017.19-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PlantUML</name>

View File

@ -54,6 +54,7 @@ import h._dt_s;
import h._dtdisc_s;
import h._dtlink_s;
import smetana.core.CString;
import smetana.core.size_t;
public class dtdisc__c {
//1 9k44uhd5foylaeoekf3llonjq
@ -124,19 +125,15 @@ public class dtdisc__c {
//3 507t9jcy6v9twvl30rs9i2nwi
// static void* dtmemory(Dt_t* dt,void* addr,size_t size,Dtdisc_t* disc)
public static Object dtmemory(Object... arg) {
UNSUPPORTED("18b3dn3pevbf7ajed6fftvnzk"); // static void* dtmemory(Dt_t* dt,void* addr,size_t size,Dtdisc_t* disc)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("cmb0rxzo3c2wr18j0upjz9iml"); // if(addr)
UNSUPPORTED("bn1cyxafod2777wzl55qh14xq"); // { if(size == 0)
public static Object dtmemory(_dt_s dt, Object addr, size_t size, _dtdisc_s disc) {
if(addr!=null) {
UNSUPPORTED("bn1cyxafod2777wzl55qh14xq"); // if(size == 0)
UNSUPPORTED("15j5ccp5owse1ebc5ljhbzg59"); // { free(addr);
UNSUPPORTED("aihzmr4oo3tuh6kkxwtn9tlbd"); // return ((void*)0);
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("9ed8imo9cbvwtwe92qmavoqko"); // else return realloc(addr,size);
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("ew5p7pzg1fmdih1t3u25rqz6y"); // else return size > 0 ? malloc(size) : ((void*)0);
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
}
else return size.isStrictPositive() ? size.malloc() : null;
throw new UnsupportedOperationException();
}

View File

@ -1085,8 +1085,8 @@ try {
h_len = strlen(h_str);
tl = ED_label(obj.castTo(Agedge_s.class));
if (tl!=null) {
UNSUPPORTED("88b430s6vk0irhr2k7x9crz9l"); // l_str = tl->text;
UNSUPPORTED("5hjl5oveu3muui5b0fffh0dz2"); // if (str) l_len = strlen(l_str);
l_str = tl.getCString("text");
if (str!=null) l_len = strlen(l_str);
}
if (agisdirected(agroot(agraphof(agtail((obj.castTo(Agedge_s.class)))))))
e_str = new CString("->");

View File

@ -44,18 +44,26 @@
*
*/
package gen.lib.common;
import static gen.lib.cgraph.attr__c.agattr;
import static gen.lib.cgraph.edge__c.agfstout;
import static gen.lib.cgraph.edge__c.aghead;
import static gen.lib.cgraph.edge__c.agnxtout;
import static gen.lib.cgraph.edge__c.agtail;
import static gen.lib.cgraph.graph__c.agnnodes;
import static gen.lib.cgraph.id__c.agnameof;
import static gen.lib.cgraph.node__c.agfstnode;
import static gen.lib.cgraph.node__c.agnxtnode;
import static gen.lib.cgraph.obj__c.agroot;
import static gen.lib.common.geom__c.ccwrotatepf;
import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.common.splines__c.getsplinepoints;
import static gen.lib.common.utils__c.late_bool;
import static gen.lib.label.xlabels__c.placeLabels;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.ED_edge_type;
import static smetana.core.Macro.ED_head_label;
import static smetana.core.Macro.ED_label;
@ -72,8 +80,13 @@ import static smetana.core.Macro.GD_label;
import static smetana.core.Macro.GD_label_pos;
import static smetana.core.Macro.GD_n_cluster;
import static smetana.core.Macro.GD_rankdir;
import static smetana.core.Macro.INT_MAX;
import static smetana.core.Macro.MAX;
import static smetana.core.Macro.MIN;
import static smetana.core.Macro.N;
import static smetana.core.Macro.ND_coord;
import static smetana.core.Macro.ND_height;
import static smetana.core.Macro.ND_width;
import static smetana.core.Macro.ND_xlabel;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
@ -87,10 +100,13 @@ import h.boxf;
import h.label_params_t;
import h.object_t;
import h.pointf;
import h.splines;
import h.textlabel_t;
import h.xlabel_t;
import smetana.core.CString;
import smetana.core.JUtils;
import smetana.core.Z;
import smetana.core.__ptr__;
import smetana.core.__struct__;
public class postproc__c {
@ -975,24 +991,25 @@ throw new UnsupportedOperationException();
//3 av67wf2xi70ncgl90j1ttrjjs
// static pointf edgeHeadpoint (Agedge_t* e)
public static Object edgeHeadpoint(Object... arg) {
UNSUPPORTED("2zzd7mrm2u540dwuyzehozffj"); // static pointf
UNSUPPORTED("ckf4uk77aptax4a60w2nhrdzl"); // edgeHeadpoint (Agedge_t* e)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("6tl9mepc2bett364jduh2q4mf"); // splines *spl;
UNSUPPORTED("3hs99atzl1l857khumt6ycmbh"); // bezier *bez;
UNSUPPORTED("26m18ntdxgq9wp5vlh2x7auh5"); // if ((spl = getsplinepoints(e)) == NULL) {
public static __struct__<pointf> edgeHeadpoint(Agedge_s e) {
return edgeHeadpoint_(e).copy();
}
private static __struct__<pointf> edgeHeadpoint_(Agedge_s e) {
splines spl;
__ptr__ bez;
spl = getsplinepoints(e);
if (spl == null) {
UNSUPPORTED("9wdrv4uc4c7ssn0qpmxgz5eu1"); // pointf p;
UNSUPPORTED("ezy0ey6dn5uqp6peuorn615x6"); // p.x = p.y = 0;
UNSUPPORTED("68kasxgknec72r19lohbk6n3q"); // return p;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("mjw3aaq1rghmemky1iymklp4"); // bez = &spl->list[spl->size - 1];
UNSUPPORTED("5g1i4pbq9il9iba3urs6bxfa0"); // if (bez->eflag) {
UNSUPPORTED("5vt6gwb8d8689fuwqbt5uhb12"); // return bez->ep;
UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
}
bez = spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr();
// bez = &spl->list[spl->size - 1];
if (bez.getBoolean("eflag")) {
return bez.getStruct("ep");
} else {
UNSUPPORTED("6qzm0hh4pxrspfbvxearcz9z8"); // return bez->list[bez->size - 1];
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
}
throw new UnsupportedOperationException();
}
@ -1002,22 +1019,19 @@ throw new UnsupportedOperationException();
//3 1ca6fh8ns5bgzfzcz8al4eh4k
// static boxf adjustBB (object_t* objp, boxf bb)
public static Object adjustBB(Object... arg) {
UNSUPPORTED("d5qt6s97burjfu5qe0oxyyrmr"); // static boxf
UNSUPPORTED("2gtud943baz3kfj1vqqhjeaj4"); // adjustBB (object_t* objp, boxf bb)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("1ilrhzyqh05f2u3j3vzg0ys8u"); // pointf ur;
UNSUPPORTED("a4qac74i3mtrli231q9zmy8pn"); // /* Adjust bounding box */
UNSUPPORTED("cgmwicrpoafwh8qt3zob8r2ye"); // bb.LL.x = MIN(bb.LL.x, objp->pos.x);
UNSUPPORTED("dqb32jehkpiyfzbiwusv0ex1n"); // bb.LL.y = MIN(bb.LL.y, objp->pos.y);
UNSUPPORTED("coywjj9bhu737b59inwiumkbc"); // ur.x = objp->pos.x + objp->sz.x;
UNSUPPORTED("4zg7x4gv3ox92n323b2vzaq32"); // ur.y = objp->pos.y + objp->sz.y;
UNSUPPORTED("p351si3o2tnvdcb1o5i8et1b"); // bb.UR.x = MAX(bb.UR.x, ur.x);
UNSUPPORTED("4a11bd6b7vdmcwc7r71y9k37z"); // bb.UR.y = MAX(bb.UR.y, ur.y);
UNSUPPORTED("5v5hh30squmit8o2i5hs25eig"); // return bb;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
public static __struct__<boxf> adjustBB(__ptr__ objp, __struct__<boxf> bb) {
return adjustBB_(objp, bb.copy()).copy();
}
private static __struct__<boxf> adjustBB_(__ptr__ objp, __struct__<boxf> bb) {
final __struct__<pointf> ur = JUtils.from(pointf.class);
/* Adjust bounding box */
bb.getStruct("LL").setDouble("x", MIN(bb.getStruct("LL").getDouble("x"), objp.getPtr("pos").getDouble("x")));
bb.getStruct("LL").setDouble("y", MIN(bb.getStruct("LL").getDouble("y"), objp.getPtr("pos").getDouble("y")));
ur.setDouble("x", objp.getPtr("pos").getDouble("x") + objp.getPtr("sz").getDouble("x"));
ur.setDouble("y", objp.getPtr("pos").getDouble("y") + objp.getPtr("sz").getDouble("y"));
bb.getStruct("UR").setDouble("x", MAX(bb.getStruct("UR").getDouble("x"), ur.getDouble("x")));
bb.getStruct("UR").setDouble("y", MAX(bb.getStruct("UR").getDouble("y"), ur.getDouble("y")));
return bb;
}
@ -1025,28 +1039,25 @@ throw new UnsupportedOperationException();
//3 3mefe722uemyoa0czmkkw6hjb
// static void addXLabel (textlabel_t* lp, object_t* objp, xlabel_t* xlp, int initObj, pointf pos)
public static Object addXLabel(Object... arg) {
UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
UNSUPPORTED("as13cbda9pe3uxi34emdcyw49"); // addXLabel (textlabel_t* lp, object_t* objp, xlabel_t* xlp, int initObj, pointf pos)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("47i4tbdfy05npmfnxoa2ljezv"); // if (initObj) {
UNSUPPORTED("4brnnjtxt9czl9vlvf1hi62hq"); // objp->sz.x = 0;
UNSUPPORTED("8vps14u07wyyud2ryypqvjgog"); // objp->sz.y = 0;
UNSUPPORTED("eiw9ykn654ml54rs1bw0lf55b"); // objp->pos = pos;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("7e3xcf5dxjm2knry7yygcx3zv"); // if (Flip) {
public static void addXLabel(textlabel_t lp, __ptr__ objp, __ptr__ xlp, int initObj, __struct__<pointf> pos) {
addXLabel_(lp, objp, xlp, initObj, pos.copy());
}
private static void addXLabel_(textlabel_t lp, __ptr__ objp, __ptr__ xlp, int initObj, __struct__<pointf> pos) {
if (initObj!=0) {
objp.getStruct("sz").setDouble("x", 0);
objp.getStruct("sz").setDouble("y", 0);
objp.setStruct("pos", pos);
}
if (Z.z().Flip) {
UNSUPPORTED("99tzt7erbvtfsbo0jbdz0lc8m"); // xlp->sz.x = lp->dimen.y;
UNSUPPORTED("6v5t3ysaisj27bwc0r9zg3rpd"); // xlp->sz.y = lp->dimen.x;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
UNSUPPORTED("3fr3ccpgshd8wywufcfat4rf5"); // xlp->sz = lp->dimen;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("jd8wxj8hvqwupmayd743a386"); // xlp->lbl = lp;
UNSUPPORTED("1z3b8kb1emm8lvcqvu8sm8r7j"); // xlp->set = 0;
UNSUPPORTED("a1r2pwxgnrpltol41p04axtld"); // objp->lbl = xlp;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
else {
xlp.setStruct("sz", lp.getStruct("dimen"));
}
xlp.setPtr("lbl", lp);
xlp.setInt("set", 0);
objp.setPtr("lbl", xlp);
}
@ -1054,25 +1065,28 @@ throw new UnsupportedOperationException();
//3 dwxd5kvlanbcxqfuncjg0ea54
// static boxf addLabelObj (textlabel_t* lp, object_t* objp, boxf bb)
public static Object addLabelObj(Object... arg) {
UNSUPPORTED("d5qt6s97burjfu5qe0oxyyrmr"); // static boxf
UNSUPPORTED("9yg6tco97jfdkxvya77inw8xx"); // addLabelObj (textlabel_t* lp, object_t* objp, boxf bb)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("7e3xcf5dxjm2knry7yygcx3zv"); // if (Flip) {
public static __struct__<boxf> addLabelObj(textlabel_t lp, __ptr__ objp, __struct__<boxf> bb) {
// WARNING!! STRUCT
return addLabelObj_(lp, objp, bb.copy()).copy();
}
private static __struct__<boxf> addLabelObj_(textlabel_t lp, __ptr__ objp, __struct__<boxf> bb) {
ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point");
try {
if (Z.z().Flip) {
UNSUPPORTED("6z2yrwq81gtsk3q9c5pofow1x"); // objp->sz.x = lp->dimen.y;
UNSUPPORTED("8xsm9kavrekjrsydqe1wh1pu"); // objp->sz.y = lp->dimen.x;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
UNSUPPORTED("40zw1ce6j4iw8dzvp9musrk6g"); // objp->sz.x = lp->dimen.x;
UNSUPPORTED("3kmv74u3ihq63ptaixci1tlt5"); // objp->sz.y = lp->dimen.y;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("ekb3vmkpcdegpnlbuvebyijm8"); // objp->pos = lp->pos;
UNSUPPORTED("6c49iw60twquhten0558iva1c"); // objp->pos.x -= (objp->sz.x) / 2.0;
UNSUPPORTED("alrfakfz0nqemd3xl3m9q2gm4"); // objp->pos.y -= (objp->sz.y) / 2.0;
UNSUPPORTED("5r3oym45e21gwxn3nsjucxlbi"); // return adjustBB(objp, bb);
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
else {
objp.getPtr("sz").setDouble("x", lp.getStruct("dimen").getDouble("x"));
objp.getPtr("sz").setDouble("y", lp.getStruct("dimen").getDouble("y"));
}
objp.setStruct("pos", lp.getStruct("pos"));
objp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") - (objp.getStruct("sz").getDouble("x") / 2.0 ));
objp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - (objp.getStruct("sz").getDouble("y") / 2.0 ));
return adjustBB(objp, bb);
} finally {
LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
}
}
@ -1080,25 +1094,28 @@ throw new UnsupportedOperationException();
//3 b8tjygxnwny5qoiir1mha1d62
// static boxf addNodeObj (node_t* np, object_t* objp, boxf bb)
public static Object addNodeObj(Object... arg) {
UNSUPPORTED("d5qt6s97burjfu5qe0oxyyrmr"); // static boxf
UNSUPPORTED("cdh6qqtv45t605q7je7xomi2j"); // addNodeObj (node_t* np, object_t* objp, boxf bb)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("7e3xcf5dxjm2knry7yygcx3zv"); // if (Flip) {
UNSUPPORTED("1ri5uimcd1z58iix8tp528l1m"); // objp->sz.x = ((ND_height(np))*(double)72);
UNSUPPORTED("6r5gwwhz3sjxrssh8yo3v5c3v"); // objp->sz.y = ((ND_width(np))*(double)72);
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
UNSUPPORTED("6cuxjl9g4nxwyz58c201qdb94"); // objp->sz.x = ((ND_width(np))*(double)72);
UNSUPPORTED("e3zk2j9kbexxv2xbsgu3pser6"); // objp->sz.y = ((ND_height(np))*(double)72);
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("d6gkdf4gkfagwtb6mkhxxvqrc"); // objp->pos = ND_coord(np);
UNSUPPORTED("6c49iw60twquhten0558iva1c"); // objp->pos.x -= (objp->sz.x) / 2.0;
UNSUPPORTED("alrfakfz0nqemd3xl3m9q2gm4"); // objp->pos.y -= (objp->sz.y) / 2.0;
UNSUPPORTED("5r3oym45e21gwxn3nsjucxlbi"); // return adjustBB(objp, bb);
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
public static __struct__<boxf> addNodeObj(Agnode_s np, __ptr__ objp, __struct__<boxf> bb) {
// WARNING!! STRUCT
return addNodeObj_(np, objp, bb.copy()).copy();
}
public static __struct__<boxf> addNodeObj_(Agnode_s np, __ptr__ objp, __struct__<boxf> bb) {
ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point");
try {
if (Z.z().Flip) {
UNSUPPORTED("1ri5uimcd1z58iix8tp528l1m"); // objp->sz.x = ((ND_height(np))*(double)72);
UNSUPPORTED("6r5gwwhz3sjxrssh8yo3v5c3v"); // objp->sz.y = ((ND_width(np))*(double)72);
}
else {
objp.getPtr("sz").setDouble("x", ((ND_width(np))*(double)72));
objp.getPtr("sz").setDouble("y", ((ND_height(np))*(double)72));
}
objp.setPtr("pos", ND_coord(np));
objp.getPtr("pos").setDouble("x", objp.getPtr("pos").getDouble("x") - objp.getPtr("sz").getDouble("x") / 2.0);
objp.getPtr("pos").setDouble("y", objp.getPtr("pos").getDouble("y") - objp.getPtr("sz").getDouble("y") / 2.0);
return adjustBB(objp, bb);
} finally {
LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
}
}
@ -1163,10 +1180,10 @@ try {
final __struct__<pointf> ur = JUtils.from(pointf.class);
textlabel_t lp;
final __struct__<label_params_t> params = JUtils.from(label_params_t.class);
object_t objs;
xlabel_t lbls;
object_t objp;
xlabel_t xlp;
__ptr__ objs;
__ptr__ lbls;
__ptr__ objp;
__ptr__ xlp;
Agsym_s force;
int et = (GD_flags(gp) & (7 << 1));
if (N(GD_has_labels(gp) & (1 << 4)) &&
@ -1175,56 +1192,59 @@ try {
N(GD_has_labels(gp) & (1 << 1)) &&
(N(GD_has_labels(gp) & (1 << 0)) || Z.z().EdgeLabelsDone!=0))
return;
UNSUPPORTED("27ppdplfezcqw6rdrkzyrr8yg"); // for (np = agfstnode(gp); np; np = agnxtnode(gp, np)) {
UNSUPPORTED("eezvruvdh9ueqsgad8k5xzbqi"); // if (ND_xlabel(np)) {
for (np = agfstnode(gp); np!=null; np = agnxtnode(gp, np)) {
if (ND_xlabel(np)!=null) {
UNSUPPORTED("6oje33bnpp4jv5mclsrrhl005"); // if (ND_xlabel(np)->set)
UNSUPPORTED("cfkrw6t4lrs7dfgx86sgrz26"); // n_set_lbls++;
UNSUPPORTED("5c97f6vfxny0zz35l2bu4maox"); // else
UNSUPPORTED("26eewzzknvqt2nbcrqds5fmti"); // n_nlbls++;
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("41dpbku41lh3gpb30ds9ex6aa"); // for (ep = agfstout(gp, np); ep; ep = agnxtout(gp, ep)) {
UNSUPPORTED("9c5vwy3kfweqsgk827cpj3d6q"); // if (ED_xlabel(ep)) {
}
for (ep = agfstout(gp, np); ep!=null; ep = agnxtout(gp, ep)) {
if (ED_xlabel(ep)!=null) {
UNSUPPORTED("appkettxihy2o612jk6fahbnh"); // if (ED_xlabel(ep)->set)
UNSUPPORTED("8k2rclvg6eaoph9r2pz4620xq"); // n_set_lbls++;
UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL)))
UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("1mk50yh8pbs8jzn7h8otaonfd"); // if (ED_head_label(ep)) {
UNSUPPORTED("4xstfnjw4gi0ja4inv8o0n8z"); // if (ED_head_label(ep)->set)
UNSUPPORTED("8k2rclvg6eaoph9r2pz4620xq"); // n_set_lbls++;
UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL)))
UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("4micw28bcx68bfiqihi9ruani"); // if (ED_tail_label(ep)) {
}
if (ED_head_label(ep)!=null) {
if (ED_head_label(ep).getBoolean("set"))
n_set_lbls++;
else if (((et != (0 << 1)) && (ED_spl(ep) != null)))
n_elbls++;
}
if (ED_tail_label(ep)!=null) {
UNSUPPORTED("abwl715n01quq34u2qs1kn9xn"); // if (ED_tail_label(ep)->set)
UNSUPPORTED("8k2rclvg6eaoph9r2pz4620xq"); // n_set_lbls++;
UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL)))
UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("92f340ohb0u21xl6jgpc2hieo"); // if (ED_label(ep)) {
UNSUPPORTED("5skvrpmqqjq5cj6a8uiylmjsw"); // if (ED_label(ep)->set)
UNSUPPORTED("8k2rclvg6eaoph9r2pz4620xq"); // n_set_lbls++;
UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL)))
UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("2uqg2vrduqxs9hk9hmamj7wlu"); // if (GD_has_labels(gp) & (1 << 3))
}
if (ED_label(ep)!=null) {
if (ED_label(ep).getBoolean("set"))
n_set_lbls++;
else if (((et != (0 << 1)) && (ED_spl(ep) != null)))
n_elbls++;
}
}
}
if ((GD_has_labels(gp) & (1 << 3))!=0)
UNSUPPORTED("4z3bgexjlrmdrfgpdaajems8q"); // n_clbls = countClusterLabels (gp);
UNSUPPORTED("19labxj7f93ljlhkpmrde0zgt"); // /* A label for each unpositioned external label */
UNSUPPORTED("5kla6rwar4q1ig2olguocajn6"); // n_lbls = n_nlbls + n_elbls;
UNSUPPORTED("apjqar4agmf5jlfd88kbn4f4d"); // if (n_lbls == 0) return;
UNSUPPORTED("4j54hc42lgojcuorb9p42tlr"); // /* An object for each node, each positioned external label, any cluster label,
UNSUPPORTED("adxf9gd6tasafb302px9vqgum"); // * and all unset edge labels and xlabels.
UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
UNSUPPORTED("6id92o3db6qu5zuuj8q40n3zn"); // n_objs = agnnodes(gp) + n_set_lbls + n_clbls + n_elbls;
UNSUPPORTED("3e10kvi719e134x675xgwi1tj"); // objp = objs = (object_t*)zmalloc((n_objs)*sizeof(object_t));
UNSUPPORTED("6z86cmeenod2nx8ej72n0qotk"); // xlp = lbls = (xlabel_t*)zmalloc((n_lbls)*sizeof(xlabel_t));
UNSUPPORTED("f2nzvg1xnr11v28w2feg923cs"); // bb.LL = pointfof(INT_MAX, INT_MAX);
UNSUPPORTED("7tttoj8cnxfqgnq2aagnnav48"); // bb.UR = pointfof(-INT_MAX, -INT_MAX);
UNSUPPORTED("27ppdplfezcqw6rdrkzyrr8yg"); // for (np = agfstnode(gp); np; np = agnxtnode(gp, np)) {
UNSUPPORTED("38hh82sue091x6ybm9e34wy61"); // bb = addNodeObj (np, objp, bb);
UNSUPPORTED("ex5hwora23t1cl8hpjo4uvphm"); // if ((lp = ND_xlabel(np))) {
/* A label for each unpositioned external label */
n_lbls = n_nlbls + n_elbls;
if (n_lbls == 0) return;
/* An object for each node, each positioned external label, any cluster label,
* and all unset edge labels and xlabels.
*/
n_objs = agnnodes(gp) + n_set_lbls + n_clbls + n_elbls;
objs = zmalloc(sizeof(object_t.class, n_objs));
objp = objs;
lbls = zmalloc(sizeof(xlabel_t.class, n_lbls));
xlp = lbls;
bb.setStruct("LL", pointfof(INT_MAX, INT_MAX));
bb.setStruct("UR", pointfof(-INT_MAX, -INT_MAX));
for (np = agfstnode(gp); np!=null; np = agnxtnode(gp, np)) {
bb.___(addNodeObj (np, objp, bb));
lp = ND_xlabel(np);
if (lp != null) {
UNSUPPORTED("d5pjy3dwui27jfdz550cy0cln"); // if (lp->set) {
UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++;
UNSUPPORTED("3zy3jhlqyioeyh9mlrspjjgc6"); // bb = addLabelObj (lp, objp, bb);
@ -1233,28 +1253,30 @@ UNSUPPORTED("6q044im7742qhglc4553noina"); // else {
UNSUPPORTED("2msn58w2dse7pbq2esv7awk4r"); // addXLabel (lp, objp, xlp, 0, ur);
UNSUPPORTED("1zpq9rd3nn9kjrmun8ivs9zx5"); // xlp++;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("bhbvoj12subdn6905juhiubo2"); // objp++;
UNSUPPORTED("41dpbku41lh3gpb30ds9ex6aa"); // for (ep = agfstout(gp, np); ep; ep = agnxtout(gp, ep)) {
UNSUPPORTED("9zaprre819fwswan5wvid0h6g"); // if ((lp = ED_label(ep))) {
UNSUPPORTED("5dapykbxjvnhw0dpi7jfpcazk"); // if (lp->set) {
UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("dfnmpe0hri6ksye0gnxssi4zz"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL))) {
}
objp = objp.plus(1);
for (ep = agfstout(gp, np); ep!=null; ep = agnxtout(gp, ep)) {
lp = ED_label(ep);
if (lp != null) {
if (lp.getBoolean("set")) {
bb.___(addLabelObj (lp, objp, bb));
}
else if (((et != (0 << 1)) && (ED_spl(ep) != null))) {
UNSUPPORTED("9ffmrymv8cg4h4b3ea97t9qbp"); // addXLabel (lp, objp, xlp, 1, edgeMidpoint(gp, ep));
UNSUPPORTED("808184nt3k6cxj5dsg27yvpvg"); // xlp++;
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("d28blrbmwwqp80cyksuz7dwx9"); // else {
}
else {
UNSUPPORTED("3ia66n3hqrwmh3hybkoh6f8wa"); // agerr(AGWARN, "no position for edge with label %s",
UNSUPPORTED("9npeksy1st7v005znerttzzzv"); // ED_label(ep)->text);
UNSUPPORTED("2yi9az7ibt7j9bwztjilyo0v2"); // continue;
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("d23ocobgp22a33eopdnqe9o4u"); // objp++;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("a5mn7dpum21w95ku1l27m9rpk"); // if ((lp = ED_tail_label(ep))) {
UNSUPPORTED("5dapykbxjvnhw0dpi7jfpcazk"); // if (lp->set) {
}
objp = objp.plus(1);
}
lp = ED_tail_label(ep);
if (lp != null) {
if (lp.getBoolean("set")) {
UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
}
UNSUPPORTED("dfnmpe0hri6ksye0gnxssi4zz"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL))) {
UNSUPPORTED("bqc6ukxlmt6l3osbpsmqbzutc"); // addXLabel (lp, objp, xlp, 1, edgeTailpoint(ep));
UNSUPPORTED("808184nt3k6cxj5dsg27yvpvg"); // xlp++;
@ -1264,24 +1286,26 @@ UNSUPPORTED("5ixexxcbcix5hrfl43td7pj4s"); // agerr(AGWARN, "no position fo
UNSUPPORTED("cf9qaysecgkvv4165la4uu6cb"); // ED_tail_label(ep)->text);
UNSUPPORTED("2yi9az7ibt7j9bwztjilyo0v2"); // continue;
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("6rvkuvq5nj7p2za2zqxf74l3c"); // if ((lp = ED_head_label(ep))) {
UNSUPPORTED("5dapykbxjvnhw0dpi7jfpcazk"); // if (lp->set) {
objp = objp.plus(1);
}
lp = ED_head_label(ep);
if (lp != null) {
if (lp.getBoolean("set")) {
UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("dfnmpe0hri6ksye0gnxssi4zz"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL))) {
UNSUPPORTED("7gewvtwwzj3unxzrtbqpwduzg"); // addXLabel (lp, objp, xlp, 1, edgeHeadpoint(ep));
UNSUPPORTED("808184nt3k6cxj5dsg27yvpvg"); // xlp++;
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("d28blrbmwwqp80cyksuz7dwx9"); // else {
}
else if (((et != (0 << 1)) && (ED_spl(ep) != null))) {
addXLabel (lp, objp, xlp, 1, edgeHeadpoint(ep));
xlp = xlp.plus(1);
}
else {
UNSUPPORTED("8nrkavpg9ifts9yylhfijn9rp"); // agerr(AGWARN, "no position for edge with head label %s",
UNSUPPORTED("a5omwtwd411hsfrc37d8t6m8b"); // ED_head_label(ep)->text);
UNSUPPORTED("2yi9az7ibt7j9bwztjilyo0v2"); // continue;
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("1pb88fhz51khiwboqgii8qayw"); // if ((lp = ED_xlabel(ep))) {
}
objp = objp.plus(1);
}
lp = ED_xlabel(ep);
if (lp != null) {
UNSUPPORTED("5dapykbxjvnhw0dpi7jfpcazk"); // if (lp->set) {
UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
@ -1295,20 +1319,20 @@ UNSUPPORTED("dtpynjioyrbt2xfca2o46eb0j"); // ED_xlabel(ep)->text);
UNSUPPORTED("2yi9az7ibt7j9bwztjilyo0v2"); // continue;
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("5zntyu3vcfnjveucnumrmbjig"); // if (n_clbls) {
}
}
}
if (n_clbls!=0) {
UNSUPPORTED("48ipxdlv7xlti99g0yhi5zuai"); // cinfo_t info;
UNSUPPORTED("7c5iohb8t706p273ae1lxal8r"); // info.bb = bb;
UNSUPPORTED("b1474fakrbyw7p5ja42jgv90c"); // info.objp = objp;
UNSUPPORTED("6ygw8idplugc5u6w7ro3gakmb"); // info = addClusterObj (gp, info);
UNSUPPORTED("1l2cwgzediv4hztjhtm052rl3"); // bb = info.bb;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("79ifzl4zpx3wbd5szboa2x2vb"); // force = (agattr(gp,AGRAPH,"forcelabels",NULL));
UNSUPPORTED("1if7tdbcs4rwvb0polsdlbfh4"); // params.force = late_bool(gp, force, NOT(0));
UNSUPPORTED("2ol916ffwy0e2vxinxn4v4sgt"); // params.bb = bb;
UNSUPPORTED("25rb35acbkepp55u3bkjxb1gc"); // placeLabels(objs, n_objs, lbls, n_lbls, &params);
}
force = (agattr(gp,AGRAPH,new CString("forcelabels"),null));
params.setBoolean("force", late_bool(gp, force, 1));
params.setStruct("bb", bb);
placeLabels(objs, n_objs, lbls, n_lbls, params.amp());
UNSUPPORTED("2di5wqm6caczzl6bvqe35ry8y"); // if (Verbose)
UNSUPPORTED("4iypau1fdov37qnq2ub6iq5ra"); // printData(objs, n_objs, lbls, n_lbls, &params);
UNSUPPORTED("52mefujap7scy273ud7nyj9hn"); // xlp = lbls;

View File

@ -1250,8 +1250,12 @@ UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); // return 1;
bb.getStruct("UR").setDouble("x", xy);
r = 0;
}
else if (d == 1)
UNSUPPORTED("eg1w87s0blk4i583rqumhmv6n"); // xy = ba.getStruct("UR").getDouble("y"), ba.getStruct("UR").getDouble("y") = bb.getStruct("LL").getDouble("y"), bb.getStruct("LL").getDouble("y") = xy, d = 0;
else if (d == 1) {
xy = (int)(ba.getStruct("UR").getDouble("y"));
ba.getStruct("UR").setDouble("y", bb.getStruct("LL").getDouble("y"));
bb.getStruct("LL").setDouble("y", xy);
d = 0;
}
else if (u == 1)
UNSUPPORTED("5kcd52bwvbxxs0md0enfs100u"); // xy = ba.getStruct("LL").getDouble("y"), ba.getStruct("LL").getDouble("y") = bb.getStruct("UR").getDouble("y"), bb.getStruct("UR").getDouble("y") = xy, u = 0;
for (i = 0; i < errs - 1; i++) {

View File

@ -68,6 +68,7 @@ import static smetana.core.JUtils.strtol;
import static smetana.core.JUtils.tolower;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ED_head_label;
import static smetana.core.Macro.ED_head_port;
import static smetana.core.Macro.ED_label;
import static smetana.core.Macro.ED_label_ontop;
@ -94,6 +95,7 @@ import h.Agedge_s;
import h.Agnode_s;
import h.Agraph_s;
import h.Agsym_s;
import h.ST_Agsym_s;
import h.ST_boxf;
import h.ST_port;
import h.boxf;
@ -933,11 +935,9 @@ LEAVING("8oon4q1mrublaru177xfntqgd","late_nnstring");
//3 87ifze04q7qzigjj1fb9y9by2
// boolean late_bool(void *obj, attrsym_t * attr, int def)
public static Object late_bool(Object... arg) {
UNSUPPORTED("4p67t5j48pxpmswky3dw3s392"); // boolean late_bool(void *obj, attrsym_t * attr, int def)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("183nee60g5fytepk82gop4u8s"); // if (attr == (void *)0)
UNSUPPORTED("1jfc1szr9lzyizq62jp9jz7ah"); // return def;
public static boolean late_bool(__ptr__ obj, Agsym_s attr, int def) {
if (attr == null)
return def!=0;
UNSUPPORTED("a0kh1y5n8u59z0xo7mag3zmt6"); // return mapbool(agxget(obj, attr));
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
@ -1501,18 +1501,16 @@ LEAVING("d2v8l80y27ue2fag5c0qplah8","initFontEdgeAttr");
//3 ak3pxrdrq900wymudwnjmbito
// static void initFontLabelEdgeAttr(edge_t * e, struct fontinfo *fi, struct fontinfo *lfi)
public static Object initFontLabelEdgeAttr(Object... arg) {
UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
UNSUPPORTED("64kdcuymwqrq619sxnmgnuyal"); // initFontLabelEdgeAttr(edge_t * e, struct fontinfo *fi,
UNSUPPORTED("rd78u02b7ldtc7gt7aw5t8fz"); // struct fontinfo *lfi)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("9rkwm6oonv051kf4hnage0877"); // if (!fi->fontname) initFontEdgeAttr(e, fi);
UNSUPPORTED("aok5f09eydgwsqtsl0xmmhft"); // lfi->fontsize = late_double(e, E_labelfontsize, fi->fontsize, 1.0);
UNSUPPORTED("aviu0lhq8s4ez3n8cil4bwac6"); // lfi->fontname = late_nnstring(e, E_labelfontname, fi->fontname);
UNSUPPORTED("75il36n46r24ag5njqgshp8xz"); // lfi->fontcolor = late_nnstring(e, E_labelfontcolor, fi->fontcolor);
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
public static void initFontLabelEdgeAttr(Agedge_s e, fontinfo fi, fontinfo lfi) {
ENTERING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr");
try {
if (N(fi.getPtr("fontname"))) initFontEdgeAttr(e, fi);
lfi.setDouble("fontsize", late_double(e, Z.z().E_labelfontsize, fi.getDouble("fontsize"), 1.0));
lfi.setPtr("fontname", late_nnstring(e, Z.z().E_labelfontname, fi.getCString("fontname")));
lfi.setPtr("fontcolor", late_nnstring(e, Z.z().E_labelfontcolor, fi.getCString("fontcolor")));
} finally {
LEAVING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr");
}
}
@ -1600,10 +1598,10 @@ UNSUPPORTED("c078bypfszv0nsvp1nc0x28wx"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))
}
/* vladimir */
if (Z.z().E_headlabel!=null && (str = agxget(e, Z.z().E_headlabel))!=null && (str.charAt(0)!='\0')) {
UNSUPPORTED("cgznvdnh671wl8jq8q3tyhv1r"); // initFontLabelEdgeAttr(e, &fi, &lfi);
UNSUPPORTED("6nfh8swason2akjp45hm0o5b0"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->head_label) = make_label((void*)e, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
UNSUPPORTED("eu3ztkfva2x87y72tnu7vv4re"); // lfi.fontsize, lfi.fontname, lfi.fontcolor);
UNSUPPORTED("axtvdewh7zhtm1diu8c6dprx4"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))->data))->has_labels) |= (1 << 1);
initFontLabelEdgeAttr(e, fi.amp(), lfi.amp());
ED_head_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
lfi.getDouble("fontsize"), lfi.getCString("fontname"), lfi.getCString("fontcolor")));
GD_has_labels(sg, GD_has_labels(sg) | (1 << 1));
}
if (Z.z().E_taillabel!=null && (str = agxget(e, Z.z().E_taillabel))!=null && (str.charAt(0)!='\0')) {
UNSUPPORTED("6y6e1y496y6j6a6065nfesr8o"); // if (!lfi.fontname)

View File

@ -44,7 +44,13 @@
*
*/
package gen.lib.label;
import static gen.lib.label.node__c.*;
import static gen.lib.common.memory__c.zmalloc;
import static smetana.core.JUtils.sizeof;
import static smetana.core.Macro.UNSUPPORTED;
import h.RTree;
import h._Node_t___;
import smetana.core.__ptr__;
public class index__c {
@ -105,6 +111,140 @@ UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
///* Allocate space for a node in the list used in DeletRect to
// * store Nodes that are too empty.
// */
//static struct ListNode *RTreeNewListNode(void)
//{
// return (struct ListNode*)zmalloc(sizeof(struct ListNode));
//}
//
///* Add a node to the reinsertion list. All its branches will later
// * be reinserted into the index structure.
// */
//static int RTreeReInsert(RTree_t * rtp, Node_t * n, struct ListNode **ee)
//{
// register struct ListNode *l;
//
// if (!(l = RTreeNewListNode()))
// return -1;
// l->node = n;
// l->next = *ee;
// *ee = l;
// return 0;
//}
//
//RTree_t *RTreeOpen()
public static __ptr__ RTreeOpen() {
RTree rtp;
rtp = (RTree) zmalloc(sizeof(RTree.class));
if (rtp!=null)
rtp.setPtr("root", RTreeNewIndex(rtp));
return rtp;
}
///* Make a new index, empty. Consists of a single node. */
//Node_t *RTreeNewIndex(RTree_t * rtp)
public static _Node_t___ RTreeNewIndex(RTree rtp) {
_Node_t___ x;
x = RTreeNewNode(rtp);
// x->level = 0; /* leaf */
// rtp->LeafCount++;
// return x;
//}
throw new UnsupportedOperationException();
}
//
//static int RTreeClose2(RTree_t * rtp, Node_t * n)
//{
// int i;
//
// if (n->level > 0) {
// for (i = 0; i < 64; i++) {
// if (!n->branch[i].child)
// continue;
// if (!RTreeClose2(rtp, n->branch[i].child)) {
// free(n->branch[i].child);
// DisconBranch(n, i);
// rtp->EntryCount--;
// if (rtp->StatFlag)
// rtp->ElimCount++;
// }
// }
// } else {
// for (i = 0; i < 64; i++) {
// if (!n->branch[i].child)
// continue;
// // free(n->branch[i].child);
// DisconBranch(n, i);
// rtp->EntryCount--;
// if (rtp->StatFlag)
// rtp->ElimCount++;
// }
// //free(n);
// }
// return 0;
//}
//
//int RTreeClose(RTree_t * rtp)
//{
// RTreeClose2(rtp, rtp->root);
// free(rtp->root);
// free(rtp);
// return 0;
//}
//
//
///* RTreeSearch in an index tree or subtree for all data retangles that
//** overlap the argument rectangle.
//** Returns the number of qualifying data rects.
//*/
//LeafList_t *RTreeSearch(RTree_t * rtp, Node_t * n, Rect_t * r)
//{
// register int i;
// LeafList_t *llp = 0;
//
// assert(n);
// assert(n->level >= 0);
// assert(r);
//
// rtp->SeTouchCount++;
//
// if (n->level > 0) { /* this is an internal node in the tree */
// for (i = 0; i < 64; i++)
// if (n->branch[i].child && Overlap(r, &n->branch[i].rect)) {
// LeafList_t *tlp = RTreeSearch(rtp, n->branch[i].child, r);
// if (llp) {
// LeafList_t *xlp = llp;
// while (xlp->next)
// xlp = xlp->next;
// xlp->next = tlp;
// } else
// llp = tlp;
// }
// } else { /* this is a leaf node */
// for (i = 0; i < 64; i++) {
// if (n->branch[i].child && Overlap(r, &n->branch[i].rect)) {
// llp = RTreeLeafListAdd(llp, (Leaf_t *) & n->branch[i]);
//
//
//
// }
// }
// }
// return llp;
//}
//
///* Insert a data rectangle into an index structure.
//** RTreeInsert provides for splitting the root;
//** returns 1 if root was split, 0 if it was not.
//** The level argument specifies the number of steps up from the leaf
//** level to insert; e.g. a data rectangle goes in at level = 0.
//** RTreeInsert2 does the recursion.
//*/
//static int RTreeInsert2(RTree_t *, Rect_t *, void *, Node_t *, Node_t **,
// int);
///*static int RTreeInsert2(RTree_t*, Rect_t*, int, Node_t*, Node_t**, int); */

View File

@ -45,18 +45,19 @@
*/
package gen.lib.label;
import static smetana.core.Macro.UNSUPPORTED;
import h.RTree;
import h._Node_t___;
import smetana.core.Memory;
public class node__c {
//3 9uj7ni1m6q6drtoh56w82d6m4
// Node_t *RTreeNewNode(RTree_t * rtp)
public static Object RTreeNewNode(Object... arg) {
UNSUPPORTED("6r87cuk0qgu4wqagr86fr5tts"); // Node_t *RTreeNewNode(RTree_t * rtp)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("7wl3hkaktfhqdqsm6ubxboo1q"); // register Node_t *n;
UNSUPPORTED("4bwg40kiiowl2obspxcr4saa2"); // rtp->NodeCount++;
UNSUPPORTED("azoy4bfuupxwp4mi8hfbfb78g"); // n = (Node_t *) malloc(sizeof(Node_t));
public static _Node_t___ RTreeNewNode(RTree rtp) {
_Node_t___ n;
rtp.setInt("NodeCount", rtp.getInt("NodeCount") + 1);
n = (_Node_t___) Memory.malloc(_Node_t___.class);
UNSUPPORTED("a4ey5uckjqallol1ktyqe35bv"); // InitNode(n);
UNSUPPORTED("69hc24ic55i66g8tf2ne42327"); // return n;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }

View File

@ -44,7 +44,19 @@
*
*/
package gen.lib.label;
import static gen.lib.cdt.dtopen__c.dtopen;
import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.label.index__c.RTreeOpen;
import static smetana.core.JUtils.sizeof;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import h.BestPos_t;
import h.XLabels_t;
import h._dt_s;
import h._dtdisc_s;
import h.label_params_t;
import smetana.core.Z;
import smetana.core.__ptr__;
public class xlabels__c {
//1 9k44uhd5foylaeoekf3llonjq
@ -123,8 +135,7 @@ public class xlabels__c {
//3 5p3ac8qk4gnne5hj1dc21ysi
// static int icompare(Dt_t * dt, void * v1, void * v2, Dtdisc_t * disc)
public static Object icompare(Object... arg) {
UNSUPPORTED("bpbhsdw4fe10xdxxfuegnvqt2"); // static int icompare(Dt_t * dt, void * v1, void * v2, Dtdisc_t * disc)
public static int icompare(_dt_s dt, __ptr__ v1, __ptr__ v2, _dtdisc_s disc) {
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("ehks25fxahyjbjd4lm6ryh9su"); // int k1 = *((int *) v1), k2 = *((int *) v2);
UNSUPPORTED("6in30ubiocmaih693f0arymgc"); // return k1 - k2;
@ -138,24 +149,22 @@ throw new UnsupportedOperationException();
//3 88mbfm305igsr7cew5qx6yldp
// static XLabels_t *xlnew(object_t * objs, int n_objs, xlabel_t * lbls, int n_lbls, label_params_t * params)
public static Object xlnew(Object... arg) {
UNSUPPORTED("3le94zdf67vws2boexolzlx7k"); // static XLabels_t *xlnew(object_t * objs, int n_objs,
UNSUPPORTED("cb2wq8p902q5tlc1mh5hikgi2"); // xlabel_t * lbls, int n_lbls,
UNSUPPORTED("bz8hxsdu70exdmt52dnayj0c7"); // label_params_t * params)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("bkrrqfyt0mc9r9usgj4c7t9zs"); // XLabels_t *xlp;
UNSUPPORTED("5tfjcsm3vbxebkz2ev3uqptnx"); // xlp = (XLabels_t*)zmalloc(sizeof(XLabels_t));
UNSUPPORTED("evg8rhuwggcno9jwcrub0i4y4"); // /* used to load the rtree in hilbert space filling curve order */
UNSUPPORTED("8yj6rj5llf2mw5pp8tt355a7o"); // if (!(xlp->hdx = dtopen(&Hdisc, Dtobag))) {
public static XLabels_t xlnew(__ptr__ objs, int n_objs, __ptr__ lbls, int n_lbls, label_params_t params) {
__ptr__ xlp;
xlp = zmalloc(sizeof(XLabels_t.class));
/* used to load the rtree in hilbert space filling curve order */
xlp.setPtr("hdx", dtopen(Z.z().Hdisc.amp(), Z.z().Dtobag));
if (N(xlp.getPtr("hdx"))) {
UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n");
UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("1bzq9uxiqzj7l6llb7e6gti7e"); // /* for querying intersection candidates */
}
/* for querying intersection candidates */
xlp.setPtr("spdx", RTreeOpen());
UNSUPPORTED("7elrkgy2129t2ut4mi03dhf75"); // if (!(xlp->spdx = RTreeOpen())) {
UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n");
UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("85lb5m2umu5izyudq40of0dgi"); // /* save arg pointers in the handle */
/* save arg pointers in the handle */
UNSUPPORTED("ava6c0wrmq2d6j1i4j7bd1lpp"); // xlp->objs = objs;
UNSUPPORTED("85sh2ov52z31nsy9mk5su9p5p"); // xlp->n_objs = n_objs;
UNSUPPORTED("3et8g76wlkf60sgxrmi3z1vom"); // xlp->lbls = lbls;
@ -804,14 +813,10 @@ throw new UnsupportedOperationException();
//3 brqgbskh3z4ah8infjompibvu
// int placeLabels(object_t * objs, int n_objs, xlabel_t * lbls, int n_lbls, label_params_t * params)
public static Object placeLabels(Object... arg) {
UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
UNSUPPORTED("ec68cktfb4yv5ddz6c3prlrlz"); // placeLabels(object_t * objs, int n_objs,
UNSUPPORTED("5ldon0a05p5rangda7ft97vpf"); // xlabel_t * lbls, int n_lbls, label_params_t * params)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("ch9su7givqwexp175hzif4dga"); // int r, i;
UNSUPPORTED("ac14qcqjljksbh1ulqbhsnrnb"); // BestPos_t bp;
UNSUPPORTED("as2y5lue6yv2statqso3a65vn"); // XLabels_t *xlp = xlnew(objs, n_objs, lbls, n_lbls, params);
public static int placeLabels(__ptr__ objs, int n_objs, __ptr__ lbls, int n_lbls, label_params_t params) {
int r, i;
BestPos_t bp;
XLabels_t xlp = xlnew(objs, n_objs, lbls, n_lbls, params);
UNSUPPORTED("dm5w2lmehr2rv6b2yi2v83i3g"); // if ((r = xlinitialize(xlp)) < 0)
UNSUPPORTED("bt8wt6mqb316pv7egiekltb74"); // return r;
UNSUPPORTED("8izrf1sxed8y2dmpz5ju27b6h"); // /* Place xlabel_t* lp near lp->obj so that the rectangle whose lower-left

View File

@ -324,6 +324,10 @@ public class ST_Agedgeinfo_t extends UnsupportedStructAndPtr {
this.label = (ST_textlabel_t) newData;
return this.label;
}
if (fieldName.equals("head_label")) {
this.head_label = (ST_textlabel_t) newData;
return this.head_label;
}
return super.setPtr(fieldName, newData);
}

91
src/h/ST_HDict_t.java Normal file
View File

@ -0,0 +1,91 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import h.ST_HDict_t.Amp;
import java.util.Arrays;
import java.util.List;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.amiga.StarStruct;
public class ST_HDict_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_HDict_t() {
this(null);
}
public ST_HDict_t(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct obyh",
// "{",
// "Dtlink_t link",
// "int key",
// "Leaf_t d",
// "}",
// "HDict_t");
}
// typedef struct obyh {
// Dtlink_t link;
// int key;
// Leaf_t d;
// } HDict_t;

93
src/h/ST_IMapEntry_t.java Normal file
View File

@ -0,0 +1,93 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import h.ST_IMapEntry_t.Amp;
import java.util.Arrays;
import java.util.List;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.amiga.StarStruct;
public class ST_IMapEntry_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_IMapEntry_t() {
this(null);
}
public ST_IMapEntry_t(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct IMapEntry_s",
// "{",
// "Dtlink_t namedict_link",
// "Dtlink_t iddict_link",
// "unsigned long id",
// "char *str",
// "}",
// "IMapEntry_t");
}
// typedef struct IMapEntry_s {
// Dtlink_t namedict_link;
// Dtlink_t iddict_link;
// unsigned long id;
// char *str;
// } IMapEntry_t;

90
src/h/ST_Node_t___.java Normal file
View File

@ -0,0 +1,90 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import h.ST_Node_t___.Amp;
import java.util.Arrays;
import java.util.List;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.amiga.StarStruct;
public class ST_Node_t___ extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_Node_t___() {
this(null);
}
public ST_Node_t___(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
//"typedef struct Node",
//"{",
//"int count",
//"int level",
//"struct Branch branch[64]",
//"}",
//"Node_t");
}
// typedef struct Node {
// int count;
// int level; /* 0 is leaf, others positive */
// struct Branch branch[64];
// } Node_t;

135
src/h/ST_Pedge_t.java Normal file
View File

@ -0,0 +1,135 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.UnsupportedSize_t;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__struct__;
import smetana.core.size_t;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarStruct;
public class ST_Pedge_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_Pedge_t() {
this(null);
}
public ST_Pedge_t(StarStruct parent) {
this.parent = parent;
}
// "typedef struct Pedge_t",
// "{",
// "Ppoint_t a, b",
private final ST_pointf a = new ST_pointf(this);
private final ST_pointf b = new ST_pointf(this);
// "}",
// "Pedge_t");
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("a")) {
return a;
}
if (fieldName.equals("b")) {
return b;
}
return super.getStruct(fieldName);
}
@Override
public void setStruct(String fieldName, __struct__ newData) {
if (fieldName.equals("a")) {
this.a.copyDataFrom(newData);
return;
}
if (fieldName.equals("b")) {
this.b.copyDataFrom(newData);
return;
}
super.setStruct(fieldName, newData);
}
public static size_t sizeof(final int nb) {
return new UnsupportedSize_t(nb) {
@Override
public Object malloc() {
return new StarArrayOfPtr(new STArray<ST_Pedge_t>(nb, 0, ST_Pedge_t.class));
}
@Override
public int getInternalNb() {
return nb;
}
@Override
public Object realloc(Object old) {
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
old2.realloc(nb);
return old2;
}
};
}
}
// typedef struct Pedge_t {
// Ppoint_t a, b;
// } Pedge_t;

View File

@ -142,7 +142,7 @@ public class ST_Ppoly_t extends UnsupportedStructAndPtr implements HardcodedStru
if (fieldName.equals("ps")) {
if (newData instanceof StarArrayOfStruct) {
StarArrayOfStruct newData2 = (StarArrayOfStruct) newData;
System.err.println("newData2=" + newData2);
System.err.println("newData2B=" + newData2);
this.ps2 = new StarArrayOfPtr(new Adaptor(newData2, 0));
return ps2;
}

165
src/h/ST_RTree.java Normal file
View File

@ -0,0 +1,165 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import h.ST_RTree.Amp;
import java.util.Arrays;
import java.util.List;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.amiga.StarStruct;
public class ST_RTree extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_RTree() {
this(null);
}
public ST_RTree(StarStruct parent) {
this.parent = parent;
}
// "struct RTree",
// "{",
// "Node_t *root",
// "SplitQ_t split",
// "int MinFill",
// "long ElapsedTime",
// "float UserTime, SystemTime",
// "int Deleting",
// "int StatFlag",
// "int InsertCount",
// "int DeleteCount",
// "int ReInsertCount",
// "int InSplitCount",
// "int DeSplitCount",
// "int ElimCount",
// "int EvalCount",
// "int InTouchCount",
// "int DeTouchCount",
// "int SeTouchCount",
// "int CallCount",
// "float SplitMeritSum",
// "int RectCount",
private int NodeCount;
// "int LeafCount, NonLeafCount",
// "int EntryCount",
// "int SearchCount",
// "int HitCount",
// "}");
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
@Override
public int getInt(String fieldName) {
if (fieldName.equals("NodeCount")) {
return NodeCount;
}
return super.getInt(fieldName);
}
@Override
public void setInt(String fieldName, int data) {
if (fieldName.equals("NodeCount")) {
this.NodeCount = data;
return;
}
super.setInt(fieldName, data);
}
}
// struct RTree {
// Node_t *root;
//
// SplitQ_t split;
//
// /* balance criterion for node splitting */
// int MinFill;
//
// /* times */
// long ElapsedTime;
// float UserTime, SystemTime;
//
// int Deleting;
//
// /* variables for statistics */
// int StatFlag; /* tells if we are counting or not */
// /* counters affected only when StatFlag set */
// int InsertCount;
// int DeleteCount;
// int ReInsertCount;
// int InSplitCount;
// int DeSplitCount;
// int ElimCount;
// int EvalCount;
// int InTouchCount;
// int DeTouchCount;
// int SeTouchCount;
// int CallCount;
// float SplitMeritSum;
//
// /* counters used even when StatFlag not set */
// int RectCount;
// int NodeCount;
// int LeafCount, NonLeafCount;
// int EntryCount;
// int SearchCount;
// int HitCount;
//
// };

116
src/h/ST_XLabels_t.java Normal file
View File

@ -0,0 +1,116 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.amiga.StarStruct;
public class ST_XLabels_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_XLabels_t() {
this(null);
}
public ST_XLabels_t(StarStruct parent) {
this.parent = parent;
}
// "typedef struct XLabels_s",
// "{",
// "object_t *objs",
// "int n_objs",
// "xlabel_t *lbls",
// "int n_lbls",
// "label_params_t *params",
private ST_dt_s hdx;
// "RTree_t *spdx",
// "}",
// "XLabels_t");
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("hdx")) {
return this.hdx;
}
return super.getPtr(fieldName);
}
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("hdx")) {
this.hdx = (ST_dt_s) newData;
return this.hdx;
}
return super.setPtr(fieldName, newData);
}
}
// typedef struct XLabels_s {
// object_t *objs;
// int n_objs;
// xlabel_t *lbls;
// int n_lbls;
// label_params_t *params;
//
// Dt_t *hdx; // splay tree keyed with hilbert spatial codes
// RTree_t *spdx; // rtree
//
// } XLabels_t;

133
src/h/ST_aspect_t.java Normal file
View File

@ -0,0 +1,133 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.amiga.StarStruct;
public class ST_aspect_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_aspect_t() {
this(null);
}
public ST_aspect_t(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct aspect_t",
// "{",
// "double targetAR",
// "double combiAR",
private int prevIterations;
private int curIterations;
private int nextIter;
private int nPasses;
private int badGraph;
// "}",
// "aspect_t");
@Override
public int getInt(String fieldName) {
if (fieldName.equals("nextIter")) {
return this.nextIter;
}
if (fieldName.equals("nPasses")) {
return this.nPasses;
}
return super.getInt(fieldName);
}
@Override
public void setInt(String fieldName, int data) {
if (fieldName.equals("nextIter")) {
this.nextIter = data;
return;
}
if (fieldName.equals("badGraph")) {
this.badGraph = data;
return;
}
if (fieldName.equals("nPasses")) {
this.nPasses = data;
return;
}
super.setInt(fieldName, data);
}
@Override
public boolean getBoolean(String fieldName) {
if (fieldName.equals("badGraph")) {
return this.badGraph != 0;
}
return super.getBoolean(fieldName);
}
}
// typedef struct aspect_t {
// double targetAR; /* target aspect ratio */
// double combiAR;
// int prevIterations; /* no. of iterations in previous pass */
// int curIterations; /* no. of iterations in current pass */
// int nextIter; /* dynamically adjusted no. of iterations */
// int nPasses; /* bound on no. of top-level passes */
// int badGraph; /* hack: set if graph is disconnected or has
// * clusters. If so, turn off aspect */
// } aspect_t;

View File

@ -112,6 +112,16 @@ public class ST_bezier extends UnsupportedStructAndPtr {
return ST_bezier.this.getArrayOfPtr(fieldName);
}
@Override
public boolean getBoolean(String fieldName) {
return ST_bezier.this.getBoolean(fieldName);
}
@Override
public __struct__ getStruct(String fieldName) {
return ST_bezier.this.getStruct(fieldName);
}
}
@Override

164
src/h/ST_fontinfo.java Normal file
View File

@ -0,0 +1,164 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.CString;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.amiga.StarStruct;
public class ST_fontinfo extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_fontinfo() {
this(null);
}
public ST_fontinfo(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
@Override
public void setDouble(String fieldName, double data) {
ST_fontinfo.this.setDouble(fieldName, data);
}
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
return ST_fontinfo.this.setPtr(fieldName, newData);
}
@Override
public __ptr__ getPtr(String fieldName) {
return ST_fontinfo.this.getPtr(fieldName);
}
@Override
public double getDouble(String fieldName) {
return ST_fontinfo.this.getDouble(fieldName);
}
@Override
public CString getCString(String fieldName) {
return ST_fontinfo.this.getCString(fieldName);
}
}
// "struct fontinfo",
// "{",
private double fontsize;
private CString fontname;
private CString fontcolor;
// "}");
@Override
public double getDouble(String fieldName) {
if (fieldName.equals("fontsize")) {
return this.fontsize;
}
return super.getDouble(fieldName);
}
@Override
public void setDouble(String fieldName, double data) {
if (fieldName.equals("fontsize")) {
this.fontsize = data;
return;
}
super.setDouble(fieldName, data);
}
@Override
public CString getCString(String fieldName) {
if (fieldName.equals("fontname")) {
return this.fontname;
}
if (fieldName.equals("fontcolor")) {
return this.fontcolor;
}
return super.getCString(fieldName);
}
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("fontname")) {
return this.fontname;
}
if (fieldName.equals("fontcolor")) {
return this.fontcolor;
}
return super.getPtr(fieldName);
}
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("fontname")) {
return this.fontname;
}
if (fieldName.equals("fontcolor")) {
return this.fontcolor;
}
return super.setPtr(fieldName, newData);
}
}
// struct fontinfo {
// double fontsize;
// char *fontname;
// char *fontcolor;
// };

150
src/h/ST_inside_t.java Normal file
View File

@ -0,0 +1,150 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.MutableDoublePtr;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.amiga.StarArrayOfStruct;
import smetana.core.amiga.StarStruct;
public class ST_inside_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_inside_t() {
this(null);
}
public ST_inside_t(StarStruct parent) {
this.parent = parent;
}
// "typedef union inside_t",
// "{",
// "struct",
// "{",
// "pointf* p",
private StarArrayOfStruct p;
private MutableDoublePtr r;
// "double* r",
// "}",
// "a",
// "struct",
// "{",
// "node_t* n",
private ST_Agnode_s n;
private ST_boxf bp;
// "boxf* bp",
// "}",
// "s",
// "}",
// "inside_t");
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
@Override
public __ptr__ getPtr(String fieldName) {
return ST_inside_t.this.getPtr(fieldName);
}
}
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("s.n")) {
this.n = (ST_Agnode_s) newData;
return this.n;
}
if (fieldName.equals("s.bp")) {
this.bp = (ST_boxf) newData;
return this.bp;
}
if (fieldName.equals("a.p")) {
this.p = (StarArrayOfStruct) newData;
return this.p;
}
if (fieldName.equals("a.r")) {
this.r = (MutableDoublePtr) newData;
return this.r;
}
return super.setPtr(fieldName, newData);
}
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("s.n")) {
return this.n;
}
if (fieldName.equals("s.bp")) {
return this.bp;
}
if (fieldName.equals("a.p")) {
return this.p;
}
if (fieldName.equals("a.r")) {
return this.r;
}
return super.getPtr(fieldName);
}
}
// typedef union inside_t {
// struct {
// pointf* p;
// double* r;
// } a;
// struct {
// node_t* n;
// boxf* bp;
// } s;
// } inside_t;

View File

@ -0,0 +1,110 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import h.ST_label_params_t.Amp;
import java.util.Arrays;
import java.util.List;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.__struct__;
import smetana.core.amiga.StarStruct;
public class ST_label_params_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_label_params_t() {
this(null);
}
public ST_label_params_t(StarStruct parent) {
this.parent = parent;
}
// "typedef struct",
// "{",
private final ST_boxf bb = new ST_boxf(this);
private boolean force;
// "}",
// "label_params_t");
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
@Override
public void setStruct(String fieldName, __struct__ newData) {
if (fieldName.equals("bb")) {
this.bb.copyDataFrom(newData);
return;
}
super.setStruct(fieldName, newData);
}
@Override
public void setBoolean(String fieldName, boolean data) {
if (fieldName.equals("force")) {
this.force = data;
return;
}
super.setBoolean(fieldName, data);
}
}
// typedef struct {
// boxf bb; /* Bounding box of all objects */
// unsigned char force; /* If true, all labels must be placed */
// } label_params_t;

145
src/h/ST_nodequeue.java Normal file
View File

@ -0,0 +1,145 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__array_of_ptr__;
import smetana.core.__ptr__;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarStruct;
public class ST_nodequeue extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_nodequeue() {
this(null);
}
public ST_nodequeue(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct nodequeue",
// "{",
// "node_t **store, **limit, **head, **tail",
private StarArrayOfPtr store;
private StarArrayOfPtr tail;
private StarArrayOfPtr head;
private StarArrayOfPtr limit;
// "}",
// "nodequeue");
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("store")) {
this.store = (StarArrayOfPtr) newData;
return this.store;
}
if (fieldName.equals("tail")) {
this.tail = (StarArrayOfPtr) newData;
return this.tail;
}
if (fieldName.equals("head")) {
this.head = (StarArrayOfPtr) newData;
return this.head;
}
if (fieldName.equals("limit")) {
this.limit = (StarArrayOfPtr) newData;
return this.limit;
}
return super.setPtr(fieldName, newData);
}
@Override
public __array_of_ptr__ getArrayOfPtr(String fieldName) {
if (fieldName.equals("store")) {
return this.store.getInternalArray();
}
if (fieldName.equals("tail")) {
return this.tail.getInternalArray();
}
if (fieldName.equals("head")) {
return this.head.getInternalArray();
}
if (fieldName.equals("limit")) {
return this.limit.getInternalArray();
}
return super.getArrayOfPtr(fieldName);
}
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("store")) {
return this.store;
}
if (fieldName.equals("tail")) {
return this.tail;
}
if (fieldName.equals("head")) {
return this.head;
}
if (fieldName.equals("limit")) {
return this.limit;
}
return super.getPtr(fieldName);
}
}
// typedef struct nodequeue {
// node_t **store, **limit, **head, **tail;
// } nodequeue;

168
src/h/ST_object_t.java Normal file
View File

@ -0,0 +1,168 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import h.ST_object_t.Amp;
import java.util.Arrays;
import java.util.List;
import smetana.core.UnsupportedSize_t;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.__struct__;
import smetana.core.size_t;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarStruct;
public class ST_object_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_object_t() {
this(null);
}
public ST_object_t(StarStruct parent) {
this.parent = parent;
}
// "typedef struct",
// "{",
private final ST_pointf pos = new ST_pointf(this);
private final ST_pointf sz = new ST_pointf(this);
// "xlabel_t *lbl",
private StarArrayOfPtr lbl;
// "}",
// "object_t");
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("pos")) {
this.pos.copyDataFrom(newData);
return newData;
}
if (fieldName.equals("lbl")) {
this.lbl = (StarArrayOfPtr) newData;
return this.lbl;
}
return super.setPtr(fieldName, newData);
}
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("pos")) {
return this.pos;
}
if (fieldName.equals("sz")) {
return this.sz;
}
return super.getStruct(fieldName);
}
@Override
public void setStruct(String fieldName, __struct__ newData) {
if (fieldName.equals("pos")) {
this.pos.copyDataFrom(newData);
return;
}
if (fieldName.equals("sz")) {
this.sz.copyDataFrom(newData);
return;
}
super.setStruct(fieldName, newData);
}
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("pos")) {
return this.pos;
}
if (fieldName.equals("sz")) {
return this.sz;
}
return super.getPtr(fieldName);
}
public static size_t sizeof(final int nb) {
return new UnsupportedSize_t(nb) {
@Override
public Object malloc() {
return new StarArrayOfPtr(new STArray<ST_object_t>(nb, 0, ST_object_t.class));
}
@Override
public int getInternalNb() {
return nb;
}
@Override
public Object realloc(Object old) {
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
old2.realloc(nb);
return old2;
}
};
}
}
// typedef struct {
// pointf pos; /* Position of lower-left corner of object */
// pointf sz; /* Size of object; may be zero for a point */
// xlabel_t *lbl; /* Label attached to object, or NULL */
// } object_t;

161
src/h/ST_pack_info.java Normal file
View File

@ -0,0 +1,161 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import h.ST_pack_info.Amp;
import java.util.Arrays;
import java.util.List;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.amiga.StarStruct;
public class ST_pack_info extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_pack_info() {
this(null);
}
public ST_pack_info(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct",
// "{",
// "float aspect",
private int sz;
private int margin;
private int doSplines;
// "pack_mode mode",
private int mode;
private __ptr__ fixed;
// "boolean *fixed",
// "packval_t* vals",
private __ptr__ vals;
private int flags;
// "}",
// "pack_info");
@Override
public int getInt(String fieldName) {
if (fieldName.equals("flags")) {
return this.flags;
}
if (fieldName.equals("mode")) {
return this.mode;
}
if (fieldName.equals("sz")) {
return this.sz;
}
if (fieldName.equals("margin")) {
return this.margin;
}
return super.getInt(fieldName);
}
@Override
public void setInt(String fieldName, int data) {
if (fieldName.equals("flags")) {
this.flags = data;
return;
}
if (fieldName.equals("mode")) {
this.mode = data;
return;
}
if (fieldName.equals("sz")) {
this.sz = data;
return;
}
if (fieldName.equals("margin")) {
this.margin = data;
return;
}
if (fieldName.equals("doSplines")) {
this.doSplines = data;
return;
}
if (fieldName.equals("fixed") && data == 0) {
this.fixed = null;
return;
}
super.setInt(fieldName, data);
}
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("vals") && newData == null) {
this.vals = newData;
return vals;
}
return super.setPtr(fieldName, newData);
}
}
// typedef struct {
// float aspect; /* desired aspect ratio */
// int sz; /* row/column size size */
// unsigned int margin; /* margin left around objects, in points */
// int doSplines; /* use splines in constructing graph shape */
// pack_mode mode; /* granularity and method */
// boolean *fixed; /* fixed[i] == true implies g[i] should not be moved */
// packval_t* vals; /* for arrays, sort numbers */
// int flags;
// } pack_info;

160
src/h/ST_path.java Normal file
View File

@ -0,0 +1,160 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__array_of_ptr__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarStruct;
public class ST_path extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_path() {
this(null);
}
public ST_path(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct path",
// "{",
final ST_port start = new ST_port(this), end = new ST_port(this);
private int nbox;
// "boxf *boxes",
private StarArrayOfPtr boxes;
private ST_Agedge_s.Amp data;
// "void *data",
// "}",
// "path");
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("boxes")) {
this.boxes = (StarArrayOfPtr) newData;
return this.boxes;
}
if (fieldName.equals("data")) {
if (newData instanceof ST_Agedge_s) {
newData = ((ST_Agedge_s) newData).amp();
}
this.data = (ST_Agedge_s.Amp) newData;
return this.data;
}
return super.setPtr(fieldName, newData);
}
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("data")) {
return this.data;
}
if (fieldName.equals("boxes")) {
return this.boxes;
}
return super.getPtr(fieldName);
}
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("start")) {
return start;
}
if (fieldName.equals("end")) {
return end;
}
return super.getStruct(fieldName);
}
@Override
public __array_of_ptr__ getArrayOfPtr(String fieldName) {
if (fieldName.equals("boxes")) {
return boxes.getInternalArray();
}
return super.getArrayOfPtr(fieldName);
}
@Override
public int getInt(String fieldName) {
if (fieldName.equals("nbox")) {
return this.nbox;
}
return super.getInt(fieldName);
}
@Override
public void setInt(String fieldName, int data) {
if (fieldName.equals("nbox")) {
this.nbox = data;
return;
}
super.setInt(fieldName, data);
}
}
// typedef struct path { /* internal specification for an edge spline */
// port start, end;
// int nbox; /* number of subdivisions */
// boxf *boxes; /* rectangular regions of subdivision */
// void *data;
// } path;

210
src/h/ST_pathend_t.java Normal file
View File

@ -0,0 +1,210 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.UnsupportedArrayOfStruct;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__array_of_struct__;
import smetana.core.__struct__;
import smetana.core.amiga.StarStruct;
public class ST_pathend_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_pathend_t() {
this(null);
}
public ST_pathend_t(StarStruct parent) {
this.parent = parent;
}
// "typedef struct pathend_t",
// "{",
private final ST_boxf nb = new ST_boxf(this);
private final ST_pointf np = new ST_pointf(this);
private int sidemask;
private int boxn;
private final ST_boxf boxes[] = new ST_boxf[] { new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(),
new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(),
new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(),
new ST_boxf(), new ST_boxf() };
// "boxf boxes[20]",
// "}",
// "pathend_t");
class ArrayOfTwenty extends UnsupportedArrayOfStruct {
final private int pos;
public ArrayOfTwenty(int pos) {
this.pos = pos;
}
@Override
public __array_of_struct__ plus(int delta) {
return new ArrayOfTwenty(pos + delta);
}
@Override
public __struct__ getStruct() {
return boxes[pos];
}
@Override
public void setStruct(__struct__ value) {
boxes[pos].copyDataFrom(value);
}
@Override
public double getDouble(String fieldName) {
return getStruct().getDouble(fieldName);
}
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
@Override
public void setStruct(String fieldName, __struct__ newData) {
ST_pathend_t.this.setStruct(fieldName, newData);
}
@Override
public __array_of_struct__ getArrayOfStruct(String fieldName) {
return ST_pathend_t.this.getArrayOfStruct(fieldName);
}
@Override
public int getInt(String fieldName) {
return ST_pathend_t.this.getInt(fieldName);
}
@Override
public void setInt(String fieldName, int data) {
ST_pathend_t.this.setInt(fieldName, data);
}
@Override
public __struct__ getStruct(String fieldName) {
return ST_pathend_t.this.getStruct(fieldName);
}
}
@Override
public void setStruct(String fieldName, __struct__ newData) {
if (fieldName.equals("np")) {
this.np.___(newData);
return;
}
if (fieldName.equals("nb")) {
this.nb.___(newData);
return;
}
super.setStruct(fieldName, newData);
}
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("nb")) {
return this.nb;
}
if (fieldName.equals("np")) {
return this.np;
}
return super.getStruct(fieldName);
}
@Override
public int getInt(String fieldName) {
if (fieldName.equals("boxn")) {
return this.boxn;
}
if (fieldName.equals("sidemask")) {
return this.sidemask;
}
return super.getInt(fieldName);
}
@Override
public void setInt(String fieldName, int data) {
if (fieldName.equals("boxn")) {
this.boxn = data;
return;
}
if (fieldName.equals("sidemask")) {
this.sidemask = data;
return;
}
super.setInt(fieldName, data);
}
@Override
public __array_of_struct__ getArrayOfStruct(String fieldName) {
if (fieldName.equals("boxes")) {
return new ArrayOfTwenty(0);
}
return super.getArrayOfStruct(fieldName);
}
}
// typedef struct pathend_t {
// boxf nb; /* the node box */
// pointf np; /* node port */
// int sidemask;
// int boxn;
// boxf boxes[20];
// } pathend_t;

122
src/h/ST_point.java Normal file
View File

@ -0,0 +1,122 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__struct__;
import smetana.core.amiga.StarStruct;
public class ST_point extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_point() {
this(null);
}
public ST_point(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct",
// "{",
private int x, y;
// "}",
// "point");
@Override
public __struct__ copy() {
final ST_point result = new ST_point();
result.x = this.x;
result.y = this.y;
return result;
}
@Override
public void ___(__struct__ other) {
ST_point this2 = (ST_point) other;
this.x = this2.x;
this.y = this2.y;
}
@Override
public int getInt(String fieldName) {
if (fieldName.equals("x")) {
return this.x;
}
if (fieldName.equals("y")) {
return this.y;
}
return super.getInt(fieldName);
}
@Override
public void setInt(String fieldName, int data) {
if (fieldName.equals("x")) {
this.x = data;
return;
}
if (fieldName.equals("y")) {
this.y = data;
return;
}
super.setInt(fieldName, data);
}
}
// typedef struct { int x, y; } point;

View File

@ -122,6 +122,13 @@ public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruc
this.y = other2.y;
}
@Override
public void copyDataFrom(__ptr__ value) {
final ST_pointf other2 = (ST_pointf) value;
this.x = other2.x;
this.y = other2.y;
}
@Override
public __struct__ getStruct() {
return this;

View File

@ -156,7 +156,7 @@ public class ST_pointnlink_t extends UnsupportedStructAndPtr implements Hardcode
link = tmp;
return link;
}
System.err.println("newData2=" + newData.getClass());
System.err.println("newData2A=" + newData.getClass());
}
return super.setPtr(fieldName, newData);
}

153
src/h/ST_spline_info_t.java Normal file
View File

@ -0,0 +1,153 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarStruct;
public class ST_spline_info_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_spline_info_t() {
this(null);
}
public ST_spline_info_t(StarStruct parent) {
this.parent = parent;
}
// public static List<String> DEFINITION = Arrays.asList(
// "typedef struct",
// "{",
private int LeftBound, RightBound, Splinesep, Multisep;
private StarArrayOfPtr Rank_box;
// "}",
// "spline_info_t");
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
@Override
public int getInt(String fieldName) {
return ST_spline_info_t.this.getInt(fieldName);
}
@Override
public __ptr__ getPtr(String fieldName) {
return ST_spline_info_t.this.getPtr(fieldName);
}
}
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("Rank_box")) {
this.Rank_box = (StarArrayOfPtr) newData;
return this.Rank_box;
}
return super.setPtr(fieldName, newData);
}
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("Rank_box")) {
return this.Rank_box;
}
return super.getPtr(fieldName);
}
@Override
public int getInt(String fieldName) {
if (fieldName.equals("LeftBound")) {
return this.LeftBound;
}
if (fieldName.equals("RightBound")) {
return this.RightBound;
}
if (fieldName.equals("Splinesep")) {
return this.Splinesep;
}
if (fieldName.equals("Multisep")) {
return this.Multisep;
}
return super.getInt(fieldName);
}
@Override
public void setInt(String fieldName, int data) {
if (fieldName.equals("LeftBound")) {
this.LeftBound = data;
return;
}
if (fieldName.equals("RightBound")) {
this.RightBound = data;
return;
}
if (fieldName.equals("Splinesep")) {
this.Splinesep = data;
return;
}
if (fieldName.equals("Multisep")) {
this.Multisep = data;
return;
}
super.setInt(fieldName, data);
}
}
// typedef struct {
// int LeftBound, RightBound, Splinesep, Multisep;
// boxf* Rank_box;
// } spline_info_t;

206
src/h/ST_tedge_t.java Normal file
View File

@ -0,0 +1,206 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import h.ST_Agclos_s.ArrayOfThreePtrDict_t;
import java.util.ArrayList;
import java.util.List;
import smetana.core.UnsupportedArrayOfPtr;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__array_of_ptr__;
import smetana.core.__ptr__;
import smetana.core.amiga.Area;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarStruct;
public class ST_tedge_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_tedge_t() {
this(null);
}
public ST_tedge_t(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct tedge_t",
// "{",
private __ptr__ pnl0p;
private __ptr__ pnl1p;
// private ST_pointnlink_t.Amp pnl0p;
// private ST_pointnlink_t.Amp pnl1p;
private StarArrayOfPtr ltp;
private StarArrayOfPtr rtp;
// "struct triangle_t *ltp",
// "struct triangle_t *rtp",
// "}",
// "tedge_t");
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("pnl0p")) {
return this.pnl0p;
}
if (fieldName.equals("pnl1p")) {
return this.pnl1p;
}
if (fieldName.equals("ltp")) {
return this.ltp;
}
if (fieldName.equals("rtp")) {
return this.rtp;
}
return super.getPtr(fieldName);
}
// class Singleton extends UnsupportedArrayOfPtr implements __array_of_ptr__ {
// private final ST_pointnlink_t.Amp data;
//
// Singleton(ST_pointnlink_t.Amp data) {
// this.data = data;
// }
//
// @Override
// public __ptr__ getPtr() {
// return data;
// }
//
// @Override
// public Area getInternal(int idx) {
// if (idx == 0) {
// return data;
// }
// System.err.println("idx=" + idx);
// return super.getInternal(idx);
// }
//
// @Override
// public String toString() {
// return super.toString() + " " + data + " " + data.getStruct();
// }
//
// @Override
// public int comparePointerInternal(__array_of_ptr__ other) {
// System.err.println("other=" + other);
// Singleton other2 = (Singleton) other;
// System.err.println("other2.data=" + other2.data);
// System.err.println("pnl0p=" + pnl0p);
// System.err.println("pnl0p=" + foo(pnl0p));
// System.err.println("pnl1p=" + pnl1p);
// System.err.println("pnl0p=" + foo(pnl1p));
// // TODO Auto-generated method stub
// return super.comparePointerInternal(other);
// }
//
// }
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
// if (fieldName.equals("pnl0p")) {
// this.pnl0p = (ST_pointnlink_t.Amp) newData;
// return this.pnl0p;
// }
if (fieldName.equals("pnl0p")) {
if (newData instanceof ST_pointnlink_t.Amp) {
this.pnl0p = (ST_pointnlink_t.Amp) newData;
// newData = new StarArrayOfPtr(new Singleton((h.ST_pointnlink_t.Amp) newData));
} else {
this.pnl0p = (StarArrayOfPtr) newData;
}
return this.pnl0p;
}
if (fieldName.equals("pnl1p")) {
if (newData instanceof ST_pointnlink_t.Amp) {
// newData = new StarArrayOfPtr(new Singleton((h.ST_pointnlink_t.Amp) newData));
this.pnl1p = (ST_pointnlink_t.Amp) newData;
} else {
this.pnl1p = (StarArrayOfPtr) newData;
}
return this.pnl1p;
}
// if (fieldName.equals("pnl1p")) {
// this.pnl1p = (ST_pointnlink_t.Amp) newData;
// return this.pnl1p;
// }
if (fieldName.equals("ltp")) {
this.ltp = (StarArrayOfPtr) newData;
return this.ltp;
}
if (fieldName.equals("rtp")) {
this.rtp = (StarArrayOfPtr) newData;
return this.rtp;
}
return super.setPtr(fieldName, newData);
}
public String foo(StarArrayOfPtr data) {
__array_of_ptr__ array = data.getInternalArray();
return array.toString();
}
}
// typedef struct tedge_t {
// pointnlink_t *pnl0p;
// pointnlink_t *pnl1p;
// struct triangle_t *ltp;
// struct triangle_t *rtp;
// } tedge_t;

View File

@ -178,6 +178,9 @@ public class ST_textlabel_t extends UnsupportedStructAndPtr {
if (fieldName.equals("html")) {
return html != null;
}
if (fieldName.equals("set")) {
return set != 0;
}
return super.getBoolean(fieldName);
}
@ -247,6 +250,7 @@ public class ST_textlabel_t extends UnsupportedStructAndPtr {
}
return super.getInt(fieldName);
}
}
// typedef struct textlabel_t {

180
src/h/ST_tna_t.java Normal file
View File

@ -0,0 +1,180 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import h.ST_tna_t.Amp;
import h.ST_triangle_t.ArrayOfThree;
import java.util.Arrays;
import java.util.List;
import smetana.core.UnsupportedArrayOfStruct;
import smetana.core.UnsupportedSize_t;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__array_of_struct__;
import smetana.core.__ptr__;
import smetana.core.__struct__;
import smetana.core.size_t;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarStruct;
public class ST_tna_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_tna_t() {
this(null);
}
public ST_tna_t(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct tna_t",
// "{",
// "Ppoint_t a[2]",
// "}",
// "tna_t");
private double t;
private final ST_pointf a[] = new ST_pointf[] { new ST_pointf(), new ST_pointf() };
class ArrayOfTwo extends UnsupportedArrayOfStruct {
final private int pos;
public ArrayOfTwo(int pos) {
this.pos = pos;
}
@Override
public __array_of_struct__ plus(int delta) {
return new ArrayOfTwo(pos + delta);
}
@Override
public __struct__ getStruct() {
return a[pos];
}
@Override
public void setStruct(__struct__ value) {
a[pos].copyDataFrom(value);
}
@Override
public double getDouble(String fieldName) {
return getStruct().getDouble(fieldName);
}
}
@Override
public __array_of_struct__ getArrayOfStruct(String fieldName) {
if (fieldName.equals("a")) {
return new ArrayOfTwo(0);
}
return super.getArrayOfStruct(fieldName);
}
@Override
public double getDouble(String fieldName) {
if (fieldName.equals("t")) {
return this.t;
}
return super.getDouble(fieldName);
}
@Override
public void setDouble(String fieldName, double data) {
if (fieldName.equals("t")) {
this.t = data;
return;
}
super.setDouble(fieldName, data);
}
@Override
public __struct__ getStruct() {
return this;
}
public static size_t sizeof(final int nb) {
return new UnsupportedSize_t(nb) {
@Override
public Object malloc() {
return new StarArrayOfPtr(new STArray<ST_tna_t>(nb, 0, ST_tna_t.class));
}
@Override
public int getInternalNb() {
return nb;
}
@Override
public Object realloc(Object old) {
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
old2.realloc(nb);
return old2;
}
};
}
}
// typedef struct tna_t {
// double t;
// Ppoint_t a[2];
// } tna_t;

179
src/h/ST_triangle_t.java Normal file
View File

@ -0,0 +1,179 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import h.ST_pathend_t.ArrayOfTwenty;
import smetana.core.UnsupportedArrayOfStruct;
import smetana.core.UnsupportedSize_t;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__array_of_struct__;
import smetana.core.__struct__;
import smetana.core.size_t;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarStruct;
public class ST_triangle_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_triangle_t() {
this(null);
}
public ST_triangle_t(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct triangle_t",
// "{",
private int mark;
private final ST_tedge_t e[] = new ST_tedge_t[] { new ST_tedge_t(), new ST_tedge_t(), new ST_tedge_t() };
class ArrayOfThree extends UnsupportedArrayOfStruct {
final private int pos;
public ArrayOfThree(int pos) {
this.pos = pos;
}
@Override
public __array_of_struct__ plus(int delta) {
return new ArrayOfThree(pos + delta);
}
@Override
public __struct__ getStruct() {
return e[pos];
}
@Override
public void setStruct(__struct__ value) {
e[pos].copyDataFrom(value);
}
@Override
public double getDouble(String fieldName) {
return getStruct().getDouble(fieldName);
}
}
// "struct tedge_t e[3]",
// "}",
// "triangle_t");
@Override
public int getInt(String fieldName) {
if (fieldName.equals("mark")) {
return this.mark;
}
return super.getInt(fieldName);
}
@Override
public void setInt(String fieldName, int data) {
if (fieldName.equals("mark")) {
this.mark = data;
return;
}
super.setInt(fieldName, data);
}
@Override
public boolean getBoolean(String fieldName) {
if (fieldName.equals("mark")) {
return this.mark != 0;
}
return super.getBoolean(fieldName);
}
@Override
public __array_of_struct__ getArrayOfStruct(String fieldName) {
if (fieldName.equals("e")) {
return new ArrayOfThree(0);
}
return super.getArrayOfStruct(fieldName);
}
public static size_t sizeof(final int nb) {
return new UnsupportedSize_t(nb) {
@Override
public Object malloc() {
return new StarArrayOfPtr(new STArray<ST_triangle_t>(nb, 0, ST_triangle_t.class));
}
@Override
public int getInternalNb() {
return nb;
}
@Override
public Object realloc(Object old) {
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
old2.realloc(nb);
return old2;
}
};
}
}
// typedef struct triangle_t {
// int mark;
// struct tedge_t e[3];
// } triangle_t;

161
src/h/ST_xlabel_t.java Normal file
View File

@ -0,0 +1,161 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import smetana.core.UnsupportedSize_t;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
import smetana.core.__struct__;
import smetana.core.size_t;
import smetana.core.amiga.StarArrayOfPtr;
import smetana.core.amiga.StarStruct;
public class ST_xlabel_t extends UnsupportedStructAndPtr {
private final StarStruct parent;
public ST_xlabel_t() {
this(null);
}
public ST_xlabel_t(StarStruct parent) {
this.parent = parent;
}
@Override
public StarStruct amp() {
return new Amp();
}
public class Amp extends UnsupportedStarStruct {
}
// "typedef struct",
// "{",
final private ST_pointf sz = new ST_pointf(this);
final private ST_pointf pos = new ST_pointf(this);
// "void *lbl",
private ST_textlabel_t lbl;
private int set;
// "unsigned char set",
// "}",
// "xlabel_t");
@Override
public void setInt(String fieldName, int data) {
if (fieldName.equals("set")) {
this.set = data;
return;
}
super.setInt(fieldName, data);
}
@Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("lbl")) {
this.lbl = (ST_textlabel_t) newData;
return this.lbl;
}
return super.setPtr(fieldName, newData);
}
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("sz")) {
return this.sz;
}
if (fieldName.equals("pos")) {
return this.pos;
}
return super.getStruct(fieldName);
}
@Override
public void setStruct(String fieldName, __struct__ newData) {
if (fieldName.equals("sz")) {
this.sz.copyDataFrom(newData);
return;
}
if (fieldName.equals("pos")) {
this.pos.copyDataFrom(newData);
return;
}
super.setStruct(fieldName, newData);
}
public static size_t sizeof(final int nb) {
return new UnsupportedSize_t(nb) {
@Override
public Object malloc() {
return new StarArrayOfPtr(new STArray<ST_xlabel_t>(nb, 0, ST_xlabel_t.class));
}
@Override
public int getInternalNb() {
return nb;
}
@Override
public Object realloc(Object old) {
StarArrayOfPtr old2 = (StarArrayOfPtr) old;
old2.realloc(nb);
return old2;
}
};
}
}
// typedef struct {
// pointf sz; /* Size of label (input) */
// pointf pos; /* Position of lower-left corner of label (output) */
// void *lbl; /* Pointer to label in the graph */
// unsigned char set; /* True if the position has been set (input/output) */
// } xlabel_t;

View File

@ -51,7 +51,7 @@ import smetana.core.__ptr__;
//2 aqoki3wwzhqcy2mpz21vzdona
public interface _Note_t___ extends __ptr__ {
public interface _Node_t___ extends __ptr__ {
public static List<String> DEFINITION = Arrays.asList(
"typedef struct Node",
"{",

View File

@ -99,7 +99,7 @@ public class BackSlash {
final StringBuilder result = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
final char c = s.charAt(i);
if (c == '\\' && i < s.length() - 1 && isEnglishLetter(s.charAt(i + 1))) {
if (c == '\\' && i < s.length() - 1 && isEnglishLetterOfBackSlash(s.charAt(i + 1))) {
result.append('\\');
result.append(translateChar(s.charAt(i + 1)));
i++;
@ -110,6 +110,11 @@ public class BackSlash {
return result.toString();
}
private static boolean isEnglishLetterOfBackSlash(char c) {
return c == 'n';
// return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}
public static String untranslateBackSlashes(CharSequence s) {
if (s == null) {
return null;
@ -125,10 +130,6 @@ public class BackSlash {
return result.toString();
}
private static boolean isEnglishLetter(char c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}
private static char translateChar(char c) {
if (c > 128) {
throw new IllegalArgumentException();

View File

@ -162,7 +162,9 @@ public enum ColorParam {
iconProtectedBackground(HtmlColorUtils.COL_FFFF44),
iconPublic(HtmlColorUtils.COL_038048),
iconPublicBackground(HtmlColorUtils.COL_84BE84),
iconIEMandatory(HtmlColorUtils.BLACK);
iconIEMandatory(HtmlColorUtils.BLACK),
arrowLollipop(HtmlColorUtils.WHITE);
private final boolean isBackground;
private final HtmlColor defaultValue;

View File

@ -73,6 +73,10 @@ public class Dimension2DDouble extends Dimension2D {
return delta(dim, delta, delta);
}
public Dimension2DDouble withWidth(double newWidth) {
return new Dimension2DDouble(newWidth, height);
}
public static Dimension2D delta(Dimension2D dim, double deltaWidth, double deltaHeight) {
if (deltaHeight == 0 && deltaWidth == 0) {
return dim;

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.awt.geom.Dimension2D;
@ -86,24 +87,71 @@ public enum FileFormat {
final static private BufferedImage imDummy = new BufferedImage(800, 100, BufferedImage.TYPE_INT_RGB);
final static private Graphics2D gg = imDummy.createGraphics();
public StringBounder getDefaultStringBounder() {
public StringBounder getDefaultStringBounder(TikzFontDistortion tikzFontDistortion) {
if (this == LATEX || this == LATEX_NO_PREAMBLE) {
return getTikzStringBounder(tikzFontDistortion);
}
if (this == BRAILLE_PNG) {
return new StringBounder() {
public Dimension2D calculateDimension(UFont font, String text) {
final int nb = BrailleCharFactory.build(text).size();
final double quanta = UGraphicBraille.QUANTA;
final double height = 5 * quanta;
final double width = 3 * nb * quanta + 1;
return new Dimension2DDouble(width, height);
}
};
return getBrailleStringBounder();
}
return getNormalStringBounder();
}
private StringBounder getNormalStringBounder() {
return new StringBounder() {
@Override
public String toString() {
return "FileFormat::getNormalStringBounder";
}
public Dimension2D calculateDimension(UFont font, String text) {
final FontMetrics fm = gg.getFontMetrics(font.getFont());
final Rectangle2D rect = fm.getStringBounds(text, gg);
return new Dimension2DDouble(rect.getWidth(), rect.getHeight());
return getJavaDimension(font, text);
}
};
}
private Dimension2DDouble getJavaDimension(UFont font, String text) {
final Font javaFont = font.getFont();
final FontMetrics fm = gg.getFontMetrics(javaFont);
final Rectangle2D rect = fm.getStringBounds(text, gg);
return new Dimension2DDouble(rect.getWidth(), rect.getHeight());
}
private StringBounder getBrailleStringBounder() {
return new StringBounder() {
@Override
public String toString() {
return "FileFormat::getBrailleStringBounder";
}
public Dimension2D calculateDimension(UFont font, String text) {
final int nb = BrailleCharFactory.build(text).size();
final double quanta = UGraphicBraille.QUANTA;
final double height = 5 * quanta;
final double width = 3 * nb * quanta + 1;
return new Dimension2DDouble(width, height);
}
};
}
private StringBounder getTikzStringBounder(final TikzFontDistortion tikzFontDistortion) {
return new StringBounder() {
@Override
public String toString() {
return "FileFormat::getTikzStringBounder";
}
public Dimension2D calculateDimension(UFont font, String text) {
final Dimension2DDouble w1 = getJavaDimension(font.goTikz(-1), text);
final Dimension2DDouble w2 = getJavaDimension(font.goTikz(0), text);
final Dimension2DDouble w3 = getJavaDimension(font.goTikz(1), text);
final double factor = (w3.getWidth() - w1.getWidth()) / w2.getWidth();
final double distortion = tikzFontDistortion.getDistortion();
final double magnify = tikzFontDistortion.getMagnify();
final double delta = (w2.getWidth() - w1.getWidth()) * factor * distortion;
return w2.withWidth(Math.max(w1.getWidth(), magnify * w2.getWidth() - delta));
}
};
}

View File

@ -55,13 +55,14 @@ public class FileFormatOption implements Serializable {
private final boolean useRedForError;
private final String svgLinkTarget;
private final String hoverColor;
private final TikzFontDistortion tikzFontDistortion;
public FileFormatOption(FileFormat fileFormat) {
this(fileFormat, null, true, false, "_top", false, null);
this(fileFormat, null, true, false, "_top", false, null, TikzFontDistortion.getDefault());
}
public StringBounder getDefaultStringBounder() {
return fileFormat.getDefaultStringBounder();
return fileFormat.getDefaultStringBounder(tikzFontDistortion);
}
public String getSvgLinkTarget() {
@ -73,11 +74,11 @@ public class FileFormatOption implements Serializable {
}
public FileFormatOption(FileFormat fileFormat, boolean withMetadata) {
this(fileFormat, null, false, false, "_top", false, null);
this(fileFormat, null, false, false, "_top", false, null, TikzFontDistortion.getDefault());
}
private FileFormatOption(FileFormat fileFormat, AffineTransform at, boolean withMetadata, boolean useRedForError,
String svgLinkTarget, boolean debugsvek, String hoverColor) {
String svgLinkTarget, boolean debugsvek, String hoverColor, TikzFontDistortion tikzFontDistortion) {
this.hoverColor = hoverColor;
this.fileFormat = fileFormat;
this.affineTransform = at;
@ -85,21 +86,30 @@ public class FileFormatOption implements Serializable {
this.useRedForError = useRedForError;
this.svgLinkTarget = svgLinkTarget;
this.debugsvek = debugsvek;
this.tikzFontDistortion = tikzFontDistortion;
if (tikzFontDistortion == null) {
throw new IllegalArgumentException();
}
}
public FileFormatOption withUseRedForError() {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek,
hoverColor);
hoverColor, tikzFontDistortion);
}
public FileFormatOption withTikzFontDistortion(TikzFontDistortion tikzFontDistortion) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek,
hoverColor, tikzFontDistortion);
}
public FileFormatOption withSvgLinkTarget(String svgLinkTarget) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
debugsvek, hoverColor);
debugsvek, hoverColor, tikzFontDistortion);
}
public FileFormatOption withHoverColor(String hoverColor) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget,
debugsvek, hoverColor);
debugsvek, hoverColor, tikzFontDistortion);
}
@Override
@ -137,4 +147,8 @@ public class FileFormatOption implements Serializable {
this.withMetadata = false;
}
public final TikzFontDistortion getTikzFontDistortion() {
return tikzFontDistortion;
}
}

View File

@ -139,6 +139,8 @@ public interface ISkinParam extends ISkinSimple {
public HtmlColor getHoverPathColor();
public TikzFontDistortion getTikzFontDistortion();
public double getPadding(PaddingParam param);
public boolean useRankSame();

View File

@ -46,6 +46,7 @@ public enum LineParam {
sequenceParticipantBorder, noteBorder, sequenceGroupBorder, sequenceReferenceBorder,
legendBorder,
sequenceArrow,
arrow,
classBorder, objectBorder, usecaseBorder,
partitionBorder,
packageBorder,

View File

@ -311,7 +311,7 @@ public class OptionFlags {
}
private static boolean isTrue(final String value) {
return "on".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value) || "on".equalsIgnoreCase(value);
return "on".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value);
}
public boolean isEnableStats() {

View File

@ -36,10 +36,12 @@
package net.sourceforge.plantuml;
import java.awt.Font;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
@ -91,7 +93,9 @@ public class SkinParam implements ISkinParam {
}
public void setParam(String key, String value) {
params.put(cleanForKey(key), StringUtils.trin(value));
for (String key2 : cleanForKey(key)) {
params.put(key2, StringUtils.trin(value));
}
}
private SkinParam(UmlDiagramType type) {
@ -108,16 +112,12 @@ public class SkinParam implements ISkinParam {
return result;
}
static String cleanForKey(String key) {
static List<String> cleanForKey(String key) {
key = StringUtils.trin(StringUtils.goLowerCase(key));
key = key.replaceAll("_|\\.|\\s", "");
// key = replaceSmart(key, "partition", "package");
key = replaceSmart(key, "sequenceparticipant", "participant");
key = replaceSmart(key, "sequenceactor", "actor");
// if (key.contains("arrow")) {
// key = key.replaceAll("activityarrow|objectarrow|classarrow|componentarrow|statearrow|usecasearrow",
// "genericarrow");
// }
key = key.replaceAll("activityarrow", "arrow");
key = key.replaceAll("objectarrow", "arrow");
key = key.replaceAll("classarrow", "arrow");
@ -125,13 +125,16 @@ public class SkinParam implements ISkinParam {
key = key.replaceAll("statearrow", "arrow");
key = key.replaceAll("usecasearrow", "arrow");
key = key.replaceAll("sequencearrow", "arrow");
final Matcher2 m = stereoPattern.matcher(key);
if (m.find()) {
final String s = m.group(1);
key = key.replaceAll(stereoPatternString, "");
key += "<<" + s + ">>";
final Matcher2 mm = stereoPattern.matcher(key);
final List<String> result = new ArrayList<String>();
while (mm.find()) {
final String s = mm.group(1);
result.add(key.replaceAll(stereoPatternString, "") + "<<" + s + ">>");
}
return key;
if (result.size() == 0) {
result.add(key);
}
return result;
}
private static String replaceSmart(String s, String src, String target) {
@ -158,7 +161,13 @@ public class SkinParam implements ISkinParam {
}
public String getValue(String key) {
return params.get(cleanForKey(key));
for (String key2 : cleanForKey(key)) {
final String result = params.get(key2);
if (result != null) {
return result;
}
}
return null;
}
static String humanName(String key) {
@ -862,4 +871,9 @@ public class SkinParam implements ISkinParam {
return false;
}
public TikzFontDistortion getTikzFontDistortion() {
final String value = getValue("tikzFont");
return TikzFontDistortion.fromValue(value);
}
}

View File

@ -271,4 +271,8 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.displayGenericWithOldFashion();
}
public TikzFontDistortion getTikzFontDistortion() {
return skinParam.getTikzFontDistortion();
}
}

View File

@ -44,6 +44,7 @@ import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.sourceforge.plantuml.asciiart.Wcwidth;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
@ -284,7 +285,7 @@ public class StringUtils {
return s;
}
public static int getWidth(Display stringsToDisplay) {
private static int getWidth(Display stringsToDisplay) {
int result = 1;
for (CharSequence s : stringsToDisplay) {
if (s != null && result < s.length()) {
@ -294,6 +295,17 @@ public class StringUtils {
return result;
}
public static int getWcWidth(Display stringsToDisplay) {
int result = 1;
for (CharSequence s : stringsToDisplay) {
final int length = Wcwidth.length(s);
if (s != null && result < length) {
result = length;
}
}
return result;
}
public static int getHeight(List<? extends CharSequence> stringsToDisplay) {
return stringsToDisplay.size();
}
@ -423,6 +435,8 @@ public class StringUtils {
c += 13;
} else if ((c >= 'n' && c <= 'z') || (c >= 'N' && c <= 'Z')) {
c -= 13;
} else if (c > 126) {
throw new IllegalArgumentException(s);
}
sb.append(c);
}

View File

@ -0,0 +1,86 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML 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 3 of the License, or
* (at your option) any later version.
*
* PlantUML 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 library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml;
import java.util.StringTokenizer;
public class TikzFontDistortion {
private final double magnify;
private final double distortion;
private TikzFontDistortion(double magnify, double distortion) {
this.magnify = magnify;
this.distortion = distortion;
}
@Override
public String toString() {
return "" + magnify + ";" + distortion;
}
public static TikzFontDistortion fromValue(String value) {
if (value == null) {
return getDefault();
}
final StringTokenizer st = new StringTokenizer(value, ";");
if (st.hasMoreElements() == false) {
return getDefault();
}
final String v1 = st.nextToken();
if (st.hasMoreElements() == false) {
return getDefault();
}
final String v2 = st.nextToken();
if (v1.matches("[\\d.]+") && v2.matches("[-\\d.]+")) {
return new TikzFontDistortion(Double.parseDouble(v1), Double.parseDouble(v2));
}
return getDefault();
}
public static TikzFontDistortion getDefault() {
return new TikzFontDistortion(1.20, 4.0);
}
public final double getMagnify() {
return magnify;
}
public final double getDistortion() {
return distortion;
}
}

View File

@ -223,6 +223,7 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
final HtmlColor hover = getSkinParam().getHoverPathColor();
fileFormatOption = fileFormatOption.withSvgLinkTarget(getSkinParam().getSvgLinkTarget());
fileFormatOption = fileFormatOption.withTikzFontDistortion(getSkinParam().getTikzFontDistortion());
if (hover != null) {
fileFormatOption = fileFormatOption.withHoverColor(StringUtils.getAsHtml(getSkinParam().getColorMapper()
.getMappedColor(hover)));

View File

@ -54,6 +54,7 @@ public class Url implements EnsureVisible {
if (url.contains("{")) {
throw new IllegalArgumentException(url);
}
url = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(url, "\"");
this.url = url;
if (tooltip == null) {
this.tooltip = url;

View File

@ -59,6 +59,7 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
@ -84,11 +85,9 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("ARROW_BODY1", "([-.]+)"), //
new RegexLeaf("ARROW_STYLE1",
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?"), //
new RegexLeaf("ARROW_STYLE1", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_DIRECTION", "(\\*|left|right|up|down|le?|ri?|up?|do?)?"), //
new RegexLeaf("ARROW_STYLE2",
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?"), //
new RegexLeaf("ARROW_STYLE2", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_BODY2", "([-.]*)\\>"), //
new RegexLeaf("[%s]*"), //
@ -150,7 +149,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE);
if ((arrowBody1 + arrowBody2).contains(".")) {
type = type.getDotted();
type = type.goDotted();
}
Link link = new Link(entity1, entity2, type, linkLabel, lenght);

View File

@ -64,6 +64,7 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.color.ColorType;
public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram> {
@ -93,11 +94,9 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
new RegexLeaf("ARROW_BODY1", "([-.]+)"), //
new RegexLeaf("ARROW_STYLE1",
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?"), //
new RegexLeaf("ARROW_STYLE1", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_DIRECTION", "(\\*|left|right|up|down|le?|ri?|up?|do?)?"), //
new RegexLeaf("ARROW_STYLE2",
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)\\])?"), //
new RegexLeaf("ARROW_STYLE2", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_BODY2", "([-.]*)\\>"), //
new RegexLeaf("[%s]*"), //
@ -179,7 +178,8 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
entity2.setStereotype(new Stereotype(lineLast.get(2)));
}
if (lineLast.get(4) != null) {
entity2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(lineLast.get(4)));
entity2.setSpecificColorTOBEREMOVED(ColorType.BACK, diagram.getSkinParam().getIHtmlColorSet()
.getColorIfValid(lineLast.get(4)));
}
if (entity1 == null || entity2 == null) {
@ -198,7 +198,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE);
if (arrow.contains(".")) {
type = type.getDotted();
type = type.goDotted();
}
Link link = new Link(entity1, entity2, type, linkLabel, lenght);
final Direction direction = StringUtils.getArrowDirection(arrowBody1 + arrowDirection + arrowBody2 + ">");

View File

@ -78,6 +78,13 @@ public class InstructionRepeat implements Instruction {
this.color = color;
}
private boolean isLastOfTheParent() {
if (parent instanceof InstructionList) {
return ((InstructionList) parent).getLast() == this;
}
return false;
}
public void setBackward(Display label) {
this.backward = label;
}
@ -89,9 +96,9 @@ public class InstructionRepeat implements Instruction {
public Ftile createFtile(FtileFactory factory) {
final Ftile back = Display.isNull(backward) ? null : factory.activity(backward, swimlane, BoxStyle.PLAIN,
Colors.empty());
final Ftile result = factory.repeat(swimlane, repeatList.getSwimlaneOut(),
startLabel, factory.decorateOut(repeatList.createFtile(factory), endRepeatLinkRendering), test, yes, out,
color, backRepeatLinkRendering, back);
final Ftile result = factory.repeat(swimlane, repeatList.getSwimlaneOut(), startLabel,
factory.decorateOut(repeatList.createFtile(factory), endRepeatLinkRendering), test, yes, out, color,
backRepeatLinkRendering, back, isLastOfTheParent());
if (killed) {
return new FtileKilled(result);
}

View File

@ -43,11 +43,13 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexOr;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.Rainbow;
public class CommandArrow3 extends SingleLineCommand2<ActivityDiagram3> {
public static final String STYLE_COLORS = "-\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*(?:;(?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)*)\\]->";
public static final String STYLE_COLORS = "-\\[(" + CommandLinkElement.LINE_STYLE + "(?:;"
+ CommandLinkElement.LINE_STYLE + ")*)\\]->";
public CommandArrow3() {
super(getRegexConcat());

View File

@ -75,7 +75,7 @@ public interface FtileFactory {
public Ftile assembly(Ftile tile1, Ftile tile2);
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat, Display test, Display yes,
Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward);
Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward, boolean noOut);
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
LinkRendering afterEndwhile, HtmlColor color, Instruction specialOut);

View File

@ -142,9 +142,9 @@ public class FtileFactoryDelegator implements FtileFactory {
}
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat, Display test, Display yes,
Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward) {
Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward, boolean noOut) {
return factory.repeat(swimlane, swimlaneOut, startLabel, repeat, test, yes, out, color, backRepeatLinkRendering,
backward);
backward, noOut);
}
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,

View File

@ -70,15 +70,15 @@ public class Worm implements Iterable<Point2D.Double> {
throw new IllegalArgumentException();
}
final LinkStyle style = color.getStyle();
if (style == LinkStyle.INVISIBLE) {
if (style.isInvisible()) {
return;
}
ug = ug.apply(new UChangeColor(color2));
ug = ug.apply(new UChangeBackColor(color2));
if (style == LinkStyle.NORMAL) {
if (style.isNormal()) {
ug = ug.apply(new UStroke(stroke));
} else {
ug = ug.apply(LinkStyle.getStroke(style, stroke));
ug = ug.apply(style.goThickness(stroke).getStroke3());
}
boolean drawn = false;
for (int i = 0; i < points.size() - 1; i++) {

View File

@ -72,13 +72,14 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
@Override
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, final Ftile repeat, Display test,
Display yes, Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward) {
Display yes, Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward,
boolean noOut) {
final ConditionStyle conditionStyle = skinParam().getConditionStyle();
final HtmlColor borderColor = getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBorder);
final HtmlColor backColor = color == null ? getRose().getHtmlColor(skinParam(), ColorParam.activityDiamondBackground)
: color;
final HtmlColor backColor = color == null ? getRose().getHtmlColor(skinParam(),
ColorParam.activityDiamondBackground) : color;
final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering();
@ -92,7 +93,7 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
Ftile result = FtileRepeat.create(backRepeatLinkRendering, swimlane, swimlaneOut, backStart, repeat, test, yes,
out, borderColor, backColor, arrowColor, endRepeatLinkColor, conditionStyle, this.skinParam(),
fcDiamond, fcArrow, backward);
fcDiamond, fcArrow, backward, noOut);
final List<WeldingPoint> weldingPoints = repeat.getWeldingPoints();
if (weldingPoints.size() > 0) {
@ -110,7 +111,8 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
final UTranslate tr2 = genealogy.getTranslate(diamondBreak, ug.getStringBounder());
final Dimension2D dimDiamond = diamondBreak.calculateDimension(ug.getStringBounder());
final Snake snake = new Snake(getFtile1().arrowHorizontalAlignment(), arrowColor, Arrows.asToRight());
final Snake snake = new Snake(getFtile1().arrowHorizontalAlignment(), arrowColor, Arrows
.asToRight());
snake.addPoint(tr1.getDx(), tr1.getDy());
snake.addPoint(0, tr1.getDy());
snake.addPoint(0, tr2.getDy() + dimDiamond.getHeight() / 2);

View File

@ -54,6 +54,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
import net.sourceforge.plantuml.activitydiagram3.ftile.Diamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileEmpty;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
@ -111,7 +112,8 @@ class FtileRepeat extends AbstractFtile {
public static Ftile create(LinkRendering backRepeatLinkRendering, Swimlane swimlane, Swimlane swimlaneOut,
Ftile backStart, Ftile repeat, Display test, Display yes, Display out, HtmlColor borderColor,
HtmlColor backColor, Rainbow arrowColor, Rainbow endRepeatLinkColor, ConditionStyle conditionStyle,
ISkinSimple spriteContainer, FontConfiguration fcDiamond, FontConfiguration fcArrow, Ftile backward) {
ISkinSimple spriteContainer, FontConfiguration fcDiamond, FontConfiguration fcArrow, Ftile backward,
boolean noOut) {
final FontConfiguration fontConfiguration1 = conditionStyle == ConditionStyle.INSIDE ? fcDiamond : fcArrow;
@ -129,8 +131,13 @@ class FtileRepeat extends AbstractFtile {
}
final FtileRepeat result;
if (conditionStyle == ConditionStyle.INSIDE) {
final Ftile diamond2 = new FtileDiamondInside(repeat.skinParam(), backColor, borderColor, swimlaneOut,
tbTest).withEast(yesTb).withSouth(outTb);
final Ftile diamond2;
if (noOut && Display.isNull(test)) {
diamond2 = new FtileEmpty(repeat.skinParam());
} else {
diamond2 = new FtileDiamondInside(repeat.skinParam(), backColor, borderColor, swimlaneOut, tbTest)
.withEast(yesTb).withSouth(outTb);
}
result = new FtileRepeat(repeat, diamond1, diamond2, TextBlockUtils.empty(0, 0), backward);
} else if (conditionStyle == ConditionStyle.DIAMOND) {
final Ftile diamond2 = new FtileDiamond(repeat.skinParam(), backColor, borderColor, swimlane)

View File

@ -116,8 +116,9 @@ public class VCompactFactory implements FtileFactory {
return new FtileAssemblySimple(tile1, tile2);
}
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat, Display test, Display yes,
Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward) {
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat, Display test,
Display yes, Display out, HtmlColor color, LinkRendering backRepeatLinkRendering, Ftile backward,
boolean noOut) {
return repeat;
}

View File

@ -78,6 +78,17 @@ public class BasicCharAreaImpl implements BasicCharArea {
}
}
private boolean isLong(char c) {
final int wc = Wcwidth.of(c);
if (wc == 1) {
return false;
}
if (wc == 2) {
return true;
}
throw new IllegalArgumentException("warning width=" + wc + " char=" + ((int) c));
}
private void ensurePossible(int x, int y) {
int newCharSize1 = charSize1;
int newCharSize2 = charSize2;
@ -106,8 +117,15 @@ public class BasicCharAreaImpl implements BasicCharArea {
}
public void drawStringLR(String string, int x, int y) {
int pos = x;
for (int i = 0; i < string.length(); i++) {
drawChar(string.charAt(i), x + i, y);
final char c = string.charAt(i);
drawChar(c, pos, y);
pos++;
if (isLong(c)) {
drawChar('\0', pos, y);
pos++;
}
}
}
@ -120,7 +138,10 @@ public class BasicCharAreaImpl implements BasicCharArea {
public String getLine(int line) {
final StringBuilder sb = new StringBuilder(charSize1);
for (int x = 0; x < width; x++) {
sb.append(chars[x][line]);
final char c = chars[x][line];
if (c != '\0') {
sb.append(c);
}
}
return sb.toString();
}

View File

@ -100,7 +100,7 @@ public class ComponentTextActor extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
return StringUtils.getWidth(stringsToDisplay) + 2;
return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}

View File

@ -96,7 +96,7 @@ public class ComponentTextArrow extends AbstractComponentText {
final UmlCharArea charArea = ((UGraphicTxt) ug).getCharArea();
final int width = (int) dimensionToUse.getWidth();
final int height = (int) dimensionToUse.getHeight();
final int textWidth = StringUtils.getWidth(stringsToDisplay);
final int textWidth = StringUtils.getWcWidth(stringsToDisplay);
final int yarrow = height - 2;
charArea.drawHLine(fileFormat == FileFormat.UTXT ? '\u2500' : '-', yarrow, 1, width);
@ -125,7 +125,7 @@ public class ComponentTextArrow extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
final int width = StringUtils.getWidth(stringsToDisplay) + 2;
final int width = StringUtils.getWcWidth(stringsToDisplay) + 2;
if (maxAsciiMessageLength > 0) {
return Math.min(maxAsciiMessageLength, width);
}

View File

@ -59,7 +59,7 @@ public class ComponentTextDelay extends AbstractComponentText {
final Dimension2D dimensionToUse = area.getDimensionToUse();
final UmlCharArea charArea = ((UGraphicTxt) ug).getCharArea();
final int width = (int) dimensionToUse.getWidth();
final int textWidth = StringUtils.getWidth(stringsToDisplay);
final int textWidth = StringUtils.getWcWidth(stringsToDisplay);
final int textPos = (width - textWidth) / 2;
if (stringsToDisplay.isWhite()) {
@ -75,7 +75,7 @@ public class ComponentTextDelay extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
return StringUtils.getWidth(stringsToDisplay) + 2;
return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}

View File

@ -63,7 +63,7 @@ public class ComponentTextDivider extends AbstractComponentText {
final Dimension2D dimensionToUse = area.getDimensionToUse();
final UmlCharArea charArea = ((UGraphicTxt) ug).getCharArea();
final int width = (int) dimensionToUse.getWidth();
final int textWidth = StringUtils.getWidth(stringsToDisplay);
final int textWidth = StringUtils.getWcWidth(stringsToDisplay);
// final int height = (int) dimensionToUse.getHeight();
final int textPos = (width - textWidth - 1) / 2;
@ -91,7 +91,7 @@ public class ComponentTextDivider extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
return StringUtils.getWidth(stringsToDisplay) + 2;
return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}

View File

@ -103,7 +103,7 @@ public class ComponentTextGroupingHeader extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
return StringUtils.getWidth(stringsToDisplay) + 2;
return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}

View File

@ -86,7 +86,7 @@ public class ComponentTextNote extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
return StringUtils.getWidth(stringsToDisplay) + 7;
return StringUtils.getWcWidth(stringsToDisplay) + 7;
}
}

View File

@ -91,7 +91,7 @@ public class ComponentTextParticipant extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
return StringUtils.getWidth(stringsToDisplay) + 2;
return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}

View File

@ -102,7 +102,7 @@ public class ComponentTextSelfArrow extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
return StringUtils.getWidth(stringsToDisplay) + 6;
return StringUtils.getWcWidth(stringsToDisplay) + 6;
}
}

View File

@ -84,7 +84,7 @@ public class ComponentTextShape extends AbstractComponentText {
}
public double getPreferredWidth(StringBounder stringBounder) {
return StringUtils.getWidth(stringsToDisplay) + 2;
return StringUtils.getWcWidth(stringsToDisplay) + 2;
}
}

View File

@ -0,0 +1,253 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML 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 3 of the License, or
* (at your option) any later version.
*
* PlantUML 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 library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
* Source code provided by Yasuhiro Matsumoto
*
*/
/**
* Source code provided by Yasuhiro Matsumoto.
* See:
* https://github.com/plantuml/plantuml/issues/74
*
* Many thanks for his help!
*/
/**
* <p>See <a href="http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c">wcwidth.c</a></p>
*
* <p>This is an implementation of wcwidth() and wcswidth() (defined in
* IEEE Std 1002.1-2001) for Unicode.</p>
*
* http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html
* http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html
*
* <p>In fixed-width output devices, Latin characters all occupy a single
* "cell" position of equal width, whereas ideographic CJK characters
* occupy two such cells. Interoperability between terminal-line
* applications and (teletype-style) character terminals using the
* UTF-8 encoding requires agreement on which character should advance
* the cursor by how many cell positions. No established formal
* standards exist at present on which Unicode character shall occupy
* how many cell positions on character terminals. These routines are
* a first attempt of defining such behavior based on simple rules
* applied to data provided by the Unicode Consortium.</p>
*
* <p>For some graphical characters, the Unicode standard explicitly
* defines a character-cell width via the definition of the East Asian
* FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes.
* In all these cases, there is no ambiguity about which width a
* terminal shall use. For characters in the East Asian Ambiguous (A)
* class, the width choice depends purely on a preference of backward
* compatibility with either historic CJK or Western practice.
* Choosing single-width for these characters is easy to justify as
* the appropriate long-term solution, as the CJK practice of
* displaying these characters as double-width comes from historic
* implementation simplicity (8-bit encoded characters were displayed
* single-width and 16-bit ones double-width, even for Greek,
* Cyrillic, etc.) and not any typographic considerations.</p>
*
* <p>Much less clear is the choice of width for the Not East Asian
* (Neutral) class. Existing practice does not dictate a width for any
* of these characters. It would nevertheless make sense
* typographically to allocate two character cells to characters such
* as for instance EM SPACE or VOLUME INTEGRAL, which cannot be
* represented adequately with a single-width glyph. The following
* routines at present merely assign a single-cell width to all
* neutral characters, in the interest of simplicity. This is not
* entirely satisfactory and should be reconsidered before
* establishing a formal standard in this area. At the moment, the
* decision which Not East Asian (Neutral) characters should be
* represented by double-width glyphs cannot yet be answered by
* applying a simple rule from the Unicode database content. Setting
* up a proper standard for the behavior of UTF-8 character terminals
* will require a careful analysis not only of each Unicode character,
* but also of each presentation form, something the author of these
* routines has avoided to do so far.</p>
*
* <p>http://www.unicode.org/unicode/reports/tr11/</p>
*/
package net.sourceforge.plantuml.asciiart;
public class Wcwidth {
/**
* sorted list of non-overlapping intervals of non-spacing characters
* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c"
*/
private static final int[][] COMBINING = {
{0x0300, 0x036F}, {0x0483, 0x0486}, {0x0488, 0x0489},
{0x0591, 0x05BD}, {0x05BF, 0x05BF}, {0x05C1, 0x05C2},
{0x05C4, 0x05C5}, {0x05C7, 0x05C7}, {0x0600, 0x0603},
{0x0610, 0x0615}, {0x064B, 0x065E}, {0x0670, 0x0670},
{0x06D6, 0x06E4}, {0x06E7, 0x06E8}, {0x06EA, 0x06ED},
{0x070F, 0x070F}, {0x0711, 0x0711}, {0x0730, 0x074A},
{0x07A6, 0x07B0}, {0x07EB, 0x07F3}, {0x0901, 0x0902},
{0x093C, 0x093C}, {0x0941, 0x0948}, {0x094D, 0x094D},
{0x0951, 0x0954}, {0x0962, 0x0963}, {0x0981, 0x0981},
{0x09BC, 0x09BC}, {0x09C1, 0x09C4}, {0x09CD, 0x09CD},
{0x09E2, 0x09E3}, {0x0A01, 0x0A02}, {0x0A3C, 0x0A3C},
{0x0A41, 0x0A42}, {0x0A47, 0x0A48}, {0x0A4B, 0x0A4D},
{0x0A70, 0x0A71}, {0x0A81, 0x0A82}, {0x0ABC, 0x0ABC},
{0x0AC1, 0x0AC5}, {0x0AC7, 0x0AC8}, {0x0ACD, 0x0ACD},
{0x0AE2, 0x0AE3}, {0x0B01, 0x0B01}, {0x0B3C, 0x0B3C},
{0x0B3F, 0x0B3F}, {0x0B41, 0x0B43}, {0x0B4D, 0x0B4D},
{0x0B56, 0x0B56}, {0x0B82, 0x0B82}, {0x0BC0, 0x0BC0},
{0x0BCD, 0x0BCD}, {0x0C3E, 0x0C40}, {0x0C46, 0x0C48},
{0x0C4A, 0x0C4D}, {0x0C55, 0x0C56}, {0x0CBC, 0x0CBC},
{0x0CBF, 0x0CBF}, {0x0CC6, 0x0CC6}, {0x0CCC, 0x0CCD},
{0x0CE2, 0x0CE3}, {0x0D41, 0x0D43}, {0x0D4D, 0x0D4D},
{0x0DCA, 0x0DCA}, {0x0DD2, 0x0DD4}, {0x0DD6, 0x0DD6},
{0x0E31, 0x0E31}, {0x0E34, 0x0E3A}, {0x0E47, 0x0E4E},
{0x0EB1, 0x0EB1}, {0x0EB4, 0x0EB9}, {0x0EBB, 0x0EBC},
{0x0EC8, 0x0ECD}, {0x0F18, 0x0F19}, {0x0F35, 0x0F35},
{0x0F37, 0x0F37}, {0x0F39, 0x0F39}, {0x0F71, 0x0F7E},
{0x0F80, 0x0F84}, {0x0F86, 0x0F87}, {0x0F90, 0x0F97},
{0x0F99, 0x0FBC}, {0x0FC6, 0x0FC6}, {0x102D, 0x1030},
{0x1032, 0x1032}, {0x1036, 0x1037}, {0x1039, 0x1039},
{0x1058, 0x1059}, {0x1160, 0x11FF}, {0x135F, 0x135F},
{0x1712, 0x1714}, {0x1732, 0x1734}, {0x1752, 0x1753},
{0x1772, 0x1773}, {0x17B4, 0x17B5}, {0x17B7, 0x17BD},
{0x17C6, 0x17C6}, {0x17C9, 0x17D3}, {0x17DD, 0x17DD},
{0x180B, 0x180D}, {0x18A9, 0x18A9}, {0x1920, 0x1922},
{0x1927, 0x1928}, {0x1932, 0x1932}, {0x1939, 0x193B},
{0x1A17, 0x1A18}, {0x1B00, 0x1B03}, {0x1B34, 0x1B34},
{0x1B36, 0x1B3A}, {0x1B3C, 0x1B3C}, {0x1B42, 0x1B42},
{0x1B6B, 0x1B73}, {0x1DC0, 0x1DCA}, {0x1DFE, 0x1DFF},
{0x200B, 0x200F}, {0x202A, 0x202E}, {0x2060, 0x2063},
{0x206A, 0x206F}, {0x20D0, 0x20EF}, {0x302A, 0x302F},
{0x3099, 0x309A}, {0xA806, 0xA806}, {0xA80B, 0xA80B},
{0xA825, 0xA826}, {0xFB1E, 0xFB1E}, {0xFE00, 0xFE0F},
{0xFE20, 0xFE23}, {0xFEFF, 0xFEFF}, {0xFFF9, 0xFFFB},
{0x10A01, 0x10A03}, {0x10A05, 0x10A06}, {0x10A0C, 0x10A0F},
{0x10A38, 0x10A3A}, {0x10A3F, 0x10A3F}, {0x1D167, 0x1D169},
{0x1D173, 0x1D182}, {0x1D185, 0x1D18B}, {0x1D1AA, 0x1D1AD},
{0x1D242, 0x1D244}, {0xE0001, 0xE0001}, {0xE0020, 0xE007F},
{0xE0100, 0xE01EF}
};
static boolean bisearch(int ucs) {
int min = 0;
int mid;
int max = COMBINING.length - 1;
if (ucs < COMBINING[0][0] || ucs > COMBINING[max][1]) {
return false;
}
while (max >= min) {
mid = (min + max) / 2;
if (ucs > COMBINING[mid][1]) {
min = mid + 1;
} else if (ucs < COMBINING[mid][0]) {
max = mid - 1;
} else {
return true;
}
}
return false;
}
/**
* See : http://www.cl.cam.ac.uk/%7Emgk25/ucs/wcwidth.c
*
* The following two functions define the column width of an ISO 10646
* character as follows:
*
* - The null character (U+0000) has a column width of 0.
*
* - Other C0/C1 control characters and DEL will lead to a return
* value of -1.
*
* - Non-spacing and enclosing combining characters (general
* category code Mn or Me in the Unicode database) have a
* column width of 0.
*
* - SOFT HYPHEN (U+00AD) has a column width of 1.
*
* - Other format characters (general category code Cf in the Unicode
* database) and ZERO WIDTH SPACE (U+200B) have a column width of 0.
*
* - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
* have a column width of 0.
*
* - Spacing characters in the East Asian Wide (W) or East Asian
* Full-width (F) category as defined in Unicode Technical
* Report #11 have a column width of 2.
*
* - All remaining characters (including all printable
* ISO 8859-1 and WGL4 characters, Unicode control characters,
* etc.) have a column width of 1.
*
* This implementation assumes that wchar_t characters are encoded
* in ISO 10646.
*/
public static int of(int codePoint) {
// test for 8-bit control characters
if (codePoint == 0) {
return 0;
}
if (codePoint < 32 || (codePoint >= 0x7f && codePoint < 0xa0)) {
return -1;
}
// Added by Arnaud : Usual 8 bit char
if (codePoint < 127) {
return 1;
}
// binary search in table of non-spacing characters
if (bisearch(codePoint)) {
return 0;
}
// if we arrive here, ucs is not a combining or C0/C1 control character
return 1 +
((codePoint >= 0x1100 &&
(codePoint <= 0x115f || // Hangul Jamo init. consonants
codePoint == 0x2329 || codePoint == 0x232a ||
(codePoint >= 0x2e80 && codePoint <= 0xa4cf &&
codePoint != 0x303f) || // CJK ... Yi
(codePoint >= 0xac00 && codePoint <= 0xd7a3) || // Hangul Syllables
(codePoint >= 0xf900 && codePoint <= 0xfaff) || // CJK Compatibility Ideographs
(codePoint >= 0xfe10 && codePoint <= 0xfe19) || // Vertical forms
(codePoint >= 0xfe30 && codePoint <= 0xfe6f) || // CJK Compatibility Forms
(codePoint >= 0xff00 && codePoint <= 0xff60) || // Fullwidth Forms
(codePoint >= 0xffe0 && codePoint <= 0xffe6) ||
(codePoint >= 0x20000 && codePoint <= 0x2fffd) ||
(codePoint >= 0x30000 && codePoint <= 0x3fffd))) ? 1 : 0);
}
public static int length(CharSequence s) {
int result = 0;
for (int i = 0; i < s.length(); i++) {
result += of(s.charAt(i));
}
return result;
}
}

View File

@ -39,6 +39,7 @@ import java.io.OutputStream;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.StringBounder;
@ -117,7 +118,7 @@ public class UGraphicBraille extends AbstractUGraphic<BrailleGrid> implements Cl
}
public StringBounder getStringBounder() {
return FileFormat.BRAILLE_PNG.getDefaultStringBounder();
return FileFormat.BRAILLE_PNG.getDefaultStringBounder(TikzFontDistortion.getDefault());
}
public void startUrl(Url url) {

View File

@ -69,7 +69,9 @@ import net.sourceforge.plantuml.command.note.FactoryNoteOnEntityCommand;
import net.sourceforge.plantuml.command.note.FactoryNoteOnLinkCommand;
import net.sourceforge.plantuml.command.note.FactoryTipOnEntityCommand;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.descdiagram.command.CommandCreateElementMultilines;
import net.sourceforge.plantuml.descdiagram.command.CommandNewpage;
import net.sourceforge.plantuml.descdiagram.command.CommandPackageWithUSymbol;
import net.sourceforge.plantuml.objectdiagram.command.CommandCreateEntityObject;
import net.sourceforge.plantuml.objectdiagram.command.CommandCreateEntityObjectMultilines;
@ -107,6 +109,7 @@ public class ClassDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandPackage());
cmds.add(new CommandEndPackage());
cmds.add(new CommandPackageEmpty());
cmds.add(new CommandPackageWithUSymbol());
cmds.add(new CommandNamespace());
cmds.add(new CommandStereotype());
@ -143,6 +146,9 @@ public class ClassDiagramFactory extends UmlDiagramFactory {
cmds.add(new CommandNamespaceSeparator());
cmds.add(new CommandCreateElementMultilines(0));
cmds.add(new CommandCreateElementMultilines(1));
return cmds;
}
}

View File

@ -169,7 +169,7 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
final IEntity cl2 = system.getOrCreateLeaf(other, type2, null);
LinkType typeLink = new LinkType(LinkDecor.NONE, LinkDecor.EXTENDS);
if (type2 == LeafType.INTERFACE && entity.getLeafType() != LeafType.INTERFACE) {
typeLink = typeLink.getDashed();
typeLink = typeLink.goDashed();
}
final Link link = new Link(cl2, entity, typeLink, Display.NULL, 2, null, null,
system.getLabeldistance(), system.getLabelangle());

View File

@ -59,6 +59,7 @@ import net.sourceforge.plantuml.cucadiagram.Link;
import net.sourceforge.plantuml.cucadiagram.LinkArrow;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
@ -75,25 +76,21 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
}
static private RegexConcat getRegexConcat(UmlDiagramType umlDiagramType) {
return new RegexConcat(
new RegexLeaf("HEADER", "^(?:@([\\d.]+)[%s]+)?"), //
return new RegexConcat(new RegexLeaf("HEADER", "^(?:@([\\d.]+)[%s]+)?"), //
new RegexOr( //
new RegexLeaf("ENT1", getClassIdentifier()),//
new RegexLeaf("COUPLE1", COUPLE)),
new RegexLeaf("[%s]*"), //
new RegexLeaf("COUPLE1", COUPLE)), new RegexLeaf("[%s]*"), //
new RegexLeaf("FIRST_LABEL", "(?:[%g]([^%g]+)[%g])?"), //
new RegexLeaf("[%s]*"), //
new RegexConcat(
//
//
new RegexLeaf("ARROW_HEAD1", "([%s]+[ox]|[)#\\[<*+^}]|[<\\[]\\||\\}o|\\}\\||\\|o|\\|\\|)?"), //
new RegexLeaf("ARROW_BODY1", "([-=.]+)"), //
new RegexLeaf("ARROW_STYLE1",
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
new RegexLeaf("ARROW_STYLE1", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_DIRECTION", "(left|right|up|down|le?|ri?|up?|do?)?"), //
new RegexLeaf("INSIDE", "(?:(0|\\(0\\)|\\(0|0\\))(?=[-=.~]))?"), //
new RegexLeaf("ARROW_STYLE2",
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
new RegexLeaf("ARROW_STYLE2", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_BODY2", "([-=.]*)"), //
new RegexLeaf("ARROW_HEAD2", "([ox][%s]+|[(#\\]>*+^\\{]|\\|[>\\]]|o\\{|\\|\\{|o\\||\\|\\|)?")), //
@ -400,8 +397,6 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
return diagram.associationClass(clName1A, clName1B, clName2A, clName2B, linkType, label);
}
private CommandExecutionResult executeArgSpecial2(AbstractClassOrObjectDiagram diagram, RegexResult arg) {
final Code clName2A = Code.of(arg.get("COUPLE2", 0));
final Code clName2B = Code.of(arg.get("COUPLE2", 1));
@ -532,7 +527,7 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
LinkType result = new LinkType(decors2, decors1);
if (arg.get("ARROW_BODY1", 0).contains(".") || arg.get("ARROW_BODY2", 0).contains(".")) {
result = result.getDashed();
result = result.goDashed();
}
final String middle = arg.get("INSIDE", 0);
if ("0".equals(middle)) {
@ -611,6 +606,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
// Do nothing
} else if (s.equalsIgnoreCase("norank")) {
link.goNorank();
} else if (s.startsWith("thickness=")) {
link.goThickness(Double.parseDouble(s.substring("thickness=".length())));
} else {
link.setSpecificColor(s);
if (colors != null) {

View File

@ -143,7 +143,7 @@ public final class FactoryNoteActivityCommand implements SingleMultiFactoryComma
final Position position = Position.valueOf(StringUtils.goUpperCase(arg.get("POSITION", 0))).withRankdir(
diagram.getSkinParam().getRankdir());
final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).getDashed();
final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).goDashed();
if (position == Position.RIGHT) {
link = new Link(activity, note, type, Display.NULL, 1);

View File

@ -179,7 +179,7 @@ public final class FactoryNoteOnEntityCommand implements SingleMultiFactoryComma
diagram.getSkinParam().getRankdir());
final Link link;
final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).getDashed();
final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).goDashed();
if (position == Position.RIGHT) {
link = new Link(cl1, note, type, Display.NULL, 1);
link.setHorizontalSolitary(true);

View File

@ -61,11 +61,11 @@ public class CommandLinkBlock extends SingleLineCommand<CompositeDiagram> {
final String deco2 = arg.get(3);
LinkType linkType = new LinkType(getLinkDecor(deco1), getLinkDecor(deco2));
if ("*)".equals(deco1)) {
linkType = linkType.getInterfaceProvider();
} else if ("(*".equals(deco2)) {
linkType = linkType.getInterfaceUser();
}
// if ("*)".equals(deco1)) {
// linkType = linkType.getInterfaceProvider();
// } else if ("(*".equals(deco2)) {
// linkType = linkType.getInterfaceUser();
// }
final String queue = arg.get(2);

View File

@ -335,7 +335,7 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy,
// final CucaDiagramFileMaker maker = OptionFlags.USE_HECTOR ? new CucaDiagramFileMakerHectorC1(this)
// : new CucaDiagramFileMakerSvek(this);
final CucaDiagramFileMaker maker = this.isUseJDot() ? new CucaDiagramFileMakerJDot(this,
fileFormat.getDefaultStringBounder()) : new CucaDiagramFileMakerSvek(this);
fileFormatOption.getDefaultStringBounder()) : new CucaDiagramFileMakerSvek(this);
final ImageData result = maker.createFile(os, getDotStrings(), fileFormatOption);
if (result == null) {

View File

@ -167,11 +167,15 @@ public class Link implements Hideable, Removeable {
}
public void goDashed() {
type = type.getDashed();
type = type.goDashed();
}
public void goDotted() {
type = type.getDotted();
type = type.goDotted();
}
public void goThickness(double thickness) {
type = type.goThickness(thickness);
}
private boolean hidden = false;
@ -185,7 +189,7 @@ public class Link implements Hideable, Removeable {
}
public void goBold() {
type = type.getBold();
type = type.goBold();
}
public String getLabeldistance() {

View File

@ -35,6 +35,7 @@
*/
package net.sourceforge.plantuml.cucadiagram;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.svek.extremity.MiddleCircleCircledMode;
import net.sourceforge.plantuml.svek.extremity.MiddleFactory;
import net.sourceforge.plantuml.svek.extremity.MiddleFactoryCircle;
@ -44,18 +45,18 @@ public enum LinkMiddleDecor {
NONE, CIRCLE, CIRCLE_CIRCLED, CIRCLE_CIRCLED1, CIRCLE_CIRCLED2;
public MiddleFactory getMiddleFactory() {
public MiddleFactory getMiddleFactory(HtmlColor backColor) {
if (this == CIRCLE) {
return new MiddleFactoryCircle();
return new MiddleFactoryCircle(backColor);
}
if (this == CIRCLE_CIRCLED) {
return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.BOTH);
return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.BOTH, backColor);
}
if (this == CIRCLE_CIRCLED1) {
return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.MODE1);
return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.MODE1, backColor);
}
if (this == CIRCLE_CIRCLED2) {
return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.MODE2);
return new MiddleFactoryCircleCircled(MiddleCircleCircledMode.MODE2, backColor);
}
throw new UnsupportedOperationException();
}

View File

@ -37,43 +37,113 @@ package net.sourceforge.plantuml.cucadiagram;
import net.sourceforge.plantuml.ugraphic.UStroke;
public enum LinkStyle {
public class LinkStyle {
NORMAL, DASHED, DOTTED, BOLD, INVISIBLE,
DOUBLE_tobedone, __toremove_INTERFACE_PROVIDER, __toremove_INTERFACE_USER;
public static UStroke getStroke(LinkStyle style) {
return getStroke(style, 1);
static enum Type {
NORMAL, DASHED, DOTTED, BOLD, INVISIBLE;
}
public static UStroke getStroke(LinkStyle style, double thickness) {
if (style == LinkStyle.DASHED) {
return new UStroke(6, 6, thickness);
private LinkStyle(Type type, double thickness) {
this.type = type;
this.thickness = thickness;
}
// private final static LinkStyle NORMAL = new LinkStyle();
// private final static LinkStyle DASHED = new LinkStyle();
// private final static LinkStyle DOTTED = new LinkStyle();
// private final static LinkStyle BOLD = new LinkStyle();
// private final static LinkStyle INVISIBLE = new LinkStyle();
private final Type type;
private final double thickness;
@Override
public String toString() {
return type.toString() + "(" + thickness + ")";
}
// DOUBLE_tobedone, __toremove_INTERFACE_PROVIDER, __toremove_INTERFACE_USER;
// private UStroke getStroke2() {
// return getStroke2(1);
// }
public boolean isNormal() {
return type == Type.NORMAL;
}
public boolean isInvisible() {
return type == Type.INVISIBLE;
}
public static LinkStyle NORMAL() {
return new LinkStyle(Type.NORMAL, 0);
}
public static LinkStyle INVISIBLE() {
return new LinkStyle(Type.INVISIBLE, 0);
}
public static LinkStyle BOLD() {
return new LinkStyle(Type.BOLD, 0);
}
public static LinkStyle DOTTED() {
return new LinkStyle(Type.DOTTED, 0);
}
public static LinkStyle DASHED() {
return new LinkStyle(Type.DASHED, 0);
}
public LinkStyle goThickness(double thickness) {
return new LinkStyle(type, thickness);
}
public UStroke getStroke3() {
if (type == Type.DASHED) {
return new UStroke(7, 7, nonZeroThickness());
}
if (style == LinkStyle.DOTTED) {
return new UStroke(1, 3, thickness);
if (type == Type.DOTTED) {
return new UStroke(1, 3, nonZeroThickness());
}
if (style == LinkStyle.BOLD) {
return new UStroke(2.5);
if (type == Type.BOLD) {
return new UStroke(2);
}
return new UStroke();
return new UStroke(nonZeroThickness());
}
private double nonZeroThickness() {
if (thickness == 0) {
return 1;
}
return thickness;
}
public static LinkStyle fromString(String s) {
if ("dashed".equalsIgnoreCase(s)) {
return DASHED;
return DASHED();
}
if ("dotted".equalsIgnoreCase(s)) {
return DOTTED;
return DOTTED();
}
if ("bold".equalsIgnoreCase(s)) {
return BOLD;
return BOLD();
}
if ("hidden".equalsIgnoreCase(s)) {
return INVISIBLE;
return INVISIBLE();
}
return LinkStyle.NORMAL;
return LinkStyle.NORMAL();
}
@Deprecated
public static LinkStyle valueOf(String s) {
return fromString(s);
}
public boolean isThicknessOverrided() {
return thickness != 0;
}
}

View File

@ -51,7 +51,7 @@ public class LinkType {
}
public LinkType(LinkHat hat1, LinkDecor decor1, LinkDecor decor2, LinkHat hat2) {
this(hat1, decor1, LinkStyle.NORMAL, LinkMiddleDecor.NONE, decor2, hat2);
this(hat1, decor1, LinkStyle.NORMAL(), LinkMiddleDecor.NONE, decor2, hat2);
}
public LinkType withoutDecors1() {
@ -84,6 +84,9 @@ public class LinkType {
private LinkType(LinkHat hat1, LinkDecor decor1, LinkStyle style, LinkMiddleDecor middleDecor, LinkDecor decor2,
LinkHat hat2) {
if (style == null) {
throw new IllegalArgumentException();
}
this.decor1 = decor1;
this.style = style;
this.decor2 = decor2;
@ -92,41 +95,45 @@ public class LinkType {
this.hat2 = hat2;
}
public boolean isDashed() {
return style == LinkStyle.DASHED;
}
public boolean isDotted() {
return style == LinkStyle.DOTTED;
}
public boolean isBold() {
return style == LinkStyle.BOLD;
}
// private boolean isDashed() {
// return style == LinkStyle.DASHED;
// }
//
// private boolean isDotted() {
// return style == LinkStyle.DOTTED;
// }
//
// private boolean isBold() {
// return style == LinkStyle.BOLD;
// }
public boolean isInvisible() {
return style == LinkStyle.INVISIBLE;
return style.isInvisible();
}
public LinkType getDashed() {
return new LinkType(hat1, decor1, LinkStyle.DASHED, middleDecor, decor2, hat2);
public LinkType goDashed() {
return new LinkType(hat1, decor1, LinkStyle.DASHED(), middleDecor, decor2, hat2);
}
public LinkType getDotted() {
return new LinkType(hat1, decor1, LinkStyle.DOTTED, middleDecor, decor2, hat2);
public LinkType goDotted() {
return new LinkType(hat1, decor1, LinkStyle.DOTTED(), middleDecor, decor2, hat2);
}
public LinkType getBold() {
return new LinkType(hat1, decor1, LinkStyle.BOLD, middleDecor, decor2, hat2);
public LinkType goThickness(double thickness) {
return new LinkType(hat1, decor1, style.goThickness(thickness), middleDecor, decor2, hat2);
}
public LinkType getInterfaceProvider() {
return new LinkType(hat1, decor1, LinkStyle.__toremove_INTERFACE_PROVIDER, middleDecor, decor2, hat2);
public LinkType goBold() {
return new LinkType(hat1, decor1, LinkStyle.BOLD(), middleDecor, decor2, hat2);
}
public LinkType getInterfaceUser() {
return new LinkType(hat1, decor1, LinkStyle.__toremove_INTERFACE_USER, middleDecor, decor2, hat2);
}
// public LinkType getInterfaceProvider() {
// return new LinkType(hat1, decor1, LinkStyle.__toremove_INTERFACE_PROVIDER, middleDecor, decor2, hat2);
// }
//
// public LinkType getInterfaceUser() {
// return new LinkType(hat1, decor1, LinkStyle.__toremove_INTERFACE_USER, middleDecor, decor2, hat2);
// }
public LinkType getInversed() {
return new LinkType(hat2, decor2, style, middleDecor, decor1, hat1);
@ -149,7 +156,7 @@ public class LinkType {
}
public LinkType getInvisible() {
return new LinkType(hat1, decor1, LinkStyle.INVISIBLE, middleDecor, decor2, hat2);
return new LinkType(hat1, decor1, LinkStyle.INVISIBLE(), middleDecor, decor2, hat2);
}
public String getSpecificDecorationSvek() {
@ -221,17 +228,14 @@ public class LinkType {
return new LinkType(LinkHat.NONE, LinkDecor.NONE, style, middleDecor, decor2, hat2);
}
public UStroke getStroke() {
if (style == LinkStyle.DASHED) {
return new UStroke(7, 7, 1);
public UStroke getStroke3(UStroke defaultThickness) {
if (style.isThicknessOverrided()) {
return style.getStroke3();
}
if (style == LinkStyle.DOTTED) {
return new UStroke(1, 3, 1);
if (defaultThickness == null) {
return style.getStroke3();
}
if (style == LinkStyle.BOLD) {
return new UStroke(2);
}
return new UStroke();
return style.goThickness(defaultThickness.getThickness()).getStroke3();
}
public LinkMiddleDecor getMiddleDecor() {

View File

@ -161,15 +161,15 @@ public final class CucaDiagramTxtMaker {
}
private int getWidth(IEntity entity) {
int result = StringUtils.getWidth(entity.getDisplay());
int result = StringUtils.getWcWidth(entity.getDisplay());
for (Member att : entity.getBodier().getMethodsToDisplay()) {
final int w = StringUtils.getWidth(Display.getWithNewlines(att.getDisplay(true)));
final int w = StringUtils.getWcWidth(Display.getWithNewlines(att.getDisplay(true)));
if (w > result) {
result = w;
}
}
for (Member att : entity.getBodier().getFieldsToDisplay()) {
final int w = StringUtils.getWidth(Display.getWithNewlines(att.getDisplay(true)));
final int w = StringUtils.getWcWidth(Display.getWithNewlines(att.getDisplay(true)));
if (w > result) {
result = w;
}

View File

@ -166,6 +166,9 @@ final class EntityImpl implements ILeaf, IGroup {
throw new IllegalArgumentException();
}
if (leafType != LeafType.STILL_UNKNOWN) {
if (newType == this.leafType) {
return true;
}
if (leafType != LeafType.ANNOTATION && leafType != LeafType.ABSTRACT_CLASS && leafType != LeafType.CLASS
&& leafType != LeafType.ENUM && leafType != LeafType.INTERFACE) {
return false;

View File

@ -40,6 +40,7 @@ import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder;
import net.sourceforge.plantuml.UrlBuilder.ModeUrl;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -204,7 +205,7 @@ public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiag
return CommandExecutionResult.ok();
}
public static boolean existsWithBadType(DescriptionDiagram diagram, final Code code, LeafType type, USymbol usymbol) {
public static boolean existsWithBadType(AbstractEntityDiagram diagram, final Code code, LeafType type, USymbol usymbol) {
if (diagram.leafExist(code) == false) {
return false;
}

View File

@ -39,6 +39,7 @@ import java.util.List;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.CommandMultilines2;
@ -52,12 +53,11 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.ILeaf;
import net.sourceforge.plantuml.cucadiagram.LeafType;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
public class CommandCreateElementMultilines extends CommandMultilines2<DescriptionDiagram> {
public class CommandCreateElementMultilines extends CommandMultilines2<AbstractEntityDiagram> {
private final int type;
@ -107,7 +107,7 @@ public class CommandCreateElementMultilines extends CommandMultilines2<Descripti
throw new IllegalArgumentException();
}
public CommandExecutionResult executeNow(DescriptionDiagram diagram, BlocLines lines) {
public CommandExecutionResult executeNow(AbstractEntityDiagram diagram, BlocLines lines) {
lines = lines.trim(false);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
final String symbol = StringUtils.goUpperCase(line0.get("TYPE", 0));

View File

@ -63,25 +63,27 @@ import net.sourceforge.plantuml.graphic.color.Colors;
public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
static private final String KEY1 = "dotted|dashed|plain|bold|hidden|norank|thickness=\\d+";
static private final String KEY2 = ",dotted|,dashed|,plain|,bold|,hidden|,norank|,thickness=\\d+";
static public final String LINE_STYLE = "(?:#\\w+|" + CommandLinkElement.KEY1 + ")(?:,#\\w+|"
+ CommandLinkElement.KEY2 + ")*";
public CommandLinkElement() {
super(getRegexConcat());
}
static RegexConcat getRegexConcat() {
return new RegexConcat(
new RegexLeaf("^"), //
return new RegexConcat(new RegexLeaf("^"), //
getGroup("ENT1"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("LABEL1", "(?:[%g]([^%g]+)[%g])?"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("HEAD2", "(0\\)|<<|[<^*+#0)]|<\\||[%s]+o)?"), //
new RegexLeaf("BODY1", "([-=.~]+)"), //
new RegexLeaf("ARROW_STYLE1",
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
new RegexLeaf("ARROW_STYLE1", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("DIRECTION", "(?:(left|right|up|down|le?|ri?|up?|do?)(?=[-=.~0()]))?"), //
new RegexLeaf("INSIDE", "(?:(0|\\(0\\)|\\(0|0\\))(?=[-=.~]))?"), //
new RegexLeaf("ARROW_STYLE2",
"(?:\\[((?:#\\w+|dotted|dashed|plain|bold|hidden|norank)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden|,norank)*)\\])?"),
new RegexLeaf("ARROW_STYLE2", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("BODY2", "([-=.~]*)"), //
new RegexLeaf("HEAD1", "(\\(0|>>|[>^*+#0(]|\\|>|o[%s]+)?"), //
new RegexLeaf("[%s]*"), //
@ -157,11 +159,11 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
LinkType result = new LinkType(d1, d2);
final String queue = getQueue(arg);
if (queue.contains(".")) {
result = result.getDashed();
result = result.goDashed();
} else if (queue.contains("~")) {
result = result.getDotted();
result = result.goDotted();
} else if (queue.contains("=")) {
result = result.getBold();
result = result.goBold();
}
final String middle = arg.get("INSIDE", 0);

View File

@ -65,19 +65,19 @@ import net.sourceforge.plantuml.version.PSystemVersion;
public class PSystemDonors extends AbstractPSystem {
public static final String DONORS = "UDfbL4jksp0GtSyfk1RIGoXsujI_17QQ0jcDvR75c29Tad8ghuBUe421hdk3eaKMHOjiUW7bHXsvbKcb"
+ "10oOud3utinxawhato8BL-J9YbHxeoLcS4r9MAQ0iGbRwo1jh-821ZOSKGLpMg3p4hMOcbn3gfV6Ye4X"
+ "lwVcxsh54MquQXXZz93sq9VjHYf8GsgpWtaP85Gma4btQGF35cNfOEvfcvCMFMEspA_VlaCEHiMBgyP2"
+ "poYfnSoKZc1OlZXFxWmJQJTR2PC8DHRnbfzA5Rr7lUHozdB9MTTeAsOwEzBMQvZ6wFqUBfNSyOM-p3QC"
+ "_7WYDPovOseTWKXe1_rz8Rsjn1XpiqGODaM_pP7JHt49gT0kNfkAowJHSnpZOrp3l-1fqs6bbxor6TVa"
+ "71UssfXxjv6SIF6rI-lb7Yv2zDB0H6OvAN6AKbKn0xMFmJW7GqBzQeZPkvASw9SBYznB5VZUc3jFMIv6"
+ "5Xq6I6jYYKOTks-KnI5YP7Oo5if1Acy2OOamYyJRF17pJExuzZQIbTaqbJar5ZMgxOcu9Ozcws361D4k"
+ "nKWshOLpPMnJxydlNqeTcXu4eI9nifp6HpbPRAlTT3tlCd9mXQqyPh83E5LIp16NR1sx9l6Mz9hiYPYa"
+ "rw_dQP1sOZGCg6EPcBdEM2A5k67KVHRjA4HQQZhBPXaJmTakLluEOHgIKD62J28QWrAoBig2nBafoOVw"
+ "PWxEuyuSk0Grw7rSDeOxbMlMq5mMmO8CY9syQYgDxEe8TA8Kr9_gnoXz_LZ_W5xUiNR5nYiNXq5WDNlX"
+ "mdJW3CYiLfOgCPK5Dsw8_q-L6QvGYKdb57ka_b8_FZ_KtvkdHFsvVgf_ra_F7_Ztm9--mPcblHYXAjXP"
+ "5t6l6xaIw_MKL7EeexRnApAQYad2GxBBWWLsGo-7Kb8gdXij5G_pGqBdeVvOVpsMX86nvqAUQxEG3AEF"
+ "jeXzoY8mdS6dU8G65Qwugt7XDl07r_Qm0000";
public static final String DONORS = "UDfjL4jksp0GtSyfk1RIGoXsxDI_17QQ0jcDvR75c29TKd8ghOBUe421hdk3eaKMHOjiUW7bHXqvbKcb"
+ "9M3058V3zsRUcrX5VnTPkAISh8XrRhJ41AueyijaC35-Qnt4xLLSmj3w8ofXGKjqkKGjPYRL4EkLiM9e"
+ "AA-e-RjUSqGRZXec63oaS-ZBTYCLn3wrsSEYy11A6CgekxI1KOkoSB38QPUI5ZrZTioltxv33iRPYwl6"
+ "GiyegSNS58vWLBmuZsuD4satEmdJ03LcuPQVYXMzHxtYSlPIoLatQ4jcEZ_IrXkOXUZp2YwKtFE5laos"
+ "ZFnu8ZMSkMDg7O28Q0_zAfEvBSK4KxD263L5lqcHqmTn4IdVBbxRaikaCUSuniUuHi_WQTjXfLUyjGdN"
+ "P81BMsxDdTjAJgJuseNDPGNdFdfbO2gJb9GuHQdAa86gGZ3EmOXGlnfXyguW9_h5qYBtKdc-r-OsfoGL"
+ "OuiEFQGDiKI3Zjqrok8GCJPx6Ghb89Ktdh14c0VYRPu8UKQtV7iNoCficygS6eiQrUv4t52EPkTWpWJH"
+ "hiHODgs5WJAsgVVqzo-b3attWb21E5bEawESBBRLRhgUTXavkCHM7dFP0HmhAHQ8AxQEtP1uItf3zaHC"
+ "uwlNYzXBEp8QXjInJCXS9ooHJ5mpwZwBTkmZBJMTPRDCYE1i7of_Zp3pIIXhGKO1ZM4XMHT5Hc9W2ifz"
+ "VHC7Wx0p1ovU3ReAoyPmPtB36bh8p5kG0R6JrqsbaLqTW8wKWlfJ_H2ahn_g7z1BEzOksNZ5yZ08h6Ol"
+ "d9iEd26PzTfIAMOouyQDyD-fCiSrAZ4jdMAFr5_gXwVx-dlpbAW_ru_rp_hnwGF_xldJDpYpL8angeoT"
+ "THxskf4hiLvFIJM7EcWRloA3gHX5F2IxB5XWr_HoA4M5uhdHKibXSKZeSgW_rb-F9M5Wx3cVvyei9SFe"
+ "eyr2dx88J6VmAHwXNeLhxcfOkAtF-PyPyzpDFxMzjnO0";
@Override
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)

View File

@ -64,7 +64,7 @@ public class HtmlColorAndStyle {
}
private HtmlColorAndStyle(HtmlColor color) {
this(color, LinkStyle.NORMAL);
this(color, LinkStyle.NORMAL());
}
public HtmlColorAndStyle(HtmlColor color, LinkStyle style) {
@ -85,11 +85,11 @@ public class HtmlColorAndStyle {
public static HtmlColorAndStyle build(ISkinParam skinParam, String definition) {
HtmlColor color = build(skinParam).getColors().get(0).color;
LinkStyle style = LinkStyle.NORMAL;
LinkStyle style = LinkStyle.NORMAL();
final IHtmlColorSet set = skinParam.getIHtmlColorSet();
for (String s : definition.split(",")) {
final LinkStyle tmpStyle = LinkStyle.fromString(s);
if (tmpStyle != LinkStyle.NORMAL) {
if (tmpStyle.isNormal() == false) {
style = tmpStyle;
continue;
}

View File

@ -240,9 +240,10 @@ public class QuoteUtils {
"Fhpprff pbafvfgf bs tbvat sebz snvyher gb snvyher jvgubhg ybff bs raguhfvnfz",
"Vs lbh'er tbvat guebhtu uryy, xrrc tbvat",
"Jre xnzcsg, xnaa ireyvrera. Jre avpug xnzcsg, ung fpuba ireybera.",
"P'rfg nh cvrq qh zhe dhr y'ba ibvg yr zvrhk yr zhe."
);
"P'rfg nh cvrq qh zhe dhr y'ba ibvg yr zvrhk yr zhe.",
"Jr xabj ubj uhznaf jbex. Gurl ner nyy fb cerqvpgnoyr.",
"Gur qbtznf bs gur dhvrg cnfg ner vanqrdhngr gb gur fgbezl cerfrag",
"Ab jnl gb cerirag guvf, fnlf bayl angvba jurer guvf erthyneyl unccraf");
private QuoteUtils() {
}

View File

@ -103,11 +103,11 @@ public class Colors {
}
}
if (data.contains("line.dashed")) {
lineStyle = LinkStyle.DASHED;
lineStyle = LinkStyle.DASHED();
} else if (data.contains("line.dotted")) {
lineStyle = LinkStyle.DOTTED;
lineStyle = LinkStyle.DOTTED();
} else if (data.contains("line.bold")) {
lineStyle = LinkStyle.BOLD;
lineStyle = LinkStyle.BOLD();
}
}
@ -130,7 +130,7 @@ public class Colors {
if (lineStyle == null) {
return null;
}
return LinkStyle.getStroke(lineStyle);
return lineStyle.getStroke3();
}
// public Colors addSpecificLineStroke(UStroke specificStroke) {
@ -182,7 +182,7 @@ public class Colors {
if (colors.lineStyle == null) {
return ug;
}
return ug.apply(LinkStyle.getStroke(colors.lineStyle));
return ug.apply(colors.lineStyle.getStroke3());
}
public Colors applyStereotype(Stereotype stereotype, ISkinParam skinParam, ColorParam param) {

View File

@ -82,25 +82,28 @@ public class PngIO {
public static void write(RenderedImage image, OutputStream os, String metadata, int dpi, String debugData)
throws IOException {
if (metadata != null && checkPNGMetadata()) {
if (forceImageIO == false && metadata != null && checkPNGMetadata()) {
PngIOMetadata.writeWithMetadata(image, os, metadata, dpi, debugData);
} else {
ImageIO.write(image, "png", os);
}
}
public static boolean forceImageIO = false;
static boolean checkPNGMetadata() {
try {
final Class cl = Class.forName("com.sun.imageio.plugins.png.PNGMetadata");
if (cl == null) {
Log.info("Cannot load com.sun.imageio.plugins.png.PNGMetadata");
forceImageIO = true;
return false;
}
Log.info("Ok for com.sun.imageio.plugins.png.PNGMetadata");
return true;
} catch (Exception e) {
Log.info("Error loading com.sun.imageio.plugins.png.PNGMetadata " + e);
forceImageIO = true;
return false;
}
}

View File

@ -57,8 +57,20 @@ public class PngIOMetadata {
String debugData) throws IOException {
// Create & populate metadata
final PNGMetadata pngMetadata = new PNGMetadata();
PNGMetadata pngMetadata = null;
try {
pngMetadata = new PNGMetadata();
} catch (Throwable e) {
Log.info("Cannot create com.sun.imageio.plugins.png.PNGMetadata");
PngIO.forceImageIO = true;
ImageIO.write(image, "png", os);
return;
}
writeInternal(image, os, metadata, dpi, debugData, pngMetadata);
}
private static void writeInternal(RenderedImage image, OutputStream os, String metadata, int dpi, String debugData,
final PNGMetadata pngMetadata) throws IOException {
if (dpi != 96) {
pngMetadata.pHYs_present = true;
pngMetadata.pHYs_unitSpecifier = PNGMetadata.PHYS_UNIT_METER;
@ -97,7 +109,7 @@ public class PngIOMetadata {
try {
imagewriter.write(null /* default */, iioImage, null /* use default ImageWriteParam */);
} finally {
//os.flush();
// os.flush();
// Log.debug("PngIOMetadata finally 1");
imageOutputStream.flush();
// Log.debug("PngIOMetadata finally 2");

View File

@ -52,9 +52,9 @@ public class DecorInterfaceProvider implements Decor {
// private final double distanceCircle = 16;
public DecorInterfaceProvider(LinkStyle style) {
if (style != LinkStyle.__toremove_INTERFACE_PROVIDER && style != LinkStyle.__toremove_INTERFACE_USER) {
throw new IllegalArgumentException();
}
// if (style != LinkStyle.__toremove_INTERFACE_PROVIDER && style != LinkStyle.__toremove_INTERFACE_USER) {
// throw new IllegalArgumentException();
// }
this.style = style;
}
@ -64,9 +64,9 @@ public class DecorInterfaceProvider implements Decor {
final double cornerX2 = start.getX() - radius2 - 0 * Math.sin(direction * Math.PI / 180.0);
final double cornerY2 = start.getY() - radius2 - 0 * Math.cos(direction * Math.PI / 180.0);
if (style == LinkStyle.__toremove_INTERFACE_USER) {
direction += 180;
}
// if (style == LinkStyle.__toremove_INTERFACE_USER) {
// direction += 180;
// }
if (direction >= 360) {
direction -= 360;
}

View File

@ -129,25 +129,26 @@ public class PathDrawerInterface implements PathDrawer {
}
final LinkStyle style = linkType.getStyle();
if (style == LinkStyle.__toremove_INTERFACE_PROVIDER || style == LinkStyle.__toremove_INTERFACE_USER) {
final Decor decor = new DecorInterfaceProvider(style);
final Map<Point2D, Double> all = dotPath.somePoints();
final Point2D p = getFarest(outPoint, inPoint, all.keySet());
// if (style == LinkStyle.__toremove_INTERFACE_PROVIDER || style == LinkStyle.__toremove_INTERFACE_USER) {
// final Decor decor = new DecorInterfaceProvider(style);
// final Map<Point2D, Double> all = dotPath.somePoints();
// final Point2D p = getFarest(outPoint, inPoint, all.keySet());
//
// ug = ug.apply(new UChangeBackColor(rose.getHtmlColor(param, ColorParam.background)));
// ug = ug.apply(new UChangeColor(rose.getHtmlColor(param, ColorParam.classBorder)));
//
// decor.drawDecor(ug, p, all.get(p));
// }
ug = ug.apply(new UChangeBackColor(rose.getHtmlColor(param, ColorParam.background)));
ug = ug.apply(new UChangeColor(rose.getHtmlColor(param, ColorParam.classBorder)));
decor.drawDecor(ug, p, all.get(p));
}
ug = ug.apply(new UChangeColor(rose.getHtmlColor(param, ColorParam.classBorder)));
if (linkType.isDashed()) {
goDash(ug);
}
ug.draw(dotPath);
if (linkType.isDashed()) {
noDash(ug);
}
throw new UnsupportedOperationException();
// ug = ug.apply(new UChangeColor(rose.getHtmlColor(param, ColorParam.classBorder)));
// if (linkType.isDashed()) {
// goDash(ug);
// }
// ug.draw(dotPath);
// if (linkType.isDashed()) {
// noDash(ug);
// }
}
private double atan2(final Point2D endPath, final Point2D inPoint) {

View File

@ -119,7 +119,7 @@ public class PostItDiagram extends UmlDiagram {
.getMappedColor(this.getSkinParam().getBackgroundColor());
final FileFormat fileFormat = fileFormatOption.getFileFormat();
if (fileFormat == FileFormat.PNG) {
final double height = getDefaultArea().heightWhenWidthIs(width, fileFormat.getDefaultStringBounder());
final double height = getDefaultArea().heightWhenWidthIs(width, fileFormatOption.getDefaultStringBounder());
final EmptyImageBuilder builder = new EmptyImageBuilder(width, height, backColor);
final Graphics2D graphics2D = builder.getGraphics2D();

Some files were not shown because too many files have changed in this diff Show More