1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-22 04:55:10 +00:00

Import version 1.2020.22

This commit is contained in:
Arnaud Roques 2020-12-06 22:43:09 +01:00
parent 9b708081fc
commit 7e81ef289b
179 changed files with 3423 additions and 1431 deletions

View File

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

View File

@ -45,10 +45,10 @@
*/
package gen.lib.cdt;
import static gen.lib.cdt.dtsize__c.dtsize_;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -46,10 +46,10 @@
package gen.lib.cdt;
import static gen.lib.cdt.dtflatten__c.dtflatten;
import static gen.lib.cdt.dtrestore__c.dtrestore;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -44,14 +44,14 @@
*
*/
package gen.lib.cdt;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.DT_BAG;
import static smetana.core.Macro.DT_FLATTEN;
import static smetana.core.Macro.DT_OBAG;
import static smetana.core.Macro.DT_OSET;
import static smetana.core.Macro.DT_SET;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -46,9 +46,9 @@
package gen.lib.cdt;
import static gen.lib.cdt.dtdisc__c.dtdisc;
import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -44,8 +44,6 @@
*
*/
package gen.lib.cdt;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.DT_BAG;
import static smetana.core.Macro.DT_FLATTEN;
import static smetana.core.Macro.DT_OBAG;
@ -53,6 +51,8 @@ import static smetana.core.Macro.DT_OSET;
import static smetana.core.Macro.DT_SET;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -44,14 +44,14 @@
*
*/
package gen.lib.cdt;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.DT_LIST;
import static smetana.core.Macro.DT_OBAG;
import static smetana.core.Macro.DT_OSET;
import static smetana.core.Macro.DT_QUEUE;
import static smetana.core.Macro.DT_STACK;
import static smetana.core.Macro.UNFLATTEN;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -48,8 +48,6 @@ import static gen.lib.cdt.dtrestore__c.dtrestore;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtils.strcmp;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.DT_ATTACH;
import static smetana.core.Macro.DT_CLEAR;
import static smetana.core.Macro.DT_DELETE;
@ -72,6 +70,8 @@ import static smetana.core.Macro.llink____warning;
import static smetana.core.Macro.lrotate;
import static smetana.core.Macro.rlink____warning;
import static smetana.core.Macro.rrotate;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;
@ -352,17 +352,16 @@ try {
// else goto no_root;
}
else if((type&(DT_DELETE|DT_DETACH))!=0) {
throw new UnsupportedOperationException();
// { /* taking an object out of the dictionary */
// dt_delete:
// obj = (lk < 0 ? ((Dthold_t*)(root))->obj : (void*)((char*)(root) - lk) );
// if(disc->freef && (type&0000002))
// (*disc->freef)(dt,obj,disc);
// if(disc->link < 0)
// (*dt->memoryf)(dt,(void*)root,0,disc);
// if((dt->data->size -= 1) < 0)
// dt->data->size = -1;
// goto no_root;
obj = (__ptr__) _DTOBJ(root,lk);
//if(disc.freef!=null && (type&DT_DELETE)!=0)
//UNSUPPORTED("(*disc->freef)(dt,obj,disc);");
//if(disc.link.getSign() < 0);
//dt.memoryf.exe(dt, root, null, disc);
if((dt.data.size -= 1) < 0)
UNSUPPORTED("// dt->data->size = -1;");
throw new no_root();
}
else if((type&(DT_INSERT|DT_ATTACH))!=0)
{ if((dt.meth.type&DT_OSET)!=0)

View File

@ -46,8 +46,6 @@
package gen.lib.cdt;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.DT_CLEAR;
import static smetana.core.Macro.DT_DELETE;
import static smetana.core.Macro.DT_FIRST;
@ -65,6 +63,8 @@ import static smetana.core.Macro.UNFLATTEN;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro._DTCMP;
import static smetana.core.Macro._DTKEY;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -46,8 +46,6 @@
package gen.lib.cgraph;
import static gen.lib.cgraph.subg__c.agfstsubg;
import static gen.lib.cgraph.subg__c.agnxtsubg;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGINEDGE;
import static smetana.core.Macro.AGNODE;
import static smetana.core.Macro.AGOUTEDGE;
@ -55,6 +53,8 @@ import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -64,8 +64,6 @@ import static gen.lib.cgraph.subg__c.agparent;
import static gen.lib.cgraph.utils__c.agdtopen;
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.AGEDGE;
import static smetana.core.Macro.AGINEDGE;
import static smetana.core.Macro.AGNODE;
@ -76,6 +74,8 @@ import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.dtinsert;
import static smetana.core.Macro.dtsearch;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import java.util.ArrayList;

View File

@ -62,8 +62,6 @@ import static gen.lib.cgraph.subg__c.agparent;
import static smetana.core.JUtils.EQ;
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.AGEDGE;
import static smetana.core.Macro.AGHEAD;
import static smetana.core.Macro.AGID;
@ -83,6 +81,8 @@ import static smetana.core.Macro.dtfirst;
import static smetana.core.Macro.dtinsert;
import static smetana.core.Macro.dtnext;
import static smetana.core.Macro.dtsearch;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;
@ -256,7 +256,7 @@ LEAVING("8zy2u6gsi2xzv2ffv8o4v4uvf","agnxtedge");
@Original(version="2.38.0", path="lib/cgraph/edge.c", name="", key="c175o6j61jqmfnl4o1g1h1mie", definition="static Agedge_t *agfindedge_by_key(Agraph_t * g, Agnode_t * t, Agnode_t * h, Agtag_t key)")
public static ST_Agedge_s agfindedge_by_key(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, final ST_Agtag_s key) {
// WARNING!! STRUCT
return agfindedge_by_key_w_(g, t, h, (ST_Agtag_s) key.copy());
return agfindedge_by_key_w_(g, t, h, key.copy());
}
private static ST_Agedge_s agfindedge_by_key_w_(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, final ST_Agtag_s key) {
ENTERING("c175o6j61jqmfnl4o1g1h1mie","agfindedge_by_key");

View File

@ -59,8 +59,6 @@ import static gen.lib.cgraph.subg__c.agparent;
import static gen.lib.cgraph.utils__c.agdtopen;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGID;
import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.AGSEQ;
@ -68,6 +66,8 @@ import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.ASINT;
import static smetana.core.Macro.N;
import static smetana.core.Macro.NOT;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.Original;

View File

@ -50,8 +50,6 @@ import static gen.lib.cgraph.imap__c.aginternalmapprint;
import static gen.lib.cgraph.obj__c.agraphof;
import static gen.lib.cgraph.refstr__c.agstrbind;
import static gen.lib.cgraph.refstr__c.agstrdup;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGCLOS_id;
import static smetana.core.Macro.AGDISC_id;
import static smetana.core.Macro.AGEDGE;
@ -60,6 +58,8 @@ import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.ASINT;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.Original;

View File

@ -44,11 +44,11 @@
*
*/
package gen.lib.cgraph;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGEDGE;
import static smetana.core.Macro.AGINEDGE;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -44,9 +44,9 @@
*
*/
package gen.lib.cgraph;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -59,8 +59,6 @@ import static gen.lib.cgraph.subg__c.agparent;
import static smetana.core.JUtils.EQ;
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.AGID;
import static smetana.core.Macro.AGNODE;
import static smetana.core.Macro.AGSEQ;
@ -70,6 +68,8 @@ import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.dtfirst;
import static smetana.core.Macro.dtnext;
import static smetana.core.Macro.dtsearch;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -48,8 +48,6 @@ import static gen.lib.cgraph.edge__c.agsubedge;
import static gen.lib.cgraph.node__c.agidnode;
import static gen.lib.cgraph.pend__c.agrecord_callback;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGID;
import static smetana.core.Macro.AGINEDGE;
import static smetana.core.Macro.AGNODE;
@ -58,6 +56,8 @@ import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.CB_UPDATE;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -50,8 +50,6 @@ import static gen.lib.cgraph.refstr__c.agstrdup;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.strcmp;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGDATA;
import static smetana.core.Macro.AGINEDGE;
import static smetana.core.Macro.AGNODE;
@ -61,6 +59,8 @@ import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.ASINT;
import static smetana.core.Macro.N;
import static smetana.core.Macro.NOT;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -47,10 +47,10 @@ package gen.lib.cgraph;
import static gen.lib.cgraph.utils__c.agdtdelete;
import static gen.lib.cgraph.utils__c.agdtopen;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.dtinsert;
import static smetana.core.Macro.dtsearch;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -50,12 +50,12 @@ import static gen.lib.cgraph.id__c.agregister;
import static gen.lib.cgraph.mem__c.agalloc;
import static gen.lib.cgraph.utils__c.agdtdisc;
import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGID;
import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.dtfirst;
import static smetana.core.Macro.dtnext;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;
@ -64,8 +64,8 @@ import h.ST_Agdesc_s;
import h.ST_Agraph_s;
import h.ST_dt_s;
import smetana.core.CString;
import smetana.core.JUtilsDebug;
import smetana.core.Z;
import smetana.core.debug.SmetanaDebug;
public class subg__c {
@ -123,22 +123,22 @@ public static ST_Agraph_s agsubg(ST_Agraph_s g, CString name, boolean cflag) {
ENTERING("a24jd4r2sdyb4lb2hyababrda","agsubg");
try {
final int id[] = new int[]{0};
JUtilsDebug.LOG("agsubg g=" + g + " name=" + name);
SmetanaDebug.LOG("agsubg g=" + g + " name=" + name);
ST_Agraph_s subg;
if (name!=null && agmapnametoid(g, AGRAPH, name, id, false)!=0) {
JUtilsDebug.LOG("might already exist");
SmetanaDebug.LOG("might already exist");
/* might already exist */
if ((subg = agfindsubg_by_id(g, id[0]))!=null) {
JUtilsDebug.LOG("yes returning "+subg);
SmetanaDebug.LOG("yes returning "+subg);
return subg;}
}
if (cflag && agmapnametoid(g, AGRAPH, name, id, true)!=0) { /* reserve id */
subg = localsubg(g, id[0]);
agregister(g, AGRAPH, subg);
JUtilsDebug.LOG("reserve id "+subg);
SmetanaDebug.LOG("reserve id "+subg);
return subg;
}
JUtilsDebug.LOG("return null");
SmetanaDebug.LOG("return null");
return null;
} finally {
LEAVING("a24jd4r2sdyb4lb2hyababrda","agsubg");

View File

@ -47,9 +47,10 @@ package gen.lib.cgraph;
import static gen.lib.cdt.dtdisc__c.dtdisc;
import static gen.lib.cdt.dtopen__c.dtopen;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.dtdelete;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;
@ -149,13 +150,14 @@ LEAVING("48ox0bg1qmasrer8np51uwsyk","agdtopen");
@Unused
@Original(version="2.38.0", path="lib/cgraph/utils.c", name="agdtdelete", key="6pbz2fsmebq8iy7if4way3ct2", definition="long agdtdelete(Agraph_t * g, Dict_t * dict, void *obj)")
public static int agdtdelete(ST_Agraph_s g, ST_dt_s disc, __ptr__ obj) {
UNSUPPORTED("216ju3s3n4ltlcsntcuo0fg5p"); // long agdtdelete(Agraph_t * g, Dict_t * dict, void *obj)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("id2cse8d1e37coxkbocjgjt4"); // Ag_dictop_G = g;
UNSUPPORTED("1ii7n9w3quq15wnwynuuwg395"); // return (long) (*(((Dt_t*)(dict))->searchf))((dict),(void*)(obj),0000002);
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
public static __ptr__ agdtdelete(ST_Agraph_s g, ST_dt_s dict, __ptr__ obj) {
ENTERING("6pbz2fsmebq8iy7if4way3ct2","agdtdelete");
try {
Z.z().Ag_dictop_G = g;
return (__ptr__) dtdelete(dict, obj);
} finally {
LEAVING("6pbz2fsmebq8iy7if4way3ct2","agdtdelete");
}
}

View File

@ -53,8 +53,6 @@ import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.strlen;
import static smetana.core.JUtils.strncmp;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ARR_TYPE_GAP;
import static smetana.core.Macro.ARR_TYPE_NONE;
import static smetana.core.Macro.ARR_TYPE_NORM;
@ -64,8 +62,12 @@ import static smetana.core.Macro.DIST2;
import static smetana.core.Macro.ED_conc_opp_flag;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Doc;
import gen.annotation.Original;
import gen.annotation.Todo;
import gen.annotation.Unused;
import h.ST_Agedge_s;
import h.ST_arrowdir_t;
@ -77,8 +79,8 @@ import smetana.core.CArray;
import smetana.core.CFunction;
import smetana.core.CFunctionAbstract;
import smetana.core.CString;
import smetana.core.JUtilsDebug;
import smetana.core.Z;
import smetana.core.debug.SmetanaDebug;
public class arrows__c {
@ -144,6 +146,8 @@ private static final int NUMB_OF_ARROW_HEADS = 4;
//3 2pveqb5qcgfxcqp410ub942eg
// static void arrow_match_name(char *name, int *flag)
@Unused
@Doc("update flags for arrow. Warning: implementation changed in Java")
@Todo(what = "Check why C is strange")
@Original(version="2.38.0", path="lib/common/arrows.c", name="arrow_match_name", key="2pveqb5qcgfxcqp410ub942eg", definition="static void arrow_match_name(char *name, int *flag)")
public static void arrow_match_name(CString name, int flag[]) {
ENTERING("2pveqb5qcgfxcqp410ub942eg","arrow_match_name");
@ -167,7 +171,6 @@ try {
if (f[0] != ARR_TYPE_NONE)
flag[0] |= (f[0]);
// flag[0] |= (f[0] << (i++ * BITS_PER_ARROW));
JUtilsDebug.LOG("WARNING: strange code");
}
} finally {
LEAVING("2pveqb5qcgfxcqp410ub942eg","arrow_match_name");
@ -180,6 +183,8 @@ LEAVING("2pveqb5qcgfxcqp410ub942eg","arrow_match_name");
//3 2szgwtfieaw58pea2ohjyu8ea
// void arrow_flags(Agedge_t * e, int *sflag, int *eflag)
@Unused
@Doc("update flags for arrow. Warning: implementation changed in Java")
@Todo(what = "Check why C is strange")
@Original(version="2.38.0", path="lib/common/arrows.c", name="arrow_flags", key="2szgwtfieaw58pea2ohjyu8ea", definition="void arrow_flags(Agedge_t * e, int *sflag, int *eflag)")
public static void arrow_flags(ST_Agedge_s e, int sflag[], int eflag[]) {
ENTERING("2szgwtfieaw58pea2ohjyu8ea","arrow_flags");
@ -188,7 +193,7 @@ try {
ST_arrowdir_t arrowdir;
sflag[0] = ARR_TYPE_NONE;
eflag[0] = agisdirected(agraphof(e)) ? ARR_TYPE_NORM : ARR_TYPE_NONE;
JUtilsDebug.LOG("WARNING: strange code");
sflag[0] = ARR_TYPE_NORM;
eflag[0] = ARR_TYPE_NORM;

View File

@ -47,10 +47,10 @@ package gen.lib.common;
import static gen.lib.cgraph.attr__c.agget;
import static gen.lib.common.geom__c.ptToLine2;
import static gen.lib.common.utils__c.Bezier;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -44,11 +44,12 @@
*
*/
package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;
import gen.annotation.Unused;
import h.ST_pointf;
@ -92,8 +93,7 @@ LEAVING("3aiyj7urv33rvps5ds204tciu","rotatepf");
//3 5q8h2tm3jifiasn423wrm0y60
// pointf cwrotatepf(pointf p, int cwrot)
@Unused
@Reviewed(when = "01/12/2020")
@Original(version="2.38.0", path="lib/common/geom.c", name="cwrotatepf", key="5q8h2tm3jifiasn423wrm0y60", definition="pointf cwrotatepf(pointf p, int cwrot)")
public static ST_pointf cwrotatepf(final ST_pointf p, int cwrot) {
// WARNING!! STRUCT

View File

@ -44,9 +44,9 @@
*
*/
package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -63,8 +63,6 @@ import static smetana.core.JUtils.atof;
import static smetana.core.JUtils.atoi;
import static smetana.core.JUtils.getenv;
import static smetana.core.JUtils.strstr;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGNODE;
import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.BOTTOM_IX;
@ -104,6 +102,8 @@ import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.agfindedgeattr;
import static smetana.core.Macro.agfindgraphattr;
import static smetana.core.Macro.agfindnodeattr;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;
@ -277,13 +277,11 @@ UNSUPPORTED("7vlda224wrgcdhr0ts3mndh5q"); // rankdir = 3;
p = late_string(g, agfindgraphattr(g, "ranksep"), null);
if (p!=null) {
UNSUPPORTED("c3p25g4289dxlei062z4eflss"); // if (sscanf(p, "%lf", &xf) == 0)
UNSUPPORTED("570vljex12zx5dkwi7mqa9knw"); // xf = 0.5;
UNSUPPORTED("8k75h069sv2k9b6tgz77dscwd"); // else {
UNSUPPORTED("p882lodfwy5v48rwbxvg5s9i"); // if (xf < 0.02)
UNSUPPORTED("dhhbmqv6n01j1eeyy7fpus1xw"); // xf = 0.02;
xf = atof(p);
if (xf < 0.02)
xf = 0.02;
if (strstr(p, new CString("equally"))!=null)
if (p.isSame(new CString("equally")))
GD_exact_ranksep(g, 1);
} else
xf = DEFAULT_RANKSEP;

View File

@ -54,8 +54,6 @@ import static gen.lib.common.htmltable__c.make_html_label;
import static gen.lib.common.utils__c.htmlEntityUTF8;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.strlen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGEDGE;
import static smetana.core.Macro.AGNODE;
import static smetana.core.Macro.AGRAPH;
@ -73,8 +71,11 @@ import static smetana.core.Macro.N;
import static smetana.core.Macro.ND_label;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.hackInitDimensionFromLabel;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.Doc;
import gen.annotation.Original;
import gen.annotation.Reviewed;
import gen.annotation.Unused;
@ -92,6 +93,7 @@ import smetana.core.CString;
import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.__ptr__;
import smetana.core.debug.SmetanaDebug;
public class labels__c {
@ -100,6 +102,7 @@ public class labels__c {
@Reviewed(when = "13/11/2020")
@Difficult
@Doc("Compute size of a string and store size")
@Original(version="2.38.0", path="lib/common/labels.c", name="storeline", key="4wkeqik2dt7ecr64ej6ltbnvb", definition="static void storeline(GVC_t *gvc, textlabel_t *lp, char *line, char terminator)")
public static void storeline(ST_GVC_s gvc, ST_textlabel_t lp, CString line, char terminator) {
ENTERING("4wkeqik2dt7ecr64ej6ltbnvb","storeline");
@ -119,6 +122,7 @@ try {
size.x = 0.0;
size.y = (int)(lp.fontsize * 1.20);
hackInitDimensionFromLabel(size, line.getContent());
SmetanaDebug.LOG("storeline line.getContent()="+line.getContent()+" size="+size);
span.size.y = (int)size.y;
lp.nspans++;
@ -126,6 +130,7 @@ try {
lp.dimen.x = MAX(lp.dimen.x, size.x);
/* accumulate height */
lp.dimen.y = lp.dimen.y + size.y;
SmetanaDebug.LOG("storeline "+lp);
} finally {
LEAVING("4wkeqik2dt7ecr64ej6ltbnvb","storeline");
}
@ -135,6 +140,7 @@ LEAVING("4wkeqik2dt7ecr64ej6ltbnvb","storeline");
@Reviewed(when = "12/11/2020")
@Doc("Parse simple label")
@Original(version="2.38.0", path="lib/common/labels.c", name="make_simple_label", key="22ar72ye93a8ntj8pagnt5b5k", definition="void make_simple_label(GVC_t * gvc, textlabel_t * lp)")
public static void make_simple_label(ST_GVC_s gvc, ST_textlabel_t lp) {
ENTERING("22ar72ye93a8ntj8pagnt5b5k","make_simple_label");

View File

@ -45,9 +45,9 @@
*/
package gen.lib.common;
import static smetana.core.JUtils.memset;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -55,8 +55,6 @@ import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.atoi;
import static smetana.core.JUtils.setjmp;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ED_cutvalue;
import static smetana.core.Macro.ED_minlen;
import static smetana.core.Macro.ED_tree_index;
@ -86,6 +84,8 @@ import static smetana.core.Macro.SLACK;
import static smetana.core.Macro.TREE_EDGE;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.free_list;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.HasND_Rank;

View File

@ -62,10 +62,8 @@ import static gen.lib.common.utils__c.updateBB;
import static gen.lib.label.xlabels__c.placeLabels;
import static h.ST_pointf.pointfof;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.*;
import static smetana.core.Macro.EDGE_LABEL;
import static smetana.core.Macro.EDGE_XLABEL;
import static smetana.core.Macro.ED_edge_type;
import static smetana.core.Macro.ED_head_label;
@ -86,6 +84,7 @@ import static smetana.core.Macro.GD_n_cluster;
import static smetana.core.Macro.GD_rankdir;
import static smetana.core.Macro.GRAPH_LABEL;
import static smetana.core.Macro.HEAD_LABEL;
import static smetana.core.Macro.IGNORED;
import static smetana.core.Macro.INT_MAX;
import static smetana.core.Macro.MAX;
import static smetana.core.Macro.MIN;
@ -98,6 +97,8 @@ import static smetana.core.Macro.NODE_XLABEL;
import static smetana.core.Macro.NOTI;
import static smetana.core.Macro.TAIL_LABEL;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -52,8 +52,6 @@ import static gen.lib.pathplan.util__c.make_polyline;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.cos;
import static smetana.core.JUtils.sin;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ABS;
import static smetana.core.Macro.ED_edge_type;
import static smetana.core.Macro.ED_to_orig;
@ -62,6 +60,8 @@ import static smetana.core.Macro.INT_MIN;
import static smetana.core.Macro.MIN;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;
@ -396,7 +396,7 @@ UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL;
if (polyline!=0) {
UNSUPPORTED("48veztc3k9dfw8tqolu7jsktk"); // make_polyline (pl, &spl);
make_polyline (pl, spl);
}
else {
if (poly.pn > Z.z().edgen) {
@ -507,12 +507,7 @@ LEAVING("axqoytp2rpr8crajhkuvns6q9","routesplines");
public static CArray<ST_pointf> routepolylines(ST_path pp, int npoints[]) {
ENTERING("2v22s41xitwnnsljk9n01nrcy","routepolylines");
try {
UNSUPPORTED("1kjkc6bl8zpf8zjcwgbyni9p3"); // pointf *routepolylines(path * pp, int *npoints)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("6wf7p4npeom96y0l1v39essmx"); // return _routesplines (pp, npoints, 1);
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
return _routesplines (pp, npoints, 1);
} finally {
LEAVING("2v22s41xitwnnsljk9n01nrcy","routepolylines");
}

View File

@ -65,8 +65,6 @@ import static smetana.core.JUtils.sin;
import static smetana.core.JUtils.sqrt;
import static smetana.core.JUtils.strcmp;
import static smetana.core.JUtils.strlen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.BETWEEN;
import static smetana.core.Macro.BOTTOM;
import static smetana.core.Macro.DIST2;
@ -106,8 +104,11 @@ import static smetana.core.Macro.TOP;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.fabs;
import static smetana.core.Macro.hypot;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.Doc;
import gen.annotation.Original;
import gen.annotation.Reviewed;
import gen.annotation.Unused;
@ -1617,6 +1618,7 @@ LEAVING("7zxlp1fmrq3zt4fprrtesdbg3","poly_init");
//3 dwk0rh74bwfd7mky5hg9t1epj
// static pointf size_reclbl(node_t * n, field_t * f)
@Unused
@Doc("?")
@Original(version="2.38.0", path="lib/common/shapes.c", name="size_reclbl", key="dwk0rh74bwfd7mky5hg9t1epj", definition="static pointf size_reclbl(node_t * n, field_t * f)")
public static ST_pointf size_reclbl(ST_Agnode_s n, ST_field_t f) {
// WARNING!! STRUCT
@ -1778,15 +1780,18 @@ public static CFunction record_init = new CFunctionAbstract("record_init") {
}};
@Unused
@Doc("Init 'record' node")
@Reviewed(when = "02/12/2020")
@Original(version="2.38.0", path="lib/common/shapes.c", name="record_init", key="h2lcuthzwljbcjwdeidw1jiv", definition="static void record_init(node_t * n)")
public static void record_init(ST_Agnode_s n) {
ENTERING("h2lcuthzwljbcjwdeidw1jiv","poly_init");
ENTERING("h2lcuthzwljbcjwdeidw1jiv","record_init");
try {
ST_field_t info;
final ST_pointf ul = new ST_pointf(), sz = new ST_pointf();
boolean flip;
int len;
CString textbuf; /* temp buffer for storing labels */
int sides = BOTTOM | RIGHT | TOP | LEFT;
/* Always use rankdir to determine how records are laid out */
flip = NOT(GD_realflip(agraphof(n)));
@ -1804,8 +1809,8 @@ UNSUPPORTED("2wv3zfqhq53941rwk4vu9p9th"); // info = parse_reclbl(n, flip, NOT(0
}
Memory.free(textbuf);
size_reclbl(n, info);
sz.x = (ROUND((ND_width(n))*72));
sz.y = (ROUND((ND_height(n))*72));
sz.x = POINTS(ND_width(n));;
sz.y = POINTS(ND_height(n));
if (mapbool(late_string(n, Z.z().N_fixed, new CString("false")))) {
UNSUPPORTED("8iu51xbtntpdf5sc00g91djym"); // if ((sz.x < info->size.x) || (sz.y < info->size.y)) {
UNSUPPORTED("4vs5u30jzsrn6fpjd327xjf7r"); // /* should check that the record really won't fit, e.g., there may be no text.
@ -1819,8 +1824,8 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
resize_reclbl(info, sz, mapbool(late_string(n, Z.z().N_nojustify, new CString("false"))));
ul.___(pointfof(-sz.x / 2., sz.y / 2.)); /* FIXME - is this still true: suspected to introduce ronding error - see Kluge below */
pos_reclbl(info, ul, sides);
ND_width(n, ((info.size.x)/(double)72));
ND_height(n, ((info.size.y + 1)/(double)72)); /* Kluge!! +1 to fix rounding diff between layout and rendering
ND_width(n, PS2INCH(info.size.x));
ND_height(n, PS2INCH(info.size.y + 1)); /* Kluge!! +1 to fix rounding diff between layout and rendering
otherwise we can get -1 coords in output */
ND_shape_info(n, info);
} finally {
@ -2410,6 +2415,7 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
//3 ckbg1dyu9jzx7g0c9dbriez7r
// port resolvePort(node_t * n, node_t * other, port * oldport)
@Unused
@Doc("Choose closestSide of a node")
@Original(version="2.38.0", path="lib/common/shapes.c", name="resolvePort", key="ckbg1dyu9jzx7g0c9dbriez7r", definition="port resolvePort(node_t * n, node_t * other, port * oldport)")
public static ST_port resolvePort(ST_Agnode_s n, ST_Agnode_s other, ST_port oldport) {
// WARNING!! STRUCT

View File

@ -57,8 +57,6 @@ import static gen.lib.common.utils__c.dotneato_closest;
import static h.ST_pointf.add_pointf;
import static h.ST_pointf.pointfof;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ABS;
import static smetana.core.Macro.APPROXEQPT;
import static smetana.core.Macro.BOTTOM;
@ -88,10 +86,16 @@ import static smetana.core.Macro.NORMAL;
import static smetana.core.Macro.NOTI;
import static smetana.core.Macro.REGULAREDGE;
import static smetana.core.Macro.RIGHT;
import static smetana.core.Macro.SELFEDGE;
import static smetana.core.Macro.TOP;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Comment;
import gen.annotation.Original;
import gen.annotation.Reviewed;
import gen.annotation.Todo;
import gen.annotation.Unused;
import h.ST_Agedge_s;
import h.ST_Agnode_s;
@ -248,13 +252,16 @@ try {
int i;
double save_real_size;
final CArray<ST_pointf> c = CArray.<ST_pointf>ALLOC__(4, ST_pointf.class);
save_real_size = ND_rw(n);
for (i = 0; i < 4; i++) {
c.get__(i).x = curve.get__(i).x - ND_coord(n).x;
c.get__(i).y = curve.get__(i).y - ND_coord(n).y;
}
bezier_clip(inside_context, ND_shape(n).fns.insidefn, c,
left_inside);
for (i = 0; i < 4; i++) {
curve.get__(i).x = c.get__(i).x + ND_coord(n).x;
curve.get__(i).y = c.get__(i).y + ND_coord(n).y;
@ -300,6 +307,12 @@ LEAVING("bdirexg1qdtophlh0ofjvsmj7","new_spline");
/* clip_and_install:
* Given a raw spline (pn control points in ps), representing
* a path from edge agtail(fe) ending in node hn, clip the ends to
* the node boundaries and attach the resulting spline to the
* edge.
*/
//3 duednxyuvf6xrff752uuv620f
// void clip_and_install(edge_t * fe, node_t * hn, pointf * ps, int pn, splineInfo * info)
@Unused
@ -318,10 +331,13 @@ try {
ST_Agedge_s orig;
ST_boxf tbox=null, hbox=null;
final ST_inside_t inside_context = new ST_inside_t();
tn = agtail(fe);
g = agraphof(tn);
newspl = new_spline(fe, pn);
for (orig = fe; ED_edge_type(orig) != 0; orig = ED_to_orig(orig));
for (orig = fe; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig));
/* may be a reversed flat edge */
if (N(info.ignoreSwap) && (ND_rank(tn) == ND_rank(hn)) && (ND_order(tn) > ND_order(hn))) {
ST_Agnode_s tmp;
@ -341,6 +357,7 @@ try {
hbox = ED_tail_port(orig).bp;
tbox = ED_head_port(orig).bp;
}
/* spline may be interior to node */
if(clipTail && ND_shape(tn)!=null && ND_shape(tn).fns.insidefn!=null) {
inside_context.s_n = tn;
@ -373,9 +390,14 @@ try {
if (N(APPROXEQPT(ps.get__(end[0]), ps.get__(end[0] + 3), MILLIPOINT)))
break;
arrow_clip(fe, hn, ps, start, end, newspl, info);
for (i = start[0]; i < end[0] + 4; ) {
final CArray<ST_pointf> cp = CArray.<ST_pointf>ALLOC__(4, ST_pointf.class);
// if (UnsupportedStarStruct.SPY_ME!=null)
// System.err.println("TOTO 41 =" + UnsupportedStarStruct.SPY_ME + " " +ps.get__(i).UID);
newspl.list.get__(i - start[0]).___(ps.get__(i));
// if (UnsupportedStarStruct.SPY_ME!=null)
// System.err.println("TOTO 42 =" + UnsupportedStarStruct.SPY_ME + " " +ps.get__(i).UID);
cp.get__(0).___(ps.get__(i));
i++;
if ( i >= end[0] + 4)
@ -492,6 +514,9 @@ LEAVING("egq4f4tmy1dhyj6jpj92r7xhu","add_box");
*/
@Unused
@Todo(what = "bug72?")
@Reviewed(when = "02/12/2020")
@Comment(comment = "Side choice?")
@Original(version="2.38.0", path="lib/common/splines.c", name="beginpath", key="7pc43ifcw5g56449d101qf590", definition="void beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)")
public static void beginpath(ST_path P, ST_Agedge_s e, int et, final ST_pathend_t endp, boolean merge) {
ENTERING("7pc43ifcw5g56449d101qf590","beginpath");
@ -566,12 +591,12 @@ UNSUPPORTED("4v7mmisc358r5tpq14qp4dx0f"); // endp->boxn = 2;
}
else if ((side & LEFT)!=0) {
endp.sidemask = LEFT;
b.UR.x = P.end.p.x;
b.UR.y = ND_coord(n).y + HT2(n);
b.LL.y = P.end.p.y;
b.UR.x = P.start.p.x;
b.LL.y = ND_coord(n).y - HT2(n);
b.UR.y = P.start.p.y;
endp.boxes[0].___(b);
endp.boxn[0] = 1;
P.end.p.x -= 1;
P.start.p.x -= 1;
}
else {
endp.sidemask = RIGHT;
@ -665,7 +690,7 @@ UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
endp.boxes[0].___(endp.nb);
endp.boxn[0] = 1;
switch (et) {
case 8:
case SELFEDGE:
/* moving the box UR.y by + 1 avoids colinearity between
port point and box that confuses Proutespline(). it's
a bug in Proutespline() but this is the easiest fix. */
@ -673,16 +698,16 @@ UNSUPPORTED("9rnob8jdqqdjwzanv53yxc47u"); // assert(0); /* at present, we
UNSUPPORTED("46vb5zg9vm9n0q21g53nj66v3"); // endp->boxes[0].UR.y = P->start.p.y - 1;
UNSUPPORTED("auefgwb39x5hzqqc9b1zgl239"); // endp->sidemask = 1<<0;
break;
case 2:
if (endp.sidemask == (1<<2))
case FLATEDGE:
if (endp.sidemask == TOP)
endp.boxes[0].LL.y = P.start.p.y;
else
endp.boxes[0].UR.y = P.start.p.y;
break;
case 1:
case REGULAREDGE:
endp.boxes[0].UR.y = P.start.p.y;
endp.sidemask = (1<<0);
P.start.p.y = P.start.p.y - 1;
endp.sidemask = BOTTOM;
P.start.p.y -= 1;
break;
}
}
@ -704,6 +729,7 @@ private static double HT2(ST_Agnode_s n) {
//3 79dr5om55xs3n5lgai1sf58vu
// void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)
@Unused
@Reviewed(when = "02/12/2020")
@Original(version="2.38.0", path="lib/common/splines.c", name="endpath", key="79dr5om55xs3n5lgai1sf58vu", definition="void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)")
public static void endpath(ST_path P, ST_Agedge_s e, int et, final ST_pathend_t endp, boolean merge) {
ENTERING("79dr5om55xs3n5lgai1sf58vu","endpath");
@ -711,7 +737,9 @@ try {
int side, mask;
ST_Agnode_s n;
CFunction pboxfn;
n = aghead(e);
if (ED_head_port(e).dyna)
ED_head_port(e, resolvePort(aghead(e), agtail(e), ED_head_port(e)));
if (ND_shape(n)!=null)
@ -732,17 +760,17 @@ UNSUPPORTED("2w0c22i5xgcch77xd9jg104nw"); // P->end.constrained = NOT(0);
P.end.constrained = false;
}
endp.np.___(P.end.p);
if ((et == 1) && (ND_node_type(n) == 0) && ((side = ED_head_port(e).side)!=0)) {
if ((et == REGULAREDGE) && (ND_node_type(n) == NORMAL) && ((side = ED_head_port(e).side)!=0)) {
ST_Agedge_s orig;
final ST_boxf b0 = new ST_boxf(), b = endp.nb.copy();
if ((side & (1<<2))!=0) {
endp.sidemask = 1<<2;
if ((side & TOP)!=0) {
endp.sidemask = TOP;
b.LL.y = MIN(b.LL.y,P.end.p.y);
endp.boxes[0].___(b);
endp.boxn[0] = 1;
P.end.p.y += 1;
}
else if ((side & (1<<0))!=0) {
else if ((side & BOTTOM)!=0) {
UNSUPPORTED("auefgwb39x5hzqqc9b1zgl239"); // endp->sidemask = 1<<0;
UNSUPPORTED("4tlqpclu7x0szo1rszndqau0d"); // if (P->end.p.x < ND_coord(n).x) { /* go left */
UNSUPPORTED("80ypgtfgfrgq8j7whkaueouh5"); // b0.LL.x = b.LL.x-1;
@ -773,7 +801,7 @@ UNSUPPORTED("196ta4n5nsqizd83y6oo7z8a2"); // }
UNSUPPORTED("4v7mmisc358r5tpq14qp4dx0f"); // endp->boxn = 2;
UNSUPPORTED("6kjd8mut2dn2xv1k1zr63qp0s"); // P->end.p.y -= 1;
}
else if ((side & (1<<3))!=0) {
else if ((side & LEFT)!=0) {
UNSUPPORTED("2lmjkw07sr4x9a3xxrcb3yj07"); // endp->sidemask = 1<<3;
UNSUPPORTED("4e2bsroer72trfy5dl5k8f5s8"); // b.UR.x = P->end.p.x;
UNSUPPORTED("3rsswd4vcybmrbhoqt0aldqds"); // b.UR.y = ND_coord(n).y + (ND_ht(n)/2);
@ -783,15 +811,15 @@ UNSUPPORTED("3hptqfzzuz4dlsc8ejk1ynxt9"); // endp->boxn = 1;
UNSUPPORTED("5j92wv3nt0b7hnlf3ktengoom"); // P->end.p.x -= 1;
}
else {
endp.sidemask = 1<<1;
endp.sidemask = RIGHT;
b.LL.x = P.end.p.x;
b.UR.y = ND_coord(n).y + (ND_ht(n)/2);
b.UR.y = ND_coord(n).y + HT2(n);
b.LL.y = P.end.p.y;
endp.boxes[0].___(b);
endp.boxn[0] = 1;
P.end.p.x += 1;
}
for (orig = e; ED_edge_type(orig) != 0; orig = ED_to_orig(orig));
for (orig = e; ED_edge_type(orig) != NORMAL; orig = ED_to_orig(orig));
if (EQ(n, aghead(orig)))
ED_head_port(orig).clip = false;
else
@ -799,7 +827,7 @@ UNSUPPORTED("dk49xvmby8949ngdmft4sgrox"); // ED_tail_port(orig).clip = 0;
endp.sidemask = side;
return;
}
if ((et == 2) && ((side = ED_head_port(e).side)!=0)) {
if ((et == FLATEDGE) && ((side = ED_head_port(e).side)!=0)) {
UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb;
UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig;
UNSUPPORTED("ait3wtnnvt134z2k87lvhq4ek"); // if (side & (1<<2)) {
@ -865,7 +893,8 @@ UNSUPPORTED("dk49xvmby8949ngdmft4sgrox"); // ED_tail_port(orig).clip = 0;
UNSUPPORTED("8jqn3kj2hrrlcifbw3x9sf6qu"); // endp->sidemask = side;
UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
}
if (et == 1) side = 1<<2;
if (et == REGULAREDGE) side = TOP;
else side = endp.sidemask; /* for flat edges */
if (pboxfn!=null
&& (mask = (Integer) pboxfn.exe(n, ED_head_port(e), side, endp.boxes[0], endp.boxn))!=0)
@ -873,8 +902,9 @@ UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
else {
endp.boxes[0].___(endp.nb);
endp.boxn[0] = 1;
switch (et) {
case 8:
case SELFEDGE:
/* offset of -1 is symmetric w.r.t. beginpath()
* FIXME: is any of this right? what if self-edge
* doesn't connect from BOTTOM to TOP??? */
@ -882,16 +912,16 @@ UNSUPPORTED("bhkhf4i9pvxtxyka4sobszg33"); // assert(0); /* at present, we
UNSUPPORTED("db6vmvnse8bawy8qwct7l24u8"); // endp->boxes[0].LL.y = P->end.p.y + 1;
UNSUPPORTED("1r4lctdj9z1ivlz3uqpcj1yzf"); // endp->sidemask = 1<<2;
UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break;
case 2:
if (endp.sidemask == (1<<2))
case FLATEDGE:
if (endp.sidemask == TOP)
endp.boxes[0].LL.y = P.end.p.y;
else
endp.boxes[0].UR.y = P.end.p.y;
break;
case 1:
case REGULAREDGE:
endp.boxes[0].LL.y = P.end.p.y;
endp.sidemask = (1<<2);
P.end.p.y = P.end.p.y +1;
endp.sidemask = TOP;
P.end.p.y += 1;
break;
}
}

View File

@ -45,8 +45,8 @@
*/
package gen.lib.common;
import static smetana.core.JUtils.tolower;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -44,8 +44,8 @@
*
*/
package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -62,8 +62,6 @@ import static smetana.core.JUtils.strchr;
import static smetana.core.JUtils.strcmp;
import static smetana.core.JUtils.strtod;
import static smetana.core.JUtils.strtol;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.DEFAULT_FONTSIZE;
import static smetana.core.Macro.DEFAULT_NODEHEIGHT;
import static smetana.core.Macro.DEFAULT_NODESHAPE;
@ -109,7 +107,10 @@ import static smetana.core.Macro.TAIL_ID;
import static smetana.core.Macro.TAIL_LABEL;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.fabs;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Doc;
import gen.annotation.Original;
import gen.annotation.Reviewed;
import gen.annotation.Unused;
@ -1110,6 +1111,7 @@ LEAVING("13cpqbf2ztcjdfz4a6v7nv00u","setEdgeType");
@Reviewed(when = "13/11/2020")
@Doc("Store size of a node from inch")
@Original(version="2.38.0", path="lib/common/utils.c", name="gv_nodesize", key="80q488y0eqojtsm7osnfydmo5", definition="void gv_nodesize(node_t * n, boolean flip)")
public static void gv_nodesize(ST_Agnode_s n, boolean flip) {
ENTERING("80q488y0eqojtsm7osnfydmo5","gv_nodesize");

View File

@ -50,14 +50,14 @@ import static gen.lib.dotgen.fastgr__c.delete_fast_edge;
import static gen.lib.dotgen.fastgr__c.find_fast_edge;
import static gen.lib.dotgen.fastgr__c.merge_oneway;
import static gen.lib.dotgen.fastgr__c.virtual_edge;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.GD_comp;
import static smetana.core.Macro.GD_nlist;
import static smetana.core.Macro.ND_mark;
import static smetana.core.Macro.ND_next;
import static smetana.core.Macro.ND_onstack;
import static smetana.core.Macro.ND_out;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -45,10 +45,10 @@
*/
package gen.lib.dotgen;
import static gen.lib.cgraph.attr__c.agget;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -60,8 +60,6 @@ import static gen.lib.dotgen.fastgr__c.virtual_edge;
import static gen.lib.dotgen.fastgr__c.virtual_node;
import static gen.lib.dotgen.position__c.make_aux_edge;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ED_minlen;
import static smetana.core.Macro.ED_to_orig;
import static smetana.core.Macro.ED_to_virt;
@ -70,6 +68,8 @@ import static smetana.core.Macro.GD_leader;
import static smetana.core.Macro.ND_clust;
import static smetana.core.Macro.ND_node_type;
import static smetana.core.Macro.ND_rank;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -66,8 +66,6 @@ import static gen.lib.dotgen.mincross__c.virtual_weight;
import static gen.lib.dotgen.position__c.ports_eq;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.CLUSTER;
import static smetana.core.Macro.CLUSTER_EDGE;
import static smetana.core.Macro.ED_conc_opp_flag;
@ -99,6 +97,8 @@ import static smetana.core.Macro.ND_ranktype;
import static smetana.core.Macro.ND_rw;
import static smetana.core.Macro.ND_weight_class;
import static smetana.core.Macro.agfindedge;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.HasND_Rank;
@ -111,8 +111,8 @@ import h.ST_Agnode_s;
import h.ST_Agraph_s;
import h.ST_pointf;
import smetana.core.CArrayOfStar;
import smetana.core.JUtilsDebug;
import smetana.core.Z;
import smetana.core.debug.SmetanaDebug;
/* classify edges for mincross/nodepos/splines, using given ranks */
public class class2__c {
@ -378,14 +378,13 @@ try {
}
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
JUtilsDebug.LOG("n="+n.NAME);
if ((ND_clust(n) == null) && (EQ(n, UF_find(n)))) {
fast_node(g, n);
GD_n_nodes(g, GD_n_nodes(g) + 1);
}
prev = null;
for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) {
JUtilsDebug.LOG("e="+e.NAME);
/* already processed */
if (ED_to_virt(e)!=null) {
@ -485,9 +484,8 @@ try {
prev = e;
}
}
JUtilsDebug.LOG("OUT1");
}
JUtilsDebug.LOG("OUT2");
/* since decompose() is not called on subgraphs */
if (NEQ(g, dot_root(g))) {
GD_comp(g).list = CArrayOfStar.<ST_Agnode_s>REALLOC(1, GD_comp(g).list, ST_Agnode_s.class);

View File

@ -78,8 +78,6 @@ import static gen.lib.dotgen.mincross__c.install_in_rank;
import static gen.lib.dotgen.position__c.ports_eq;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGMKOUT;
import static smetana.core.Macro.CLUSTER;
import static smetana.core.Macro.CL_CROSS;
@ -112,6 +110,8 @@ import static smetana.core.Macro.ND_rw;
import static smetana.core.Macro.NORMAL;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.VIRTUAL;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.HasND_Rank;
import gen.annotation.Original;

View File

@ -50,8 +50,6 @@ import static gen.lib.cgraph.node__c.agfstnode;
import static gen.lib.cgraph.node__c.agnxtnode;
import static gen.lib.common.utils__c.UF_find;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.GD_comp;
import static smetana.core.Macro.GD_n_nodes;
import static smetana.core.Macro.GD_nlist;
@ -65,6 +63,8 @@ import static smetana.core.Macro.ND_next;
import static smetana.core.Macro.ND_out;
import static smetana.core.Macro.ND_prev;
import static smetana.core.Macro.ND_rank;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.Original;

View File

@ -79,8 +79,6 @@ import static gen.lib.pack.pack__c.getPackModeInfo;
import static smetana.core.JUtils.EQ;
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.CL_OFFSET;
import static smetana.core.Macro.ED_count;
import static smetana.core.Macro.ED_minlen;
@ -101,6 +99,8 @@ import static smetana.core.Macro.NEW_RANK;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.agfindgraphattr;
import static smetana.core.Macro.alloc_elist;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -51,7 +51,6 @@ import static gen.lib.cgraph.edge__c.agtail;
import static gen.lib.cgraph.node__c.agfstnode;
import static gen.lib.cgraph.node__c.agnxtnode;
import static gen.lib.cgraph.obj__c.agraphof;
import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.common.routespl__c.makeStraightEdge;
import static gen.lib.common.routespl__c.routepolylines;
import static gen.lib.common.routespl__c.routesplines;
@ -72,12 +71,12 @@ import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.LOG2;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.qsort1;
import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ABS;
import static smetana.core.Macro.AGSEQ;
import static smetana.core.Macro.BETWEEN;
import static smetana.core.Macro.BOTTOM;
import static smetana.core.Macro.EDGETYPEMASK;
import static smetana.core.Macro.EDGE_LABEL;
import static smetana.core.Macro.ED_adjacent;
import static smetana.core.Macro.ED_edge_type;
import static smetana.core.Macro.ED_head_port;
@ -87,8 +86,12 @@ import static smetana.core.Macro.ED_tail_port;
import static smetana.core.Macro.ED_to_orig;
import static smetana.core.Macro.ED_to_virt;
import static smetana.core.Macro.ED_tree_index;
import static smetana.core.Macro.ET_CURVED;
import static smetana.core.Macro.ET_LINE;
import static smetana.core.Macro.ET_NONE;
import static smetana.core.Macro.ET_SPLINE;
import static smetana.core.Macro.FLATEDGE;
import static smetana.core.Macro.FLATORDER;
import static smetana.core.Macro.GD_bb;
import static smetana.core.Macro.GD_flags;
import static smetana.core.Macro.GD_flip;
@ -99,6 +102,8 @@ import static smetana.core.Macro.GD_nlist;
import static smetana.core.Macro.GD_nodesep;
import static smetana.core.Macro.GD_rank;
import static smetana.core.Macro.GD_ranksep;
import static smetana.core.Macro.GVSPLINES;
import static smetana.core.Macro.IGNORED;
import static smetana.core.Macro.MAKEFWDEDGE;
import static smetana.core.Macro.MAX;
import static smetana.core.Macro.MIN;
@ -120,9 +125,14 @@ import static smetana.core.Macro.ND_other;
import static smetana.core.Macro.ND_out;
import static smetana.core.Macro.ND_rank;
import static smetana.core.Macro.ND_rw;
import static smetana.core.Macro.NORMAL;
import static smetana.core.Macro.NOTI;
import static smetana.core.Macro.REGULAREDGE;
import static smetana.core.Macro.ROUND;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.VIRTUAL;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.Original;
@ -396,6 +406,19 @@ throw new UnsupportedOperationException();
private final static int NSUB = 9;
private final static int CHUNK = 128;
private final static int MINW = 16;
private final static int HALFMINW = 8;
private final static int FWDEDGE = 16;
private final static int BWDEDGE = 32;
private final static int MAINGRAPH = 64;
private final static int AUXGRAPH = 128;
/* _dot_splines:
* Main spline routing code.
* The normalize parameter allows this function to be called by the
@ -405,6 +428,7 @@ throw new UnsupportedOperationException();
*/
//3 6agx6m2qof9lg57co232lwakj
// static void _dot_splines(graph_t * g, int normalize)
@Original(version="2.38.0", path="lib/dotgen/dotsplines.c", name="_dot_splines", key="6agx6m2qof9lg57co232lwakj", definition="static void _dot_splines(graph_t * g, int normalize)")
static void _dot_splines(ST_Agraph_s g, int normalize)
{
ENTERING("6agx6m2qof9lg57co232lwakj","_dot_splines");
@ -420,10 +444,12 @@ try {
int et = (GD_flags(g) & (7 << 1));
fwdedgea.out.base.data = fwdedgeai;
fwdedgeb.out.base.data = fwdedgebi;
if (et == (0 << 1)) return;
if (et == (2 << 1)) {
if (et == ET_NONE) return;
if (et == ET_CURVED) {
resetRW (g);
if ((GD_has_labels(g) & (1 << 0))!=0) {
if ((GD_has_labels(g) & EDGE_LABEL)!=0) {
UNSUPPORTED("4k888z8ymdp2b653twxc1ugbu"); // agerr (AGWARN, "edge labels with splines=curved not supported in dot - use xlabels\n");
}
for (n = agfstnode (g); n!=null; n = agnxtnode(g, n)) {
@ -433,13 +459,15 @@ UNSUPPORTED("4k888z8ymdp2b653twxc1ugbu"); // agerr (AGWARN, "edge labels wi
}
UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
}
mark_lowclusters(g);
if (routesplinesinit()!=0) return;
P = (ST_path) zmalloc(sizeof(ST_path.class));
P = new ST_path();
/* FlatHeight = 2 * GD_nodesep(g); */
sd.Splinesep = GD_nodesep(g) / 4;
sd.Multisep = GD_nodesep(g);
edges = CArrayOfStar.<ST_Agedge_s>ALLOC(128, ST_Agedge_s.class);
edges = CArrayOfStar.<ST_Agedge_s>ALLOC(CHUNK, ST_Agedge_s.class);
/* compute boundaries and list of splines */
sd.RightBound = 0;
@ -451,11 +479,11 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
sd.LeftBound = (int)MIN(sd.LeftBound, (ND_coord(n).x - ND_lw(n)));
if (GD_rank(g).get__(i).n!=0 && (n = GD_rank(g).get__(i).v.get_(GD_rank(g).get__(i).n - 1))!=null)
sd.RightBound = (int)MAX(sd.RightBound, (ND_coord(n).x + ND_rw(n)));
sd.LeftBound = sd.LeftBound - 16;
sd.RightBound = sd.RightBound + 16;
sd.LeftBound -= MINW;
sd.RightBound += MINW;
for (j = 0; j < GD_rank(g).get__(i).n; j++) {
n = (ST_Agnode_s) GD_rank(g).get__(i).v.get_(j);
n = GD_rank(g).get__(i).v.get_(j);
/* if n is the label of a flat edge, copy its position to
* the label.
*/
@ -465,24 +493,24 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
ED_label(fe).pos.___(ND_coord(n));
ED_label(fe).set= NOTI(false);
}
if ((ND_node_type(n) != 0) &&
if ((ND_node_type(n) != NORMAL) &&
((Boolean)Z.z().sinfo.splineMerge.exe(n) == false))
continue;
for (k = 0; (e = (ST_Agedge_s) ND_out(n).list.get_(k))!=null; k++) {
if ((ED_edge_type(e) == 4)
|| (ED_edge_type(e) == 6))
for (k = 0; (e = ND_out(n).list.get_(k))!=null; k++) {
if ((ED_edge_type(e) == FLATORDER)
|| (ED_edge_type(e) == IGNORED))
continue;
setflags(e, 1, 16, 64);
setflags(e, REGULAREDGE, FWDEDGE, MAINGRAPH);
edges.set_(n_edges++, e);
if (n_edges % 128 == 0)
edges = CArrayOfStar.<ST_Agedge_s>REALLOC(n_edges + 128, edges, ST_Agedge_s.class);
if (n_edges % CHUNK == 0)
edges = CArrayOfStar.<ST_Agedge_s>REALLOC(n_edges + CHUNK, edges, ST_Agedge_s.class);
}
if (ND_flat_out(n).list!=null)
for (k = 0; (e = (ST_Agedge_s) ND_flat_out(n).list.get_(k))!=null; k++) {
setflags(e, 2, 0, 128);
for (k = 0; (e = ND_flat_out(n).list.get_(k))!=null; k++) {
setflags(e, FLATEDGE, 0, AUXGRAPH);
edges.set_(n_edges++, e);
if (n_edges % 128 == 0)
edges = CArrayOfStar.<ST_Agedge_s>REALLOC(n_edges + 128, edges, ST_Agedge_s.class);
if (n_edges % CHUNK == 0)
edges = CArrayOfStar.<ST_Agedge_s>REALLOC(n_edges + CHUNK, edges, ST_Agedge_s.class);
}
if (ND_other(n).list!=null) {
/* In position, each node has its rw stored in mval and,
@ -490,16 +518,16 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
* reflect the loops and associated labels. We restore
* the original value here.
*/
if (ND_node_type(n) == 0) {
if (ND_node_type(n) == NORMAL) {
double tmp = ND_rw(n);
ND_rw(n, ND_mval(n));
ND_mval(n, tmp);
}
for (k = 0; (e = (ST_Agedge_s) ND_other(n).list.get_(k))!=null; k++) {
setflags(e, 0, 0, 128);
for (k = 0; (e = ND_other(n).list.get_(k))!=null; k++) {
setflags(e, 0, 0, AUXGRAPH);
edges.set_(n_edges++, e);
if (n_edges % 128 == 0)
edges = CArrayOfStar.<ST_Agedge_s>REALLOC(n_edges + 128, edges, ST_Agedge_s.class);
if (n_edges % CHUNK == 0)
edges = CArrayOfStar.<ST_Agedge_s>REALLOC(n_edges + CHUNK, edges, ST_Agedge_s.class);
}
}
}
@ -511,20 +539,23 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
* routed separately.
*/
LOG2("_dot_splines::n_edges="+n_edges);
qsort1(edges,
n_edges,
qsort1(edges, n_edges,
dotsplines__c.edgecmp);
/* FIXME: just how many boxes can there be? */
P.boxes = ST_boxf.malloc(n_nodes + 20 * 2 * 9);
P.boxes = ST_boxf.malloc(n_nodes + 20 * 2 * NSUB);
sd.Rank_box = ST_boxf.malloc(i);
if (et == (1 << 1)) {
if (et == ET_LINE) {
/* place regular edge labels */
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
if ((ND_node_type(n) == 1) && (ND_label(n)!=null)) {
if ((ND_node_type(n) == VIRTUAL) && (ND_label(n)!=null)) {
place_vnlabel(n);
}
}
}
for (i = 0; i < n_edges;) {
boolean havePorts;
ind = i;
@ -536,10 +567,11 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
havePorts = false;
ea = le0;
}
if ((ED_tree_index(ea) & 32)!=0) {
if ((ED_tree_index(ea) & BWDEDGE)!=0) {
MAKEFWDEDGE(fwdedgea.out, ea);
ea = fwdedgea.out;
}
for (cnt = 1; i < n_edges; cnt++, i++) {
if (NEQ(le0, (le1 = getmainedge((e1 = edges.get_(i))))))
break;
@ -553,20 +585,21 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
else
eb = le1;
}
if ((ED_tree_index(eb) & 32)!=0) {
if ((ED_tree_index(eb) & BWDEDGE)!=0) {
MAKEFWDEDGE(fwdedgeb.out, eb);
eb = (ST_Agedge_s) fwdedgeb.out;
eb = fwdedgeb.out;
}
if (portcmp(ED_tail_port(ea), ED_tail_port(eb))!=0)
break;
if (portcmp(ED_head_port(ea), ED_head_port(eb))!=0)
break;
if ((ED_tree_index(e0) & 15) == 2
if ((ED_tree_index(e0) & EDGETYPEMASK) == FLATEDGE
&& NEQ(ED_label(e0), ED_label(e1)))
break;
if ((ED_tree_index(edges.get_(i)) & 64)!=0) /* Aha! -C is on */
if ((ED_tree_index(edges.get_(i)) & MAINGRAPH)!=0) /* Aha! -C is on */
break;
}
if (EQ(agtail(e0), aghead(e0))) {
int b, sizey, r;
n = agtail(e0);
@ -600,11 +633,12 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
}
/* place regular edge labels */
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
if ((ND_node_type(n) == 1) && (ND_label(n))!=null) {
if ((ND_node_type(n) == VIRTUAL) && (ND_label(n))!=null) {
place_vnlabel(n);
updateBB(g, ND_label(n));
}
}
/* normalize splines so they always go from tail to head */
/* place_portlabel relies on this being done first */
if (normalize!=0)
@ -632,14 +666,14 @@ UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
}
/* end vladimir */
if (et != (2 << 1)) {
if (et != ET_CURVED) {
Memory.free(edges);
Memory.free(P.boxes);
Memory.free(P);
Memory.free(sd.Rank_box);
routesplinesterm();
}
Z.z().State = 1;
Z.z().State = GVSPLINES;
Z.z().EdgeLabelsDone = 1;
} finally {
LEAVING("6agx6m2qof9lg57co232lwakj","_dot_splines");
@ -1589,6 +1623,7 @@ LEAVING("2n9bpvx34fnukqu1f9u4v7v6n","makeLineEdge");
}
private static final int NUMPTS = 2000;
//3 30wfq1dby4t07hft9io52nq6z
// static void make_regular_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, int et)
@ -1608,14 +1643,16 @@ try {
boolean smode;
int pn[] = new int[] {0};
int pointn[] = new int[] {0};
fwdedgea.out.base.data = fwdedgeai;
fwdedgeb.out.base.data = fwdedgebi;
fwdedge.out.base.data = fwdedgei;
if (N(Z.z().pointfs)) {
Z.z().pointfs = CArray.<ST_pointf>ALLOC__(2000, ST_pointf.class);
Z.z().pointfs2 = CArray.<ST_pointf>ALLOC__(2000, ST_pointf.class);
Z.z().numpts = 2000;
Z.z().numpts2 = 2000;
Z.z().pointfs = CArray.<ST_pointf>ALLOC__(NUMPTS, ST_pointf.class);
Z.z().pointfs2 = CArray.<ST_pointf>ALLOC__(NUMPTS, ST_pointf.class);
Z.z().numpts = NUMPTS;
Z.z().numpts2 = NUMPTS;
}
sl = 0;
e = edges.get_(ind);
@ -1645,17 +1682,19 @@ UNSUPPORTED("8kdma1vi9aibo7isrge0lunrh"); // ED_to_orig(&fwdedgea.out) = e;
UNSUPPORTED("eih8eaai768x1un5mixrtgstp"); // e = &fwdedgea.out;
UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
} else {
if ((ED_tree_index(e) & 32)!=0) {
if ((ED_tree_index(e) & BWDEDGE)!=0) {
MAKEFWDEDGE(fwdedgea.out, e);
e = fwdedgea.out;
}
}
fe = e;
/* compute the spline points for the edge */
if ((et == (1 << 1)) && (pointn[0] = makeLineEdge (g, fe, Z.z().pointfs, hn.unsupported()))!=0) {
if ((et == ET_LINE) && (pointn[0] = makeLineEdge (g, fe, Z.z().pointfs, hn.unsupported()))!=0) {
}
else {
boolean splines = (et == (5 << 1));
boolean splines = (et == ET_SPLINE);
boxn = 0;
pointn[0] = 0;
segfirst = e;
@ -1663,26 +1702,21 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
hn = aghead(e);
b.___(maximal_bbox(g, sp, tn, null, e));
tend.nb.___(b);
beginpath(P, e, 1, tend, spline_merge(tn));
b.UR.y =
tend.boxes[tend.boxn[0] - 1].UR.y;
b.LL.y =
tend.boxes[tend.boxn[0] - 1].LL.y;
b.___(makeregularend(b, (1<<0),
beginpath(P, e, REGULAREDGE, tend, spline_merge(tn));
b.UR.y = tend.boxes[tend.boxn[0] - 1].UR.y;
b.LL.y = tend.boxes[tend.boxn[0] - 1].LL.y;
b.___(makeregularend(b, BOTTOM,
ND_coord(tn).y - GD_rank(g).get__(ND_rank(tn)).ht1));
if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
{
tend.boxes[tend.boxn[0]].___(b);
tend.boxn[0] = tend.boxn[0] + 1;
}
tend.boxes[tend.boxn[0]++].___(b);
longedge = 0;
smode = false; si = -1;
while (ND_node_type(hn) == 1 && N(((Boolean)Z.z().sinfo.splineMerge.exe(hn)).booleanValue())) {
while (ND_node_type(hn) == VIRTUAL && N(((Boolean)Z.z().sinfo.splineMerge.exe(hn)).booleanValue())) {
longedge = 1;
Z.z().boxes[boxn++].___(rank_box(sp, g, ND_rank(tn)));
if (N(smode)
&& ((sl = straight_len(hn)) >=
((GD_has_labels(g) & (1 << 0))!=0 ? 4 + 1 : 2 + 1))) {
((GD_has_labels(g) & EDGE_LABEL)!=0 ? 4 + 1 : 2 + 1))) {
smode = true;
si = 1; sl -= 2;
}
@ -1757,7 +1791,7 @@ UNSUPPORTED("cjx6tldge3otk1pk6ks1pkn2w"); // tend.boxes[tend.boxn++] =
longedge);
if (splines) ps = routesplines(P, pn);
else ps = routepolylines (P, pn);
if ((et == (1 << 1)) && (pn[0] > 4)) {
if ((et == ET_LINE) && (pn[0] > 4)) {
/* Here we have used the polyline case to handle
* an edge between two nodes on adjacent ranks. If the
* results really is a polyline, straighten it.
@ -2199,7 +2233,7 @@ LEAVING("dzvvmxkya868w5x78lkvchigk","cl_bound");
}
private final static int FUDGE = 4;
//3 6qwgl36ugfnduc5x59ohuewv1
// static boxf maximal_bbox(graph_t* g, spline_info_t* sp, node_t* vn, edge_t* ie, edge_t* oe)
@ -2216,15 +2250,17 @@ try {
ST_Agraph_s left_cl, right_cl;
ST_Agnode_s left, right;
final ST_boxf rv = new ST_boxf();
left_cl = right_cl = null;
/* give this node all the available space up to its neighbors */
b = (double)(ND_coord(vn).x - ND_lw(vn) - 4);
b = (double)(ND_coord(vn).x - ND_lw(vn) - FUDGE);
if ((left = neighbor(g, vn, ie, oe, -1))!=null) {
if ((left_cl = cl_bound(g, vn, left))!=null)
nb = GD_bb(left_cl).UR.x + (double)(sp.Splinesep);
else {
nb = (double)(ND_coord(left).x + ND_mval(left));
if (ND_node_type(left) == 0)
if (ND_node_type(left) == NORMAL)
nb += GD_nodesep(g) / 2.;
else
nb += (double)(sp.Splinesep);
@ -2234,17 +2270,18 @@ try {
rv.LL.x = ROUND(b);
} else
rv.LL.x = MIN(ROUND(b), sp.LeftBound);
/* we have to leave room for our own label! */
if ((ND_node_type(vn) == 1) && (ND_label(vn)!=null))
if ((ND_node_type(vn) == VIRTUAL) && (ND_label(vn)!=null))
b = (double)(ND_coord(vn).x + 10);
else
b = (double)(ND_coord(vn).x + ND_rw(vn) + 4);
b = (double)(ND_coord(vn).x + ND_rw(vn) + FUDGE);
if ((right = neighbor(g, vn, ie, oe, 1))!=null) {
if ((right_cl = cl_bound(g, vn, right))!=null)
nb = GD_bb(right_cl).LL.x - (double)(sp.Splinesep);
else {
nb = ND_coord(right).x - ND_lw(right);
if (ND_node_type(right) == 0)
if (ND_node_type(right) == NORMAL)
nb -= GD_nodesep(g) / 2.;
else
nb -= (double)(sp.Splinesep);
@ -2254,10 +2291,12 @@ try {
rv.UR.x = ROUND(b);
} else
rv.UR.x = MAX(ROUND(b), sp.RightBound);
if ((ND_node_type(vn) == 1) && (ND_label(vn)!=null)) {
if ((ND_node_type(vn) == VIRTUAL) && (ND_label(vn)!=null)) {
rv.UR.x = rv.UR.x - ND_rw(vn);
if (rv.UR.x < rv.LL.x) rv.UR.x = ND_coord(vn).x;
}
rv.LL.y = ND_coord(vn).y - GD_rank(g).get__(ND_rank(vn)).ht1;
rv.UR.y = ND_coord(vn).y + GD_rank(g).get__(ND_rank(vn)).ht2;
return rv;

View File

@ -50,8 +50,6 @@ import static gen.lib.cgraph.obj__c.agroot;
import static gen.lib.dotgen.dotinit__c.dot_root;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGINEDGE;
import static smetana.core.Macro.AGNODE;
import static smetana.core.Macro.AGOUTEDGE;
@ -88,6 +86,8 @@ import static smetana.core.Macro.UNSURE_ABOUT;
import static smetana.core.Macro.VIRTUAL;
import static smetana.core.Macro.alloc_elist;
import static smetana.core.Macro.elist_append;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.Original;

View File

@ -52,8 +52,6 @@ import static gen.lib.dotgen.fastgr__c.virtual_node;
import static gen.lib.dotgen.mincross__c.rec_reset_vlists;
import static gen.lib.dotgen.mincross__c.rec_save_vlists;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ED_adjacent;
import static smetana.core.Macro.ED_dist;
import static smetana.core.Macro.ED_edge_type;
@ -88,6 +86,8 @@ import static smetana.core.Macro.ND_rank;
import static smetana.core.Macro.ND_rw;
import static smetana.core.Macro.NORMAL;
import static smetana.core.Macro.VIRTUAL;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.HasND_Rank;
@ -101,7 +101,7 @@ import h.ST_pointf;
import h.ST_rank_t;
import smetana.core.CArray;
import smetana.core.CArrayOfStar;
import smetana.core.JUtilsDebug;
import smetana.core.debug.SmetanaDebug;
public class flat__c {
@ -240,7 +240,7 @@ try {
r = ND_rank(agtail(e)) - 1;
if (r<0) {
JUtilsDebug.LOG("flat_limits r="+r); // Set xt07
SmetanaDebug.LOG("flat_limits r="+r); // Set xt07
}
rank = GD_rank(g).get__(r).v;
lnode = 0;
@ -288,7 +288,7 @@ try {
ST_Agedge_s ve;
final ST_pointf dimen = new ST_pointf();
JUtilsDebug.LOG("Flat node for "+e.NAME);
SmetanaDebug.LOG("Flat node for "+e.NAME);
if (ED_label(e) == null)
return;
g = dot_root(agtail(e));
@ -384,7 +384,7 @@ LEAVING("1lopavodoru6ee52snd5l6swd","abomination");
public static void checkFlatAdjacent(ST_Agedge_s e) {
ENTERING("ctujx6e8k3rzv08h6gswdcaqs","checkFlatAdjacent");
try {
JUtilsDebug.LOG("checkFlatAdjacent "+e.NAME);
SmetanaDebug.LOG("checkFlatAdjacent "+e.NAME);
ST_Agnode_s tn = agtail(e);
ST_Agnode_s hn = aghead(e);
int i, lo, hi;
@ -448,10 +448,6 @@ try {
boolean found = false;
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
JUtilsDebug.LOG("flat_edges "+n);
JUtilsDebug.LOG("out= "+ND_flat_out(n).list);
JUtilsDebug.LOG("other= "+ND_other(n).list);
JUtilsDebug.LOG("");
if (ND_flat_out(n).list!=null) {
for (j = 0; (e = ND_flat_out(n).list.get_(j))!=null; j++) {
checkFlatAdjacent (e);
@ -484,13 +480,13 @@ try {
if (ND_flat_out(n).list!=null) {
for (i = 0; (e = ND_flat_out(n).list.get_(i))!=null; i++) {
if (ED_label(e)!=null) {
JUtilsDebug.LOG("Aie1 for "+e.NAME+" "+ED_adjacent(e));
SmetanaDebug.LOG("Aie1 for "+e.NAME+" "+ED_adjacent(e));
if (ED_adjacent(e)!=0) {
if (GD_flip(g)) ED_dist(e, ED_label(e).dimen.y);
else ED_dist(e, ED_label(e).dimen.x);
}
else {
JUtilsDebug.LOG("reset1 true");
SmetanaDebug.LOG("reset1 true");
reset = true;
flat_node(e);
}
@ -500,16 +496,16 @@ try {
for (j = 0; j < ND_other(n).size; j++) {
ST_Agedge_s le;
e = ND_other(n).list.get_(j);
JUtilsDebug.LOG("e="+e.NAME);
SmetanaDebug.LOG("e="+e.NAME);
if (ND_rank(agtail(e)) != ND_rank(aghead(e))) continue;
if (EQ(agtail(e), aghead(e))) continue; /* skip loops */
le = e;
while (ED_to_virt(le)!=null) le = ED_to_virt(le);
ED_adjacent(e, ED_adjacent(le));
if (ED_label(e)!=null) {
JUtilsDebug.LOG("Aie2 for "+e.NAME+" "+ED_adjacent(e));
JUtilsDebug.LOG("e2="+le.NAME);
JUtilsDebug.LOG("le2="+le.NAME);
SmetanaDebug.LOG("Aie2 for "+e.NAME+" "+ED_adjacent(e));
SmetanaDebug.LOG("e2="+le.NAME);
SmetanaDebug.LOG("le2="+le.NAME);
if (ED_adjacent(e)!=0) {
double lw;
if (GD_flip(g)) lw = ED_label(e).dimen.y;
@ -517,7 +513,7 @@ try {
ED_dist(le, MAX(lw,ED_dist(le)));
}
else {
JUtilsDebug.LOG("reset2 true");
SmetanaDebug.LOG("reset2 true");
reset = true;
flat_node(e);
}

View File

@ -73,8 +73,6 @@ import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.atof;
import static smetana.core.JUtils.qsort1;
import static smetana.core.JUtils.qsort2;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ALLOC_INT;
import static smetana.core.Macro.CLUSTER;
import static smetana.core.Macro.ED_edge_type;
@ -127,6 +125,8 @@ import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.VIRTUAL;
import static smetana.core.Macro.elist_append;
import static smetana.core.Macro.flatindex;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.Original;
@ -1651,8 +1651,7 @@ LEAVING("14t80owwvm7io4ou6czb9ba9","mincross_step");
//3 aq18oa4k4grixvfjx7r2qnl6r
// static int local_cross(elist l, int dir)
@Unused
@Reviewed(when = "01/12/2020")
@Original(version="2.38.0", path="lib/dotgen/mincross.c", name="local_cross", key="aq18oa4k4grixvfjx7r2qnl6r", definition="static int local_cross(elist l, int dir)")
public static int local_cross(final ST_elist l, int dir) {
// WARNING!! STRUCT
@ -1666,7 +1665,7 @@ try {
int cross = 0;
ST_Agedge_s e, f;
if (dir > 0)
is_out = NOT(0);
is_out = true;
else
is_out = false;
for (i = 0; (e = l.list.get_(i))!=null; i++) {

View File

@ -65,8 +65,6 @@ import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.USHRT_MAX;
import static smetana.core.JUtils.atof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGINEDGE;
import static smetana.core.Macro.AGOUTEDGE;
import static smetana.core.Macro.AGTYPE;
@ -133,6 +131,8 @@ import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.UNSURE_ABOUT;
import static smetana.core.Macro.alloc_elist;
import static smetana.core.Macro.free_list;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.HasND_Rank;

View File

@ -70,8 +70,6 @@ import static gen.lib.dotgen.dotinit__c.dot_root;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.strncmp;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.CLUSTER;
import static smetana.core.Macro.EDGE_LABEL;
import static smetana.core.Macro.ED_minlen;
@ -111,6 +109,8 @@ import static smetana.core.Macro.SAMERANK;
import static smetana.core.Macro.SINKRANK;
import static smetana.core.Macro.SOURCERANK;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Difficult;
import gen.annotation.HasND_Rank;

View File

@ -45,11 +45,11 @@
*/
package gen.lib.dotgen;
import static gen.lib.cgraph.attr__c.agattr;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGEDGE;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -48,10 +48,10 @@ import static gen.lib.cgraph.attr__c.agattr;
import static gen.lib.common.textspan__c.textfont_dict_open;
import static gen.lib.gvc.gvcontext__c.gvNEWcontext;
import static gen.lib.gvc.gvtextlayout__c.gvtextlayout_select;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGNODE;
import static smetana.core.Macro.NOT;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -44,8 +44,8 @@
*
*/
package gen.lib.gvc;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -51,8 +51,6 @@ import static gen.lib.common.input__c.graph_init;
import static smetana.core.JUtils.LOG2;
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.GD_cleanup;
import static smetana.core.Macro.GD_drawing;
import static smetana.core.Macro.GD_gvc;
@ -60,6 +58,8 @@ import static smetana.core.Macro.GVRENDER_PLUGIN;
import static smetana.core.Macro.LAYOUT_USES_RANKDIR;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -46,9 +46,9 @@
package gen.lib.gvc;
import static smetana.core.JUtils.strchr;
import static smetana.core.JUtils.strncpy;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -45,9 +45,9 @@
*/
package gen.lib.gvc;
import static gen.lib.gvc.gvplugin__c.gvplugin_load;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -51,10 +51,10 @@ import static gen.lib.label.node__c.PickBranch;
import static gen.lib.label.node__c.RTreeNewNode;
import static gen.lib.label.rectangle__c.CombineRect;
import static gen.lib.label.rectangle__c.Overlap;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -48,9 +48,9 @@ import static gen.lib.label.rectangle__c.CombineRect;
import static gen.lib.label.rectangle__c.InitRect;
import static gen.lib.label.rectangle__c.RectArea;
import static gen.lib.label.split_q__c.SplitNode;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -44,10 +44,10 @@
*
*/
package gen.lib.label;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -50,11 +50,11 @@ import static gen.lib.label.node__c.RTreeNewNode;
import static gen.lib.label.rectangle__c.CombineRect;
import static gen.lib.label.rectangle__c.NullRect;
import static gen.lib.label.rectangle__c.RectArea;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.NODECARD;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -52,10 +52,10 @@ import static gen.lib.label.index__c.RTreeLeafListFree;
import static gen.lib.label.index__c.RTreeOpen;
import static gen.lib.label.index__c.RTreeSearch;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -45,9 +45,9 @@
*/
package gen.lib.pack;
import static gen.lib.cgraph.attr__c.agget;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;

View File

@ -47,13 +47,14 @@ package gen.lib.pathplan;
import static gen.lib.pathplan.solvers__c.solve3;
import static smetana.core.JUtils.setjmp;
import static smetana.core.JUtils.sqrt;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.DISTSQ;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;
import gen.annotation.Unused;
import h.ST_Pedge_t;
import h.ST_Ppoly_t;
@ -513,8 +514,7 @@ LEAVING("9011b45d42bhwfxzhgxqnlfhp","points2coeff");
//3 6ldk438jjflh0huxkg4cs8kwu
// static void addroot(double root, double *roots, int *rootnp)
@Unused
@Reviewed(when = "01/12/2020")
@Original(version="2.38.0", path="lib/pathplan/route.c", name="addroot", key="6ldk438jjflh0huxkg4cs8kwu", definition="static void addroot(double root, double *roots, int *rootnp)")
public static void addroot(double root, double roots[], int rootnp[]) {
ENTERING("6ldk438jjflh0huxkg4cs8kwu","addroot");

View File

@ -48,11 +48,11 @@ import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.LOG2;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.setjmp;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.HUGE_VAL;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -48,8 +48,8 @@ import static smetana.core.JUtils.atan2;
import static smetana.core.JUtils.cos;
import static smetana.core.JUtils.pow;
import static smetana.core.JUtils.sqrt;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;

View File

@ -44,10 +44,15 @@
*
*/
package gen.lib.pathplan;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Unused;
import h.ST_Ppoly_t;
import h.ST_pointf;
import smetana.core.CArray;
import smetana.core.Z;
public class util__c {
@ -56,9 +61,42 @@ public class util__c {
// void make_polyline(Ppolyline_t line, Ppolyline_t* sline)
@Unused
@Original(version="2.38.0", path="lib/pathplan/util.c", name="make_polyline", key="ct6tszngugakbl42zkaqrt7p1", definition="void make_polyline(Ppolyline_t line, Ppolyline_t* sline)")
public static Object make_polyline(Object... arg_) {
UNSUPPORTED("caslgp07xc1rz7m4io9o6y06u"); // make_polyline(Ppolyline_t line, Ppolyline_t* sline)
throw new UnsupportedOperationException();
public static void make_polyline(ST_Ppoly_t line, ST_Ppoly_t sline) {
make_polyline_(line.copy(), sline);
}
private static void make_polyline_(ST_Ppoly_t line, ST_Ppoly_t sline) {
ENTERING("ct6tszngugakbl42zkaqrt7p1","make_polyline_");
try {
int i, j;
int npts = 4 + 3*(line.pn-2);
if (npts > Z.z().isz) {
Z.z().ispline = CArray.<ST_pointf>REALLOC__(npts, Z.z().ispline, ST_pointf.class);
Z.z().isz = npts;
}
j = i = 0;
Z.z().ispline.get__(j+1).___(line.ps.get__(i));
Z.z().ispline.get__(j ).___(line.ps.get__(i));
j += 2;
i++;
for (; i < line.pn-1; i++) {
Z.z().ispline.get__(j+2).___(line.ps.get__(i));
Z.z().ispline.get__(j+1).___(line.ps.get__(i));
Z.z().ispline.get__(j ).___(line.ps.get__(i));
j += 3;
}
Z.z().ispline.get__(j+1).___(line.ps.get__(i));
Z.z().ispline.get__(j ).___(line.ps.get__(i));
sline.pn = npts;
sline.ps = Z.z().ispline;
} finally {
LEAVING("ct6tszngugakbl42zkaqrt7p1","make_polyline_");
}
}

View File

@ -45,10 +45,10 @@
*/
package h;
import smetana.core.JUtilsDebug;
import smetana.core.OFFSET;
import smetana.core.__ptr__;
import smetana.core.__struct__;
import smetana.core.debug.SmetanaDebug;
final public class ST_Agraph_s extends ST_Agobj_s {
@ -76,7 +76,7 @@ final public class ST_Agraph_s extends ST_Agobj_s {
public ST_Agraph_s() {
this.NAME = "G" + CPT;
CPT++;
JUtilsDebug.LOG("creation " + this);
SmetanaDebug.LOG("creation " + this);
}

View File

@ -61,7 +61,7 @@ final public class ST_Agtag_s extends UnsupportedStarStruct {
}
@Override
public __struct__ copy() {
public ST_Agtag_s copy() {
final ST_Agtag_s result = new ST_Agtag_s();
result.objtype = objtype;
result.mtflock = mtflock;

View File

@ -47,7 +47,6 @@ package h;
import smetana.core.CArray;
import smetana.core.UnsupportedStarStruct;
import smetana.core.__struct__;
final public class ST_Ppoly_t extends UnsupportedStarStruct {
@ -56,7 +55,7 @@ final public class ST_Ppoly_t extends UnsupportedStarStruct {
@Override
public __struct__ copy() {
public ST_Ppoly_t copy() {
ST_Ppoly_t result = new ST_Ppoly_t();
result.ps = this.ps;
result.pn = this.pn;

View File

@ -53,7 +53,10 @@ final public class ST_boxf extends UnsupportedStarStruct {
public final ST_pointf LL = new ST_pointf();
public final ST_pointf UR = new ST_pointf();
@Override
public String toString() {
return "LL=" + LL + " UR=" + UR;
}
public static ST_boxf[] malloc(int nb) {
final ST_boxf result[] = new ST_boxf[nb];
@ -78,8 +81,6 @@ final public class ST_boxf extends UnsupportedStarStruct {
this.UR.___(other.UR);
}
}
// typedef struct { pointf LL, UR; } boxf;

View File

@ -48,32 +48,33 @@ package h;
import smetana.core.CArrayOfStar;
import smetana.core.CString;
import smetana.core.UnsupportedStarStruct;
import smetana.core.__ptr__;
import smetana.core.__struct__;
final public class ST_field_t extends UnsupportedStarStruct implements SHAPE_INFO {
public final ST_pointf size = new ST_pointf(); /* its dimension */
public final ST_boxf b = new ST_boxf(); /* its placement in node's coordinates */
public final ST_pointf size = new ST_pointf(); /* its dimension */
public final ST_boxf b = new ST_boxf(); /* its placement in node's coordinates */
public int n_flds;
public ST_textlabel_t lp; /* n_flds == 0 */
// struct field_t **fld; /* n_flds > 0 */
public ST_textlabel_t lp; /* n_flds == 0 */
// struct field_t **fld; /* n_flds > 0 */
public CArrayOfStar<ST_field_t> fld;
public CString id; /* user's identifier */
public boolean LR; /* if box list is horizontal (left to right) */
public int sides; /* sides of node exposed to field */
public CString id; /* user's identifier */
public boolean LR; /* if box list is horizontal (left to right) */
public int sides; /* sides of node exposed to field */
@Override
public __ptr__ castTo(Class dest) {
public String toString() {
return id + " sides=" + sides + " n_flds=" + n_flds + " lp=" + lp + " fld=" + fld;
}
@Override
public ST_field_t castTo(Class dest) {
if (dest == ST_field_t.class) {
return this;
}
return super.castTo(dest);
return (ST_field_t) super.castTo(dest);
}
@Override
public void ___(__struct__ other) {
ST_field_t other2 = (ST_field_t) other;
@ -87,8 +88,6 @@ final public class ST_field_t extends UnsupportedStarStruct implements SHAPE_INF
this.sides = other2.sides;
}
}
// typedef struct field_t {
// pointf size; /* its dimension */

View File

@ -52,7 +52,6 @@ import smetana.core.__ptr__;
final public class ST_textlabel_t extends UnsupportedStarStruct {
public CString text, fontname, fontcolor;
public int charset;
public double fontsize;
@ -71,10 +70,10 @@ final public class ST_textlabel_t extends UnsupportedStarStruct {
public boolean html;
@Override
public String toString() {
return text + " " + dimen;
}
@Override
public boolean isSameThan(__ptr__ other) {
@ -82,7 +81,6 @@ final public class ST_textlabel_t extends UnsupportedStarStruct {
return this == other2;
}
}
// typedef struct textlabel_t {

View File

@ -97,16 +97,36 @@ public enum FileFormat {
}
public StringBounder getDefaultStringBounder(TikzFontDistortion tikzFontDistortion) {
return getDefaultStringBounder(tikzFontDistortion, SvgCharSizeHack.NO_HACK);
}
public StringBounder getDefaultStringBounder(TikzFontDistortion tikzFontDistortion, SvgCharSizeHack charSizeHack) {
if (this == LATEX || this == LATEX_NO_PREAMBLE) {
return getTikzStringBounder(tikzFontDistortion);
}
if (this == BRAILLE_PNG) {
return getBrailleStringBounder();
}
if (this == SVG) {
return getSvgStringBounder(charSizeHack);
}
return getNormalStringBounder();
}
private StringBounder getSvgStringBounder(final SvgCharSizeHack charSizeHack) {
return new StringBounder() {
public String toString() {
return "FileFormat::getSvgStringBounder";
}
public Dimension2D calculateDimension(UFont font, String text) {
text = charSizeHack.transformStringForSizeHack(text);
return getJavaDimension(font, text);
}
};
}
private StringBounder getNormalStringBounder() {
return new StringBounder() {
@Override
@ -121,7 +141,7 @@ public enum FileFormat {
};
}
private Dimension2DDouble getJavaDimension(UFont font, String text) {
static 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);

View File

@ -92,8 +92,8 @@ public final class FileFormatOption implements Serializable {
}
}
public StringBounder getDefaultStringBounder() {
return fileFormat.getDefaultStringBounder(tikzFontDistortion);
public StringBounder getDefaultStringBounder(SvgCharSizeHack charSizeHack) {
return fileFormat.getDefaultStringBounder(tikzFontDistortion, charSizeHack);
}
public String getSvgLinkTarget() {

View File

@ -188,4 +188,6 @@ public interface ISkinParam extends ISkinSimple {
public ActorStyle actorStyle();
public void setSvgSize(String origin, String sizeToUse);
}

View File

@ -60,7 +60,6 @@ public class OptionFlags {
}
static public void setMaxPixel(int max) {
ImageBuilder.setMaxPixel(max);
}
static public final boolean USE_HECTOR = false;

View File

@ -68,6 +68,7 @@ import net.sourceforge.plantuml.error.PSystemError;
import net.sourceforge.plantuml.error.PSystemErrorUtils;
import net.sourceforge.plantuml.flowdiagram.FlowDiagramFactory;
import net.sourceforge.plantuml.font.PSystemListFontsFactory;
import net.sourceforge.plantuml.gitlog.GitDiagramFactory;
import net.sourceforge.plantuml.help.HelpFactory;
import net.sourceforge.plantuml.jcckit.PSystemJcckitFactory;
import net.sourceforge.plantuml.jsondiagram.JsonDiagramFactory;
@ -213,6 +214,7 @@ public class PSystemBuilder {
factories.add(new HelpFactory());
factories.add(new WireDiagramFactory());
factories.add(new JsonDiagramFactory());
factories.add(new GitDiagramFactory());
return factories;
}

View File

@ -45,6 +45,7 @@ import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeSet;
@ -91,7 +92,6 @@ public class SkinParam implements ISkinParam {
private String skin = "plantuml.skin";
private StyleBuilder styleBuilder;
private SkinParam(UmlDiagramType type) {
UseStyle.setBetaStyle(false);
this.type = type;
@ -107,6 +107,9 @@ public class SkinParam implements ISkinParam {
if (type == UmlDiagramType.JSON) {
UseStyle.setBetaStyle(true);
}
if (type == UmlDiagramType.GIT) {
UseStyle.setBetaStyle(true);
}
if (type == UmlDiagramType.SEQUENCE) {
// skin = "debug.skin";
// USE_STYLE2.set(true);
@ -160,6 +163,7 @@ public class SkinParam implements ISkinParam {
private static final Pattern2 stereoPattern = MyPattern.cmpile(stereoPatternString);
private final Map<String, String> params = new HashMap<String, String>();
private final Map<String, String> svgCharSizes = new HashMap<String, String>();
private Rankdir rankdir = Rankdir.TOP_TO_BOTTOM;
private final UmlDiagramType type;
private boolean useVizJs;
@ -970,7 +974,7 @@ public class SkinParam implements ISkinParam {
final String value = getValue("conditionStyle");
final ConditionStyle p = ConditionStyle.fromString(value);
if (p == null) {
return ConditionStyle.INSIDE;
return ConditionStyle.INSIDE_HEXAGON;
}
return p;
}
@ -1239,4 +1243,16 @@ public class SkinParam implements ISkinParam {
return ActorStyle.STICKMAN;
}
public void setSvgSize(String origin, String sizeToUse) {
svgCharSizes.put(StringUtils.manageUnicodeNotationUplus(origin),
StringUtils.manageUnicodeNotationUplus(sizeToUse));
}
public String transformStringForSizeHack(String s) {
for (Entry<String, String> ent : svgCharSizes.entrySet()) {
s = s.replace(ent.getKey(), ent.getValue());
}
return s;
}
}

View File

@ -364,4 +364,12 @@ public class SkinParamDelegator implements ISkinParam {
return skinParam.actorStyle();
}
public void setSvgSize(String origin, String sizeToUse) {
skinParam.setSvgSize(origin, sizeToUse);
}
public String transformStringForSizeHack(String s) {
return skinParam.transformStringForSizeHack(s);
}
}

View File

@ -48,9 +48,12 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.GraphicStrings;
import net.sourceforge.plantuml.preproc.Defines;
import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.ImageParameter;
import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public class SourceStringReader {
@ -80,7 +83,8 @@ public class SourceStringReader {
this(defines, source, charset, config, FileSystem.getInstance().getCurrentDir());
}
public SourceStringReader(Defines defines, String source, String charset, List<String> config, SFile newCurrentDir) {
public SourceStringReader(Defines defines, String source, String charset, List<String> config,
SFile newCurrentDir) {
// // WARNING GLOBAL LOCK HERE
// synchronized (SourceStringReader.class) {
try {
@ -224,8 +228,10 @@ public class SourceStringReader {
private void noStartumlFound(OutputStream os, FileFormatOption fileFormatOption, long seed) throws IOException {
final TextBlockBackcolored error = GraphicStrings.createForError(Arrays.asList("No @startuml/@enduml found"),
fileFormatOption.isUseRedForError());
final ImageBuilder imageBuilder = ImageBuilder.buildA(new ColorMapperIdentity(), false, null, null, null, 1.0,
error.getBackcolor());
HColor backcolor = error.getBackcolor();
final ImageParameter imageParameter = new ImageParameter(new ColorMapperIdentity(), false, null, 1.0, null,
null, ClockwiseTopRightBottomLeft.none(), backcolor);
final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter);
imageBuilder.setUDrawable(error);
imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed, os);
}

View File

@ -37,7 +37,7 @@ package net.sourceforge.plantuml;
import net.sourceforge.plantuml.sprite.Sprite;
public interface SpriteContainer {
public interface SpriteContainer extends SvgCharSizeHack {
public Sprite getSprite(String name);

View File

@ -98,4 +98,8 @@ public class SpriteContainerEmpty implements SpriteContainer, ISkinSimple {
return 0;
}
public String transformStringForSizeHack(String s) {
return s;
}
}

View File

@ -0,0 +1,48 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, 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;
public interface SvgCharSizeHack {
public static final SvgCharSizeHack NO_HACK = new SvgCharSizeHack() {
public String transformStringForSizeHack(String s) {
return s;
}
};
public String transformStringForSizeHack(String s);
}

View File

@ -72,12 +72,14 @@ import net.sourceforge.plantuml.pdf.PdfConverter;
import net.sourceforge.plantuml.security.ImageIO;
import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.security.SecurityUtils;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.style.NoStyleAvailableException;
import net.sourceforge.plantuml.svek.EmptySvgException;
import net.sourceforge.plantuml.svek.GraphvizCrash;
import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.AffineTransformType;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.ImageParameter;
import net.sourceforge.plantuml.ugraphic.PixelImage;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UImage;
@ -205,9 +207,11 @@ public abstract class UmlDiagram extends TitledDiagram implements Diagram, Annot
}
strings.addAll(CommandExecutionResult.getStackTrace(exception));
HColor backcolor = HColorUtils.WHITE;
final ImageParameter imageParameter = new ImageParameter(new ColorMapperIdentity(), false, null, 1.0, metadata,
null, ClockwiseTopRightBottomLeft.none(), backcolor);
final ImageBuilder imageBuilder = ImageBuilder.buildA(new ColorMapperIdentity(), false, null, metadata, null,
1.0, HColorUtils.WHITE);
final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter);
BufferedImage im2 = null;
if (flash != null) {

View File

@ -39,7 +39,7 @@ import net.sourceforge.plantuml.style.SName;
public enum UmlDiagramType {
SEQUENCE, STATE, CLASS, OBJECT, ACTIVITY, DESCRIPTION, COMPOSITE, FLOW, TIMING, BPM, NWDIAG, MINDMAP, WBS, WIRE,
HELP, GANTT, SALT, JSON;
HELP, GANTT, SALT, JSON, GIT;
public SName getStyleName() {
if (this == SEQUENCE) {

View File

@ -57,6 +57,7 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.Rainbow;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockRecentred;
import net.sourceforge.plantuml.graphic.USymbol;
@ -65,6 +66,7 @@ import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteType;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.ImageParameter;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.comp.CompressionMode;
import net.sourceforge.plantuml.ugraphic.comp.CompressionXorYBuilder;
@ -207,17 +209,18 @@ public class ActivityDiagram3 extends UmlDiagram {
throws IOException {
// BUG42
// COMPRESSION
swinlanes.computeSize(fileFormatOption.getDefaultStringBounder());
final StringBounder stringBounder = fileFormatOption.getDefaultStringBounder(getSkinParam());
swinlanes.computeSize(stringBounder);
TextBlock result = swinlanes;
result = CompressionXorYBuilder.build(CompressionMode.ON_X, result, fileFormatOption.getDefaultStringBounder());
result = CompressionXorYBuilder.build(CompressionMode.ON_Y, result, fileFormatOption.getDefaultStringBounder());
result = CompressionXorYBuilder.build(CompressionMode.ON_X, result, stringBounder);
result = CompressionXorYBuilder.build(CompressionMode.ON_Y, result, stringBounder);
result = new TextBlockRecentred(result);
final ISkinParam skinParam = getSkinParam();
result = new AnnotatedWorker(this, skinParam, fileFormatOption.getDefaultStringBounder()).addAdd(result);
result = new AnnotatedWorker(this, skinParam, stringBounder).addAdd(result);
final Dimension2D dim = result.getMinMax(fileFormatOption.getDefaultStringBounder()).getDimension();
final Dimension2D dim = result.getMinMax(stringBounder).getDimension();
final ClockwiseTopRightBottomLeft margins;
if (UseStyle.useBetaStyle()) {
margins = ClockwiseTopRightBottomLeft.marginForDocument(skinParam.getCurrentStyleBuilder());
@ -228,8 +231,12 @@ public class ActivityDiagram3 extends UmlDiagram {
final double dpiFactor = getDpiFactor(fileFormatOption,
Dimension2DDouble.delta(dim, margins.getLeft() + margins.getRight(), 0));
final ImageBuilder imageBuilder = ImageBuilder.buildD(getSkinParam(), margins, getAnimation(),
fileFormatOption.isWithMetadata() ? getMetadata() : null, getWarningOrError(), dpiFactor);
final HColor backcolor = skinParam.getBackgroundColor(false);
final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null;
final ImageParameter imageParameter = new ImageParameter(skinParam, getAnimation(), dpiFactor, metadata,
getWarningOrError(), margins, backcolor);
final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter);
imageBuilder.setUDrawable(result);
return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os);

View File

@ -105,7 +105,7 @@ public class Diamond {
};
}
public static UPolygon asPolygonFoo1(boolean shadowing, double width, double height) {
public static UPolygon asPolygonSquare(boolean shadowing, double width, double height) {
final UPolygon diams = new UPolygon();
diams.addPoint(width / 2, 0);

View File

@ -78,7 +78,7 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
final HColor backColor;
final Rainbow arrowColor;
final FontConfiguration fcTest;
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE_HEXAGON ? FontParam.ACTIVITY_DIAMOND
: FontParam.ARROW;
final FontConfiguration fcArrow;
if (UseStyle.useBetaStyle()) {

View File

@ -80,7 +80,7 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
final FontConfiguration fontArrow;
final FontConfiguration fcTest;
final ConditionStyle conditionStyle = skinParam().getConditionStyle();
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE_HEXAGON ? FontParam.ACTIVITY_DIAMOND
: FontParam.ARROW;
if (UseStyle.useBetaStyle()) {
final Style styleArrow = getDefaultStyleDefinitionArrow()

View File

@ -138,10 +138,10 @@ class FtileIfAndStop extends AbstractFtile {
tileNonStop.getThickness());
final Ftile diamond1;
if (conditionStyle == ConditionStyle.INSIDE) {
if (conditionStyle == ConditionStyle.INSIDE_HEXAGON) {
diamond1 = new FtileDiamondInside(tileNonStop.skinParam(), backColor, borderColor, swimlane, tbTest);
// .withWest(tb1).withEast(tb2);
} else if (conditionStyle == ConditionStyle.DIAMOND) {
} else if (conditionStyle == ConditionStyle.EMPTY_DIAMOND) {
diamond1 = new FtileDiamond(tileNonStop.skinParam(), backColor, borderColor, swimlane).withNorth(tbTest);
// .withWest(tb1).withEast(tb2).withNorth(tbTest);
} else {

View File

@ -62,7 +62,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondFoo1;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.cucadiagram.Display;
@ -121,7 +121,7 @@ class FtileRepeat extends AbstractFtile {
FontConfiguration fcDiamond, FontConfiguration fcArrow, Ftile backward, boolean noOut,
LinkRendering incoming1, LinkRendering incoming2) {
final FontConfiguration fontConfiguration1 = conditionStyle == ConditionStyle.INSIDE ? fcDiamond : fcArrow;
final FontConfiguration fontConfiguration1 = conditionStyle == ConditionStyle.INSIDE_HEXAGON ? fcDiamond : fcArrow;
final TextBlock tbTest = (Display.isNull(test) || test.isWhite()) ? TextBlockUtils.empty(0, 0)
: test.create(fontConfiguration1, repeat.skinParam().getDefaultTextAlignment(HorizontalAlignment.LEFT),
@ -137,7 +137,7 @@ class FtileRepeat extends AbstractFtile {
diamond1 = entry;
}
final FtileRepeat result;
if (conditionStyle == ConditionStyle.INSIDE) {
if (conditionStyle == ConditionStyle.INSIDE_HEXAGON) {
final Ftile diamond2;
if (noOut && Display.isNull(test)) {
diamond2 = new FtileEmpty(repeat.skinParam());
@ -146,12 +146,12 @@ class FtileRepeat extends AbstractFtile {
.withEast(yesTb).withSouth(outTb);
}
result = new FtileRepeat(repeat, diamond1, diamond2, TextBlockUtils.empty(0, 0), backward);
} else if (conditionStyle == ConditionStyle.DIAMOND) {
} else if (conditionStyle == ConditionStyle.EMPTY_DIAMOND) {
final Ftile diamond2 = new FtileDiamond(repeat.skinParam(), diamondColor, borderColor, swimlane)
.withEast(tbTest);
result = new FtileRepeat(repeat, diamond1, diamond2, tbTest, backward);
} else if (conditionStyle == ConditionStyle.FOO1) {
final Ftile diamond2 = new FtileDiamondFoo1(repeat.skinParam(), diamondColor, borderColor, swimlane,
} else if (conditionStyle == ConditionStyle.INSIDE_DIAMOND) {
final Ftile diamond2 = new FtileDiamondSquare(repeat.skinParam(), diamondColor, borderColor, swimlane,
tbTest);
result = new FtileRepeat(repeat, diamond1, diamond2, TextBlockUtils.empty(0, 0), backward);
} else {

View File

@ -61,7 +61,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.MergeStrategy;
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondFoo1;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.FontConfiguration;
@ -126,13 +126,13 @@ class FtileWhile extends AbstractFtile {
ftileFactory.skinParam());
final Ftile diamond1;
if (conditionStyle == ConditionStyle.INSIDE) {
if (conditionStyle == ConditionStyle.INSIDE_HEXAGON) {
diamond1 = new FtileDiamondInside(whileBlock.skinParam(), backColor, borderColor, swimlane, testTb)
.withNorth(yesTb).withWest(outTb);
} else if (conditionStyle == ConditionStyle.FOO1) {
diamond1 = new FtileDiamondFoo1(whileBlock.skinParam(), backColor, borderColor, swimlane, testTb)
} else if (conditionStyle == ConditionStyle.INSIDE_DIAMOND) {
diamond1 = new FtileDiamondSquare(whileBlock.skinParam(), backColor, borderColor, swimlane, testTb)
.withNorth(yesTb).withWest(outTb);
} else if (conditionStyle == ConditionStyle.DIAMOND) {
} else if (conditionStyle == ConditionStyle.EMPTY_DIAMOND) {
diamond1 = new FtileDiamond(whileBlock.skinParam(), backColor, borderColor, swimlane).withNorth(testTb)
.withSouth(yesTb).withWest(outTb);
} else {

View File

@ -52,7 +52,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileWithUrl;
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileIfDown;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamond;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondFoo1;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondSquare;
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside;
import net.sourceforge.plantuml.creole.CreoleMode;
import net.sourceforge.plantuml.creole.Parser;
@ -243,7 +243,7 @@ public class ConditionalBuilder {
final TextBlock tbTest = new SheetBlock2(sheetBlock1, Diamond.asStencil(sheetBlock1), tile1.getThickness());
final Ftile diamond1;
if (conditionStyle == ConditionStyle.INSIDE) {
if (conditionStyle == ConditionStyle.INSIDE_HEXAGON) {
if (eastWest) {
diamond1 = new FtileDiamondInside(tile1.skinParam(), backColor, borderColor, swimlane, tbTest)
.withWestAndEast(tb1, tb2);
@ -251,7 +251,7 @@ public class ConditionalBuilder {
diamond1 = new FtileDiamondInside(tile1.skinParam(), backColor, borderColor, swimlane, tbTest)
.withSouth(tb1).withEast(tb2);
}
} else if (conditionStyle == ConditionStyle.DIAMOND) {
} else if (conditionStyle == ConditionStyle.EMPTY_DIAMOND) {
if (eastWest) {
diamond1 = new FtileDiamond(tile1.skinParam(), backColor, borderColor, swimlane).withNorth(tbTest)
.withWestAndEast(tb1, tb2);
@ -259,13 +259,13 @@ public class ConditionalBuilder {
diamond1 = new FtileDiamond(tile1.skinParam(), backColor, borderColor, swimlane).withNorth(tbTest)
.withSouth(tb1).withEast(tb2);
}
} else if (conditionStyle == ConditionStyle.FOO1) {
} else if (conditionStyle == ConditionStyle.INSIDE_DIAMOND) {
if (eastWest) {
diamond1 = new FtileDiamondFoo1(tile1.skinParam(), backColor, borderColor, swimlane, tbTest)
diamond1 = new FtileDiamondSquare(tile1.skinParam(), backColor, borderColor, swimlane, tbTest)
.withWestAndEast(tb1, tb2);
} else {
diamond1 = new FtileDiamondFoo1(tile1.skinParam(), backColor, borderColor, swimlane, tbTest)
/* .withSouth(tb1) */.withEast(tb2);
diamond1 = new FtileDiamondSquare(tile1.skinParam(), backColor, borderColor, swimlane, tbTest)
.withSouth(tb1).withEast(tb2);
}
} else {
throw new IllegalStateException();

View File

@ -416,50 +416,120 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
super(null, null);
this.arrowColor = arrowColor;
}
public void drawU(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder();
final Dimension2D totalDim = calculateDimensionInternal(stringBounder);
final Swimlane intoSw;
final List<Ftile> allTiles = new ArrayList<Ftile>();
allTiles.add(tile1);
allTiles.add(tile2);
final double[] minmax;
if (ug instanceof UGraphicInterceptorOneSwimlane) {
intoSw = ((UGraphicInterceptorOneSwimlane) ug).getSwimlane();
final UGraphicInterceptorOneSwimlane interceptor = (UGraphicInterceptorOneSwimlane) ug;
final List<Swimlane> allSwimlanes = interceptor.getOrderedListOfAllSwimlanes();
minmax = getMinmax(stringBounder, totalDim.getWidth(), allTiles, interceptor.getSwimlane(),
allSwimlanes);
} else {
intoSw = null;
minmax = getMinmaxSimple(stringBounder, totalDim.getWidth(), allTiles);
}
final List<Ftile> all = new ArrayList<Ftile>();
all.add(tile1);
all.add(tile2);
double minX = totalDim.getWidth() / 2;
double maxX = totalDim.getWidth() / 2;
boolean atLeastOne = false;
for (Ftile tmp : all) {
final double minX = minmax[0];
final double maxX = minmax[1];
if (Double.isNaN(minX) || Double.isNaN(maxX)) {
return;
}
final Snake s = Snake.create(arrowColor).withMerge(MergeStrategy.NONE);
s.addPoint(minX, totalDim.getHeight());
s.addPoint(maxX, totalDim.getHeight());
ug.draw(s);
}
private double[] getMinmax(StringBounder stringBounder, double width, List<Ftile> allTiles, Swimlane intoSw,
List<Swimlane> allSwimlanes) {
final int current = allSwimlanes.indexOf(intoSw);
// final Double leftOut = getLeftOut(stringBounder);
// if (leftOut == null)
// return new double[] { Double.NaN, Double.NaN };
if (current == -1) {
throw new IllegalStateException();
}
final int first = getFirstSwimlane(stringBounder, allTiles, allSwimlanes);
final int last = getLastSwimlane(stringBounder, allTiles, allSwimlanes);
if (current < first || current > last)
return new double[] { Double.NaN, Double.NaN };
double minX = current != first ? 0 : width;
double maxX = current != last ? width : 0;
// minX = Math.min(minX, leftOut);
// maxX = Math.max(maxX, leftOut);
for (Ftile tmp : allTiles) {
if (tmp.calculateDimension(stringBounder).hasPointOut() == false) {
continue;
}
if (intoSw != null && tmp.getSwimlanes().contains(intoSw) == false) {
if (ftileDoesOutcomeInThatSwimlane(tmp, intoSw) == false) {
continue;
}
if (intoSw != null && tmp.getSwimlaneOut() != intoSw) {
continue;
}
atLeastOne = true;
final UTranslate ut = getTranslateFor(tmp, stringBounder);
final double out = tmp.calculateDimension(stringBounder).translate(ut).getLeft();
minX = Math.min(minX, out);
maxX = Math.max(maxX, out);
}
if (atLeastOne == false) {
return;
}
final Snake s = Snake.create(arrowColor).withMerge(MergeStrategy.NONE);
final double height = totalDim.getHeight();
s.addPoint(minX, height);
s.addPoint(maxX, height);
ug.draw(s);
return new double[] { minX, maxX };
}
private double[] getMinmaxSimple(StringBounder stringBounder, double width, List<Ftile> allTiles) {
// final Double leftOut = getLeftOut(stringBounder);
// if (leftOut == null)
// return new double[] { Double.NaN, Double.NaN };
double minX = width / 2;
double maxX = width / 2;
// minX = Math.min(minX, leftOut);
// maxX = Math.max(maxX, leftOut);
for (Ftile tmp : allTiles) {
if (tmp.calculateDimension(stringBounder).hasPointOut() == false) {
continue;
}
final UTranslate ut = getTranslateFor(tmp, stringBounder);
final double out = tmp.calculateDimension(stringBounder).translate(ut).getLeft();
minX = Math.min(minX, out);
maxX = Math.max(maxX, out);
}
return new double[] { minX, maxX };
}
private int getFirstSwimlane(StringBounder stringBounder, List<Ftile> allTiles, List<Swimlane> allSwimlanes) {
for (int i = 0; i < allSwimlanes.size(); i++) {
if (atLeastOne(stringBounder, allSwimlanes.get(i), allTiles)) {
return i;
}
}
throw new IllegalStateException();
}
private int getLastSwimlane(StringBounder stringBounder, List<Ftile> allTiles, List<Swimlane> allSwimlanes) {
for (int i = allSwimlanes.size() - 1; i >= 0; i--) {
if (atLeastOne(stringBounder, allSwimlanes.get(i), allTiles)) {
return i;
}
}
throw new IllegalStateException();
}
private boolean atLeastOne(StringBounder stringBounder, Swimlane intoSw, List<Ftile> allTiles) {
for (Ftile tmp : allTiles)
if (tmp.calculateDimension(stringBounder).hasPointOut() && ftileDoesOutcomeInThatSwimlane(tmp, intoSw))
return true;
return false;
}
private boolean ftileDoesOutcomeInThatSwimlane(Ftile ftile, Swimlane swimlane) {
return ftile.getSwimlaneOut() == swimlane && ftile.getSwimlanes().contains(swimlane);
}
}
public Ftile addLinks(Branch branch1, Branch branch2, StringBounder stringBounder) {

View File

@ -53,7 +53,7 @@ import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public class FtileDiamondFoo1 extends AbstractFtile {
public class FtileDiamondSquare extends AbstractFtile {
private final HColor backColor;
private final HColor borderColor;
@ -62,32 +62,36 @@ public class FtileDiamondFoo1 extends AbstractFtile {
private final TextBlock west;
private final TextBlock east;
private final TextBlock north;
private final TextBlock south;
public FtileDiamondFoo1(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
public FtileDiamondSquare(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label) {
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0),
this(skinParam, backColor, borderColor, swimlane, label, TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0),
TextBlockUtils.empty(0, 0), TextBlockUtils.empty(0, 0));
}
public FtileDiamondFoo1 withNorth(TextBlock north) {
return new FtileDiamondFoo1(skinParam(), backColor, borderColor, swimlane, label, north, west, east);
public FtileDiamondSquare withNorth(TextBlock north) {
return new FtileDiamondSquare(skinParam(), backColor, borderColor, swimlane, label, north, west, east, south);
}
public FtileDiamondFoo1 withWest(TextBlock west) {
return new FtileDiamondFoo1(skinParam(), backColor, borderColor, swimlane, label, north, west, east);
public FtileDiamondSquare withWest(TextBlock west) {
return new FtileDiamondSquare(skinParam(), backColor, borderColor, swimlane, label, north, west, east, south);
}
public FtileDiamondFoo1 withEast(TextBlock east) {
return new FtileDiamondFoo1(skinParam(), backColor, borderColor, swimlane, label, north, west, east);
public FtileDiamondSquare withEast(TextBlock east) {
return new FtileDiamondSquare(skinParam(), backColor, borderColor, swimlane, label, north, west, east, south);
}
public FtileDiamondSquare withSouth(TextBlock south) {
return new FtileDiamondSquare(skinParam(), backColor, borderColor, swimlane, label, north, west, east, south);
}
public Ftile withWestAndEast(TextBlock tb1, TextBlock tb2) {
return withWest(tb1).withEast(tb2);
}
private FtileDiamondFoo1(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label, TextBlock north, TextBlock west, TextBlock east) {
private FtileDiamondSquare(ISkinParam skinParam, HColor backColor, HColor borderColor, Swimlane swimlane,
TextBlock label, TextBlock north, TextBlock west, TextBlock east, TextBlock south) {
super(skinParam);
this.backColor = backColor;
this.swimlane = swimlane;
@ -96,6 +100,7 @@ public class FtileDiamondFoo1 extends AbstractFtile {
this.west = west;
this.east = east;
this.north = north;
this.south = south;
}
public Set<Swimlane> getSwimlanes() {
@ -118,9 +123,11 @@ public class FtileDiamondFoo1 extends AbstractFtile {
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
ug = ug.apply(borderColor).apply(getThickness()).apply(backColor.bg());
ug.draw(Diamond.asPolygonFoo1(skinParam().shadowing(null), dimTotal.getWidth(), dimTotal.getHeight()));
ug.draw(Diamond.asPolygonSquare(skinParam().shadowing(null), dimTotal.getWidth(), dimTotal.getHeight()));
// Fix why north and south are the same
north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
final double lx = (dimTotal.getWidth() - dimLabel.getWidth()) / 2;
final double ly = (dimTotal.getHeight() - dimLabel.getHeight()) / 2;

View File

@ -42,6 +42,7 @@ import java.util.Deque;
import java.util.List;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParam;
import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.UmlDiagramType;
@ -52,6 +53,8 @@ import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.ImageParameter;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public class BpmDiagram extends UmlDiagram {
@ -93,9 +96,14 @@ public class BpmDiagram extends UmlDiagram {
margin1 = 10;
margin2 = 10;
}
final ImageBuilder imageBuilder = ImageBuilder.buildD(getSkinParam(),
ClockwiseTopRightBottomLeft.margin1margin2(margin1, margin2), getAnimation(),
fileFormatOption.isWithMetadata() ? getMetadata() : null, getWarningOrError(), dpiFactor);
ISkinParam skinParam = getSkinParam();
final HColor backcolor = skinParam.getBackgroundColor(false);
final ClockwiseTopRightBottomLeft margins = ClockwiseTopRightBottomLeft.margin1margin2(margin1, margin2);
final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null;
final ImageParameter imageParameter = new ImageParameter(skinParam, getAnimation(), dpiFactor, metadata,
getWarningOrError(), margins, backcolor);
final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter);
imageBuilder.setUDrawable(getUDrawable());
return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os);

View File

@ -42,10 +42,12 @@ import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.posimo.DotPath;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.ugraphic.AbstractCommonUGraphic;
import net.sourceforge.plantuml.ugraphic.AbstractUGraphic;
import net.sourceforge.plantuml.ugraphic.ClipContainer;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.ImageParameter;
import net.sourceforge.plantuml.ugraphic.UCenteredCharacter;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic2;
@ -57,6 +59,7 @@ import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UText;
import net.sourceforge.plantuml.ugraphic.color.ColorMapper;
import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
// https://www.branah.com/braille-translator
@ -80,16 +83,19 @@ public class UGraphicBraille extends AbstractUGraphic<BrailleGrid> implements Cl
register();
}
// public UGraphicBraille(ColorMapper colorMapper, String backcolor, boolean textAsPath, double scale, String
// public UGraphicBraille(ColorMapper colorMapper, String backcolor, boolean
// textAsPath, double scale, String
// linkTarget) {
// this(colorMapper, new SvgGraphics(backcolor, scale), textAsPath, linkTarget);
// }
//
// public UGraphicBraille(ColorMapper colorMapper, boolean textAsPath, double scale, String linkTarget) {
// public UGraphicBraille(ColorMapper colorMapper, boolean textAsPath, double
// scale, String linkTarget) {
// this(colorMapper, new SvgGraphics(scale), textAsPath, linkTarget);
// }
//
// public UGraphicBraille(ColorMapper mapper, HtmlColorGradient gr, boolean textAsPath, double scale, String
// public UGraphicBraille(ColorMapper mapper, HtmlColorGradient gr, boolean
// textAsPath, double scale, String
// linkTarget) {
// this(mapper, new SvgGraphics(scale), textAsPath, linkTarget);
//
@ -121,8 +127,10 @@ public class UGraphicBraille extends AbstractUGraphic<BrailleGrid> implements Cl
}
public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException {
final ImageBuilder imageBuilder = ImageBuilder.buildA(new ColorMapperIdentity(),
false, null, metadata, null, 1.0, HColorUtils.WHITE);
HColor backcolor = HColorUtils.WHITE;
final ImageParameter imageParameter = new ImageParameter(new ColorMapperIdentity(), false, null, 1.0, metadata,
null, ClockwiseTopRightBottomLeft.none(), backcolor);
final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter);
imageBuilder.setUDrawable(new BrailleDrawer(getGraphicObject()));
imageBuilder.writeImageTOBEMOVED(new FileFormatOption(FileFormat.PNG), 42, os);

View File

@ -39,6 +39,7 @@ import java.io.IOException;
import java.io.OutputStream;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.SkinParam;
import net.sourceforge.plantuml.UmlDiagramType;
@ -60,6 +61,8 @@ import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram;
import net.sourceforge.plantuml.style.ClockwiseTopRightBottomLeft;
import net.sourceforge.plantuml.svek.image.EntityImageClass;
import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.ImageParameter;
import net.sourceforge.plantuml.ugraphic.color.HColor;
public class ClassDiagram extends AbstractClassOrObjectDiagram {
@ -214,8 +217,11 @@ public class ClassDiagram extends AbstractClassOrObjectDiagram {
margin1 = 0;
margin2 = 0;
}
final ImageBuilder imageBuilder = ImageBuilder.buildD(getSkinParam(),
ClockwiseTopRightBottomLeft.margin1margin2(margin1, margin2), null, null, null, 1);
ISkinParam skinParam = getSkinParam();
final HColor backcolor = skinParam.getBackgroundColor(false);
final ClockwiseTopRightBottomLeft margins = ClockwiseTopRightBottomLeft.margin1margin2(margin1, margin2);
final ImageParameter imageParameter = new ImageParameter(skinParam, null, 1.0, null, null, margins, backcolor);
final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter);
imageBuilder.setUDrawable(fullLayout);
return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os);
}

View File

@ -35,6 +35,8 @@
*/
package net.sourceforge.plantuml.command;
import java.util.StringTokenizer;
import net.sourceforge.plantuml.LineLocation;
import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.TitledDiagram;
@ -67,15 +69,22 @@ public class CommandPragma extends SingleLineCommand2<TitledDiagram> {
protected CommandExecutionResult executeArg(TitledDiagram system, LineLocation location, RegexResult arg) {
final String name = StringUtils.goLowerCase(arg.get("NAME", 0));
final String value = arg.get("VALUE", 0);
system.getPragma().define(name, value);
if (name.equalsIgnoreCase("graphviz_dot") && value.equalsIgnoreCase("smetana")) {
system.setUseJDot(true);
}
if (name.equalsIgnoreCase("graphviz_dot") && value.equalsIgnoreCase("jdot")) {
system.setUseJDot(true);
}
if (name.equalsIgnoreCase("graphviz_dot") && value.equalsIgnoreCase(GraphvizUtils.VIZJS)) {
system.getSkinParam().setUseVizJs(true);
if (name.equalsIgnoreCase("svgsize")) {
if (value.contains(" ")) {
final StringTokenizer st = new StringTokenizer(value);
system.getSkinParam().setSvgSize(st.nextToken(), st.nextToken());
}
} else {
system.getPragma().define(name, value);
if (name.equalsIgnoreCase("graphviz_dot") && value.equalsIgnoreCase("smetana")) {
system.setUseJDot(true);
}
if (name.equalsIgnoreCase("graphviz_dot") && value.equalsIgnoreCase("jdot")) {
system.setUseJDot(true);
}
if (name.equalsIgnoreCase("graphviz_dot") && value.equalsIgnoreCase(GraphvizUtils.VIZJS)) {
system.getSkinParam().setUseVizJs(true);
}
}
return CommandExecutionResult.ok();
}

View File

@ -39,7 +39,7 @@ import net.sourceforge.plantuml.utils.StartUtils;
public enum DiagramType {
UML, BPM, DITAA, DOT, PROJECT, JCCKIT, SALT, FLOW, CREOLE, JUNGLE, CUTE, MATH, LATEX,
DEFINITION, GANTT, NW, MINDMAP, WBS, WIRE, JSON,
DEFINITION, GANTT, NW, MINDMAP, WBS, WIRE, JSON, GIT,
UNKNOWN;
static public DiagramType getTypeFromArobaseStart(String s) {
@ -107,6 +107,9 @@ public enum DiagramType {
if (StartUtils.startsWithSymbolAnd("startjson", s)) {
return JSON;
}
if (StartUtils.startsWithSymbolAnd("startgit", s)) {
return GIT;
}
return UNKNOWN;
}
}

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