mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-22 04:55:10 +00:00
version 8040
This commit is contained in:
parent
092b0a79bd
commit
d2bb8f328c
2
pom.xml
2
pom.xml
@ -35,7 +35,7 @@
|
||||
|
||||
<groupId>net.sourceforge.plantuml</groupId>
|
||||
<artifactId>plantuml</artifactId>
|
||||
<version>8040-SNAPSHOT</version>
|
||||
<version>8041-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>PlantUML</name>
|
||||
|
@ -359,19 +359,19 @@ try {
|
||||
Agdatadict_s parent_dd, dd;
|
||||
dd = (Agdatadict_s) agbindrec(g, DataDictName, sizeof(Agdatadict_s.class),
|
||||
false).castTo(Agdatadict_s.class);
|
||||
dd.setPtr("dict.n", agdtopen(g, Z._().AgDataDictDisc.amp(), Z._().Dttree));
|
||||
dd.setPtr("dict.e", agdtopen(g, Z._().AgDataDictDisc.amp(),Z._(). Dttree));
|
||||
dd.setPtr("dict.g", agdtopen(g, Z._().AgDataDictDisc.amp(), Z._().Dttree));
|
||||
dd.setPtr("dict.n", agdtopen(g, Z.z().AgDataDictDisc.amp(), Z.z().Dttree));
|
||||
dd.setPtr("dict.e", agdtopen(g, Z.z().AgDataDictDisc.amp(),Z.z(). Dttree));
|
||||
dd.setPtr("dict.g", agdtopen(g, Z.z().AgDataDictDisc.amp(), Z.z().Dttree));
|
||||
if ((par = agparent(g))!=null) {
|
||||
parent_dd = agdatadict(par, false);
|
||||
dtview((_dt_s)dd.getPtr("dict.n"), (_dt_s)parent_dd.getPtr("dict.n"));
|
||||
dtview((_dt_s)dd.getPtr("dict.e"), (_dt_s)parent_dd.getPtr("dict.e"));
|
||||
dtview((_dt_s)dd.getPtr("dict.g"), (_dt_s)parent_dd.getPtr("dict.g"));
|
||||
} else {
|
||||
if (Z._().ProtoGraph!=null && NEQ(g, Z._().ProtoGraph)) {
|
||||
if (Z.z().ProtoGraph!=null && NEQ(g, Z.z().ProtoGraph)) {
|
||||
/* it's not ok to dtview here for several reasons. the proto
|
||||
graph could change, and the sym indices don't match */
|
||||
parent_dd = agdatadict(Z._().ProtoGraph, false);
|
||||
parent_dd = agdatadict(Z.z().ProtoGraph, false);
|
||||
agcopydict(parent_dd.getPtr("dict.n"), dd.getPtr("dict.n"), g, AGNODE);
|
||||
agcopydict(parent_dd.getPtr("dict.e"), dd.getPtr("dict.e"), g, AGEDGE);
|
||||
agcopydict(parent_dd.getPtr("dict.g"), dd.getPtr("dict.g"), g, AGRAPH);
|
||||
@ -667,9 +667,9 @@ ENTERING("blr3drm2hxuzwd6gpeeb84yyg","agattr");
|
||||
try {
|
||||
Agsym_s rv;
|
||||
if (g == null) {
|
||||
if (Z._().ProtoGraph == null)
|
||||
Z._().ProtoGraph = agopen(null, Z._().ProtoDesc.copy(), null);
|
||||
g = Z._().ProtoGraph;
|
||||
if (Z.z().ProtoGraph == null)
|
||||
Z.z().ProtoGraph = agopen(null, Z.z().ProtoDesc.copy(), null);
|
||||
g = Z.z().ProtoGraph;
|
||||
}
|
||||
if (value!=null)
|
||||
rv = setattr(g, kind, name, value);
|
||||
|
@ -599,7 +599,7 @@ try {
|
||||
if (agisstrict(g)) {
|
||||
if (g.getPtr("desc").getBoolean("no_loop") && (EQ(t, h))) /* simple graphs */
|
||||
return false;
|
||||
key.____(Z._().Tag);
|
||||
key.____(Z.z().Tag);
|
||||
key.setInt("objtype", 0); /* wild card */
|
||||
if (agfindedge_by_key(g, t, h, key)!=null)
|
||||
return false;
|
||||
@ -655,7 +655,7 @@ try {
|
||||
if (have_id!=0 || ((name == null) && ((NOT(cflag)) || agisstrict(g)))) {
|
||||
/* probe for pre-existing edge */
|
||||
final __struct__<Agtag_s> key = __struct__.from(Agtag_s.class);
|
||||
key.____(Z._().Tag);
|
||||
key.____(Z.z().Tag);
|
||||
if (have_id!=0) {
|
||||
key.setInt("id", id[0]);
|
||||
key.setInt("objtype", AGEDGE);
|
||||
|
@ -229,13 +229,13 @@ try {
|
||||
__ptr__ memclosure;
|
||||
Agclos_s rv;
|
||||
/* establish an allocation arena */
|
||||
memdisc = (Agmemdisc_s) ((proto != null && proto.getPtr("mem") != null) ? proto.getPtr("mem") : Z._().AgMemDisc.amp());
|
||||
memdisc = (Agmemdisc_s) ((proto != null && proto.getPtr("mem") != null) ? proto.getPtr("mem") : Z.z().AgMemDisc.amp());
|
||||
memclosure = (__ptr__) memdisc.call("open", proto);
|
||||
rv = (Agclos_s) memdisc.call("alloc", memclosure, sizeof(Agclos_s.class));
|
||||
rv.getStruct("disc").setPtr("mem", memdisc);
|
||||
rv.getStruct("state").setPtr("mem", memclosure);
|
||||
rv.getStruct("disc").setPtr("id", ((proto != null && proto.getPtr("id") != null) ? proto.getPtr("id") : Z._().AgIdDisc.amp()));
|
||||
rv.getStruct("disc").setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z._().AgIdDisc.amp()));
|
||||
rv.getStruct("disc").setPtr("id", ((proto != null && proto.getPtr("id") != null) ? proto.getPtr("id") : Z.z().AgIdDisc.amp()));
|
||||
rv.getStruct("disc").setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIdDisc.amp()));
|
||||
rv.setBoolean("callbacks_enabled", (N(0)));
|
||||
return rv;
|
||||
} finally {
|
||||
@ -286,11 +286,11 @@ public static Agraph_s agopen1(Agraph_s g) {
|
||||
ENTERING("8jyhwfdfm0a877qfz8cjlb8rk","agopen1");
|
||||
try {
|
||||
Agraph_s par;
|
||||
g.setPtr("n_seq", agdtopen(g, Z._().Ag_subnode_seq_disc.amp(), Z._().Dttree));
|
||||
g.setPtr("n_id", agdtopen(g, Z._().Ag_subnode_id_disc.amp(), Z._().Dttree));
|
||||
g.setPtr("e_seq", agdtopen(g, EQ(g, agroot(g))? Z._().Ag_mainedge_seq_disc.amp() : Z._().Ag_subedge_seq_disc.amp(), Z._().Dttree));
|
||||
g.setPtr("e_id", agdtopen(g, EQ(g, agroot(g))? Z._().Ag_mainedge_id_disc.amp() : Z._().Ag_subedge_id_disc.amp(), Z._().Dttree));
|
||||
g.setPtr("g_dict", agdtopen(g, Z._().Ag_subgraph_id_disc.amp(), Z._().Dttree));
|
||||
g.setPtr("n_seq", agdtopen(g, Z.z().Ag_subnode_seq_disc.amp(), Z.z().Dttree));
|
||||
g.setPtr("n_id", agdtopen(g, Z.z().Ag_subnode_id_disc.amp(), Z.z().Dttree));
|
||||
g.setPtr("e_seq", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_seq_disc.amp() : Z.z().Ag_subedge_seq_disc.amp(), Z.z().Dttree));
|
||||
g.setPtr("e_id", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_id_disc.amp() : Z.z().Ag_subedge_id_disc.amp(), Z.z().Dttree));
|
||||
g.setPtr("g_dict", agdtopen(g, Z.z().Ag_subgraph_id_disc.amp(), Z.z().Dttree));
|
||||
par = agparent(g);
|
||||
if (par!=null) {
|
||||
AGSEQ(g, agnextseq(par, AGRAPH));
|
||||
|
@ -226,8 +226,8 @@ try {
|
||||
s = agstrbind(g, str);
|
||||
id[0] = Memory.identityHashCode(s);
|
||||
} else {
|
||||
id[0] = Z._().ctr;
|
||||
Z._().ctr += 2;
|
||||
id[0] = Z.z().ctr;
|
||||
Z.z().ctr += 2;
|
||||
}
|
||||
return ASINT(N(0));
|
||||
} finally {
|
||||
|
@ -216,9 +216,9 @@ public static Agnode_s agfindnode_by_id(Agraph_s g, int id) {
|
||||
ENTERING("4w89du6uel405pm3vxsr3ayxt","agfindnode_by_id");
|
||||
try {
|
||||
Agsubnode_s sn;
|
||||
Z._().dummy.getStruct("base").getStruct("tag").setInt("id", id);
|
||||
Z._().template.setPtr("node", Z._().dummy.amp());
|
||||
sn = (Agsubnode_s) (g.getPtr("n_id").call("searchf", g.getPtr("n_id"), Z._().template.amp(),0000004));
|
||||
Z.z().dummy.getStruct("base").getStruct("tag").setInt("id", id);
|
||||
Z.z().template.setPtr("node", Z.z().dummy.amp());
|
||||
sn = (Agsubnode_s) (g.getPtr("n_id").call("searchf", g.getPtr("n_id"), Z.z().template.amp(),0000004));
|
||||
return (Agnode_s) (sn!=null ? sn.getPtr("node") : null);
|
||||
} finally {
|
||||
LEAVING("4w89du6uel405pm3vxsr3ayxt","agfindnode_by_id");
|
||||
|
@ -238,17 +238,17 @@ try {
|
||||
else
|
||||
dictref = STARSTAR.amp(new ACCESS<_dt_s>() {
|
||||
public _dt_s get() {
|
||||
return Z._().Refdict_default;
|
||||
return Z.z().Refdict_default;
|
||||
}
|
||||
public void set(_dt_s obj) {
|
||||
Z._().Refdict_default = obj;
|
||||
Z.z().Refdict_default = obj;
|
||||
}
|
||||
});
|
||||
if (dictref.getMe() == null) {
|
||||
dictref.setMe(agdtopen(g, Z._().Refstrdisc.amp(), Z._().Dttree));
|
||||
dictref.setMe(agdtopen(g, Z.z().Refstrdisc.amp(), Z.z().Dttree));
|
||||
}
|
||||
Z._().HTML_BIT = 1 << 31;
|
||||
Z._().CNT_BITS = ~Z._().HTML_BIT;
|
||||
Z.z().HTML_BIT = 1 << 31;
|
||||
Z.z().CNT_BITS = ~Z.z().HTML_BIT;
|
||||
return dictref.getMe();
|
||||
} finally {
|
||||
LEAVING("f1nwss2xoaub1hyord232ugoj","refdict");
|
||||
@ -408,7 +408,7 @@ try {
|
||||
if (r!=null) r = (refstr_t) r.castTo(refstr_t.class);
|
||||
if (r!=null && (EQ(r.getPtr("s"), s))) {
|
||||
r.setInt("refcnt", r.getInt("refcnt")-1);
|
||||
if ((r.getInt("refcnt")!=0 && Z._().CNT_BITS!=0) == false) {
|
||||
if ((r.getInt("refcnt")!=0 && Z.z().CNT_BITS!=0) == false) {
|
||||
agdtdelete(g, strdict, r);
|
||||
/*
|
||||
if (g) agfree(g,r);
|
||||
@ -436,7 +436,7 @@ try {
|
||||
if (s == null)
|
||||
return 0;
|
||||
key = (refstr_t) s.addVirtualBytes(-OFFSET.create(refstr_t.class, "s").toInt());
|
||||
return (key.getInt("refcnt") & Z._().HTML_BIT);
|
||||
return (key.getInt("refcnt") & Z.z().HTML_BIT);
|
||||
} finally {
|
||||
LEAVING("3em4wzjnpajd5d3igb90l3rml","aghtmlstr");
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ public static Agraph_s agfindsubg_by_id(Agraph_s g, int id) {
|
||||
ENTERING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id");
|
||||
try {
|
||||
final __struct__<Agraph_s> template = __struct__.from(Agraph_s.class);
|
||||
agdtdisc(g, (_dt_s) g.getPtr("g_dict"), Z._().Ag_subgraph_id_disc.amp());
|
||||
agdtdisc(g, (_dt_s) g.getPtr("g_dict"), Z.z().Ag_subgraph_id_disc.amp());
|
||||
AGID(template.amp(), id);
|
||||
return (Agraph_s) g.getPtr("g_dict").castTo(_dt_s.class).call("searchf", g.getPtr("g_dict"), template.amp(), 0000004);
|
||||
} finally {
|
||||
|
@ -202,7 +202,7 @@ public static Object agdictobjmem(_dt_s dict, Object p, size_t size, _dtdisc_s d
|
||||
ENTERING("7dkudp41c9byhicatk2sxtxqk","agdictobjmem");
|
||||
try {
|
||||
Agraph_s g;
|
||||
g = Z._().Ag_dictop_G;
|
||||
g = Z.z().Ag_dictop_G;
|
||||
if (g!=null) {
|
||||
if (p!=null)
|
||||
agfree(g, p);
|
||||
@ -253,10 +253,10 @@ try {
|
||||
_dt_s d;
|
||||
memf = (Dtmemory_f) disc.getPtr("memoryf");
|
||||
disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem"));
|
||||
Z._().Ag_dictop_G = g;
|
||||
Z.z().Ag_dictop_G = g;
|
||||
d = dtopen(disc, method);
|
||||
disc.setPtr("memoryf", memf);
|
||||
Z._().Ag_dictop_G = null;
|
||||
Z.z().Ag_dictop_G = null;
|
||||
return d;
|
||||
} finally {
|
||||
LEAVING("48ox0bg1qmasrer8np51uwsyk","agdtopen");
|
||||
|
@ -795,7 +795,7 @@ ENTERING("b669zec8aznq4obnil98j5lby","arrow_match_shape");
|
||||
try {
|
||||
CString next, rest;
|
||||
int f[] = new int[] {0};
|
||||
rest = arrow_match_name_frag(name, Z._().Arrowsynonyms, f);
|
||||
rest = arrow_match_name_frag(name, Z.z().Arrowsynonyms, f);
|
||||
UNSUPPORTED("304yfmlt3qwn4zydpx1hgmf5o"); // if (rest == name) {
|
||||
UNSUPPORTED("8vxyvy38lzpbd83cu26nejaan"); // do {
|
||||
UNSUPPORTED("do0zgfzipmk0sgv0q0u14es1c"); // next = rest;
|
||||
@ -845,7 +845,7 @@ try {
|
||||
arrowdir_t arrowdir;
|
||||
sflag[0] = (0);
|
||||
eflag[0] = agisdirected(agraphof(e)) ? 1 : (0);
|
||||
if (Z._().E_dir!=null && ((attr = agxget(e, Z._().E_dir))).charAt(0)!='\0') {
|
||||
if (Z.z().E_dir!=null && ((attr = agxget(e, Z.z().E_dir))).charAt(0)!='\0') {
|
||||
UNSUPPORTED("em7x45v09orjeey5u06gf9b4s"); // for (arrowdir = Arrowdirs; arrowdir->dir; arrowdir++) {
|
||||
UNSUPPORTED("dhaookuw0a1xqmh07lldcvlgi"); // if ((*(attr)==*(arrowdir->dir)&&!strcmp(attr,arrowdir->dir))) {
|
||||
UNSUPPORTED("1d32qbc447n7nmmvedj3bnhr4"); // *sflag = arrowdir->sflag;
|
||||
@ -854,9 +854,9 @@ UNSUPPORTED("9ekmvj13iaml5ndszqyxa8eq"); // break;
|
||||
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
|
||||
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
|
||||
}
|
||||
if (Z._().E_arrowhead!=null && (eflag[0] == 1) && ((attr = agxget(e,Z._(). E_arrowhead))).charAt(0)!='\0')
|
||||
if (Z.z().E_arrowhead!=null && (eflag[0] == 1) && ((attr = agxget(e,Z.z(). E_arrowhead))).charAt(0)!='\0')
|
||||
arrow_match_name(attr, eflag);
|
||||
if (Z._().E_arrowtail!=null && (sflag[0] == 1) && ((attr = agxget(e, Z._().E_arrowtail))).charAt(0)!='\0')
|
||||
if (Z.z().E_arrowtail!=null && (sflag[0] == 1) && ((attr = agxget(e, Z.z().E_arrowtail))).charAt(0)!='\0')
|
||||
arrow_match_name(attr, sflag);
|
||||
if (ED_conc_opp_flag(e)) {
|
||||
UNSUPPORTED("1p2usipxeqlorwroqo37t3yfy"); // edge_t *f;
|
||||
@ -886,7 +886,7 @@ try {
|
||||
for (i = 0; i < 4; i++) {
|
||||
/* we don't simply index with flag because arrowtypes are not necessarily sorted */
|
||||
f = (flag >> (i * 8)) & ((1 << 4) - 1);
|
||||
for (arrowtype = Z._().Arrowtypes.asPtr(); arrowtype.getPtr("gen")!=null; arrowtype=arrowtype.plus(1)) {
|
||||
for (arrowtype = Z.z().Arrowtypes.asPtr(); arrowtype.getPtr("gen")!=null; arrowtype=arrowtype.plus(1)) {
|
||||
if (f == arrowtype.getInt("type")) {
|
||||
lenfact += arrowtype.getDouble("lenfact");
|
||||
break;
|
||||
@ -895,7 +895,7 @@ try {
|
||||
}
|
||||
/* The original was missing the factor E_arrowsz, but I believe it
|
||||
should be here for correct arrow clipping */
|
||||
return 10. * lenfact * late_double(e, Z._().E_arrowsz, 1.0, 0.0);
|
||||
return 10. * lenfact * late_double(e, Z.z().E_arrowsz, 1.0, 0.0);
|
||||
} finally {
|
||||
LEAVING("1yk5wl46i7rlzcern0tefd24s","arrow_length");
|
||||
}
|
||||
|
@ -1400,86 +1400,86 @@ UNSUPPORTED("dhhbmqv6n01j1eeyy7fpus1xw"); // xf = 0.02;
|
||||
else if ((p = agget(g, new CString("landscape")))!=null)
|
||||
GD_drawing(g).setBoolean("landscape", mapbool(p));
|
||||
p = agget(g, new CString("clusterrank"));
|
||||
Z._().CL_type = maptoken(p, rankname, rankcode);
|
||||
Z.z().CL_type = maptoken(p, rankname, rankcode);
|
||||
p = agget(g, new CString("concentrate"));
|
||||
Z._().Concentrate = mapbool(p);
|
||||
Z._().State = 0;
|
||||
Z._().EdgeLabelsDone = 0;
|
||||
Z.z().Concentrate = mapbool(p);
|
||||
Z.z().State = 0;
|
||||
Z.z().EdgeLabelsDone = 0;
|
||||
GD_drawing(g).setDouble("dpi", 0.0);
|
||||
if (((p = agget(g, new CString("dpi")))!=null && p.charAt(0)!='\0')
|
||||
|| ((p = agget(g, new CString("resolution")))!=null && p.charAt(0)!='\0'))
|
||||
GD_drawing(g).setDouble("dpi", atof(p));
|
||||
do_graph_label(g);
|
||||
Z._().Initial_dist = (1.0e+37);
|
||||
Z._().G_ordering = (agattr(g,AGRAPH,new CString("ordering"),null));
|
||||
Z._().G_gradientangle = (agattr(g,AGRAPH,new CString("gradientangle"),null));
|
||||
Z._().G_margin = (agattr(g,AGRAPH,new CString("margin"),null));
|
||||
Z.z().Initial_dist = (1.0e+37);
|
||||
Z.z().G_ordering = (agattr(g,AGRAPH,new CString("ordering"),null));
|
||||
Z.z().G_gradientangle = (agattr(g,AGRAPH,new CString("gradientangle"),null));
|
||||
Z.z().G_margin = (agattr(g,AGRAPH,new CString("margin"),null));
|
||||
/* initialize nodes */
|
||||
Z._().N_height = (agattr(g,AGNODE,new CString("height"),null));
|
||||
Z._().N_width = (agattr(g,AGNODE,new CString("width"),null));
|
||||
Z._().N_shape = (agattr(g,AGNODE,new CString("shape"),null));
|
||||
Z._().N_color = (agattr(g,AGNODE,new CString("color"),null));
|
||||
Z._().N_fillcolor = (agattr(g,AGNODE,new CString("fillcolor"),null));
|
||||
Z._().N_style = (agattr(g,AGNODE,new CString("style"),null));
|
||||
Z._().N_fontsize = (agattr(g,AGNODE,new CString("fontsize"),null));
|
||||
Z._().N_fontname = (agattr(g,AGNODE,new CString("fontname"),null));
|
||||
Z._().N_fontcolor = (agattr(g,AGNODE,new CString("fontcolor"),null));
|
||||
Z._().N_label = (agattr(g,AGNODE,new CString("label"),null));
|
||||
if (N(Z._().N_label))
|
||||
Z._().N_label = agattr(g, AGNODE, new CString("label"), new CString("\\N"));
|
||||
Z._().N_xlabel = (agattr(g,AGNODE,new CString("xlabel"),null));
|
||||
Z._().N_showboxes = (agattr(g,AGNODE,new CString("showboxes"),null));
|
||||
Z._().N_penwidth = (agattr(g,AGNODE,new CString("penwidth"),null));
|
||||
Z._().N_ordering = (agattr(g,AGNODE,new CString("ordering"),null));
|
||||
Z._().N_margin = (agattr(g,AGNODE,new CString("margin"),null));
|
||||
Z.z().N_height = (agattr(g,AGNODE,new CString("height"),null));
|
||||
Z.z().N_width = (agattr(g,AGNODE,new CString("width"),null));
|
||||
Z.z().N_shape = (agattr(g,AGNODE,new CString("shape"),null));
|
||||
Z.z().N_color = (agattr(g,AGNODE,new CString("color"),null));
|
||||
Z.z().N_fillcolor = (agattr(g,AGNODE,new CString("fillcolor"),null));
|
||||
Z.z().N_style = (agattr(g,AGNODE,new CString("style"),null));
|
||||
Z.z().N_fontsize = (agattr(g,AGNODE,new CString("fontsize"),null));
|
||||
Z.z().N_fontname = (agattr(g,AGNODE,new CString("fontname"),null));
|
||||
Z.z().N_fontcolor = (agattr(g,AGNODE,new CString("fontcolor"),null));
|
||||
Z.z().N_label = (agattr(g,AGNODE,new CString("label"),null));
|
||||
if (N(Z.z().N_label))
|
||||
Z.z().N_label = agattr(g, AGNODE, new CString("label"), new CString("\\N"));
|
||||
Z.z().N_xlabel = (agattr(g,AGNODE,new CString("xlabel"),null));
|
||||
Z.z().N_showboxes = (agattr(g,AGNODE,new CString("showboxes"),null));
|
||||
Z.z().N_penwidth = (agattr(g,AGNODE,new CString("penwidth"),null));
|
||||
Z.z().N_ordering = (agattr(g,AGNODE,new CString("ordering"),null));
|
||||
Z.z().N_margin = (agattr(g,AGNODE,new CString("margin"),null));
|
||||
/* attribs for polygon shapes */
|
||||
Z._().N_sides = (agattr(g,AGNODE,new CString("sides"),null));
|
||||
Z._().N_peripheries = (agattr(g,AGNODE,new CString("peripheries"),null));
|
||||
Z._().N_skew = (agattr(g,AGNODE,new CString("skew"),null));
|
||||
Z._().N_orientation = (agattr(g,AGNODE,new CString("orientation"),null));
|
||||
Z._().N_distortion = (agattr(g,AGNODE,new CString("distortion"),null));
|
||||
Z._().N_fixed = (agattr(g,AGNODE,new CString("fixedsize"),null));
|
||||
Z._().N_imagescale = (agattr(g,AGNODE,new CString("imagescale"),null));
|
||||
Z._().N_nojustify = (agattr(g,AGNODE,new CString("nojustify"),null));
|
||||
Z._().N_layer = (agattr(g,AGNODE,new CString("layer"),null));
|
||||
Z._().N_group = (agattr(g,AGNODE,new CString("group"),null));
|
||||
Z._().N_comment = (agattr(g,AGNODE,new CString("comment"),null));
|
||||
Z._().N_vertices = (agattr(g,AGNODE,new CString("vertices"),null));
|
||||
Z._().N_z = (agattr(g,AGNODE,new CString("z"),null));
|
||||
Z._().N_gradientangle = (agattr(g,AGNODE,new CString("gradientangle"),null));
|
||||
Z.z().N_sides = (agattr(g,AGNODE,new CString("sides"),null));
|
||||
Z.z().N_peripheries = (agattr(g,AGNODE,new CString("peripheries"),null));
|
||||
Z.z().N_skew = (agattr(g,AGNODE,new CString("skew"),null));
|
||||
Z.z().N_orientation = (agattr(g,AGNODE,new CString("orientation"),null));
|
||||
Z.z().N_distortion = (agattr(g,AGNODE,new CString("distortion"),null));
|
||||
Z.z().N_fixed = (agattr(g,AGNODE,new CString("fixedsize"),null));
|
||||
Z.z().N_imagescale = (agattr(g,AGNODE,new CString("imagescale"),null));
|
||||
Z.z().N_nojustify = (agattr(g,AGNODE,new CString("nojustify"),null));
|
||||
Z.z().N_layer = (agattr(g,AGNODE,new CString("layer"),null));
|
||||
Z.z().N_group = (agattr(g,AGNODE,new CString("group"),null));
|
||||
Z.z().N_comment = (agattr(g,AGNODE,new CString("comment"),null));
|
||||
Z.z().N_vertices = (agattr(g,AGNODE,new CString("vertices"),null));
|
||||
Z.z().N_z = (agattr(g,AGNODE,new CString("z"),null));
|
||||
Z.z().N_gradientangle = (agattr(g,AGNODE,new CString("gradientangle"),null));
|
||||
/* initialize edges */
|
||||
Z._().E_weight = (agattr(g,AGEDGE,new CString("weight"),null));
|
||||
Z._().E_color = (agattr(g,AGEDGE,new CString("color"),null));
|
||||
Z._().E_fillcolor = (agattr(g,AGEDGE,new CString("fillcolor"),null));
|
||||
Z._().E_fontsize = (agattr(g,AGEDGE,new CString("fontsize"),null));
|
||||
Z._().E_fontname = (agattr(g,AGEDGE,new CString("fontname"),null));
|
||||
Z._().E_fontcolor = (agattr(g,AGEDGE,new CString("fontcolor"),null));
|
||||
Z._().E_label = (agattr(g,AGEDGE,new CString("label"),null));
|
||||
Z._().E_xlabel = (agattr(g,AGEDGE,new CString("xlabel"),null));
|
||||
Z._().E_label_float = (agattr(g,AGEDGE,new CString("labelfloat"),null));
|
||||
Z.z().E_weight = (agattr(g,AGEDGE,new CString("weight"),null));
|
||||
Z.z().E_color = (agattr(g,AGEDGE,new CString("color"),null));
|
||||
Z.z().E_fillcolor = (agattr(g,AGEDGE,new CString("fillcolor"),null));
|
||||
Z.z().E_fontsize = (agattr(g,AGEDGE,new CString("fontsize"),null));
|
||||
Z.z().E_fontname = (agattr(g,AGEDGE,new CString("fontname"),null));
|
||||
Z.z().E_fontcolor = (agattr(g,AGEDGE,new CString("fontcolor"),null));
|
||||
Z.z().E_label = (agattr(g,AGEDGE,new CString("label"),null));
|
||||
Z.z().E_xlabel = (agattr(g,AGEDGE,new CString("xlabel"),null));
|
||||
Z.z().E_label_float = (agattr(g,AGEDGE,new CString("labelfloat"),null));
|
||||
/* vladimir */
|
||||
Z._().E_dir = (agattr(g,AGEDGE,new CString("dir"),null));
|
||||
Z._().E_arrowhead = (agattr(g,AGEDGE,new CString("arrowhead"),null));
|
||||
Z._().E_arrowtail = (agattr(g,AGEDGE,new CString("arrowtail"),null));
|
||||
Z._().E_headlabel = (agattr(g,AGEDGE,new CString("headlabel"),null));
|
||||
Z._().E_taillabel = (agattr(g,AGEDGE,new CString("taillabel"),null));
|
||||
Z._().E_labelfontsize = (agattr(g,AGEDGE,new CString("labelfontsize"),null));
|
||||
Z._().E_labelfontname = (agattr(g,AGEDGE,new CString("labelfontname"),null));
|
||||
Z._().E_labelfontcolor = (agattr(g,AGEDGE,new CString("labelfontcolor"),null));
|
||||
Z._().E_labeldistance = (agattr(g,AGEDGE,new CString("labeldistance"),null));
|
||||
Z._().E_labelangle = (agattr(g,AGEDGE,new CString("labelangle"),null));
|
||||
Z.z().E_dir = (agattr(g,AGEDGE,new CString("dir"),null));
|
||||
Z.z().E_arrowhead = (agattr(g,AGEDGE,new CString("arrowhead"),null));
|
||||
Z.z().E_arrowtail = (agattr(g,AGEDGE,new CString("arrowtail"),null));
|
||||
Z.z().E_headlabel = (agattr(g,AGEDGE,new CString("headlabel"),null));
|
||||
Z.z().E_taillabel = (agattr(g,AGEDGE,new CString("taillabel"),null));
|
||||
Z.z().E_labelfontsize = (agattr(g,AGEDGE,new CString("labelfontsize"),null));
|
||||
Z.z().E_labelfontname = (agattr(g,AGEDGE,new CString("labelfontname"),null));
|
||||
Z.z().E_labelfontcolor = (agattr(g,AGEDGE,new CString("labelfontcolor"),null));
|
||||
Z.z().E_labeldistance = (agattr(g,AGEDGE,new CString("labeldistance"),null));
|
||||
Z.z().E_labelangle = (agattr(g,AGEDGE,new CString("labelangle"),null));
|
||||
/* end vladimir */
|
||||
Z._().E_minlen = (agattr(g,AGEDGE,new CString("minlen"),null));
|
||||
Z._().E_showboxes = (agattr(g,AGEDGE,new CString("showboxes"),null));
|
||||
Z._().E_style = (agattr(g,AGEDGE,new CString("style"),null));
|
||||
Z._().E_decorate = (agattr(g,AGEDGE,new CString("decorate"),null));
|
||||
Z._().E_arrowsz = (agattr(g,AGEDGE,new CString("arrowsize"),null));
|
||||
Z._().E_constr = (agattr(g,AGEDGE,new CString("constraint"),null));
|
||||
Z._().E_layer = (agattr(g,AGEDGE,new CString("layer"),null));
|
||||
Z._().E_comment = (agattr(g,AGEDGE,new CString("comment"),null));
|
||||
Z._().E_tailclip = (agattr(g,AGEDGE,new CString("tailclip"),null));
|
||||
Z._().E_headclip = (agattr(g,AGEDGE,new CString("headclip"),null));
|
||||
Z._().E_penwidth = (agattr(g,AGEDGE,new CString("penwidth"),null));
|
||||
Z.z().E_minlen = (agattr(g,AGEDGE,new CString("minlen"),null));
|
||||
Z.z().E_showboxes = (agattr(g,AGEDGE,new CString("showboxes"),null));
|
||||
Z.z().E_style = (agattr(g,AGEDGE,new CString("style"),null));
|
||||
Z.z().E_decorate = (agattr(g,AGEDGE,new CString("decorate"),null));
|
||||
Z.z().E_arrowsz = (agattr(g,AGEDGE,new CString("arrowsize"),null));
|
||||
Z.z().E_constr = (agattr(g,AGEDGE,new CString("constraint"),null));
|
||||
Z.z().E_layer = (agattr(g,AGEDGE,new CString("layer"),null));
|
||||
Z.z().E_comment = (agattr(g,AGEDGE,new CString("comment"),null));
|
||||
Z.z().E_tailclip = (agattr(g,AGEDGE,new CString("tailclip"),null));
|
||||
Z.z().E_headclip = (agattr(g,AGEDGE,new CString("headclip"),null));
|
||||
Z.z().E_penwidth = (agattr(g,AGEDGE,new CString("penwidth"),null));
|
||||
/* background */
|
||||
GD_drawing(g).setPtr("xdots", init_xdot (g));
|
||||
/* initialize id, if any */
|
||||
|
@ -737,8 +737,8 @@ try {
|
||||
span.setPtr("str", line);
|
||||
span.setInt("just", terminator);
|
||||
if (line!=null && line.charAt(0)!='\0') {
|
||||
Z._().tf.setPtr("name", lp.getPtr("fontname"));
|
||||
Z._().tf.setDouble("size", lp.getDouble("fontsize"));
|
||||
Z.z().tf.setPtr("name", lp.getPtr("fontname"));
|
||||
Z.z().tf.setDouble("size", lp.getDouble("fontsize"));
|
||||
// WE CHEAT
|
||||
size.setDouble("x", 0.0);
|
||||
size.setDouble("y", (int)(lp.getDouble("fontsize") * 1.20));
|
||||
|
@ -777,19 +777,19 @@ try {
|
||||
UNSUPPORTED("cq4nqjjxvb0dtdfy4c7pwpqai"); // agerr(AGERR, "add_tree_edge: missing tree edge\n");
|
||||
UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); // longjmp (jbuf, 1);
|
||||
}
|
||||
ED_tree_index(e, Z._().Tree_edge.getInt("size"));
|
||||
ED_tree_index(e, Z.z().Tree_edge.getInt("size"));
|
||||
|
||||
Z._().Tree_edge.getArrayOfPtr("list").plus(Z._().Tree_edge.getInt("size")).setPtr(e);
|
||||
Z._().Tree_edge.setInt("size", 1+ Z._().Tree_edge.getInt("size"));
|
||||
Z.z().Tree_edge.getArrayOfPtr("list").plus(Z.z().Tree_edge.getInt("size")).setPtr(e);
|
||||
Z.z().Tree_edge.setInt("size", 1+ Z.z().Tree_edge.getInt("size"));
|
||||
|
||||
if (ND_mark(agtail(e)) == 0) {
|
||||
Z._().Tree_node.getArrayOfPtr("list").plus(Z._().Tree_node.getInt("size")).setPtr(agtail(e));
|
||||
Z._().Tree_node.setInt("size", 1+ Z._().Tree_node.getInt("size"));
|
||||
Z.z().Tree_node.getArrayOfPtr("list").plus(Z.z().Tree_node.getInt("size")).setPtr(agtail(e));
|
||||
Z.z().Tree_node.setInt("size", 1+ Z.z().Tree_node.getInt("size"));
|
||||
}
|
||||
|
||||
if (ND_mark(aghead(e)) == 0) {
|
||||
Z._().Tree_node.getArrayOfPtr("list").plus(Z._().Tree_node.getInt("size")).setPtr(aghead(e));
|
||||
Z._().Tree_node.setInt("size", 1+ Z._().Tree_node.getInt("size"));
|
||||
Z.z().Tree_node.getArrayOfPtr("list").plus(Z.z().Tree_node.getInt("size")).setPtr(aghead(e));
|
||||
Z.z().Tree_node.setInt("size", 1+ Z.z().Tree_node.getInt("size"));
|
||||
}
|
||||
n = agtail(e);
|
||||
ND_mark(n, 1);
|
||||
@ -829,7 +829,7 @@ try {
|
||||
int i, j;
|
||||
Agnode_s n;
|
||||
ED_tree_index(f, ED_tree_index(e));
|
||||
Z._().Tree_edge.getArrayOfPtr("list").plus(ED_tree_index(e)).setPtr(f);
|
||||
Z.z().Tree_edge.getArrayOfPtr("list").plus(ED_tree_index(e)).setPtr(f);
|
||||
ED_tree_index(e, -1);
|
||||
n = agtail(e);
|
||||
ND_tree_out(n).setInt("size", ND_tree_out(n).getInt("size") -1);
|
||||
@ -872,9 +872,9 @@ try {
|
||||
nodequeue Q;
|
||||
Agnode_s v;
|
||||
Agedge_s e;
|
||||
Q = new_queue(Z._().N_nodes);
|
||||
Q = new_queue(Z.z().N_nodes);
|
||||
ctr = 0;
|
||||
for (v = GD_nlist(Z._().G_ns); v!=null; v = ND_next(v)) {
|
||||
for (v = GD_nlist(Z.z().G_ns); v!=null; v = ND_next(v)) {
|
||||
if (ND_priority(v) == 0)
|
||||
enqueue(Q, v);
|
||||
}
|
||||
@ -889,7 +889,7 @@ try {
|
||||
enqueue(Q, aghead(e));
|
||||
}
|
||||
}
|
||||
if (ctr != Z._().N_nodes) {
|
||||
if (ctr != Z.z().N_nodes) {
|
||||
UNSUPPORTED("7sgp99x1l3hzfks5wykxa87gf"); // agerr(AGERR, "trouble in init_rank\n");
|
||||
UNSUPPORTED("bwwunxmw4kgz6qntbn6xp0cur"); // for (v = (((Agraphinfo_t*)(((Agobj_t*)(G))->data))->nlist); v; v = (((Agnodeinfo_t*)(((Agobj_t*)(v))->data))->next))
|
||||
UNSUPPORTED("3dk132mz1u2pf0tla64kl6hv0"); // if ((((Agnodeinfo_t*)(((Agobj_t*)(v))->data))->priority))
|
||||
@ -932,32 +932,32 @@ ENTERING("4i9tcvid2iql874c6k70s9aqm","leave_edge");
|
||||
try {
|
||||
Agedge_s f, rv = null;
|
||||
int j, cnt = 0;
|
||||
j = Z._().S_i;
|
||||
while (Z._().S_i < Z._().Tree_edge.getInt("size")) {
|
||||
if (ED_cutvalue(f = (Agedge_s) Z._().Tree_edge.getArrayOfPtr("list").plus(Z._().S_i).getPtr()) < 0) {
|
||||
j = Z.z().S_i;
|
||||
while (Z.z().S_i < Z.z().Tree_edge.getInt("size")) {
|
||||
if (ED_cutvalue(f = (Agedge_s) Z.z().Tree_edge.getArrayOfPtr("list").plus(Z.z().S_i).getPtr()) < 0) {
|
||||
if (rv!=null) {
|
||||
if (ED_cutvalue(rv) > ED_cutvalue(f))
|
||||
rv = f;
|
||||
} else
|
||||
rv = (Agedge_s) Z._().Tree_edge.getArrayOfPtr("list").plus(Z._().S_i).getPtr();
|
||||
if (++cnt >= Z._().Search_size)
|
||||
rv = (Agedge_s) Z.z().Tree_edge.getArrayOfPtr("list").plus(Z.z().S_i).getPtr();
|
||||
if (++cnt >= Z.z().Search_size)
|
||||
return rv;
|
||||
}
|
||||
Z._().S_i++;
|
||||
Z.z().S_i++;
|
||||
}
|
||||
if (j > 0) {
|
||||
Z._().S_i = 0;
|
||||
while (Z._().S_i < j) {
|
||||
if (ED_cutvalue(f = (Agedge_s) Z._().Tree_edge.getArrayOfPtr("list").plus(Z._().S_i).getPtr()) < 0) {
|
||||
Z.z().S_i = 0;
|
||||
while (Z.z().S_i < j) {
|
||||
if (ED_cutvalue(f = (Agedge_s) Z.z().Tree_edge.getArrayOfPtr("list").plus(Z.z().S_i).getPtr()) < 0) {
|
||||
if (rv!=null) {
|
||||
if (ED_cutvalue(rv) > ED_cutvalue(f))
|
||||
rv = f;
|
||||
} else
|
||||
rv = (Agedge_s) Z._().Tree_edge.getArrayOfPtr("list").plus(Z._().S_i).getPtr();
|
||||
if (++cnt >= Z._().Search_size)
|
||||
rv = (Agedge_s) Z.z().Tree_edge.getArrayOfPtr("list").plus(Z.z().S_i).getPtr();
|
||||
if (++cnt >= Z.z().Search_size)
|
||||
return rv;
|
||||
}
|
||||
Z._().S_i++;
|
||||
Z.z().S_i++;
|
||||
}
|
||||
}
|
||||
return rv;
|
||||
@ -986,17 +986,17 @@ try {
|
||||
Agedge_s e;
|
||||
for (i = 0; (e = (Agedge_s) ND_out(v).getArrayOfPtr("list").plus(i).getPtr())!=null; i++) {
|
||||
if (TREE_EDGE(e) == false) {
|
||||
if (N(SEQ(Z._().Low, ND_lim(aghead(e)), Z._().Lim))) {
|
||||
if (N(SEQ(Z.z().Low, ND_lim(aghead(e)), Z.z().Lim))) {
|
||||
slack = SLACK(e);
|
||||
if ((slack < Z._().Slack) || (Z._().Enter == null)) {
|
||||
Z._().Enter = e;
|
||||
Z._().Slack = slack;
|
||||
if ((slack < Z.z().Slack) || (Z.z().Enter == null)) {
|
||||
Z.z().Enter = e;
|
||||
Z.z().Slack = slack;
|
||||
}
|
||||
}
|
||||
} else if (ND_lim(aghead(e)) < ND_lim(v))
|
||||
dfs_enter_outedge(aghead(e));
|
||||
}
|
||||
for (i = 0; (e = (Agedge_s) ND_tree_in(v).getArrayOfPtr("list").plus(i).getPtr())!=null && (Z._().Slack > 0); i++)
|
||||
for (i = 0; (e = (Agedge_s) ND_tree_in(v).getArrayOfPtr("list").plus(i).getPtr())!=null && (Z.z().Slack > 0); i++)
|
||||
if (ND_lim(agtail(e)) < ND_lim(v))
|
||||
dfs_enter_outedge(agtail(e));
|
||||
} finally {
|
||||
@ -1016,17 +1016,17 @@ try {
|
||||
Agedge_s e;
|
||||
for (i = 0; (e = (Agedge_s) ND_in(v).getArrayOfPtr("list").plus(i).getPtr())!=null; i++) {
|
||||
if (TREE_EDGE(e) == false) {
|
||||
if (N(SEQ(Z._().Low, ND_lim(agtail(e)), Z._().Lim))) {
|
||||
if (N(SEQ(Z.z().Low, ND_lim(agtail(e)), Z.z().Lim))) {
|
||||
slack = SLACK(e);
|
||||
if ((slack < Z._().Slack) || (Z._().Enter == null)) {
|
||||
Z._().Enter = e;
|
||||
Z._().Slack = slack;
|
||||
if ((slack < Z.z().Slack) || (Z.z().Enter == null)) {
|
||||
Z.z().Enter = e;
|
||||
Z.z().Slack = slack;
|
||||
}
|
||||
}
|
||||
} else if (ND_lim(agtail(e)) < ND_lim(v))
|
||||
dfs_enter_inedge(agtail(e));
|
||||
}
|
||||
for (i = 0; (e = (Agedge_s) ND_tree_out(v).getArrayOfPtr("list").plus(i).getPtr())!=null && (Z._().Slack > 0); i++)
|
||||
for (i = 0; (e = (Agedge_s) ND_tree_out(v).getArrayOfPtr("list").plus(i).getPtr())!=null && (Z.z().Slack > 0); i++)
|
||||
if (ND_lim(aghead(e)) < ND_lim(v))
|
||||
dfs_enter_inedge(aghead(e));
|
||||
} finally {
|
||||
@ -1052,15 +1052,15 @@ try {
|
||||
v = aghead(e);
|
||||
outsearch = 1;
|
||||
}
|
||||
Z._().Enter = null;
|
||||
Z._().Slack = INT_MAX;
|
||||
Z._().Low = ND_low(v);
|
||||
Z._().Lim = ND_lim(v);
|
||||
Z.z().Enter = null;
|
||||
Z.z().Slack = INT_MAX;
|
||||
Z.z().Low = ND_low(v);
|
||||
Z.z().Lim = ND_lim(v);
|
||||
if (outsearch!=0)
|
||||
dfs_enter_outedge(v);
|
||||
else
|
||||
dfs_enter_inedge(v);
|
||||
return Z._().Enter;
|
||||
return Z.z().Enter;
|
||||
} finally {
|
||||
LEAVING("aeu2po1o1rvibmafk0k8dw0fh","enter_edge");
|
||||
}
|
||||
@ -1079,14 +1079,14 @@ try {
|
||||
for (i = 0; (e = (Agedge_s) ND_out(v).getArrayOfPtr("list").plus(i).getPtr())!=null; i++) {
|
||||
if ((ND_mark(aghead(e)) == 0) && (SLACK(e) == 0)) {
|
||||
add_tree_edge(e);
|
||||
if ((Z._().Tree_edge.getInt("size") == Z._().N_nodes - 1) || treesearch(aghead(e)))
|
||||
if ((Z.z().Tree_edge.getInt("size") == Z.z().N_nodes - 1) || treesearch(aghead(e)))
|
||||
return NOT(0);
|
||||
}
|
||||
}
|
||||
for (i = 0; (e = (Agedge_s) ND_in(v).getArrayOfPtr("list").plus(i).getPtr())!=null; i++) {
|
||||
if ((ND_mark(agtail(e)) == 0) && (SLACK(e) == 0)) {
|
||||
add_tree_edge(e);
|
||||
if ((Z._().Tree_edge.getInt("size") == Z._().N_nodes - 1) || treesearch(agtail(e)))
|
||||
if ((Z.z().Tree_edge.getInt("size") == Z.z().N_nodes - 1) || treesearch(agtail(e)))
|
||||
return NOT(0);
|
||||
}
|
||||
}
|
||||
@ -1106,20 +1106,20 @@ ENTERING("c98bj1u8j43cdezeczn33mec0","tight_tree");
|
||||
try {
|
||||
int i;
|
||||
Agnode_s n;
|
||||
for (n = GD_nlist(Z._().G_ns); n!=null; n = ND_next(n)) {
|
||||
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
|
||||
ND_mark(n, 0);
|
||||
ND_tree_in(n).getArrayOfPtr("list").plus(0).setPtr(null);
|
||||
ND_tree_out(n).getArrayOfPtr("list").plus(0).setPtr(null);
|
||||
ND_tree_in(n).setInt("size", 0);
|
||||
ND_tree_out(n).setInt("size", 0);
|
||||
}
|
||||
for (i = 0; i < Z._().Tree_edge.getInt("size"); i++)
|
||||
ED_tree_index(Z._().Tree_edge.getArrayOfPtr("list").plus(i).getPtr(), -1);
|
||||
Z._().Tree_node.setInt("size", 0);
|
||||
Z._().Tree_edge.setInt("size", 0);
|
||||
for (n = GD_nlist(Z._().G_ns); n!=null && (Z._().Tree_edge.getInt("size") == 0); n = ND_next(n))
|
||||
for (i = 0; i < Z.z().Tree_edge.getInt("size"); i++)
|
||||
ED_tree_index(Z.z().Tree_edge.getArrayOfPtr("list").plus(i).getPtr(), -1);
|
||||
Z.z().Tree_node.setInt("size", 0);
|
||||
Z.z().Tree_edge.setInt("size", 0);
|
||||
for (n = GD_nlist(Z.z().G_ns); n!=null && (Z.z().Tree_edge.getInt("size") == 0); n = ND_next(n))
|
||||
treesearch(n);
|
||||
return Z._().Tree_node.getInt("size");
|
||||
return Z.z().Tree_node.getInt("size");
|
||||
} finally {
|
||||
LEAVING("c98bj1u8j43cdezeczn33mec0","tight_tree");
|
||||
}
|
||||
@ -1133,8 +1133,8 @@ LEAVING("c98bj1u8j43cdezeczn33mec0","tight_tree");
|
||||
public static void init_cutvalues() {
|
||||
ENTERING("10o7oe8d097fx7swmpqd4tf0h","init_cutvalues");
|
||||
try {
|
||||
dfs_range(GD_nlist(Z._().G_ns), null, 1);
|
||||
dfs_cutval(GD_nlist(Z._().G_ns), null);
|
||||
dfs_range(GD_nlist(Z.z().G_ns), null, 1);
|
||||
dfs_cutval(GD_nlist(Z.z().G_ns), null);
|
||||
} finally {
|
||||
LEAVING("10o7oe8d097fx7swmpqd4tf0h","init_cutvalues");
|
||||
}
|
||||
@ -1151,11 +1151,11 @@ try {
|
||||
int i, delta;
|
||||
Agnode_s n;
|
||||
Agedge_s e, f;
|
||||
if (Z._().N_nodes <= 1)
|
||||
if (Z.z().N_nodes <= 1)
|
||||
return 0;
|
||||
while (tight_tree() < Z._().N_nodes) {
|
||||
while (tight_tree() < Z.z().N_nodes) {
|
||||
e = null;
|
||||
for (n = GD_nlist(Z._().G_ns); n!=null; n = ND_next(n)) {
|
||||
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
|
||||
for (i = 0; (f = (Agedge_s) ND_out(n).getArrayOfPtr("list").plus(i).getPtr())!=null; i++) {
|
||||
if ((TREE_EDGE(f) == false) && incident(f)!=null && ((e == null)
|
||||
|| (SLACK(f)
|
||||
@ -1170,8 +1170,8 @@ try {
|
||||
if (delta!=0) {
|
||||
if (EQ(incident(e), aghead(e)))
|
||||
delta = -delta;
|
||||
for (i = 0; i < Z._().Tree_node.getInt("size"); i++)
|
||||
ND_rank(Z._().Tree_node.getArrayOfPtr("list").plus(i).getPtr(), ND_rank(Z._().Tree_node.getArrayOfPtr("list").plus(i).getPtr()) + delta);
|
||||
for (i = 0; i < Z.z().Tree_node.getInt("size"); i++)
|
||||
ND_rank(Z.z().Tree_node.getArrayOfPtr("list").plus(i).getPtr(), ND_rank(Z.z().Tree_node.getArrayOfPtr("list").plus(i).getPtr()) + delta);
|
||||
}
|
||||
} else {
|
||||
return 1;
|
||||
@ -1290,19 +1290,19 @@ public static void scan_and_normalize() {
|
||||
ENTERING("3yw7w42hz7af67d6qse3b2172","scan_and_normalize");
|
||||
try {
|
||||
Agnode_s n;
|
||||
Z._().Minrank = Integer.MAX_VALUE;
|
||||
Z._().Maxrank = -Integer.MAX_VALUE;
|
||||
for (n = GD_nlist(Z._().G_ns); n!=null; n = ND_next(n)) {
|
||||
Z.z().Minrank = Integer.MAX_VALUE;
|
||||
Z.z().Maxrank = -Integer.MAX_VALUE;
|
||||
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
|
||||
if (ND_node_type(n) == 0) {
|
||||
Z._().Minrank = MIN(Z._().Minrank, ND_rank(n));
|
||||
Z._().Maxrank = MAX(Z._().Maxrank, ND_rank(n));
|
||||
Z.z().Minrank = MIN(Z.z().Minrank, ND_rank(n));
|
||||
Z.z().Maxrank = MAX(Z.z().Maxrank, ND_rank(n));
|
||||
}
|
||||
}
|
||||
if (Z._().Minrank != 0) {
|
||||
for (n = GD_nlist(Z._().G_ns); n!=null; n = ND_next(n))
|
||||
ND_rank(n, ND_rank(n) - Z._().Minrank);
|
||||
Z._().Maxrank -= Z._().Minrank;
|
||||
Z._().Minrank = 0;
|
||||
if (Z.z().Minrank != 0) {
|
||||
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n))
|
||||
ND_rank(n, ND_rank(n) - Z.z().Minrank);
|
||||
Z.z().Maxrank -= Z.z().Minrank;
|
||||
Z.z().Minrank = 0;
|
||||
}
|
||||
} finally {
|
||||
LEAVING("3yw7w42hz7af67d6qse3b2172","scan_and_normalize");
|
||||
@ -1318,7 +1318,7 @@ public static void freeTreeList(Agraph_s g) {
|
||||
ENTERING("7eg6zti36nbg4tqyo8yunh86r","freeTreeList");
|
||||
try {
|
||||
Agnode_s n;
|
||||
for (n = GD_nlist(Z._().G_ns); n!=null; n = ND_next(n)) {
|
||||
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
|
||||
free_list(ND_tree_in(n));
|
||||
free_list(ND_tree_out(n));
|
||||
ND_mark(n, 0);
|
||||
@ -1338,8 +1338,8 @@ ENTERING("9gx8p7md3v3mzp640xdjj814a","LR_balance");
|
||||
try {
|
||||
int i, delta;
|
||||
Agedge_s e, f;
|
||||
for (i = 0; i < Z._().Tree_edge.getInt("size"); i++) {
|
||||
e = (Agedge_s) Z._().Tree_edge.getArrayOfPtr("list").plus(i).getPtr();
|
||||
for (i = 0; i < Z.z().Tree_edge.getInt("size"); i++) {
|
||||
e = (Agedge_s) Z.z().Tree_edge.getArrayOfPtr("list").plus(i).getPtr();
|
||||
if (ED_cutvalue(e) == 0) {
|
||||
f = enter_edge(e);
|
||||
if (f == null)
|
||||
@ -1353,7 +1353,7 @@ try {
|
||||
rerank(aghead(e), -delta / 2);
|
||||
}
|
||||
}
|
||||
freeTreeList (Z._().G_ns);
|
||||
freeTreeList (Z.z().G_ns);
|
||||
} finally {
|
||||
LEAVING("9gx8p7md3v3mzp640xdjj814a","LR_balance");
|
||||
}
|
||||
@ -1374,18 +1374,18 @@ try {
|
||||
int inweight, outweight;
|
||||
scan_and_normalize();
|
||||
/* find nodes that are not tight and move to less populated ranks */
|
||||
nrank = zmalloc(size_t_array_of_integer(Z._().Maxrank + 1));
|
||||
for (i = 0; i <= Z._().Maxrank; i++)
|
||||
nrank = zmalloc(size_t_array_of_integer(Z.z().Maxrank + 1));
|
||||
for (i = 0; i <= Z.z().Maxrank; i++)
|
||||
nrank.plus(i).setInt(0);
|
||||
for (n = GD_nlist(Z._().G_ns); n!=null; n = ND_next(n))
|
||||
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n))
|
||||
if (ND_node_type(n) == 0)
|
||||
nrank.plus(ND_rank(n)).setInt(1+nrank.plus(ND_rank(n)).getInt());
|
||||
for (n = GD_nlist(Z._().G_ns); n!=null; n = ND_next(n)) {
|
||||
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
|
||||
if (ND_node_type(n) != 0)
|
||||
continue;
|
||||
inweight = outweight = 0;
|
||||
low = 0;
|
||||
high = Z._().Maxrank;
|
||||
high = Z.z().Maxrank;
|
||||
for (i = 0; (e = (Agedge_s) ND_in(n).getArrayOfPtr("list").plus(i).getPtr())!=null; i++) {
|
||||
inweight += ED_weight(e);
|
||||
low = MAX(low, ND_rank(agtail(e)) + ED_minlen(e));
|
||||
@ -1426,18 +1426,18 @@ try {
|
||||
int i, feasible;
|
||||
Agnode_s n;
|
||||
Agedge_s e;
|
||||
Z._().G_ns = g;
|
||||
Z._().N_nodes = Z._().N_edges = Z._().S_i = 0;
|
||||
Z.z().G_ns = g;
|
||||
Z.z().N_nodes = Z.z().N_edges = Z.z().S_i = 0;
|
||||
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
|
||||
ND_mark(n, 0);
|
||||
Z._().N_nodes++;
|
||||
Z.z().N_nodes++;
|
||||
for (i = 0; (e = (Agedge_s) ND_out(n).getArrayOfPtr("list").plus(i).getPtr())!=null; i++)
|
||||
Z._().N_edges++;
|
||||
Z.z().N_edges++;
|
||||
}
|
||||
Z._().Tree_node.setPtr("list", ALLOC_empty(Z._().N_nodes, Z._().Tree_node.getPtr("list"), Agnode_s.class));
|
||||
Z._().Tree_node.setInt("size", 0);
|
||||
Z._().Tree_edge.setPtr("list", ALLOC_empty(Z._().N_nodes, Z._().Tree_edge.getPtr("list"), Agedge_s.class));
|
||||
Z._().Tree_edge.setInt("size", 0);
|
||||
Z.z().Tree_node.setPtr("list", ALLOC_empty(Z.z().N_nodes, Z.z().Tree_node.getPtr("list"), Agnode_s.class));
|
||||
Z.z().Tree_node.setInt("size", 0);
|
||||
Z.z().Tree_edge.setPtr("list", ALLOC_empty(Z.z().N_nodes, Z.z().Tree_edge.getPtr("list"), Agedge_s.class));
|
||||
Z.z().Tree_edge.setInt("size", 0);
|
||||
feasible = 1;
|
||||
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
|
||||
ND_priority(n, 0);
|
||||
@ -1513,9 +1513,9 @@ try {
|
||||
return 1;
|
||||
}
|
||||
if (search_size >= 0)
|
||||
Z._().Search_size = search_size;
|
||||
Z.z().Search_size = search_size;
|
||||
else
|
||||
Z._().Search_size = 30;
|
||||
Z.z().Search_size = 30;
|
||||
if (setjmp (jbuf)!=0) {
|
||||
return 2;
|
||||
}
|
||||
@ -1546,7 +1546,7 @@ try {
|
||||
break;
|
||||
default:
|
||||
scan_and_normalize();
|
||||
freeTreeList (Z._().G_ns);
|
||||
freeTreeList (Z.z().G_ns);
|
||||
break;
|
||||
}
|
||||
/*if (Verbose) {
|
||||
|
@ -747,9 +747,9 @@ return map_point_w_(p.copy()).copy();
|
||||
private static __struct__<pointf> map_point_w_(final __struct__<pointf> p) {
|
||||
ENTERING("dajapw16wus3rwimkrk5ihi2b","map_point");
|
||||
try {
|
||||
p.____(ccwrotatepf(p, Z._().Rankdir * 90));
|
||||
p.setDouble("x", p.getDouble("x") - Z._().Offset.getDouble("x"));
|
||||
p.setDouble("y", p.getDouble("y") - Z._().Offset.getDouble("y"));
|
||||
p.____(ccwrotatepf(p, Z.z().Rankdir * 90));
|
||||
p.setDouble("x", p.getDouble("x") - Z.z().Offset.getDouble("x"));
|
||||
p.setDouble("y", p.getDouble("y") - Z.z().Offset.getDouble("y"));
|
||||
return p;
|
||||
} finally {
|
||||
LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
|
||||
@ -767,7 +767,7 @@ try {
|
||||
int j, k;
|
||||
final __struct__<bezier> bz = __struct__.from(bezier.class);
|
||||
if (ED_spl(e) == null) {
|
||||
if ((Z._().Concentrate == false) && (ED_edge_type(e) != 6))
|
||||
if ((Z.z().Concentrate == false) && (ED_edge_type(e) != 6))
|
||||
System.err.println("lost %s %s edge\n"+ agnameof(agtail(e))+
|
||||
agnameof(aghead(e)));
|
||||
return;
|
||||
@ -836,16 +836,16 @@ ENTERING("h4i5qxnd7hlrew919abswd13","translate_drawing");
|
||||
try {
|
||||
Agnode_s v;
|
||||
Agedge_s e;
|
||||
boolean shift = (Z._().Offset.getDouble("x")!=0.0 || Z._().Offset.getDouble("y")!=0.0);
|
||||
if (N(shift) && N(Z._().Rankdir))
|
||||
boolean shift = (Z.z().Offset.getDouble("x")!=0.0 || Z.z().Offset.getDouble("y")!=0.0);
|
||||
if (N(shift) && N(Z.z().Rankdir))
|
||||
return;
|
||||
for (v = agfstnode(g); v!=null; v = agnxtnode(g, v)) {
|
||||
if (Z._().Rankdir!=0)
|
||||
if (Z.z().Rankdir!=0)
|
||||
UNSUPPORTED("e0j848r4j1j7sojfht5gwikvi"); // gv_nodesize(v, 0);
|
||||
ND_coord(v).____(map_point(ND_coord(v)));
|
||||
if (ND_xlabel(v)!=null)
|
||||
UNSUPPORTED("3fy0l7w2v24hzrvlpstpknwl7"); // ND_xlabel(v)->pos = map_point(ND_xlabel(v)->pos);
|
||||
if (Z._().State == 1)
|
||||
if (Z.z().State == 1)
|
||||
for (e = agfstout(g, v); e!=null; e = agnxtout(g, e))
|
||||
map_edge(e);
|
||||
}
|
||||
@ -1166,7 +1166,7 @@ try {
|
||||
N(GD_has_labels(gp) & (1 << 5)) &&
|
||||
N(GD_has_labels(gp) & (1 << 2)) &&
|
||||
N(GD_has_labels(gp) & (1 << 1)) &&
|
||||
(N(GD_has_labels(gp) & (1 << 0)) || Z._().EdgeLabelsDone!=0))
|
||||
(N(GD_has_labels(gp) & (1 << 0)) || Z.z().EdgeLabelsDone!=0))
|
||||
return;
|
||||
UNSUPPORTED("27ppdplfezcqw6rdrkzyrr8yg"); // for (np = agfstnode(gp); np; np = agnxtnode(gp, np)) {
|
||||
UNSUPPORTED("eezvruvdh9ueqsgad8k5xzbqi"); // if (ND_xlabel(np)) {
|
||||
@ -1340,10 +1340,10 @@ ENTERING("8fc0zxg8y7hec3n4evx3jw6cq","gv_postprocess");
|
||||
try {
|
||||
double diff;
|
||||
final __struct__<pointf> dimen = __struct__.from(pointf.class);
|
||||
Z._().Rankdir = GD_rankdir(g);
|
||||
Z._().Flip = GD_flip(g)!=0;
|
||||
Z.z().Rankdir = GD_rankdir(g);
|
||||
Z.z().Flip = GD_flip(g)!=0;
|
||||
/* Handle cluster labels */
|
||||
if (Z._().Flip)
|
||||
if (Z.z().Flip)
|
||||
UNSUPPORTED("4hxky2sp978rmy6018sfmts6m"); // place_flip_graph_label(g);
|
||||
else
|
||||
place_graph_label(g);
|
||||
@ -1388,9 +1388,9 @@ UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
|
||||
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
|
||||
}
|
||||
if (allowTranslation!=0) {
|
||||
switch (Z._().Rankdir) {
|
||||
switch (Z.z().Rankdir) {
|
||||
case 0:
|
||||
Z._().Offset.____(GD_bb(g).getStruct("LL"));
|
||||
Z.z().Offset.____(GD_bb(g).getStruct("LL"));
|
||||
break;
|
||||
case 1:
|
||||
UNSUPPORTED("5t3j9lrc86kd5ouaqgzvz3qcm"); // Offset = pointfof(-GD_bb(g).UR.y, GD_bb(g).LL.x);
|
||||
@ -1406,7 +1406,7 @@ UNSUPPORTED("3xtu7zkpqq7nsx9oe68oi6ebt"); // Offset = pointfof(GD_bb(g).LL.
|
||||
}
|
||||
if (GD_label(g)!=null && N(GD_label(g).getPtr("set")))
|
||||
UNSUPPORTED("6dds0zsvqw48u510zcy954fh1"); // place_root_label(g, dimen);
|
||||
if (Z._().Show_boxes!=null) {
|
||||
if (Z.z().Show_boxes!=null) {
|
||||
UNSUPPORTED("8c7x8di5w36ib05qan9z4sl9"); // char buf[BUFSIZ];
|
||||
UNSUPPORTED("83qqprhiseoxlwtwi991aag0c"); // if (Flip)
|
||||
UNSUPPORTED("86tova7pv19alt02nlk0d17oj"); // sprintf(buf, "/pathbox {\n /X exch neg %.5g sub def\n /Y exch %.5g sub def\n /x exch neg %.5g sub def\n /y exch %.5g sub def\n newpath x y moveto\n X y lineto\n X Y lineto\n x Y lineto\n closepath stroke\n} def\n", Offset.x, Offset.y, Offset.x, Offset.y);
|
||||
|
@ -770,28 +770,28 @@ try {
|
||||
if (polyline)
|
||||
make_polyline (pl, spl.amp());
|
||||
else {
|
||||
if (poly.getInt("pn") > Z._().edgen) {
|
||||
Z._().edges = ALLOC(poly.getInt("pn"), Z._().edges, Pedge_t.class);
|
||||
Z._().edgen = poly.getInt("pn");
|
||||
if (poly.getInt("pn") > Z.z().edgen) {
|
||||
Z.z().edges = ALLOC(poly.getInt("pn"), Z.z().edges, Pedge_t.class);
|
||||
Z.z().edgen = poly.getInt("pn");
|
||||
}
|
||||
for (i = 0; i < poly.getInt("pn"); i++) {
|
||||
Z._().edges.plus(i).setStruct("a", poly.getArrayOfStruct("ps").plus(i).getStruct());
|
||||
Z._().edges.plus(i).setStruct("b", poly.getArrayOfStruct("ps").plus((i + 1) % poly.getInt("pn")).getStruct());
|
||||
Z.z().edges.plus(i).setStruct("a", poly.getArrayOfStruct("ps").plus(i).getStruct());
|
||||
Z.z().edges.plus(i).setStruct("b", poly.getArrayOfStruct("ps").plus((i + 1) % poly.getInt("pn")).getStruct());
|
||||
}
|
||||
evs.plus(0).setDouble("x", 0);
|
||||
evs.plus(0).setDouble("y", 0);
|
||||
evs.plus(1).setDouble("x", 0);
|
||||
evs.plus(1).setDouble("y", 0);
|
||||
if (Proutespline(Z._().edges, poly.getInt("pn"), pl, evs.asPtr(), spl.amp()) < 0)
|
||||
if (Proutespline(Z.z().edges, poly.getInt("pn"), pl, evs.asPtr(), spl.amp()) < 0)
|
||||
return null;
|
||||
}
|
||||
if (mkspacep(spl.getInt("pn")))
|
||||
return null;
|
||||
for (i = 0; i < spl.getInt("pn"); i++) {
|
||||
Z._().ps.plus(i).setStruct(spl.getArrayOfPtr("ps").plus(i).getStruct());
|
||||
Z.z().ps.plus(i).setStruct(spl.getArrayOfPtr("ps").plus(i).getStruct());
|
||||
}
|
||||
n_spl_pts[0] = spl.getInt("pn");
|
||||
return (pointf) Z._().ps;
|
||||
return (pointf) Z.z().ps;
|
||||
} finally {
|
||||
LEAVING("7ebl6qohcfpf1b9ucih5r9qgp","simpleSplineRoute");
|
||||
}
|
||||
@ -805,14 +805,14 @@ LEAVING("7ebl6qohcfpf1b9ucih5r9qgp","simpleSplineRoute");
|
||||
public static int routesplinesinit() {
|
||||
ENTERING("bfsrazjf3vkf12stnke48vc8t","routesplinesinit");
|
||||
try {
|
||||
if (++Z._().routeinit > 1) return 0;
|
||||
if (N(Z._().ps = gmalloc(sizeof(pointf.class, 300)))) {
|
||||
if (++Z.z().routeinit > 1) return 0;
|
||||
if (N(Z.z().ps = gmalloc(sizeof(pointf.class, 300)))) {
|
||||
UNSUPPORTED("2qoo3na2ur9oh7hmvt6xv1txd"); // agerr(AGERR, "routesplinesinit: cannot allocate ps\n");
|
||||
UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
|
||||
}
|
||||
Z._().maxpn = 300;
|
||||
Z._().nedges = 0;
|
||||
Z._().nboxes = 0;
|
||||
Z.z().maxpn = 300;
|
||||
Z.z().nedges = 0;
|
||||
Z.z().nboxes = 0;
|
||||
/*if (Verbose)
|
||||
start_timer();*/
|
||||
return 0;
|
||||
@ -829,8 +829,8 @@ LEAVING("bfsrazjf3vkf12stnke48vc8t","routesplinesinit");
|
||||
public static void routesplinesterm() {
|
||||
ENTERING("55j3tny5cxemrsvrt3m21jxg8","routesplinesterm");
|
||||
try {
|
||||
if (--Z._().routeinit > 0) return;
|
||||
Memory.free(Z._().ps);
|
||||
if (--Z.z().routeinit > 0) return;
|
||||
Memory.free(Z.z().ps);
|
||||
/*if (Verbose)
|
||||
fprintf(stderr,
|
||||
"routesplines: %d edges, %d boxes %.2f sec\n",
|
||||
@ -909,8 +909,8 @@ try {
|
||||
int flip;
|
||||
int loopcnt, delta = 10;
|
||||
boolean unbounded;
|
||||
Z._().nedges++;
|
||||
Z._().nboxes += pp.getInt("nbox");
|
||||
Z.z().nedges++;
|
||||
Z.z().nboxes += pp.getInt("nbox");
|
||||
for (realedge = (Agedge_s) pp.getPtr("data").castTo(Agedge_s.class);
|
||||
realedge!=null && ED_edge_type(realedge) != 0;
|
||||
realedge = ED_to_orig(realedge));
|
||||
@ -922,9 +922,9 @@ try {
|
||||
boxn = pp.getInt("nbox");
|
||||
if (checkpath(boxn, boxes, pp)!=0)
|
||||
return null;
|
||||
if (boxn * 8 > Z._().polypointn) {
|
||||
Z._().polypoints = ALLOC_allocated2(boxn * 8, Z._().polypoints, pointf.class);
|
||||
Z._().polypointn = boxn * 8;
|
||||
if (boxn * 8 > Z.z().polypointn) {
|
||||
Z.z().polypoints = ALLOC_allocated2(boxn * 8, Z.z().polypoints, pointf.class);
|
||||
Z.z().polypointn = boxn * 8;
|
||||
}
|
||||
if ((boxn > 1) && (boxes.plus(0).getStruct().getStruct("LL").getDouble("y") > boxes.plus(1).getStruct().getStruct("LL").getDouble("y"))) {
|
||||
flip = 1;
|
||||
@ -946,15 +946,15 @@ try {
|
||||
next = (boxes.plus(bi+1).getStruct().getStruct("LL").getDouble("y") > boxes.plus(bi).getStruct().getStruct("LL").getDouble("y")) ? 1 : -1;
|
||||
if (prev != next) {
|
||||
if (next == -1 || prev == 1) {
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
} else {
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
}
|
||||
}
|
||||
else if (prev == 0) { /* single box */
|
||||
@ -978,15 +978,15 @@ UNSUPPORTED("9idk92zg2ysz316lfwzvvvde6"); // return NULL;
|
||||
next = (boxes.plus(bi-1).getStruct().getStruct("LL").getDouble("y") > boxes.plus(bi).getStruct().getStruct("LL").getDouble("y")) ? 1 : -1;
|
||||
if (prev != next) {
|
||||
if (next == -1 || prev == 1 ) {
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
} else {
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
}
|
||||
}
|
||||
else if (prev == 0) { /* single box */
|
||||
@ -1001,14 +1001,14 @@ UNSUPPORTED("87y5d0ts6xdjyx905bha50f3s"); // /* it went badly, e.g. degene
|
||||
UNSUPPORTED("1qt7hixteu3pt64wk1sqw352a"); // agerr(AGERR, "in routesplines, illegal values of prev %d and next %d, line %d\n", prev, next, 476);
|
||||
UNSUPPORTED("35untdbpd42pt4c74gjbxqx7q"); // return NULL; /* for correctness sake, it's best to just stop */
|
||||
}
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z._().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z._().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z.z().polypoints.plus(pi).setDouble("x", boxes.plus(bi).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z.z().polypoints.plus(pi++).setDouble("y", boxes.plus(bi).getStruct().getStruct("LL").getDouble("y"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1024,13 +1024,13 @@ UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL;
|
||||
boxes.plus(bi).getStruct().getStruct("LL").setDouble("y", -v);
|
||||
}
|
||||
for (i = 0; i < pi; i++)
|
||||
Z._().polypoints.plus(i).setDouble("y", -1 * Z._().polypoints.plus(i).getDouble("y"));
|
||||
Z.z().polypoints.plus(i).setDouble("y", -1 * Z.z().polypoints.plus(i).getDouble("y"));
|
||||
}
|
||||
for (bi = 0; bi < boxn; bi++) {
|
||||
boxes.plus(bi).getStruct().getStruct("LL").setDouble("x", INT_MAX);
|
||||
boxes.plus(bi).getStruct().getStruct("UR").setDouble("x", INT_MIN);
|
||||
}
|
||||
poly.setPtr("ps", Z._().polypoints);
|
||||
poly.setPtr("ps", Z.z().polypoints);
|
||||
poly.setInt("pn", pi);
|
||||
eps.plus(0).getStruct().setDouble("x", pp.getStruct("start").getStruct("p").getDouble("x"));
|
||||
eps.plus(0).getStruct().setDouble("y", pp.getStruct("start").getStruct("p").getDouble("y"));
|
||||
@ -1044,13 +1044,13 @@ UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL;
|
||||
UNSUPPORTED("48veztc3k9dfw8tqolu7jsktk"); // make_polyline (pl, &spl);
|
||||
}
|
||||
else {
|
||||
if (poly.getInt("pn") > Z._().edgen) {
|
||||
Z._().edges = ALLOC_allocated2(poly.getInt("pn"), Z._().edges, Pedge_t.class);
|
||||
Z._().edgen = poly.getInt("pn");
|
||||
if (poly.getInt("pn") > Z.z().edgen) {
|
||||
Z.z().edges = ALLOC_allocated2(poly.getInt("pn"), Z.z().edges, Pedge_t.class);
|
||||
Z.z().edgen = poly.getInt("pn");
|
||||
}
|
||||
for (edgei = 0; edgei < poly.getInt("pn"); edgei++) {
|
||||
Z._().edges.plus(edgei).setStruct("a", Z._().polypoints.plus(edgei).getStruct());
|
||||
Z._().edges.plus(edgei).setStruct("b", Z._().polypoints.plus((edgei + 1) % poly.getInt("pn")).getStruct());
|
||||
Z.z().edges.plus(edgei).setStruct("a", Z.z().polypoints.plus(edgei).getStruct());
|
||||
Z.z().edges.plus(edgei).setStruct("b", Z.z().polypoints.plus((edgei + 1) % poly.getInt("pn")).getStruct());
|
||||
}
|
||||
if (pp.getStruct("start").getBoolean("constrained")) {
|
||||
evs.plus(0).getStruct().setDouble("x", cos(pp.getStruct("start").getDouble("theta")));
|
||||
@ -1068,7 +1068,7 @@ UNSUPPORTED("48veztc3k9dfw8tqolu7jsktk"); // make_polyline (pl, &spl);
|
||||
evs.plus(1).getStruct().setDouble("x", 0);
|
||||
evs.plus(1).getStruct().setDouble("y", 0);
|
||||
}
|
||||
if (Proutespline(Z._().edges, poly.getInt("pn"), pl, evs.asPtr(), spl.amp()) < 0) {
|
||||
if (Proutespline(Z.z().edges, poly.getInt("pn"), pl, evs.asPtr(), spl.amp()) < 0) {
|
||||
UNSUPPORTED("elkeyywrfd4hq75w7toc94rzs"); // agerr(AGERR, "in routesplines, Proutespline failed\n");
|
||||
UNSUPPORTED("7t3fvwp9cv90qu5bdjdglcgtk"); // return NULL;
|
||||
}
|
||||
@ -1081,10 +1081,10 @@ UNSUPPORTED("7x5kpcbvg4va887hky7ufm45y"); // return NULL; /* Bailout if no mem
|
||||
}
|
||||
unbounded = NOT(false);
|
||||
for (splinepi = 0; splinepi < spl.getInt("pn"); splinepi++) {
|
||||
Z._().ps.plus(splinepi).setStruct(spl.getArrayOfPtr("ps").plus(splinepi).getStruct());
|
||||
Z.z().ps.plus(splinepi).setStruct(spl.getArrayOfPtr("ps").plus(splinepi).getStruct());
|
||||
}
|
||||
for (loopcnt = 0; unbounded && (loopcnt < 15); loopcnt++) {
|
||||
limitBoxes (boxes, boxn, Z._().ps, spl.getInt("pn"), delta);
|
||||
limitBoxes (boxes, boxn, Z.z().ps, spl.getInt("pn"), delta);
|
||||
/* The following check is necessary because if a box is not very
|
||||
* high, it is possible that the sampling above might miss it.
|
||||
* Therefore, we make the sample finer until all boxes have
|
||||
@ -1116,7 +1116,7 @@ UNSUPPORTED("7x5kpcbvg4va887hky7ufm45y"); // return NULL; /* Bailout if no mem
|
||||
Memory.free (polyspl.getPtr("ps"));
|
||||
}
|
||||
npoints[0] = spl.getInt("pn");
|
||||
return Z._().ps;
|
||||
return Z.z().ps;
|
||||
} finally {
|
||||
LEAVING("3mcnemqisisnqtd4mr72ej76y","_routesplines");
|
||||
}
|
||||
@ -1340,14 +1340,14 @@ LEAVING("dxqjhiid5f58b9gjxp0v3j97b","checkpath");
|
||||
public static boolean mkspacep(int size) {
|
||||
ENTERING("de6jvvw786rx88318tuuqywgq","mkspacep");
|
||||
try {
|
||||
if (size > Z._().maxpn) {
|
||||
int newmax = Z._().maxpn + (size / 300 + 1) * 300;
|
||||
Z._().ps = RALLOC(newmax, Z._().ps, pointf.class);
|
||||
if (N(Z._().ps)) {
|
||||
if (size > Z.z().maxpn) {
|
||||
int newmax = Z.z().maxpn + (size / 300 + 1) * 300;
|
||||
Z.z().ps = RALLOC(newmax, Z.z().ps, pointf.class);
|
||||
if (N(Z.z().ps)) {
|
||||
UNSUPPORTED("ds2v91aohji00tc7zmjuc3v6q"); // agerr(AGERR, "cannot re-allocate ps\n");
|
||||
UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); // return 1;
|
||||
}
|
||||
Z._().maxpn = newmax;
|
||||
Z.z().maxpn = newmax;
|
||||
}
|
||||
return false;
|
||||
} finally {
|
||||
|
@ -2603,8 +2603,8 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
|
||||
width = (ROUND((ND_width(n))*72));
|
||||
height = (ROUND((ND_height(n))*72));
|
||||
}
|
||||
peripheries = late_int(n, Z._().N_peripheries, peripheries, 0);
|
||||
orientation += late_double(n, Z._().N_orientation, 0.0, -360.0);
|
||||
peripheries = late_int(n, Z.z().N_peripheries, peripheries, 0);
|
||||
orientation += late_double(n, Z.z().N_orientation, 0.0, -360.0);
|
||||
if (sides == 0) { /* not for builtins */
|
||||
UNSUPPORTED("dd178b113cb8130tl6q70lcp3"); // skew = late_double(n, N_skew, 0.0, -100.0);
|
||||
UNSUPPORTED("cp83hdn3dp0a7rp9bauc3bgki"); // sides = late_int(n, N_sides, 4, 0);
|
||||
@ -2724,7 +2724,7 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
|
||||
/* at this point, bb is the minimum size of node that can hold the label */
|
||||
min_bb.____(bb);
|
||||
/* increase node size to width/height if needed */
|
||||
fxd = late_string(n, Z._().N_fixed, new CString("false"));
|
||||
fxd = late_string(n, Z.z().N_fixed, new CString("false"));
|
||||
if ((fxd.charAt(0) == 's') && (N(strcmp(fxd,new CString("shape"))))) {
|
||||
bb.setDouble("x", width);
|
||||
bb.setDouble("y", height);
|
||||
@ -2754,7 +2754,7 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
|
||||
bb.setDouble("y", width);
|
||||
}
|
||||
/* Compute space available for label. Provides the justification borders */
|
||||
if (N(mapbool(late_string(n, Z._().N_nojustify, new CString("false"))))) {
|
||||
if (N(mapbool(late_string(n, Z.z().N_nojustify, new CString("false"))))) {
|
||||
if (isBox) {
|
||||
ND_label(n).getStruct("space").setDouble("x", MAX(dimen.getDouble("x"),bb.getDouble("x")) - spacex);
|
||||
}
|
||||
@ -2981,12 +2981,12 @@ try {
|
||||
bbox.____(bp.getStruct());
|
||||
return INSIDE(P, bbox);
|
||||
}
|
||||
if (NEQ(n, Z._().lastn)) {
|
||||
if (NEQ(n, Z.z().lastn)) {
|
||||
double n_width = 0, n_height = 0;
|
||||
Z._().poly = (polygon_t) ND_shape_info(n);
|
||||
Z._().vertex = (pointf) Z._().poly.getPtr("vertices");
|
||||
Z._().sides = Z._().poly.getInt("sides");
|
||||
if ((Z._().poly.getInt("option") & (1 << 11))!=0) {
|
||||
Z.z().poly = (polygon_t) ND_shape_info(n);
|
||||
Z.z().vertex = (pointf) Z.z().poly.getPtr("vertices");
|
||||
Z.z().sides = Z.z().poly.getInt("sides");
|
||||
if ((Z.z().poly.getInt("option") & (1 << 11))!=0) {
|
||||
UNSUPPORTED("18yw1scg4sol8bhyf1vedj9kn"); // boxf bb = polyBB(poly);
|
||||
UNSUPPORTED("7rz7vxyxao0efec2nvd6g19m1"); // n_width = bb.UR.x - bb.LL.x;
|
||||
UNSUPPORTED("4h0k2wroz3xqx1ljokdbaqaad"); // n_height = bb.UR.y - bb.LL.y;
|
||||
@ -3004,62 +3004,62 @@ UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
|
||||
UNSUPPORTED("dapvd4c0ggliaqcj08jvao221"); // ysize = ND_lw(n) + ND_rw(n);
|
||||
UNSUPPORTED("8t3g4d9acruono62leh5a8hxh"); // xsize = ND_ht(n);
|
||||
} else {
|
||||
Z._().xsize = ND_lw(n) + ND_rw(n);
|
||||
Z._().ysize = ND_ht(n);
|
||||
Z.z().xsize = ND_lw(n) + ND_rw(n);
|
||||
Z.z().ysize = ND_ht(n);
|
||||
}
|
||||
n_width = (ROUND((ND_width(n))*72));
|
||||
n_height = (ROUND((ND_height(n))*72));
|
||||
}
|
||||
/* scale */
|
||||
if (Z._().xsize == 0.0)
|
||||
Z._().xsize = 1.0;
|
||||
if (Z._().ysize == 0.0)
|
||||
Z._().ysize = 1.0;
|
||||
Z._().scalex = n_width / Z._().xsize;
|
||||
Z._().scaley = n_height / Z._().ysize;
|
||||
Z._().box_URx = n_width / 2.0;
|
||||
Z._().box_URy = n_height / 2.0;
|
||||
if (Z.z().xsize == 0.0)
|
||||
Z.z().xsize = 1.0;
|
||||
if (Z.z().ysize == 0.0)
|
||||
Z.z().ysize = 1.0;
|
||||
Z.z().scalex = n_width / Z.z().xsize;
|
||||
Z.z().scaley = n_height / Z.z().ysize;
|
||||
Z.z().box_URx = n_width / 2.0;
|
||||
Z.z().box_URy = n_height / 2.0;
|
||||
/* index to outer-periphery */
|
||||
Z._().outp = (Z._().poly.getInt("peripheries") - 1) * Z._().sides;
|
||||
if (Z._().outp < 0)
|
||||
Z._().outp = 0;
|
||||
Z._().lastn = (Agnode_s) n;
|
||||
Z.z().outp = (Z.z().poly.getInt("peripheries") - 1) * Z.z().sides;
|
||||
if (Z.z().outp < 0)
|
||||
Z.z().outp = 0;
|
||||
Z.z().lastn = (Agnode_s) n;
|
||||
}
|
||||
/* scale */
|
||||
P.setDouble("x", P.getDouble("x") * Z._().scalex);
|
||||
P.setDouble("y", P.getDouble("y") * Z._().scaley);
|
||||
P.setDouble("x", P.getDouble("x") * Z.z().scalex);
|
||||
P.setDouble("y", P.getDouble("y") * Z.z().scaley);
|
||||
/* inside bounding box? */
|
||||
if ((fabs(P.getDouble("x")) > Z._().box_URx) || (fabs(P.getDouble("y")) > Z._().box_URy))
|
||||
if ((fabs(P.getDouble("x")) > Z.z().box_URx) || (fabs(P.getDouble("y")) > Z.z().box_URy))
|
||||
return false;
|
||||
/* ellipses */
|
||||
if (Z._().sides <= 2)
|
||||
return (hypot(P.getDouble("x") / Z._().box_URx, P.getDouble("y") / Z._().box_URy) < 1.);
|
||||
if (Z.z().sides <= 2)
|
||||
return (hypot(P.getDouble("x") / Z.z().box_URx, P.getDouble("y") / Z.z().box_URy) < 1.);
|
||||
/* use fast test in case we are converging on a segment */
|
||||
i = Z._().last % Z._().sides; /* in case last left over from larger polygon */
|
||||
i1 = (i + 1) % Z._().sides;
|
||||
Q.____(Z._().vertex.plus(i + Z._().outp).getStruct());
|
||||
R.____(Z._().vertex.plus(i1 + Z._().outp).getStruct());
|
||||
if (N(same_side(P, Z._().O, Q, R))) /* false if outside the segment's face */
|
||||
i = Z.z().last % Z.z().sides; /* in case last left over from larger polygon */
|
||||
i1 = (i + 1) % Z.z().sides;
|
||||
Q.____(Z.z().vertex.plus(i + Z.z().outp).getStruct());
|
||||
R.____(Z.z().vertex.plus(i1 + Z.z().outp).getStruct());
|
||||
if (N(same_side(P, Z.z().O, Q, R))) /* false if outside the segment's face */
|
||||
return false;
|
||||
/* else inside the segment face... */
|
||||
if ((s = same_side(P, Q, R, Z._().O)) && (same_side(P, R, Z._().O, Q))) /* true if between the segment's sides */
|
||||
if ((s = same_side(P, Q, R, Z.z().O)) && (same_side(P, R, Z.z().O, Q))) /* true if between the segment's sides */
|
||||
return NOT(0);
|
||||
/* else maybe in another segment */
|
||||
for (j = 1; j < Z._().sides; j++) { /* iterate over remaining segments */
|
||||
for (j = 1; j < Z.z().sides; j++) { /* iterate over remaining segments */
|
||||
if (s) { /* clockwise */
|
||||
i = i1;
|
||||
i1 = (i + 1) % Z._().sides;
|
||||
i1 = (i + 1) % Z.z().sides;
|
||||
} else { /* counter clockwise */
|
||||
i1 = i;
|
||||
i = (i + Z._().sides - 1) % Z._().sides;
|
||||
i = (i + Z.z().sides - 1) % Z.z().sides;
|
||||
}
|
||||
if (N(same_side(P, Z._().O, Z._().vertex.plus(i + Z._().outp).getStruct(), Z._().vertex.plus(i1 + Z._().outp).getStruct()))) { /* false if outside any other segment's face */
|
||||
Z._().last = i;
|
||||
if (N(same_side(P, Z.z().O, Z.z().vertex.plus(i + Z.z().outp).getStruct(), Z.z().vertex.plus(i1 + Z.z().outp).getStruct()))) { /* false if outside any other segment's face */
|
||||
Z.z().last = i;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/* inside all segments' faces */
|
||||
Z._().last = i; /* in case next edge is to same side */
|
||||
Z.z().last = i; /* in case next edge is to same side */
|
||||
return NOT(0);
|
||||
} finally {
|
||||
LEAVING("570t4xovyyfqipaikkf63crmk","poly_inside");
|
||||
@ -3429,7 +3429,7 @@ try {
|
||||
boxf bp;
|
||||
int sides; /* bitmap of which sides the port lies along */
|
||||
if (portname.charAt(0) == '\0')
|
||||
return Z._().Center.copy();
|
||||
return Z.z().Center.copy();
|
||||
UNSUPPORTED("cm99rhftfe8nq2suzac5fwbgp"); // if (compass == NULL)
|
||||
UNSUPPORTED("238a13tlawcw3bixwliz859y5"); // compass = "_";
|
||||
UNSUPPORTED("ci2ge3idao9rokpvacvcspaxl"); // sides = (1<<0) | (1<<1) | (1<<2) | (1<<3);
|
||||
@ -4591,7 +4591,7 @@ try {
|
||||
if (str!=null && UNSUPPORTED("!(*(name)==*(\"epsf\")&&!strcmp(name,\"epsf\"))")!=null)
|
||||
name = new CString("custom");
|
||||
if (N(name.charAt(0)=='c' && N(strcmp(name,new CString("custom"))))) {
|
||||
for (shape_desc ptr : Z._().Shapes) {
|
||||
for (shape_desc ptr : Z.z().Shapes) {
|
||||
if ((N(strcmp(ptr.getCString("name"),name)))) {
|
||||
rv = ptr;
|
||||
break;
|
||||
|
@ -1447,24 +1447,24 @@ try {
|
||||
fontinfo fi = (fontinfo) Memory.malloc(fontinfo.class);
|
||||
CString str;
|
||||
ND_width(n,
|
||||
late_double(n, Z._().N_width, 0.75, 0.01));
|
||||
late_double(n, Z.z().N_width, 0.75, 0.01));
|
||||
ND_height(n,
|
||||
late_double(n, Z._().N_height, 0.5, 0.02));
|
||||
late_double(n, Z.z().N_height, 0.5, 0.02));
|
||||
ND_shape(n,
|
||||
bind_shape(late_nnstring(n, Z._().N_shape, new CString("ellipse")), n));
|
||||
str = agxget(n, Z._().N_label);
|
||||
fi.setDouble("fontsize", late_double(n, Z._().N_fontsize, 14.0, 1.0));
|
||||
fi.setPtr("fontname", late_nnstring(n, Z._().N_fontname, new CString("Times-Roman")));
|
||||
fi.setPtr("fontcolor", late_nnstring(n, Z._().N_fontcolor, new CString("black")));
|
||||
bind_shape(late_nnstring(n, Z.z().N_shape, new CString("ellipse")), n));
|
||||
str = agxget(n, Z.z().N_label);
|
||||
fi.setDouble("fontsize", late_double(n, Z.z().N_fontsize, 14.0, 1.0));
|
||||
fi.setPtr("fontname", late_nnstring(n, Z.z().N_fontname, new CString("Times-Roman")));
|
||||
fi.setPtr("fontcolor", late_nnstring(n, Z.z().N_fontcolor, new CString("black")));
|
||||
ND_label(n, make_label(n, str,
|
||||
((aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)) | ( (shapeOf(n) == enumAsInt(shape_kind.class, "SH_RECORD")) ? (2 << 1) : (0 << 1))),
|
||||
fi.getDouble("fontsize"), fi.getCString("fontname"), fi.getCString("fontcolor")));
|
||||
if (Z._().N_xlabel!=null && (str = agxget(n, Z._().N_xlabel))!=null && (str.charAt(0)!='\0')) {
|
||||
if (Z.z().N_xlabel!=null && (str = agxget(n, Z.z().N_xlabel))!=null && (str.charAt(0)!='\0')) {
|
||||
UNSUPPORTED("4ua9vld76wpovsm1celv2ff6e"); // ND_xlabel(n) = make_label((void*)n, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
|
||||
UNSUPPORTED("b0zm6fkpjlt9jacykbgugjodg"); // fi.fontsize, fi.fontname, fi.fontcolor);
|
||||
UNSUPPORTED("ail0d4qmxj2aqh2q721inwgqu"); // GD_has_labels(agraphof(n)) |= (1 << 4);
|
||||
}
|
||||
ND_showboxes(n, late_int(n, Z._().N_showboxes, 0, 0));
|
||||
ND_showboxes(n, late_int(n, Z.z().N_showboxes, 0, 0));
|
||||
ND_shape(n).getPtr("fns").call("initfn", n);
|
||||
} finally {
|
||||
LEAVING("cr81drt18h5feqzxyh3jb0u49","common_init_node");
|
||||
@ -1479,9 +1479,9 @@ LEAVING("cr81drt18h5feqzxyh3jb0u49","common_init_node");
|
||||
public static void initFontEdgeAttr(Agedge_s e, fontinfo fi) {
|
||||
ENTERING("d2v8l80y27ue2fag5c0qplah8","initFontEdgeAttr");
|
||||
try {
|
||||
fi.setDouble("fontsize", late_double(e, Z._().E_fontsize, 14.0, 1.0));
|
||||
fi.setPtr("fontname", late_nnstring(e, Z._().E_fontname, new CString("Times-Roman")));
|
||||
fi.setPtr("fontcolor", late_nnstring(e, Z._().E_fontcolor, new CString("black")));
|
||||
fi.setDouble("fontsize", late_double(e, Z.z().E_fontsize, 14.0, 1.0));
|
||||
fi.setPtr("fontname", late_nnstring(e, Z.z().E_fontname, new CString("Times-Roman")));
|
||||
fi.setPtr("fontcolor", late_nnstring(e, Z.z().E_fontcolor, new CString("black")));
|
||||
} finally {
|
||||
LEAVING("d2v8l80y27ue2fag5c0qplah8","initFontEdgeAttr");
|
||||
}
|
||||
@ -1573,16 +1573,16 @@ try {
|
||||
Agraph_s sg = agraphof(agtail(e));
|
||||
fi.setPtr("fontname", null);
|
||||
lfi.setPtr("fontname", null);
|
||||
if (Z._().E_label!=null && (str = agxget(e, Z._().E_label))!=null && (str.charAt(0)!='\0')) {
|
||||
if (Z.z().E_label!=null && (str = agxget(e, Z.z().E_label))!=null && (str.charAt(0)!='\0')) {
|
||||
r = 1;
|
||||
initFontEdgeAttr(e, fi.amp());
|
||||
ED_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
|
||||
fi.getDouble("fontsize"), fi.getCString("fontname"), fi.getCString("fontcolor")));
|
||||
GD_has_labels(sg, GD_has_labels(sg) | (1 << 0));
|
||||
ED_label_ontop(e,
|
||||
mapbool(late_string(e, Z._().E_label_float, new CString("false"))));
|
||||
mapbool(late_string(e, Z.z().E_label_float, new CString("false"))));
|
||||
}
|
||||
if (Z._().E_xlabel!=null && (str = agxget(e, Z._().E_xlabel))!=null && (str.charAt(0)!='\0')) {
|
||||
if (Z.z().E_xlabel!=null && (str = agxget(e, Z.z().E_xlabel))!=null && (str.charAt(0)!='\0')) {
|
||||
UNSUPPORTED("1j3mhgq7abuh3n19q2jtjddbc"); // if (!fi.fontname)
|
||||
UNSUPPORTED("bmqo2g5g107quod3h31r8iudr"); // initFontEdgeAttr(e, &fi);
|
||||
UNSUPPORTED("3s7kg9x748riuy3tm697s6e8t"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->xlabel) = make_label((void*)e, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
|
||||
@ -1590,13 +1590,13 @@ UNSUPPORTED("b0zm6fkpjlt9jacykbgugjodg"); // fi.fontsize, fi.fontname, fi.fo
|
||||
UNSUPPORTED("c078bypfszv0nsvp1nc0x28wx"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))->data))->has_labels) |= (1 << 5);
|
||||
}
|
||||
/* vladimir */
|
||||
if (Z._().E_headlabel!=null && (str = agxget(e, Z._().E_headlabel))!=null && (str.charAt(0)!='\0')) {
|
||||
if (Z.z().E_headlabel!=null && (str = agxget(e, Z.z().E_headlabel))!=null && (str.charAt(0)!='\0')) {
|
||||
UNSUPPORTED("cgznvdnh671wl8jq8q3tyhv1r"); // initFontLabelEdgeAttr(e, &fi, &lfi);
|
||||
UNSUPPORTED("6nfh8swason2akjp45hm0o5b0"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->head_label) = make_label((void*)e, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
|
||||
UNSUPPORTED("eu3ztkfva2x87y72tnu7vv4re"); // lfi.fontsize, lfi.fontname, lfi.fontcolor);
|
||||
UNSUPPORTED("axtvdewh7zhtm1diu8c6dprx4"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))->data))->has_labels) |= (1 << 1);
|
||||
}
|
||||
if (Z._().E_taillabel!=null && (str = agxget(e, Z._().E_taillabel))!=null && (str.charAt(0)!='\0')) {
|
||||
if (Z.z().E_taillabel!=null && (str = agxget(e, Z.z().E_taillabel))!=null && (str.charAt(0)!='\0')) {
|
||||
UNSUPPORTED("6y6e1y496y6j6a6065nfesr8o"); // if (!lfi.fontname)
|
||||
UNSUPPORTED("4w2bicw8rsgyy40x0vhyzzlnm"); // initFontLabelEdgeAttr(e, &fi, &lfi);
|
||||
UNSUPPORTED("ans0pi92t6ou5mworb3ohiqj3"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->tail_label) = make_label((void*)e, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
|
||||
@ -1615,7 +1615,7 @@ UNSUPPORTED("50hobbhvpqr6dj302waqr59mu"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))
|
||||
UNSUPPORTED("j71lo2acx1ydov0uj7xjjce"); // (((Agnodeinfo_t*)(((Agobj_t*)(((((((Agobj_t*)(e))->tag).objtype) == 3?(e):((e)+1))->node)))->data))->has_port) = (!(0));
|
||||
|
||||
ED_tail_port(e, chkPort ((CFunction) ND_shape(agtail(e)).getPtr("fns").getPtr("portfn"), agtail(e), str));
|
||||
if (noClip(e, Z._().E_tailclip))
|
||||
if (noClip(e, Z.z().E_tailclip))
|
||||
UNSUPPORTED("cg4z67u0dm6h9nrcx8kkalnlt"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->tail_port).clip = 0;
|
||||
str = agget(e, new CString("headport"));
|
||||
/* libgraph always defines tailport/headport; libcgraph doesn't */
|
||||
@ -1625,7 +1625,7 @@ UNSUPPORTED("542y57dbsosmjvsmdnzon2qb5"); // (((Agnodeinfo_t*)(((Agobj_t*)(((((
|
||||
|
||||
ED_head_port(e, chkPort((CFunction) ND_shape(aghead(e)).getPtr("fns").getPtr("portfn"), aghead(e), str));
|
||||
|
||||
if (noClip(e, Z._().E_headclip))
|
||||
if (noClip(e, Z.z().E_headclip))
|
||||
UNSUPPORTED("ayqscz30ekhcje94wh4ib1hcu"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->head_port).clip = 0;
|
||||
return r;
|
||||
} finally {
|
||||
|
@ -721,7 +721,7 @@ public static boolean nonconstraint_edge(Agedge_s e) {
|
||||
ENTERING("2luyof8ca7ewf9r08z3os3lk7","nonconstraint_edge");
|
||||
try {
|
||||
CString constr;
|
||||
if (Z._().E_constr!=null && (constr = agxget(e, Z._().E_constr))!=null) {
|
||||
if (Z.z().E_constr!=null && (constr = agxget(e, Z.z().E_constr))!=null) {
|
||||
if (constr.charAt(0)!='\0' && mapbool(constr) == false)
|
||||
return (!(false));
|
||||
}
|
||||
|
@ -1020,7 +1020,7 @@ try {
|
||||
}
|
||||
if ((ED_label(e) == null) && (ED_label(prev) == null)
|
||||
&& ports_eq(e, prev)) {
|
||||
if (Z._().Concentrate)
|
||||
if (Z.z().Concentrate)
|
||||
ED_edge_type(e, 6);
|
||||
else {
|
||||
merge_chain(g, e, ED_to_virt(prev), NOT(false));
|
||||
@ -1065,7 +1065,7 @@ try {
|
||||
make_chain(g, agtail(opp), aghead(opp), opp);
|
||||
if ((ED_label(e) == null) && (ED_label(opp) == null)
|
||||
&& ports_eq(e, opp)) {
|
||||
if (Z._().Concentrate) {
|
||||
if (Z.z().Concentrate) {
|
||||
ED_edge_type(e, 6);
|
||||
ED_conc_opp_flag(opp, NOT(false));
|
||||
} else { /* see above. this is getting out of hand */
|
||||
|
@ -726,8 +726,8 @@ throw new UnsupportedOperationException();
|
||||
public static void begin_component() {
|
||||
ENTERING("7ggrwt0f912kp1marrxdjq155","begin_component");
|
||||
try {
|
||||
Z._().Last_node_decomp = null;
|
||||
GD_nlist(Z._().G_decomp, null);
|
||||
Z.z().Last_node_decomp = null;
|
||||
GD_nlist(Z.z().G_decomp, null);
|
||||
} finally {
|
||||
LEAVING("7ggrwt0f912kp1marrxdjq155","begin_component");
|
||||
}
|
||||
@ -741,16 +741,16 @@ LEAVING("7ggrwt0f912kp1marrxdjq155","begin_component");
|
||||
public static void add_to_component(Agnode_s n) {
|
||||
ENTERING("7icc6b2pvnj6te1yndbel47gg","add_to_component");
|
||||
try {
|
||||
GD_n_nodes(Z._().G_decomp, 1+GD_n_nodes(Z._().G_decomp));
|
||||
ND_mark(n, Z._().Cmark);
|
||||
if (Z._().Last_node_decomp!=null) {
|
||||
ND_prev(n, Z._().Last_node_decomp);
|
||||
ND_next(Z._().Last_node_decomp, n);
|
||||
GD_n_nodes(Z.z().G_decomp, 1+GD_n_nodes(Z.z().G_decomp));
|
||||
ND_mark(n, Z.z().Cmark);
|
||||
if (Z.z().Last_node_decomp!=null) {
|
||||
ND_prev(n, Z.z().Last_node_decomp);
|
||||
ND_next(Z.z().Last_node_decomp, n);
|
||||
} else {
|
||||
ND_prev(n, null);
|
||||
GD_nlist(Z._().G_decomp, n);
|
||||
GD_nlist(Z.z().G_decomp, n);
|
||||
}
|
||||
Z._().Last_node_decomp = n;
|
||||
Z.z().Last_node_decomp = n;
|
||||
ND_next(n, null);
|
||||
} finally {
|
||||
LEAVING("7icc6b2pvnj6te1yndbel47gg","add_to_component");
|
||||
@ -766,10 +766,10 @@ public static void end_component() {
|
||||
ENTERING("5o8hxpr6ppi15pinuy79m7u04","end_component");
|
||||
try {
|
||||
int i;
|
||||
i = GD_comp(Z._().G_decomp).getInt("size");
|
||||
GD_comp(Z._().G_decomp).setInt("size", 1+GD_comp(Z._().G_decomp).getInt("size"));
|
||||
GD_comp(Z._().G_decomp).setPtr("list", ALLOC_empty(GD_comp(Z._().G_decomp).getInt("size"), GD_comp(Z._().G_decomp).getPtr("list"), Agnode_s.class));
|
||||
GD_comp(Z._().G_decomp).getArrayOfPtr("list").plus(i).setPtr(GD_nlist(Z._().G_decomp));
|
||||
i = GD_comp(Z.z().G_decomp).getInt("size");
|
||||
GD_comp(Z.z().G_decomp).setInt("size", 1+GD_comp(Z.z().G_decomp).getInt("size"));
|
||||
GD_comp(Z.z().G_decomp).setPtr("list", ALLOC_empty(GD_comp(Z.z().G_decomp).getInt("size"), GD_comp(Z.z().G_decomp).getPtr("list"), Agnode_s.class));
|
||||
GD_comp(Z.z().G_decomp).getArrayOfPtr("list").plus(i).setPtr(GD_nlist(Z.z().G_decomp));
|
||||
} finally {
|
||||
LEAVING("5o8hxpr6ppi15pinuy79m7u04","end_component");
|
||||
}
|
||||
@ -797,7 +797,7 @@ try {
|
||||
for (i = 0; (e = (Agedge_s) vec.plus(c).getStruct().getArrayOfPtr("list").plus(i).getPtr())!=null; i++) {
|
||||
if (EQ(other = aghead(e), n))
|
||||
other = agtail(e);
|
||||
if ((ND_mark(other) != Z._().Cmark) && (EQ(other, UF_find(other))))
|
||||
if ((ND_mark(other) != Z.z().Cmark) && (EQ(other, UF_find(other))))
|
||||
search_component(g, other);
|
||||
}
|
||||
}
|
||||
@ -816,9 +816,9 @@ ENTERING("2t7r964kqtl5qrl7i57i22tqy","decompose");
|
||||
try {
|
||||
Agraph_s subg;
|
||||
Agnode_s n, v;
|
||||
Z._().G_decomp = g;
|
||||
if (++Z._().Cmark == 0)
|
||||
Z._().Cmark = 1;
|
||||
Z.z().G_decomp = g;
|
||||
if (++Z.z().Cmark == 0)
|
||||
Z.z().Cmark = 1;
|
||||
GD_n_nodes(g, 0);
|
||||
GD_comp(g).setInt("size", 0);
|
||||
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
|
||||
@ -827,7 +827,7 @@ try {
|
||||
v = (Agnode_s) GD_rankleader(subg).plus(ND_rank(v)).getPtr();
|
||||
else if (v != UF_find(v))
|
||||
continue;
|
||||
if (ND_mark(v) != Z._().Cmark) {
|
||||
if (ND_mark(v) != Z.z().Cmark) {
|
||||
begin_component();
|
||||
search_component(g, v);
|
||||
end_component();
|
||||
|
@ -808,9 +808,9 @@ try {
|
||||
CString tailgroup, headgroup;
|
||||
agbindrec(e, new CString("Agedgeinfo_t"), sizeof(Agedgeinfo_t.class), (N(0))); //graph custom data
|
||||
common_init_edge(e);
|
||||
ED_weight(e, late_int(e, Z._().E_weight, 1, 0));
|
||||
tailgroup = late_string(agtail(e), Z._().N_group, new CString(""));
|
||||
headgroup = late_string(aghead(e), Z._().N_group, new CString(""));
|
||||
ED_weight(e, late_int(e, Z.z().E_weight, 1, 0));
|
||||
tailgroup = late_string(agtail(e), Z.z().N_group, new CString(""));
|
||||
headgroup = late_string(aghead(e), Z.z().N_group, new CString(""));
|
||||
ED_count(e, 1);
|
||||
ED_xpenalty(e, 1);
|
||||
if (tailgroup.charAt(0)!='\0' && (tailgroup.isSame(headgroup))) {
|
||||
@ -821,8 +821,8 @@ UNSUPPORTED("5y0yunmvmngg67c9exlbn6jbk"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))-
|
||||
UNSUPPORTED("54niz21n2omf1i9v67brdid9w"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->xpenalty) = 0;
|
||||
UNSUPPORTED("2v5u5jdguhhn7vjihniotrml0"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->weight) = 0;
|
||||
}
|
||||
ED_showboxes(e, late_int(e, Z._().E_showboxes, 0, 0));
|
||||
ED_minlen(e, late_int(e, Z._().E_minlen, 1, 0));
|
||||
ED_showboxes(e, late_int(e, Z.z().E_showboxes, 0, 0));
|
||||
ED_minlen(e, late_int(e, Z.z().E_minlen, 1, 0));
|
||||
} finally {
|
||||
LEAVING("zbvhnhd78bppq8wb872847bj","dot_init_edge");
|
||||
}
|
||||
|
@ -946,7 +946,7 @@ try {
|
||||
Agnode_s n;
|
||||
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
|
||||
for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) {
|
||||
if ((Boolean)Z._().sinfo.call("swapEnds", e) && ED_spl(e)!=null)
|
||||
if ((Boolean)Z.z().sinfo.call("swapEnds", e) && ED_spl(e)!=null)
|
||||
swap_spline(ED_spl(e));
|
||||
}
|
||||
}
|
||||
@ -1036,7 +1036,7 @@ UNSUPPORTED("4k888z8ymdp2b653twxc1ugbu"); // agerr (AGWARN, "edge labels wi
|
||||
}
|
||||
for (n = agfstnode (g); n!=null; n = agnxtnode(g, n)) {
|
||||
for (e = agfstout(g, n); e!=null; e = agnxtout(g,e)) {
|
||||
makeStraightEdge(g, e, et, Z._().sinfo);
|
||||
makeStraightEdge(g, e, et, Z.z().sinfo);
|
||||
}
|
||||
}
|
||||
UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
|
||||
@ -1072,7 +1072,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
|
||||
ED_label(fe).setBoolean("set", NOT(false));
|
||||
}
|
||||
if ((ND_node_type(n) != 0) &&
|
||||
((Boolean)Z._().sinfo.call("splineMerge", n) == false))
|
||||
((Boolean)Z.z().sinfo.call("splineMerge", n) == false))
|
||||
continue;
|
||||
for (k = 0; (e = (Agedge_s) ND_out(n).getArrayOfPtr("list").plus(k).getPtr())!=null; k++) {
|
||||
if ((ED_edge_type(e) == 4)
|
||||
@ -1192,7 +1192,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
|
||||
int dwny = (int) (ND_coord(n).getDouble("y") - ND_coord(GD_rank(g).plus(r+1).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y"));
|
||||
sizey = MIN(upy, dwny);
|
||||
}
|
||||
makeSelfEdge(P, edges, ind, cnt, sd.getInt("Multisep"), sizey/2, Z._().sinfo.amp());
|
||||
makeSelfEdge(P, edges, ind, cnt, sd.getInt("Multisep"), sizey/2, Z.z().sinfo.amp());
|
||||
for (b = 0; b < cnt; b++) {
|
||||
e = (Agedge_s) edges.plus(ind+b).getPtr();
|
||||
if (ED_label(e)!=null)
|
||||
@ -1219,7 +1219,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
|
||||
finish :
|
||||
/* vladimir: place port labels */
|
||||
/* FIX: head and tail labels are not part of cluster bbox */
|
||||
if ((Z._().E_headlabel!=null || Z._().E_taillabel!=null) && (Z._().E_labelangle!=null || Z._().E_labeldistance!=null)) {
|
||||
if ((Z.z().E_headlabel!=null || Z.z().E_taillabel!=null) && (Z.z().E_labelangle!=null || Z.z().E_labeldistance!=null)) {
|
||||
UNSUPPORTED("attp4bsjqe99xnhi7lr7pszar"); // for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
|
||||
UNSUPPORTED("54jm4bbgzyl0txauszo1mappu"); // if (E_headlabel) {
|
||||
UNSUPPORTED("dw8yu56thd0wpolmtby8r5doo"); // for (e = agfstin(g, n); e; e = agnxtin(g, e))
|
||||
@ -1246,8 +1246,8 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
|
||||
Memory.free(sd.getPtr("Rank_box"));
|
||||
routesplinesterm();
|
||||
}
|
||||
Z._().State = 1;
|
||||
Z._().EdgeLabelsDone = 1;
|
||||
Z.z().State = 1;
|
||||
Z.z().EdgeLabelsDone = 1;
|
||||
} finally {
|
||||
LEAVING("6agx6m2qof9lg57co232lwakj","_dot_splines");
|
||||
}
|
||||
@ -1735,7 +1735,7 @@ try {
|
||||
points.plus(pointn++).setStruct(tp);
|
||||
points.plus(pointn++).setStruct(hp);
|
||||
points.plus(pointn++).setStruct(hp);
|
||||
clip_and_install(e, aghead(e), points.asPtr(), pointn, Z._().sinfo.amp());
|
||||
clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo.amp());
|
||||
ED_label(e).getStruct("pos").setDouble("x", ctrx);
|
||||
ED_label(e).getStruct("pos").setDouble("y", tp.getDouble("y") + (ED_label(e).getStruct("dimen").getDouble("y")+6)/2.0);
|
||||
ED_label(e).setBoolean("set", NOT(false));
|
||||
@ -1793,7 +1793,7 @@ UNSUPPORTED("e2zgxycgqefryde9nbv6cqz1u"); // maxy += ED_label(e)->dimen.y +
|
||||
ED_label(e).getStruct("pos").setDouble("x", ctrx);
|
||||
ED_label(e).getStruct("pos").setDouble("y", ctry);
|
||||
ED_label(e).setBoolean("set", NOT(false));
|
||||
clip_and_install(e, aghead(e), ps, pn[0], Z._().sinfo.amp());
|
||||
clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
|
||||
}
|
||||
/* edges with no labels */
|
||||
for (; i < cnt; i++) {
|
||||
@ -1841,7 +1841,7 @@ UNSUPPORTED("7un2qk34mmmhqi296vl50bacs"); // maxy += + 6;
|
||||
poly.setPtr("ps", points.asPtr());
|
||||
ps = simpleSplineRoute (tp, hp, poly, pn, et == (3 << 1));
|
||||
if (pn[0] == 0) return;
|
||||
clip_and_install(e, aghead(e), ps, pn[0], Z._().sinfo.amp());
|
||||
clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
|
||||
}
|
||||
Memory.free (earray);
|
||||
} finally {
|
||||
@ -1888,7 +1888,7 @@ UNSUPPORTED("59cwjy3j5e0igp278migykzi"); // points[pointn++] = hp;
|
||||
UNSUPPORTED("59cwjy3j5e0igp278migykzi"); // points[pointn++] = hp;
|
||||
}
|
||||
dy += stepy;
|
||||
clip_and_install(e, aghead(e), points.asPtr(), pointn, Z._().sinfo.amp());
|
||||
clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo.amp());
|
||||
}
|
||||
} finally {
|
||||
LEAVING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat");
|
||||
@ -2132,29 +2132,29 @@ UNSUPPORTED("1uunj4jbr2uhiqxwor6rzmr3j"); // pn = 7;
|
||||
boxn = 0;
|
||||
makeFlatEnd (g, sp, P, tn, e, tend.amp(), NOT(false));
|
||||
makeFlatEnd (g, sp, P, hn, e, hend.amp(), false);
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", lb.getStruct("LL").getDouble("x"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", lb.getStruct("LL").getDouble("y"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", lb.getStruct("LL").getDouble("x"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", lb.getStruct("LL").getDouble("y"));
|
||||
boxn++;
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", lb.getStruct("LL").getDouble("y"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", lb.getStruct("UR").getDouble("y"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", lb.getStruct("LL").getDouble("y"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", lb.getStruct("UR").getDouble("y"));
|
||||
boxn++;
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", lb.getStruct("UR").getDouble("x"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", lb.getStruct("LL").getDouble("y"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", lb.getStruct("UR").getDouble("x"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", lb.getStruct("LL").getDouble("y"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct().getStruct("UR").getDouble("x"));
|
||||
boxn++;
|
||||
for (i = 0; i < tend.getInt("boxn"); i++) add_box(P, tend.getArrayOfStruct("boxes").plus(i).getStruct());
|
||||
for (i = 0; i < boxn; i++) add_box(P, Z._().boxes.plus(i).getStruct());
|
||||
for (i = 0; i < boxn; i++) add_box(P, Z.z().boxes.plus(i).getStruct());
|
||||
for (i = hend.getInt("boxn") - 1; i >= 0; i--) add_box(P, hend.getArrayOfStruct("boxes").plus(i).getStruct());
|
||||
if (et == (5 << 1)) ps = routesplines(P, pn);
|
||||
else ps = routepolylines(P, pn);
|
||||
if (pn[0] == 0) return;
|
||||
}
|
||||
clip_and_install(e, aghead(e), ps, pn[0], Z._().sinfo.amp());
|
||||
clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
|
||||
} finally {
|
||||
LEAVING("w8ptjibydq995d2lexg85mku","make_flat_labeled_edge");
|
||||
}
|
||||
@ -2308,30 +2308,30 @@ try {
|
||||
e = (Agedge_s) edges.plus(ind + i).getPtr();
|
||||
boxn = 0;
|
||||
b.____(tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct());
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", b.getStruct("LL").getDouble("x"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", b.getStruct("UR").getDouble("y"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", b.getStruct("UR").getDouble("x") + (i + 1) * stepx);
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", b.getStruct("UR").getDouble("y") + (i + 1) * stepy);
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", b.getStruct("LL").getDouble("x"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", b.getStruct("UR").getDouble("y"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", b.getStruct("UR").getDouble("x") + (i + 1) * stepx);
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", b.getStruct("UR").getDouble("y") + (i + 1) * stepy);
|
||||
boxn++;
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", Z._().boxes.plus(boxn-1).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", Z._().boxes.plus(boxn).getStruct().getStruct("LL").getDouble("y") + stepy);
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct().getStruct("LL").getDouble("x"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", Z.z().boxes.plus(boxn-1).getStruct().getStruct("UR").getDouble("y"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct().getStruct("UR").getDouble("x"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", Z.z().boxes.plus(boxn).getStruct().getStruct("LL").getDouble("y") + stepy);
|
||||
boxn++;
|
||||
b.____(hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct());
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", b.getStruct("UR").getDouble("x"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", b.getStruct("UR").getDouble("y"));
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", b.getStruct("LL").getDouble("x") - (i + 1) * stepx);
|
||||
Z._().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", Z._().boxes.plus(boxn-1).getStruct().getStruct("LL").getDouble("y"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("x", b.getStruct("UR").getDouble("x"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("y", b.getStruct("UR").getDouble("y"));
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("LL").setDouble("x", b.getStruct("LL").getDouble("x") - (i + 1) * stepx);
|
||||
Z.z().boxes.plus(boxn).getStruct().getStruct("UR").setDouble("y", Z.z().boxes.plus(boxn-1).getStruct().getStruct("LL").getDouble("y"));
|
||||
boxn++;
|
||||
for (j = 0; j < tend.getInt("boxn"); j++) add_box(P, tend.getArrayOfStruct("boxes").plus(j).getStruct());
|
||||
for (j = 0; j < boxn; j++) add_box(P, Z._().boxes.plus(j).getStruct());
|
||||
for (j = 0; j < boxn; j++) add_box(P, Z.z().boxes.plus(j).getStruct());
|
||||
for (j = hend.getInt("boxn") - 1; j >= 0; j--) add_box(P, hend.getArrayOfStruct("boxes").plus(j).getStruct());
|
||||
if (et == (5 << 1)) ps = (pointf) routesplines(P, pn);
|
||||
else ps = (pointf) routepolylines(P, pn);
|
||||
if (pn[0] == 0)
|
||||
return;
|
||||
clip_and_install(e, aghead(e), ps, pn[0], Z._().sinfo.amp());
|
||||
clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
|
||||
P.setInt("nbox", 0);
|
||||
}
|
||||
} finally {
|
||||
@ -2456,11 +2456,11 @@ try {
|
||||
fwdedgea.getStruct("out").getStruct("base").setPtr("data", fwdedgeai.amp());
|
||||
fwdedgeb.getStruct("out").getStruct("base").setPtr("data", fwdedgebi.amp());
|
||||
fwdedge.getStruct("out").getStruct("base").setPtr("data", fwdedgei.amp());
|
||||
if (N(Z._().pointfs)) {
|
||||
Z._().pointfs = gmalloc(sizeof(pointf.class, 2000));
|
||||
Z._().pointfs2 = gmalloc(sizeof(pointf.class, 2000));
|
||||
Z._().numpts = 2000;
|
||||
Z._().numpts2 = 2000;
|
||||
if (N(Z.z().pointfs)) {
|
||||
Z.z().pointfs = gmalloc(sizeof(pointf.class, 2000));
|
||||
Z.z().pointfs2 = gmalloc(sizeof(pointf.class, 2000));
|
||||
Z.z().numpts = 2000;
|
||||
Z.z().numpts2 = 2000;
|
||||
}
|
||||
sl = 0;
|
||||
e = (Agedge_s) edges.plus(ind).getPtr();
|
||||
@ -2497,7 +2497,7 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
|
||||
}
|
||||
fe = e;
|
||||
/* compute the spline points for the edge */
|
||||
if ((et == (1 << 1)) && (pointn[0] = makeLineEdge (g, fe, Z._().pointfs, hn.unsupported()))!=0) {
|
||||
if ((et == (1 << 1)) && (pointn[0] = makeLineEdge (g, fe, Z.z().pointfs, hn.unsupported()))!=0) {
|
||||
}
|
||||
else {
|
||||
boolean splines = (et == (5 << 1));
|
||||
@ -2522,9 +2522,9 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
|
||||
}
|
||||
longedge = 0;
|
||||
smode = false; si = -1;
|
||||
while (ND_node_type(hn) == 1 && N(((Boolean)Z._().sinfo.call("splineMerge", hn)).booleanValue())) {
|
||||
while (ND_node_type(hn) == 1 && N(((Boolean)Z.z().sinfo.call("splineMerge", hn)).booleanValue())) {
|
||||
longedge = 1;
|
||||
Z._().boxes.plus(boxn++).setStruct(rank_box(sp, g, ND_rank(tn)));
|
||||
Z.z().boxes.plus(boxn++).setStruct(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))) {
|
||||
@ -2533,7 +2533,7 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
|
||||
}
|
||||
if (N(smode) || si > 0) {
|
||||
si--;
|
||||
Z._().boxes.plus(boxn++).setStruct( maximal_bbox(g, sp, hn, e, (Agedge_s) ND_out(hn).getArrayOfPtr("list").plus(0).getPtr()));
|
||||
Z.z().boxes.plus(boxn++).setStruct( maximal_bbox(g, sp, hn, e, (Agedge_s) ND_out(hn).getArrayOfPtr("list").plus(0).getPtr()));
|
||||
e = (Agedge_s) ND_out(hn).getArrayOfPtr("list").plus(0).getPtr();
|
||||
tn = agtail(e);
|
||||
hn = aghead(e);
|
||||
@ -2547,7 +2547,7 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
|
||||
UNSUPPORTED("1crhubfzekx1qi2ti9ajqsfoc"); // hend.boxes[hend.boxn++] = b;
|
||||
P.getStruct("end").setDouble("theta", M_PI / 2);
|
||||
P.getStruct("end").setBoolean("constrained", NOT(false));
|
||||
completeregularpath(P, segfirst, e, tend.amp(), hend.amp(), Z._().boxes, boxn, 1);
|
||||
completeregularpath(P, segfirst, e, tend.amp(), hend.amp(), Z.z().boxes, boxn, 1);
|
||||
if (splines) ps = routesplines(P, pn);
|
||||
else {
|
||||
UNSUPPORTED("biyp75vm751j3qmqacagfej4b"); // ps = routepolylines (P, &pn);
|
||||
@ -2559,7 +2559,7 @@ UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
|
||||
}
|
||||
if (pn[0] == 0)
|
||||
return;
|
||||
if (pointn[0] + pn[0] > Z._().numpts) {
|
||||
if (pointn[0] + pn[0] > Z.z().numpts) {
|
||||
/* This should be enough to include 3 extra points added by
|
||||
* straight_path below.
|
||||
*/
|
||||
@ -2567,9 +2567,9 @@ UNSUPPORTED("k37sqlxbjikqg4xdonnvefo3"); // numpts = 2*(pointn+pn);
|
||||
UNSUPPORTED("8kbxhk7qirj3tr7hn1ukwar3h"); // pointfs = RALLOC(numpts, pointfs, pointf);
|
||||
}
|
||||
for (i = 0; i < pn[0]; i++) {
|
||||
Z._().pointfs.plus(pointn[0]++).setStruct(ps.plus(i).getStruct());
|
||||
Z.z().pointfs.plus(pointn[0]++).setStruct(ps.plus(i).getStruct());
|
||||
}
|
||||
e = straight_path((Agedge_s)ND_out(hn).getArrayOfPtr("list").plus(0).getPtr(), sl, Z._().pointfs, pointn);
|
||||
e = straight_path((Agedge_s)ND_out(hn).getArrayOfPtr("list").plus(0).getPtr(), sl, Z.z().pointfs, pointn);
|
||||
recover_slack(segfirst, P);
|
||||
segfirst = e;
|
||||
tn = agtail(e);
|
||||
@ -2585,7 +2585,7 @@ UNSUPPORTED("cjx6tldge3otk1pk6ks1pkn2w"); // tend.boxes[tend.boxn++] =
|
||||
P.getStruct("start").setBoolean("constrained", NOT(false));
|
||||
smode = false;
|
||||
}
|
||||
Z._().boxes.plus(boxn++).setStruct(rank_box(sp, g, ND_rank(tn)));
|
||||
Z.z().boxes.plus(boxn++).setStruct(rank_box(sp, g, ND_rank(tn)));
|
||||
b.____(maximal_bbox(g, sp, hn, e, null));
|
||||
hend.getStruct("nb").____(b);
|
||||
endpath(P, hackflag!=0 ? fwdedgeb.getStruct("out").amp() : e, 1, hend.amp(), spline_merge(aghead(e)));
|
||||
@ -2598,7 +2598,7 @@ UNSUPPORTED("cjx6tldge3otk1pk6ks1pkn2w"); // tend.boxes[tend.boxn++] =
|
||||
hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn")).setStruct(b);
|
||||
hend.setInt("boxn", hend.getInt("boxn")+1);
|
||||
}
|
||||
completeregularpath(P, segfirst, e, tend.amp(), hend.amp(), Z._().boxes, boxn,
|
||||
completeregularpath(P, segfirst, e, tend.amp(), hend.amp(), Z.z().boxes, boxn,
|
||||
longedge);
|
||||
if (splines) ps = routesplines(P, pn);
|
||||
else ps = routepolylines (P, pn);
|
||||
@ -2613,12 +2613,12 @@ UNSUPPORTED("95b6xp8h5ai070bekyjhmiehh"); // pn = 4;
|
||||
}
|
||||
if (pn[0] == 0)
|
||||
return;
|
||||
if (pointn[0] + pn[0] > Z._().numpts) {
|
||||
if (pointn[0] + pn[0] > Z.z().numpts) {
|
||||
UNSUPPORTED("c6ux5effs02grz7xh3k8ernda"); // numpts = 2*(pointn+pn);
|
||||
UNSUPPORTED("bedaqcn9h03q6ia6zbezuee1m"); // pointfs = RALLOC(numpts, pointfs, pointf);
|
||||
}
|
||||
for (i = 0; i < pn[0]; i++) {
|
||||
Z._().pointfs.plus(pointn[0]).setStruct(ps.plus(i).getStruct());
|
||||
Z.z().pointfs.plus(pointn[0]).setStruct(ps.plus(i).getStruct());
|
||||
pointn[0]++;
|
||||
}
|
||||
recover_slack(segfirst, P);
|
||||
@ -2626,19 +2626,19 @@ UNSUPPORTED("bedaqcn9h03q6ia6zbezuee1m"); // pointfs = RALLOC(numpts, point
|
||||
}
|
||||
/* make copies of the spline points, one per multi-edge */
|
||||
if (cnt == 1) {
|
||||
clip_and_install(fe, hn, Z._().pointfs, pointn[0], Z._().sinfo.amp());
|
||||
clip_and_install(fe, hn, Z.z().pointfs, pointn[0], Z.z().sinfo.amp());
|
||||
return;
|
||||
}
|
||||
dx = sp.getInt("Multisep") * (cnt - 1) / 2;
|
||||
for (i = 1; i < pointn[0] - 1; i++)
|
||||
Z._().pointfs.plus(i).setDouble("x", Z._().pointfs.plus(i).getDouble("x") - dx);
|
||||
if (Z._().numpts > Z._().numpts2) {
|
||||
Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.plus(i).getDouble("x") - dx);
|
||||
if (Z.z().numpts > Z.z().numpts2) {
|
||||
UNSUPPORTED("9ubr4m7bdv5f5ldk2ta6yw3up"); // numpts2 = numpts;
|
||||
UNSUPPORTED("8qwp7ddy5ztgam63fzfjmu890"); // pointfs2 = RALLOC(numpts2, pointfs2, pointf);
|
||||
}
|
||||
for (i = 0; i < pointn[0]; i++)
|
||||
Z._().pointfs2.plus(i).setStruct(Z._().pointfs.plus(i).getStruct());
|
||||
clip_and_install(fe, hn, Z._().pointfs2, pointn[0], Z._().sinfo.amp());
|
||||
Z.z().pointfs2.plus(i).setStruct(Z.z().pointfs.plus(i).getStruct());
|
||||
clip_and_install(fe, hn, Z.z().pointfs2, pointn[0], Z.z().sinfo.amp());
|
||||
for (j = 1; j < cnt; j++) {
|
||||
e = (Agedge_s) edges.plus(ind + j).getPtr();
|
||||
if ((ED_tree_index(e) & 32)!=0) {
|
||||
@ -2646,10 +2646,10 @@ UNSUPPORTED("8qwp7ddy5ztgam63fzfjmu890"); // pointfs2 = RALLOC(numpts2, pointfs
|
||||
e = (Agedge_s) fwdedge.getStruct("out").amp();
|
||||
}
|
||||
for (i = 1; i < pointn[0] - 1; i++)
|
||||
Z._().pointfs.plus(i).setDouble("x", Z._().pointfs.plus(i).getDouble("x") + sp.getInt("Multisep"));
|
||||
Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.plus(i).getDouble("x") + sp.getInt("Multisep"));
|
||||
for (i = 0; i < pointn[0]; i++)
|
||||
Z._().pointfs2.plus(i).setStruct(Z._().pointfs.plus(i).getStruct());
|
||||
clip_and_install(e, aghead(e), Z._().pointfs2, pointn[0], Z._().sinfo.amp());
|
||||
Z.z().pointfs2.plus(i).setStruct(Z.z().pointfs.plus(i).getStruct());
|
||||
clip_and_install(e, aghead(e), Z.z().pointfs2, pointn[0], Z.z().sinfo.amp());
|
||||
}
|
||||
} finally {
|
||||
LEAVING("30wfq1dby4t07hft9io52nq6z","make_regular_edge");
|
||||
@ -2875,7 +2875,7 @@ try {
|
||||
Agnode_s vn;
|
||||
b = 0; /* skip first rank box */
|
||||
for (vn = aghead(e);
|
||||
ND_node_type(vn) == 1 && N(((Boolean)Z._().sinfo.call("splineMerge", vn)).booleanValue());
|
||||
ND_node_type(vn) == 1 && N(((Boolean)Z.z().sinfo.call("splineMerge", vn)).booleanValue());
|
||||
vn = aghead(ND_out(vn).getArrayOfPtr("list").plus(0).getPtr())) {
|
||||
while ((b < p.getInt("nbox")) && (p.getPtr("boxes").plus(b).getStruct("LL").getDouble("y") > ND_coord(vn).getDouble("y")))
|
||||
b++;
|
||||
|
@ -870,7 +870,7 @@ try {
|
||||
if ((GD_n_cluster(g) > 0)
|
||||
&& (N(s = agget(g, new CString("remincross"))) || (mapbool(s)))) {
|
||||
mark_lowclusters(g);
|
||||
Z._().ReMincross = NOT(0);
|
||||
Z.z().ReMincross = NOT(0);
|
||||
nc = mincross_(g, 2, 2, doBalance);
|
||||
}
|
||||
cleanup2(g, nc);
|
||||
@ -1053,7 +1053,7 @@ public static void ordered_edges(Agraph_s g) {
|
||||
ENTERING("hzoz2czb672i0nbjvjhbc3na","ordered_edges");
|
||||
try {
|
||||
CString ordering;
|
||||
if (N(Z._().G_ordering) && N(Z._().N_ordering))
|
||||
if (N(Z.z().G_ordering) && N(Z.z().N_ordering))
|
||||
return;
|
||||
UNSUPPORTED("98iqppixxkdndoz210i5ejppy"); // if ((ordering = late_string(g, G_ordering, NULL))) {
|
||||
UNSUPPORTED("lhhw62wj3on36enoy6ug6u1p"); // if ((*(ordering)==*("out")&&!strcmp(ordering,"out")))
|
||||
@ -1115,7 +1115,7 @@ try {
|
||||
adjmatrix_t M;
|
||||
boolean rv=false;
|
||||
/* CLUSTER indicates orig nodes of clusters, and vnodes of skeletons */
|
||||
if (Z._().ReMincross == false) {
|
||||
if (Z.z().ReMincross == false) {
|
||||
if (NEQ(ND_clust(v), ND_clust(w)) && (ND_clust(v)!=null) && (ND_clust(w)!=null)) {
|
||||
/* the following allows cluster skeletons to be swapped */
|
||||
if ((ND_ranktype(v) == 7)
|
||||
@ -1216,9 +1216,9 @@ try {
|
||||
vi = ND_order(v);
|
||||
wi = ND_order(w);
|
||||
ND_order(v, wi);
|
||||
GD_rank(Z._().Root).plus(r).getArrayOfPtr("v").plus(wi).setPtr(v);
|
||||
GD_rank(Z.z().Root).plus(r).getArrayOfPtr("v").plus(wi).setPtr(v);
|
||||
ND_order(w, vi);
|
||||
GD_rank(Z._().Root).plus(r).getArrayOfPtr("v").plus(vi).setPtr(w);
|
||||
GD_rank(Z.z().Root).plus(r).getArrayOfPtr("v").plus(vi).setPtr(w);
|
||||
} finally {
|
||||
LEAVING("ba4tbr57wips1dzpgxzx3b6ja","exchange");
|
||||
}
|
||||
@ -1379,14 +1379,14 @@ try {
|
||||
if ((c1 < c0) || ((c0 > 0) && reverse && (c1 == c0))) {
|
||||
exchange(v, w);
|
||||
rv += (c0 - c1);
|
||||
GD_rank(Z._().Root).plus(r).getPtr().setBoolean("valid", false);
|
||||
GD_rank(Z.z().Root).plus(r).getPtr().setBoolean("valid", false);
|
||||
GD_rank(g).plus(r).getPtr().setBoolean("candidate", NOT(false));
|
||||
if (r > GD_minrank(g)) {
|
||||
GD_rank(Z._().Root).plus(r - 1).getPtr().setBoolean("valid", false);
|
||||
GD_rank(Z.z().Root).plus(r - 1).getPtr().setBoolean("valid", false);
|
||||
GD_rank(g).plus(r - 1).getPtr().setBoolean("candidate", NOT(false));
|
||||
}
|
||||
if (r < GD_maxrank(g)) {
|
||||
GD_rank(Z._().Root).plus(r + 1).getPtr().setBoolean("valid", false);
|
||||
GD_rank(Z.z().Root).plus(r + 1).getPtr().setBoolean("valid", false);
|
||||
GD_rank(g).plus(r + 1).getPtr().setBoolean("candidate", NOT(false));
|
||||
}
|
||||
}
|
||||
@ -1439,7 +1439,7 @@ try {
|
||||
cur_cross = best_cross = INT_MAX;
|
||||
for (pass = startpass; pass <= endpass; pass++) {
|
||||
if (pass <= 1) {
|
||||
maxthispass = MIN(4, Z._().MaxIter);
|
||||
maxthispass = MIN(4, Z.z().MaxIter);
|
||||
if (EQ(g, dot_root(g)))
|
||||
build_ranks(g, pass);
|
||||
if (pass == 0)
|
||||
@ -1451,7 +1451,7 @@ try {
|
||||
}
|
||||
trying = 0;
|
||||
} else {
|
||||
maxthispass = Z._().MaxIter;
|
||||
maxthispass = Z.z().MaxIter;
|
||||
if (cur_cross > best_cross)
|
||||
restore_best(g);
|
||||
cur_cross = best_cross;
|
||||
@ -1462,14 +1462,14 @@ try {
|
||||
fprintf(stderr,
|
||||
"mincross: pass %d iter %d trying %d cur_cross %d best_cross %d\n",
|
||||
pass, iter, trying, cur_cross, best_cross);*/
|
||||
if (trying++ >= Z._().MinQuit)
|
||||
if (trying++ >= Z.z().MinQuit)
|
||||
break;
|
||||
if (cur_cross == 0)
|
||||
break;
|
||||
mincross_step(g, iter);
|
||||
if ((cur_cross = ncross(g)) <= best_cross) {
|
||||
save_best(g);
|
||||
if (cur_cross < Z._().Convergence * best_cross)
|
||||
if (cur_cross < Z.z().Convergence * best_cross)
|
||||
trying = 0;
|
||||
best_cross = cur_cross;
|
||||
}
|
||||
@ -1506,7 +1506,7 @@ try {
|
||||
for (n = GD_nlist(g); n!=null; n = ND_next(n))
|
||||
ND_order(n, (int)ND_coord(n).getDouble("x"));
|
||||
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
|
||||
GD_rank(Z._().Root).plus(r).setBoolean("valid", false);
|
||||
GD_rank(Z.z().Root).plus(r).setBoolean("valid", false);
|
||||
qsort(GD_rank(g).plus(r).getPtr("v"),
|
||||
GD_rank(g).plus(r).getInt("n"),
|
||||
sizeof(GD_rank(g).plus(r).getPtr("v").plus(0)),
|
||||
@ -1558,8 +1558,8 @@ try {
|
||||
}
|
||||
GD_comp(g).setInt("size", 1);
|
||||
GD_nlist(g, GD_comp(g).getArrayOfPtr("list").plus(0).getPtr());
|
||||
GD_minrank(g, Z._().GlobalMinRank);
|
||||
GD_maxrank(g, Z._().GlobalMaxRank);
|
||||
GD_minrank(g, Z.z().GlobalMinRank);
|
||||
GD_maxrank(g, Z.z().GlobalMaxRank);
|
||||
} finally {
|
||||
LEAVING("6d08fwi4dsk6ikk5d0gy6rq2h","merge_components");
|
||||
}
|
||||
@ -1610,13 +1610,13 @@ try {
|
||||
int i, j, r, c;
|
||||
Agnode_s v;
|
||||
Agedge_s e;
|
||||
if (Z._().TI_list!=null) {
|
||||
Memory.free(Z._().TI_list);
|
||||
Z._().TI_list = null;
|
||||
if (Z.z().TI_list!=null) {
|
||||
Memory.free(Z.z().TI_list);
|
||||
Z.z().TI_list = null;
|
||||
}
|
||||
if (Z._().TE_list!=null) {
|
||||
Memory.free(Z._().TE_list);
|
||||
Z._().TE_list = null;
|
||||
if (Z.z().TE_list!=null) {
|
||||
Memory.free(Z.z().TE_list);
|
||||
Z.z().TE_list = null;
|
||||
}
|
||||
/* fix vlists of clusters */
|
||||
for (c = 1; c <= GD_n_cluster(g); c++)
|
||||
@ -1659,9 +1659,9 @@ try {
|
||||
assert(v!=null);
|
||||
if (dir < 0) {
|
||||
if (ND_order(v) > 0)
|
||||
rv = (Agnode_s) GD_rank(Z._().Root).plus(ND_rank(v)).getArrayOfPtr("v").plus(ND_order(v) - 1).getPtr();
|
||||
rv = (Agnode_s) GD_rank(Z.z().Root).plus(ND_rank(v)).getArrayOfPtr("v").plus(ND_order(v) - 1).getPtr();
|
||||
} else
|
||||
rv = (Agnode_s) GD_rank(Z._().Root).plus(ND_rank(v)).getArrayOfPtr("v").plus(ND_order(v) + 1).getPtr();
|
||||
rv = (Agnode_s) GD_rank(Z.z().Root).plus(ND_rank(v)).getArrayOfPtr("v").plus(ND_order(v) + 1).getPtr();
|
||||
assert((rv == null) || (ND_order(rv)-ND_order(v))*dir > 0);
|
||||
return rv;
|
||||
} finally {
|
||||
@ -1883,14 +1883,14 @@ try {
|
||||
int size;
|
||||
//if (Verbose)
|
||||
//start_timer();
|
||||
Z._().ReMincross = false;
|
||||
Z._().Root = g;
|
||||
Z.z().ReMincross = false;
|
||||
Z.z().Root = g;
|
||||
/* alloc +1 for the null terminator usage in do_ordering() */
|
||||
/* also, the +1 avoids attempts to alloc 0 sizes, something
|
||||
that efence complains about */
|
||||
size = agnedges(dot_root(g)) + 1;
|
||||
Z._().TE_list = zmalloc(sizeof_starstar_empty(Agedge_s.class, size));
|
||||
Z._().TI_list = zmalloc(size_t_array_of_integer(size));
|
||||
Z.z().TE_list = zmalloc(sizeof_starstar_empty(Agedge_s.class, size));
|
||||
Z.z().TI_list = zmalloc(size_t_array_of_integer(size));
|
||||
mincross_options(g);
|
||||
if ((GD_flags(g) & (1 << 4))!=0)
|
||||
fillRanks (g);
|
||||
@ -1898,8 +1898,8 @@ try {
|
||||
decompose(g, 1);
|
||||
allocate_ranks(g);
|
||||
ordered_edges(g);
|
||||
Z._().GlobalMinRank = GD_minrank(g);
|
||||
Z._().GlobalMaxRank = GD_maxrank(g);
|
||||
Z.z().GlobalMinRank = GD_minrank(g);
|
||||
Z.z().GlobalMaxRank = GD_maxrank(g);
|
||||
} finally {
|
||||
LEAVING("7fy4chyk12o7bgp1rv3h27yl3","init_mincross");
|
||||
}
|
||||
@ -2087,7 +2087,7 @@ UNSUPPORTED("53h8d82ax23hys2k21hjswp72"); // 1034, agnameof(g), agnameof(
|
||||
ND_order(n, i);
|
||||
GD_rank(g).plus(r).setInt("n", 1+GD_rank(g).plus(r).getInt("n"));
|
||||
// assert(GD_rank(g)[r].n <= GD_rank(g)[r].an);
|
||||
if (ND_order(n) > GD_rank(Z._().Root).plus(r).getInt("an")) {
|
||||
if (ND_order(n) > GD_rank(Z.z().Root).plus(r).getInt("an")) {
|
||||
UNSUPPORTED("399szcw1txekt1xssyw7s2x07"); // agerr(AGERR, "install_in_rank, line %d: ND_order(%s) [%d] > GD_rank(Root)[%d].an [%d]\n",
|
||||
UNSUPPORTED("9puojrmsk6vb1qc0jtr8ge4g8"); // 1052, agnameof(n), ND_order(n), r, GD_rank(Root)[r].an);
|
||||
return;
|
||||
@ -2098,7 +2098,7 @@ UNSUPPORTED("d2ugluzf7bmj7osicgitgy3sr"); // 1057, r, GD_minrank(g), GD_m
|
||||
return;
|
||||
}
|
||||
if (GD_rank(g).plus(r).getPtr("v").plus(ND_order(n)).comparePointer(
|
||||
GD_rank(g).plus(r).getPtr("av").plus(GD_rank(Z._().Root).plus(r).getInt("an")))>0) {
|
||||
GD_rank(g).plus(r).getPtr("av").plus(GD_rank(Z.z().Root).plus(r).getInt("an")))>0) {
|
||||
UNSUPPORTED("3eb32nc5czs5auwzz5p5mtl04"); // agerr(AGERR, "install_in_rank, line %d: GD_rank(g)[%d].v + ND_order(%s) [%d] > GD_rank(g)[%d].av + GD_rank(Root)[%d].an [%d]\n",
|
||||
UNSUPPORTED("3qe3qpw5h6vse39xs1ca9sjmo"); // 1062, r, agnameof(n),GD_rank(g)[r].v + ND_order(n), r, r, GD_rank(g)[r].av+GD_rank(Root)[r].an);
|
||||
return;
|
||||
@ -2145,7 +2145,7 @@ try {
|
||||
if (dequeue(q)!=null)
|
||||
UNSUPPORTED("1b3hbd5artrq77i58q2o9kgz3"); // agerr(AGERR, "surprise\n");
|
||||
for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
|
||||
GD_rank(Z._().Root).plus(i).setInt("valid", 0);
|
||||
GD_rank(Z.z().Root).plus(i).setInt("valid", 0);
|
||||
if (GD_flip(g)!=0 && (GD_rank(g).plus(i).getInt("n") > 0)) {
|
||||
int nn, ndiv2;
|
||||
__ptr__ vlist = GD_rank(g).plus(i).getPtr("v");
|
||||
@ -2318,7 +2318,7 @@ try {
|
||||
/* postprocess to restore intended order */
|
||||
}
|
||||
/* else do no harm! */
|
||||
GD_rank(Z._().Root).plus(r).setInt("valid", 0);
|
||||
GD_rank(Z.z().Root).plus(r).setInt("valid", 0);
|
||||
}
|
||||
if (temprank!=null)
|
||||
Memory.free(temprank);
|
||||
@ -2378,9 +2378,9 @@ try {
|
||||
ep = ep.plus(-1);
|
||||
}
|
||||
if (changed) {
|
||||
GD_rank(Z._().Root).plus(r).setBoolean("valid", false);
|
||||
GD_rank(Z.z().Root).plus(r).setBoolean("valid", false);
|
||||
if (r > 0)
|
||||
GD_rank(Z._().Root).plus(r - 1).setBoolean("valid", false);
|
||||
GD_rank(Z.z().Root).plus(r - 1).setBoolean("valid", false);
|
||||
}
|
||||
} finally {
|
||||
LEAVING("inv6wazjcnh4xkzzphsdcmg4","reorder");
|
||||
@ -2411,14 +2411,14 @@ try {
|
||||
} /* down pass */
|
||||
if (pass % 2 == 0) { /* down pass */
|
||||
first = GD_minrank(g) + 1;
|
||||
if (GD_minrank(g) > GD_minrank(Z._().Root))
|
||||
if (GD_minrank(g) > GD_minrank(Z.z().Root))
|
||||
first--;
|
||||
last = GD_maxrank(g);
|
||||
dir = 1;
|
||||
} else { /* up pass */
|
||||
first = GD_maxrank(g) - 1;
|
||||
last = GD_minrank(g);
|
||||
if (GD_maxrank(g) < GD_maxrank(Z._().Root))
|
||||
if (GD_maxrank(g) < GD_maxrank(Z.z().Root))
|
||||
first++;
|
||||
dir = -1;
|
||||
}
|
||||
@ -2492,25 +2492,25 @@ try {
|
||||
cross = 0;
|
||||
max = 0;
|
||||
rtop = GD_rank(g).plus(r).getPtr("v");
|
||||
if (Z._().C <= GD_rank(Z._().Root).plus(r + 1).getInt("n")) {
|
||||
Z._().C = GD_rank(Z._().Root).plus(r + 1).getInt("n") + 1;
|
||||
Z._().Count = ALLOC_INT(Z._().C, Z._().Count);
|
||||
if (Z.z().C <= GD_rank(Z.z().Root).plus(r + 1).getInt("n")) {
|
||||
Z.z().C = GD_rank(Z.z().Root).plus(r + 1).getInt("n") + 1;
|
||||
Z.z().Count = ALLOC_INT(Z.z().C, Z.z().Count);
|
||||
}
|
||||
for (i = 0; i < GD_rank(g).plus(r + 1).getInt("n"); i++)
|
||||
Z._().Count.plus(i).setInt(0);
|
||||
Z.z().Count.plus(i).setInt(0);
|
||||
for (top = 0; top < GD_rank(g).plus(r).getInt("n"); top++) {
|
||||
Agedge_s e;
|
||||
if (max > 0) {
|
||||
for (i = 0; (e = (Agedge_s) ND_out(rtop.plus(top).getPtr()).getArrayOfPtr("list").plus(i).getPtr())!=null; i++) {
|
||||
for (k = ND_order(aghead(e)) + 1; k <= max; k++)
|
||||
cross += Z._().Count.plus(k).getInt() * ED_xpenalty(e);
|
||||
cross += Z.z().Count.plus(k).getInt() * ED_xpenalty(e);
|
||||
}
|
||||
}
|
||||
for (i = 0; (e = (Agedge_s) ND_out(rtop.plus(top).getPtr()).getArrayOfPtr("list").plus(i).getPtr())!=null; i++) {
|
||||
int inv = ND_order(aghead(e));
|
||||
if (inv > max)
|
||||
max = inv;
|
||||
Z._().Count.plus(inv).setInt(Z._().Count.plus(inv).getInt() + ED_xpenalty(e));
|
||||
Z.z().Count.plus(inv).setInt(Z.z().Count.plus(inv).getInt() + ED_xpenalty(e));
|
||||
}
|
||||
}
|
||||
for (top = 0; top < GD_rank(g).plus(r).getInt("n"); top++) {
|
||||
@ -2538,7 +2538,7 @@ public static int ncross(Agraph_s g) {
|
||||
ENTERING("dbjmz2tnii2pn9sxg26ap6w5r","ncross");
|
||||
try {
|
||||
int r, count, nc;
|
||||
g = Z._().Root;
|
||||
g = Z.z().Root;
|
||||
count = 0;
|
||||
for (r = GD_minrank(g); r < GD_maxrank(g); r++) {
|
||||
if (GD_rank(g).plus(r).getBoolean("valid"))
|
||||
@ -2623,7 +2623,7 @@ try {
|
||||
__ptr__ v;
|
||||
Agedge_s e;
|
||||
boolean hasfixed = false;
|
||||
list = Z._().TI_list;
|
||||
list = Z.z().TI_list;
|
||||
v = GD_rank(g).plus(r0).getPtr("v");
|
||||
for (i = 0; i < GD_rank(g).plus(r0).getInt("n"); i++) {
|
||||
n = (Agnode_s) v.plus(i).getPtr();
|
||||
@ -2761,9 +2761,9 @@ try {
|
||||
CString p;
|
||||
double f;
|
||||
/* set default values */
|
||||
Z._().MinQuit = 8;
|
||||
Z._().MaxIter = 24;
|
||||
Z._().Convergence = .995;
|
||||
Z.z().MinQuit = 8;
|
||||
Z.z().MaxIter = 24;
|
||||
Z.z().Convergence = .995;
|
||||
p = agget(g, new CString("mclimit"));
|
||||
if (p!=null && ((f = atof(p)) > 0.0)) {
|
||||
UNSUPPORTED("4iu53eiz077u6joqgwawca8ya"); // MinQuit = ((1)>(MinQuit * f)?(1):(MinQuit * f));
|
||||
|
@ -869,7 +869,7 @@ try {
|
||||
return; /* ignore empty graph */
|
||||
mark_lowclusters(g); /* we could remove from splines.c now */
|
||||
set_ycoords(g);
|
||||
if (Z._().Concentrate)
|
||||
if (Z.z().Concentrate)
|
||||
dot_concentrate(g);
|
||||
expand_leaves(g);
|
||||
if (flat_edges(g)!=0)
|
||||
@ -1205,7 +1205,7 @@ ENTERING("73cdgjl47ohty2va766evbo4","keepout_othernodes");
|
||||
try {
|
||||
int i, c, r, margin;
|
||||
Agnode_s u, v;
|
||||
margin = late_int (g, Z._().G_margin, 8, 0);
|
||||
margin = late_int (g, Z.z().G_margin, 8, 0);
|
||||
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
|
||||
if (GD_rank(g).plus(r).getInt("n") == 0)
|
||||
continue;
|
||||
@ -1246,7 +1246,7 @@ ENTERING("c734mx1638sfqtl7vh7itaxyx","contain_subclust");
|
||||
try {
|
||||
int margin, c;
|
||||
Agraph_s subg;
|
||||
margin = late_int (g, Z._().G_margin, 8, 0);
|
||||
margin = late_int (g, Z.z().G_margin, 8, 0);
|
||||
make_lrvn(g);
|
||||
for (c = 1; c <= GD_n_cluster(g); c++) {
|
||||
subg = (Agraph_s) GD_clust(g).plus(c).getPtr();
|
||||
@ -1273,7 +1273,7 @@ try {
|
||||
int i, j, margin;
|
||||
Agraph_s low, high;
|
||||
Agraph_s left, right;
|
||||
margin = late_int (g, Z._().G_margin, 8, 0);
|
||||
margin = late_int (g, Z.z().G_margin, 8, 0);
|
||||
for (i = 1; i <= GD_n_cluster(g); i++)
|
||||
make_lrvn((Agraph_s) GD_clust(g).plus(i).getPtr());
|
||||
for (i = 1; i <= GD_n_cluster(g); i++) {
|
||||
@ -1542,7 +1542,7 @@ try {
|
||||
if (EQ(g, dot_root(g)))
|
||||
margin = 8;
|
||||
else
|
||||
margin = late_int (g, Z._().G_margin, 8, 0);
|
||||
margin = late_int (g, Z.z().G_margin, 8, 0);
|
||||
ht1 = GD_ht1(g);
|
||||
ht2 = GD_ht2(g);
|
||||
/* account for sub-clusters */
|
||||
@ -1617,7 +1617,7 @@ try {
|
||||
}
|
||||
/* update nearest enclosing cluster rank ht */
|
||||
if ((clust = ND_clust(n))!=null) {
|
||||
int yoff = (clust == g ? 0 : late_int (clust, Z._().G_margin, 8, 0));
|
||||
int yoff = (clust == g ? 0 : late_int (clust, Z.z().G_margin, 8, 0));
|
||||
if (ND_rank(n) == GD_minrank(clust))
|
||||
GD_ht2(clust, MAX(GD_ht2(clust), ht2 + yoff));
|
||||
if (ND_rank(n) == GD_maxrank(clust))
|
||||
@ -2097,7 +2097,7 @@ ENTERING("daz786541idcxnywckcbncazb","contain_nodes");
|
||||
try {
|
||||
int margin, r;
|
||||
Agnode_s ln, rn, v;
|
||||
margin = late_int (g, Z._().G_margin, 8, 0);
|
||||
margin = late_int (g, Z.z().G_margin, 8, 0);
|
||||
make_lrvn(g);
|
||||
ln = GD_ln(g);
|
||||
rn = GD_rn(g);
|
||||
|
@ -1039,7 +1039,7 @@ try {
|
||||
if (agfstnode(subg) == null)
|
||||
return;
|
||||
make_new_cluster(g, subg);
|
||||
if (Z._().CL_type == 100) {
|
||||
if (Z.z().CL_type == 100) {
|
||||
dot1_rank(subg, null);
|
||||
cluster_leader(subg);
|
||||
} else
|
||||
@ -1062,7 +1062,7 @@ try {
|
||||
for (subg = agfstsubg(g); subg!=null; subg = agnxtsubg(subg)) {
|
||||
c = rank_set_class(subg);
|
||||
if (c!=0) {
|
||||
if ((c == 7) && Z._().CL_type == 100)
|
||||
if ((c == 7) && Z.z().CL_type == 100)
|
||||
collapse_cluster(rg, subg);
|
||||
else
|
||||
collapse_rankset(rg, subg, c);
|
||||
@ -1244,7 +1244,7 @@ try {
|
||||
n = agnxtnode(g, n);
|
||||
}
|
||||
if (EQ(g, dot_root(g))) {
|
||||
if (Z._().CL_type == 100) {
|
||||
if (Z.z().CL_type == 100) {
|
||||
for (c = 1; c <= GD_n_cluster(g); c++)
|
||||
set_minmax((Agraph_s) GD_clust(g).plus(c).getPtr());
|
||||
} else {
|
||||
|
@ -707,9 +707,9 @@ try {
|
||||
int n_samehead; /* number of same_t groups on current node */
|
||||
int n_sametail; /* number of same_t groups on current node */
|
||||
int i;
|
||||
Z._().E_samehead = agattr(g, AGEDGE, new CString("samehead"),null);
|
||||
Z._().E_sametail = agattr(g, AGEDGE, new CString("sametail"),null);
|
||||
if (N(Z._().E_samehead!=null || Z._().E_sametail!=null))
|
||||
Z.z().E_samehead = agattr(g, AGEDGE, new CString("samehead"),null);
|
||||
Z.z().E_sametail = agattr(g, AGEDGE, new CString("sametail"),null);
|
||||
if (N(Z.z().E_samehead!=null || Z.z().E_sametail!=null))
|
||||
return;
|
||||
UNSUPPORTED("44thr6ep72jsj3fksjiwdx3yr"); // for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
|
||||
UNSUPPORTED("4roxmr5lxkjz6gn1j9mndurq2"); // n_samehead = n_sametail = 0;
|
||||
|
@ -101,14 +101,14 @@ UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
|
||||
/* generate the splines */
|
||||
evs.plus(0).getStruct().____(normv(evs.plus(0).getStruct()));
|
||||
evs.plus(1).getStruct().____(normv(evs.plus(1).getStruct()));
|
||||
Z._().opl = 0;
|
||||
Z.z().opl = 0;
|
||||
growops(4);
|
||||
Z._().ops_route.plus(Z._().opl).setStruct(inps.plus(0).getStruct());
|
||||
Z._().opl++;
|
||||
Z.z().ops_route.plus(Z.z().opl).setStruct(inps.plus(0).getStruct());
|
||||
Z.z().opl++;
|
||||
if (reallyroutespline(edges, edgen, inps, inpn, evs.plus(0).getStruct(), evs.plus(1).getStruct()) == -1)
|
||||
return -1;
|
||||
output.setInt("pn", Z._().opl);
|
||||
output.setPtr("ps", Z._().ops_route);
|
||||
output.setInt("pn", Z.z().opl);
|
||||
output.setPtr("ps", Z.z().ops_route);
|
||||
return 0;
|
||||
} finally {
|
||||
LEAVING("9stmrdqlmufyk2wutp3totr5j","Proutespline");
|
||||
@ -133,33 +133,33 @@ try {
|
||||
final __struct__<pointf> v1 = __struct__.from(pointf.class), v2 = __struct__.from(pointf.class), splitv = __struct__.from(pointf.class), splitv1 = __struct__.from(pointf.class), splitv2 = __struct__.from(pointf.class);
|
||||
double maxd, d, t;
|
||||
int maxi, i, spliti;
|
||||
if (Z._().tnan < inpn) {
|
||||
if (N(Z._().tnas)) {
|
||||
if (N(Z._().tnas = Memory.malloc(sizeof(tna_t.class, inpn))))
|
||||
if (Z.z().tnan < inpn) {
|
||||
if (N(Z.z().tnas)) {
|
||||
if (N(Z.z().tnas = Memory.malloc(sizeof(tna_t.class, inpn))))
|
||||
return -1;
|
||||
} else {
|
||||
if (N(Z._().tnas = Memory.realloc(Z._().tnas, sizeof(tna_t.class, inpn))))
|
||||
if (N(Z.z().tnas = Memory.realloc(Z.z().tnas, sizeof(tna_t.class, inpn))))
|
||||
return -1;
|
||||
}
|
||||
Z._().tnan = inpn;
|
||||
Z.z().tnan = inpn;
|
||||
}
|
||||
Z._().tnas.plus(0).getStruct().setDouble("t", 0);
|
||||
Z.z().tnas.plus(0).getStruct().setDouble("t", 0);
|
||||
for (i = 1; i < inpn; i++)
|
||||
Z._().tnas.plus(i).getStruct().setDouble("t", Z._().tnas.plus(i-1).getStruct().getDouble("t") + dist(inps.plus(i).getStruct(), inps.plus(i-1).getStruct()));
|
||||
Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i-1).getStruct().getDouble("t") + dist(inps.plus(i).getStruct(), inps.plus(i-1).getStruct()));
|
||||
for (i = 1; i < inpn; i++)
|
||||
Z._().tnas.plus(i).getStruct().setDouble("t", Z._().tnas.plus(i).getStruct().getDouble("t") / Z._().tnas.plus(inpn - 1).getStruct().getDouble("t"));
|
||||
Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i).getStruct().getDouble("t") / Z.z().tnas.plus(inpn - 1).getStruct().getDouble("t"));
|
||||
for (i = 0; i < inpn; i++) {
|
||||
Z._().tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).setStruct(scale(ev0, B1(Z._().tnas.plus(i).getStruct().getDouble("t"))));
|
||||
Z._().tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).setStruct(scale(ev1, B2(Z._().tnas.plus(i).getStruct().getDouble("t"))));
|
||||
Z.z().tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).setStruct(scale(ev0, B1(Z.z().tnas.plus(i).getStruct().getDouble("t"))));
|
||||
Z.z().tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).setStruct(scale(ev1, B2(Z.z().tnas.plus(i).getStruct().getDouble("t"))));
|
||||
}
|
||||
if (mkspline(inps, inpn, Z._().tnas, ev0, ev1, p1.amp(), v1.amp(), p2.amp(), v2.amp()) == -1)
|
||||
if (mkspline(inps, inpn, Z.z().tnas, ev0, ev1, p1.amp(), v1.amp(), p2.amp(), v2.amp()) == -1)
|
||||
return -1;
|
||||
if (splinefits(edges, edgen, p1, v1, p2, v2, inps, inpn)!=0)
|
||||
return 0;
|
||||
cp1.____(add(p1, scale(v1, 1 / 3.0)));
|
||||
cp2.____(sub(p2, scale(v2, 1 / 3.0)));
|
||||
for (maxd = -1, maxi = -1, i = 1; i < inpn - 1; i++) {
|
||||
t = Z._().tnas.plus(i).getDouble("t");
|
||||
t = Z.z().tnas.plus(i).getDouble("t");
|
||||
p.setDouble("x", B0(t) * p1.getDouble("x") + B1(t) * cp1.getDouble("x") + B2(t) * cp2.getDouble("x") + B3(t) * p2.getDouble("x"));
|
||||
p.setDouble("y", B0(t) * p1.getDouble("y") + B1(t) * cp1.getDouble("y") + B2(t) * cp2.getDouble("y") + B3(t) * p2.getDouble("y"));
|
||||
if ((d = dist(p, inps.plus(i).getStruct())) > maxd)
|
||||
@ -292,22 +292,22 @@ try {
|
||||
return 0;
|
||||
first = 0;
|
||||
if (splineisinside(edges, edgen, sps)) {
|
||||
growops(Z._().opl + 4);
|
||||
growops(Z.z().opl + 4);
|
||||
for (pi = 1; pi < 4; pi++) {
|
||||
Z._().ops_route.plus(Z._().opl).setDouble("x", sps.plus(pi).getStruct().getDouble("x"));
|
||||
Z._().ops_route.plus(Z._().opl).setDouble("y", sps.plus(pi).getStruct().getDouble("y"));
|
||||
Z._().opl++;
|
||||
Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().getDouble("x"));
|
||||
Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().getDouble("y"));
|
||||
Z.z().opl++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
if (a == 0 && b == 0) {
|
||||
if (forceflag!=0) {
|
||||
growops(Z._().opl + 4);
|
||||
growops(Z.z().opl + 4);
|
||||
for (pi = 1; pi < 4; pi++)
|
||||
{
|
||||
Z._().ops_route.plus(Z._().opl).setDouble("x", sps.plus(pi).getStruct().getDouble("x"));
|
||||
Z._().ops_route.plus(Z._().opl).setDouble("y", sps.plus(pi).getStruct().getDouble("y"));
|
||||
Z._().opl++;
|
||||
Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().getDouble("x"));
|
||||
Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().getDouble("y"));
|
||||
Z.z().opl++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -531,21 +531,21 @@ LEAVING("3i8m1m9fg7qmnt8jloorwlu8e","normv");
|
||||
public static void growops(int newopn) {
|
||||
ENTERING("d59jcnpi1y0wr8e9uwxny2fvk","growops");
|
||||
try {
|
||||
if (newopn <= Z._().opn_route)
|
||||
if (newopn <= Z.z().opn_route)
|
||||
return;
|
||||
if (N(Z._().ops_route)) {
|
||||
if (N(Z._().ops_route = Memory.malloc(sizeof (pointf.class, newopn)))) {
|
||||
if (N(Z.z().ops_route)) {
|
||||
if (N(Z.z().ops_route = Memory.malloc(sizeof (pointf.class, newopn)))) {
|
||||
UNSUPPORTED("413an1hqgkb4ezaec6qdsdplx"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\route.c", 32, ("cannot malloc ops"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
} else {
|
||||
if (N(Z._().ops_route = Memory.realloc(Z._().ops_route,
|
||||
if (N(Z.z().ops_route = Memory.realloc(Z.z().ops_route,
|
||||
sizeof (pointf.class, newopn)))) {
|
||||
UNSUPPORTED("8u0qgahxvk5pplf90thmhwxhl"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\route.c", 32, ("cannot realloc ops"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
}
|
||||
Z._().opn_route = newopn;
|
||||
Z.z().opn_route = newopn;
|
||||
} finally {
|
||||
LEAVING("d59jcnpi1y0wr8e9uwxny2fvk","growops");
|
||||
}
|
||||
|
@ -123,11 +123,11 @@ try {
|
||||
return -2;
|
||||
/* make space */
|
||||
growpnls(polyp.getInt("pn"));
|
||||
Z._().pnll = 0;
|
||||
Z._().tril = 0;
|
||||
Z.z().pnll = 0;
|
||||
Z.z().tril = 0;
|
||||
growdq(polyp.getInt("pn") * 2);
|
||||
Z._().dq.setInt("fpnlpi", Z._().dq.getInt("pnlpn") / 2);
|
||||
Z._().dq.setInt("lpnlpi", Z._().dq.getInt("fpnlpi") - 1);
|
||||
Z.z().dq.setInt("fpnlpi", Z.z().dq.getInt("pnlpn") / 2);
|
||||
Z.z().dq.setInt("lpnlpi", Z.z().dq.getInt("fpnlpi") - 1);
|
||||
/* make sure polygon is CCW and load pnls array */
|
||||
for (pi = 0, minx = HUGE_VAL, minpi = -1; pi < polyp.getInt("pn"); pi++) {
|
||||
if (minx > polyp.getPtr("ps").plus(pi).getDouble("x"))
|
||||
@ -144,41 +144,41 @@ try {
|
||||
&& polyp.getPtr("ps").plus(pi).getDouble("x") == polyp.getPtr("ps").plus(pi+1).getDouble("x")
|
||||
&& polyp.getPtr("ps").plus(pi).getDouble("y") == polyp.getPtr("ps").plus(pi+1).getDouble("y"))
|
||||
continue;
|
||||
Z._().pnls.plus(Z._().pnll).setPtr("pp", polyp.getPtr("ps").plus(pi));
|
||||
Z._().pnls.plus(Z._().pnll).setPtr("link", Z._().pnls.plus(Z._().pnll % polyp.getInt("pn")));
|
||||
Z._().pnlps.plus(Z._().pnll).setPtr(Z._().pnls.plus(Z._().pnll).getPtr());
|
||||
Z._().pnll++;
|
||||
Z.z().pnls.plus(Z.z().pnll).setPtr("pp", polyp.getPtr("ps").plus(pi));
|
||||
Z.z().pnls.plus(Z.z().pnll).setPtr("link", Z.z().pnls.plus(Z.z().pnll % polyp.getInt("pn")));
|
||||
Z.z().pnlps.plus(Z.z().pnll).setPtr(Z.z().pnls.plus(Z.z().pnll).getPtr());
|
||||
Z.z().pnll++;
|
||||
}
|
||||
} else {
|
||||
for (pi = 0; pi < polyp.getInt("pn"); pi++) {
|
||||
if (pi > 0 && polyp.getPtr("ps").plus(pi).getDouble("x") == polyp.getPtr("ps").plus(pi - 1).getDouble("x") &&
|
||||
polyp.getPtr("ps").plus(pi).getDouble("y") == polyp.getPtr("ps").plus(pi - 1).getDouble("y"))
|
||||
continue;
|
||||
Z._().pnls.plus(Z._().pnll).setPtr("pp", polyp.getPtr("ps").plus(pi));
|
||||
Z._().pnls.plus(Z._().pnll).setPtr("link", Z._().pnls.plus(Z._().pnll % polyp.getInt("pn")));
|
||||
Z._().pnlps.plus(Z._().pnll).setPtr(Z._().pnls.plus(Z._().pnll));
|
||||
Z._().pnll++;
|
||||
Z.z().pnls.plus(Z.z().pnll).setPtr("pp", polyp.getPtr("ps").plus(pi));
|
||||
Z.z().pnls.plus(Z.z().pnll).setPtr("link", Z.z().pnls.plus(Z.z().pnll % polyp.getInt("pn")));
|
||||
Z.z().pnlps.plus(Z.z().pnll).setPtr(Z.z().pnls.plus(Z.z().pnll));
|
||||
Z.z().pnll++;
|
||||
}
|
||||
}
|
||||
/* generate list of triangles */
|
||||
triangulate(Z._().pnlps, Z._().pnll);
|
||||
triangulate(Z.z().pnlps, Z.z().pnll);
|
||||
/* connect all pairs of triangles that share an edge */
|
||||
for (trii = 0; trii < Z._().tril; trii++)
|
||||
for (trij = trii + 1; trij < Z._().tril; trij++)
|
||||
for (trii = 0; trii < Z.z().tril; trii++)
|
||||
for (trij = trii + 1; trij < Z.z().tril; trij++)
|
||||
connecttris(trii, trij);
|
||||
/* find first and last triangles */
|
||||
for (trii = 0; trii < Z._().tril; trii++)
|
||||
for (trii = 0; trii < Z.z().tril; trii++)
|
||||
if (pointintri(trii, eps.plus(0).getStruct().amp()))
|
||||
break;
|
||||
if (trii == Z._().tril) {
|
||||
if (trii == Z.z().tril) {
|
||||
UNSUPPORTED("4ma3y8l4lmjcsw49kmsgknig6"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("source point not in any triangle"));
|
||||
UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
|
||||
}
|
||||
ftrii = trii;
|
||||
for (trii = 0; trii < Z._().tril; trii++)
|
||||
for (trii = 0; trii < Z.z().tril; trii++)
|
||||
if (pointintri(trii, eps.plus(1).getStruct().amp()))
|
||||
break;
|
||||
if (trii == Z._().tril) {
|
||||
if (trii == Z.z().tril) {
|
||||
System.err.println("libpath/%s:%d: %s\n" + "graphviz-2.38.0\\lib\\pathplan\\shortest.c" + 26 + ("destination point not in any triangle"));
|
||||
return -1;
|
||||
}
|
||||
@ -189,9 +189,9 @@ UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
|
||||
/* a straight line is better than failing */
|
||||
growops(2);
|
||||
output.setInt("pn", 2);
|
||||
Z._().ops_shortest.plus(0).setStruct(eps.plus(0).getStruct());
|
||||
Z._().ops_shortest.plus(1).setStruct(eps.plus(1).getStruct());
|
||||
output.setPtr("ps", Z._().ops_shortest);
|
||||
Z.z().ops_shortest.plus(0).setStruct(eps.plus(0).getStruct());
|
||||
Z.z().ops_shortest.plus(1).setStruct(eps.plus(1).getStruct());
|
||||
output.setPtr("ps", Z.z().ops_shortest);
|
||||
return 0;
|
||||
}
|
||||
/* if endpoints in same triangle, use a single line */
|
||||
@ -208,10 +208,10 @@ UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
|
||||
epnls.plus(1).getStruct().setPtr("pp", eps.plus(1).asPtr());
|
||||
epnls.plus(1).getStruct().setPtr("link", null);
|
||||
add2dq(1, epnls.plus(0).asPtr());
|
||||
Z._().dq.setInt("apex", Z._().dq.getInt("fpnlpi"));
|
||||
Z.z().dq.setInt("apex", Z.z().dq.getInt("fpnlpi"));
|
||||
trii = ftrii;
|
||||
while (trii != -1) {
|
||||
trip = (triangle_t) Z._().tris.plus(trii);
|
||||
trip = (triangle_t) Z.z().tris.plus(trii);
|
||||
trip.setInt("mark", 2);
|
||||
/* find the left and right points of the exiting edge */
|
||||
for (ei = 0; ei < 3; ei++)
|
||||
@ -219,14 +219,14 @@ UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
|
||||
trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").getInt("mark") == 1)
|
||||
break;
|
||||
if (ei == 3) { /* in last triangle */
|
||||
if (ccw(eps.plus(1).asPtr(), Z._().dq.getPtr("pnlps").plus(Z._().dq.getInt("fpnlpi")).getPtr().getPtr("pp"),
|
||||
Z._().dq.getPtr("pnlps").plus(Z._().dq.getInt("lpnlpi")).getPtr().getPtr("pp")) == 1)
|
||||
if (ccw(eps.plus(1).asPtr(), Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).getPtr().getPtr("pp"),
|
||||
Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr().getPtr("pp")) == 1)
|
||||
{
|
||||
lpnlp = (pointnlink_t) Z._().dq.getPtr("pnlps").plus(Z._().dq.getInt("lpnlpi")).getPtr();
|
||||
lpnlp = (pointnlink_t) Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr();
|
||||
rpnlp = (pointnlink_t) epnls.plus(1).asPtr();
|
||||
} else {
|
||||
lpnlp = (pointnlink_t) epnls.plus(1).asPtr();
|
||||
rpnlp = (pointnlink_t) Z._().dq.getPtr("pnlps").plus(Z._().dq.getInt("lpnlpi")).getPtr();
|
||||
rpnlp = (pointnlink_t) Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr();
|
||||
}
|
||||
} else {
|
||||
pnlp = (pointnlink_t) trip.getArrayOfStruct("e").plus((ei + 1) % 3).getStruct().getPtr("pnl1p");
|
||||
@ -244,30 +244,30 @@ UNSUPPORTED("2cii65lhw4wb8nyvjv702v7md"); // lpnlp = trip->e[ei].pnl1p, rpnlp
|
||||
add2dq(2, lpnlp);
|
||||
add2dq(1, rpnlp);
|
||||
} else {
|
||||
if (NEQ(Z._().dq.getPtr("pnlps").plus(Z._().dq.getInt("fpnlpi")).getPtr(), rpnlp)
|
||||
&& NEQ(Z._().dq.getPtr("pnlps").plus(Z._().dq.getInt("lpnlpi")).getPtr(), rpnlp)) {
|
||||
if (NEQ(Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).getPtr(), rpnlp)
|
||||
&& NEQ(Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr(), rpnlp)) {
|
||||
/* add right point to deque */
|
||||
splitindex = finddqsplit(rpnlp);
|
||||
splitdq(2, splitindex);
|
||||
add2dq(1, rpnlp);
|
||||
/* if the split is behind the apex, then reset apex */
|
||||
if (splitindex > Z._().dq.getInt("apex"))
|
||||
Z._().dq.setInt("apex", splitindex);
|
||||
if (splitindex > Z.z().dq.getInt("apex"))
|
||||
Z.z().dq.setInt("apex", splitindex);
|
||||
} else {
|
||||
/* add left point to deque */
|
||||
splitindex = finddqsplit(lpnlp);
|
||||
splitdq(1, splitindex);
|
||||
add2dq(2, lpnlp);
|
||||
/* if the split is in front of the apex, then reset apex */
|
||||
if (splitindex < Z._().dq.getInt("apex"))
|
||||
Z._().dq.setInt("apex", splitindex);
|
||||
if (splitindex < Z.z().dq.getInt("apex"))
|
||||
Z.z().dq.setInt("apex", splitindex);
|
||||
}
|
||||
}
|
||||
trii = -1;
|
||||
for (ei = 0; ei < 3; ei++)
|
||||
if (trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp")!=null &&
|
||||
trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").getInt("mark") == 1) {
|
||||
trii = trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").minus(Z._().tris);
|
||||
trii = trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").minus(Z.z().tris);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -276,8 +276,8 @@ UNSUPPORTED("2cii65lhw4wb8nyvjv702v7md"); // lpnlp = trip->e[ei].pnl1p, rpnlp
|
||||
growops(pi);
|
||||
output.setInt("pn", pi);
|
||||
for (pi = pi - 1, pnlp = (pointnlink_t) epnls.plus(1).asPtr(); pnlp!=null; pi--, pnlp = (pointnlink_t) pnlp.getPtr("link"))
|
||||
Z._().ops_shortest.plus(pi).setPtr(pnlp.getPtr("pp"));
|
||||
output.setPtr("ps", Z._().ops_shortest);
|
||||
Z.z().ops_shortest.plus(pi).setPtr(pnlp.getPtr("pp"));
|
||||
output.setPtr("ps", Z.z().ops_shortest);
|
||||
return 0;
|
||||
} finally {
|
||||
LEAVING("2gub5b19vo2qexn56nw23wage","Pshortestpath");
|
||||
@ -371,9 +371,9 @@ try {
|
||||
triangle_t trip;
|
||||
int ei;
|
||||
/* make space */
|
||||
if (Z._().tril >= Z._().trin)
|
||||
growtris(Z._().trin + 20);
|
||||
trip = (triangle_t) Z._().tris.plus(Z._().tril++);
|
||||
if (Z.z().tril >= Z.z().trin)
|
||||
growtris(Z.z().trin + 20);
|
||||
trip = (triangle_t) Z.z().tris.plus(Z.z().tril++);
|
||||
trip.setInt("mark", 0);
|
||||
trip.getArrayOfStruct("e").plus(0).getStruct().setPtr("pnl0p", pnlap);
|
||||
trip.getArrayOfStruct("e").plus(0).getStruct().setPtr("pnl1p", pnlbp);
|
||||
@ -403,8 +403,8 @@ try {
|
||||
int ei, ej;
|
||||
for (ei = 0; ei < 3; ei++) {
|
||||
for (ej = 0; ej < 3; ej++) {
|
||||
tri1p = (triangle_t) Z._().tris.plus(tri1);
|
||||
tri2p = (triangle_t) Z._().tris.plus(tri2);
|
||||
tri1p = (triangle_t) Z.z().tris.plus(tri1);
|
||||
tri2p = (triangle_t) Z.z().tris.plus(tri2);
|
||||
if ((EQ(tri1p.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"),
|
||||
tri2p.getArrayOfStruct("e").plus(ej).getStruct().getPtr("pnl0p").getPtr("pp")) &&
|
||||
EQ(tri1p.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp"),
|
||||
@ -433,16 +433,16 @@ public static boolean marktripath(int trii, int trij) {
|
||||
ENTERING("3waxf5wy3mwt12wpg5hxg3o9c","marktripath");
|
||||
try {
|
||||
int ei;
|
||||
if (Z._().tris.plus(trii).getBoolean("mark"))
|
||||
if (Z.z().tris.plus(trii).getBoolean("mark"))
|
||||
return false;
|
||||
Z._().tris.plus(trii).setInt("mark", 1);
|
||||
Z.z().tris.plus(trii).setInt("mark", 1);
|
||||
if (trii == trij)
|
||||
return ((!(false)));
|
||||
for (ei = 0; ei < 3; ei++)
|
||||
if (Z._().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp")!=null &&
|
||||
marktripath(Z._().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").minus(Z._().tris), trij))
|
||||
if (Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp")!=null &&
|
||||
marktripath(Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").minus(Z.z().tris), trij))
|
||||
return ((!(false)));
|
||||
Z._().tris.plus(trii).setInt("mark", 0);
|
||||
Z.z().tris.plus(trii).setInt("mark", 0);
|
||||
return false;
|
||||
} finally {
|
||||
LEAVING("3waxf5wy3mwt12wpg5hxg3o9c","marktripath");
|
||||
@ -458,17 +458,17 @@ public static void add2dq(int side, __ptr__ pnlp) {
|
||||
ENTERING("44szdl31mg8mt5qrfj70kb2sn","add2dq");
|
||||
try {
|
||||
if (side == 1) {
|
||||
if (Z._().dq.getInt("lpnlpi") - Z._().dq.getInt("fpnlpi") >= 0)
|
||||
pnlp.setPtr("link", Z._().dq.getPtr("pnlps").plus(Z._().dq.getInt("fpnlpi")).getPtr());
|
||||
if (Z.z().dq.getInt("lpnlpi") - Z.z().dq.getInt("fpnlpi") >= 0)
|
||||
pnlp.setPtr("link", Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).getPtr());
|
||||
/* shortest path links */
|
||||
Z._().dq.setInt("fpnlpi", Z._().dq.getInt("fpnlpi")-1);
|
||||
Z._().dq.getPtr("pnlps").plus(Z._().dq.getInt("fpnlpi")).setPtr(pnlp);
|
||||
Z.z().dq.setInt("fpnlpi", Z.z().dq.getInt("fpnlpi")-1);
|
||||
Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).setPtr(pnlp);
|
||||
} else {
|
||||
if (Z._().dq.getInt("lpnlpi") - Z._().dq.getInt("fpnlpi") >= 0)
|
||||
pnlp.setPtr("link", Z._().dq.getPtr("pnlps").plus(Z._().dq.getInt("lpnlpi")).getPtr());
|
||||
if (Z.z().dq.getInt("lpnlpi") - Z.z().dq.getInt("fpnlpi") >= 0)
|
||||
pnlp.setPtr("link", Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr());
|
||||
/* shortest path links */
|
||||
Z._().dq.setInt("lpnlpi", Z._().dq.getInt("lpnlpi")+1);
|
||||
Z._().dq.getPtr("pnlps").plus(Z._().dq.getInt("lpnlpi")).setPtr(pnlp);
|
||||
Z.z().dq.setInt("lpnlpi", Z.z().dq.getInt("lpnlpi")+1);
|
||||
Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).setPtr(pnlp);
|
||||
}
|
||||
} finally {
|
||||
LEAVING("44szdl31mg8mt5qrfj70kb2sn","add2dq");
|
||||
@ -484,9 +484,9 @@ public static void splitdq(int side, int index) {
|
||||
ENTERING("572sssdz1se16w790xceiy5vr","splitdq");
|
||||
try {
|
||||
if (side == 1)
|
||||
Z._().dq.setInt("lpnlpi", index);
|
||||
Z.z().dq.setInt("lpnlpi", index);
|
||||
else
|
||||
Z._().dq.setInt("fpnlpi", index);
|
||||
Z.z().dq.setInt("fpnlpi", index);
|
||||
} finally {
|
||||
LEAVING("572sssdz1se16w790xceiy5vr","splitdq");
|
||||
}
|
||||
@ -501,15 +501,15 @@ public static int finddqsplit(pointnlink_t pnlp) {
|
||||
ENTERING("9dnrc8vqpffp5t3bmsackgqtl","finddqsplit");
|
||||
try {
|
||||
int index;
|
||||
for (index = Z._().dq.getInt("fpnlpi"); index < Z._().dq.getInt("apex"); index++)
|
||||
if (ccw(Z._().dq.getPtr("pnlps").plus(index + 1).getPtr().getPtr("pp"), Z._().dq.getPtr("pnlps").plus(index).getPtr().getPtr("pp"), pnlp.getPtr("pp")) ==
|
||||
for (index = Z.z().dq.getInt("fpnlpi"); index < Z.z().dq.getInt("apex"); index++)
|
||||
if (ccw(Z.z().dq.getPtr("pnlps").plus(index + 1).getPtr().getPtr("pp"), Z.z().dq.getPtr("pnlps").plus(index).getPtr().getPtr("pp"), pnlp.getPtr("pp")) ==
|
||||
1)
|
||||
return index;
|
||||
for (index = Z._().dq.getInt("lpnlpi"); index > Z._().dq.getInt("apex"); index--)
|
||||
if (ccw(Z._().dq.getPtr("pnlps").plus(index - 1).getPtr().getPtr("pp"), Z._().dq.getPtr("pnlps").plus(index).getPtr().getPtr("pp"), pnlp.getPtr("pp")) ==
|
||||
for (index = Z.z().dq.getInt("lpnlpi"); index > Z.z().dq.getInt("apex"); index--)
|
||||
if (ccw(Z.z().dq.getPtr("pnlps").plus(index - 1).getPtr().getPtr("pp"), Z.z().dq.getPtr("pnlps").plus(index).getPtr().getPtr("pp"), pnlp.getPtr("pp")) ==
|
||||
2)
|
||||
return index;
|
||||
return Z._().dq.getInt("apex");
|
||||
return Z.z().dq.getInt("apex");
|
||||
} finally {
|
||||
LEAVING("9dnrc8vqpffp5t3bmsackgqtl","finddqsplit");
|
||||
}
|
||||
@ -591,8 +591,8 @@ ENTERING("zti1mzm2m7tr2xwnbf7e8u3d","pointintri");
|
||||
try {
|
||||
int ei, sum;
|
||||
for (ei = 0, sum = 0; ei < 3; ei++)
|
||||
if (ccw(Z._().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"),
|
||||
Z._().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp"), pp) != 2)
|
||||
if (ccw(Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"),
|
||||
Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp"), pp) != 2)
|
||||
sum++;
|
||||
return (sum == 3 || sum == 0);
|
||||
} finally {
|
||||
@ -608,30 +608,30 @@ LEAVING("zti1mzm2m7tr2xwnbf7e8u3d","pointintri");
|
||||
public static void growpnls(int newpnln) {
|
||||
ENTERING("85wstb60jkjd0kbh9tyninm4h","growpnls");
|
||||
try {
|
||||
if (newpnln <= Z._().pnln)
|
||||
if (newpnln <= Z.z().pnln)
|
||||
return;
|
||||
if (N(Z._().pnls)) {
|
||||
if (N(Z._().pnls = (pointnlink_t) Memory.malloc(sizeof (pointnlink_t.class, newpnln)))) {
|
||||
if (N(Z.z().pnls)) {
|
||||
if (N(Z.z().pnls = (pointnlink_t) Memory.malloc(sizeof (pointnlink_t.class, newpnln)))) {
|
||||
UNSUPPORTED("9zyfc4bjg3i6rrna9vqf8doys"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc pnls"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
if (N(Z._().pnlps = Memory.malloc(sizeof_starstar_empty(pointnlink_t.class, newpnln)))) {
|
||||
if (N(Z.z().pnlps = Memory.malloc(sizeof_starstar_empty(pointnlink_t.class, newpnln)))) {
|
||||
UNSUPPORTED("1etar0wd2cbbvqo4jnmbvjiz4"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc pnlps"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
} else {
|
||||
if (N(Z._().pnls = (pointnlink_t) Memory.realloc(Z._().pnls,
|
||||
if (N(Z.z().pnls = (pointnlink_t) Memory.realloc(Z.z().pnls,
|
||||
sizeof (pointnlink_t.class, newpnln)))) {
|
||||
UNSUPPORTED("105nogpkt0qqut0yu4alvkk1u"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc pnls"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
if (N(Z._().pnlps = Memory.realloc(Z._().pnlps,
|
||||
if (N(Z.z().pnlps = Memory.realloc(Z.z().pnlps,
|
||||
sizeof_starstar_empty(pointnlink_t.class, newpnln)))) {
|
||||
UNSUPPORTED("be84alh84ub40x4um989aj20d"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc pnlps"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
}
|
||||
Z._().pnln = newpnln;
|
||||
Z.z().pnln = newpnln;
|
||||
} finally {
|
||||
LEAVING("85wstb60jkjd0kbh9tyninm4h","growpnls");
|
||||
}
|
||||
@ -645,20 +645,20 @@ LEAVING("85wstb60jkjd0kbh9tyninm4h","growpnls");
|
||||
public static void growtris(int newtrin) {
|
||||
ENTERING("c5q8ult6w26jppe5ifzgcoq82","growtris");
|
||||
try {
|
||||
if (newtrin <= Z._().trin)
|
||||
if (newtrin <= Z.z().trin)
|
||||
return;
|
||||
if (N(Z._().tris)) {
|
||||
if (N(Z._().tris = Memory.malloc(sizeof(triangle_t.class, newtrin)))) {
|
||||
if (N(Z.z().tris)) {
|
||||
if (N(Z.z().tris = Memory.malloc(sizeof(triangle_t.class, newtrin)))) {
|
||||
UNSUPPORTED("5782e28cjpaa3dpf8up4zmtq7"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc tris"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
} else {
|
||||
if (N(Z._().tris = Memory.realloc(Z._().tris, sizeof (triangle_t.class, newtrin)))) {
|
||||
if (N(Z.z().tris = Memory.realloc(Z.z().tris, sizeof (triangle_t.class, newtrin)))) {
|
||||
UNSUPPORTED("d3fgu54pn5tydfhn7z73v73ra"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc tris"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
}
|
||||
Z._().trin = newtrin;
|
||||
Z.z().trin = newtrin;
|
||||
} finally {
|
||||
LEAVING("c5q8ult6w26jppe5ifzgcoq82","growtris");
|
||||
}
|
||||
@ -672,23 +672,23 @@ LEAVING("c5q8ult6w26jppe5ifzgcoq82","growtris");
|
||||
public static void growdq(int newdqn) {
|
||||
ENTERING("bzym9u6dtatii1vp4hcmofc80","growdq");
|
||||
try {
|
||||
if (newdqn <= Z._().dq.getInt("pnlpn"))
|
||||
if (newdqn <= Z.z().dq.getInt("pnlpn"))
|
||||
return;
|
||||
if (N(Z._().dq.getPtr("pnlps"))) {
|
||||
if (N(Z.z().dq.getPtr("pnlps"))) {
|
||||
if (N
|
||||
(Z._().dq.setPtr("pnlps",
|
||||
(Z.z().dq.setPtr("pnlps",
|
||||
(__ptr__) Memory.malloc(sizeof_starstar_empty(pointnlink_t.class, newdqn))))) {
|
||||
UNSUPPORTED("88fwpb40wz9jc8jiz7u032s4t"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc dq.pnls"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
} else {
|
||||
if (N(Z._().dq.setPtr("pnlps", (__ptr__) Memory.realloc(Z._().dq.getPtr("pnlps"),
|
||||
if (N(Z.z().dq.setPtr("pnlps", (__ptr__) Memory.realloc(Z.z().dq.getPtr("pnlps"),
|
||||
sizeof_starstar_empty(pointnlink_t.class, newdqn))))) {
|
||||
UNSUPPORTED("exqx4ck7h15m8whgip6xpnhoo"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc dq.pnls"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
}
|
||||
Z._().dq.setInt("pnlpn", newdqn);
|
||||
Z.z().dq.setInt("pnlpn", newdqn);
|
||||
} finally {
|
||||
LEAVING("bzym9u6dtatii1vp4hcmofc80","growdq");
|
||||
}
|
||||
@ -702,21 +702,21 @@ LEAVING("bzym9u6dtatii1vp4hcmofc80","growdq");
|
||||
public static void growops(int newopn) {
|
||||
ENTERING("d7vtt8xqxbdnx9kwtt1zzof75","growops");
|
||||
try {
|
||||
if (newopn <= Z._().opn_shortest)
|
||||
if (newopn <= Z.z().opn_shortest)
|
||||
return;
|
||||
if (N(Z._().ops_shortest)) {
|
||||
if (N(Z._().ops_shortest = Memory.malloc(sizeof(pointf.class, newopn)))) {
|
||||
if (N(Z.z().ops_shortest)) {
|
||||
if (N(Z.z().ops_shortest = Memory.malloc(sizeof(pointf.class, newopn)))) {
|
||||
UNSUPPORTED("7wxgcgah7iy6vetj5yszoq4k4"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc ops"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
} else {
|
||||
if (N(Z._().ops_shortest = Memory.realloc(Z._().ops_shortest,
|
||||
if (N(Z.z().ops_shortest = Memory.realloc(Z.z().ops_shortest,
|
||||
sizeof(pointf.class, newopn)))) {
|
||||
UNSUPPORTED("7azrdo5s3kc44taqmtmeu1s33"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc ops"));
|
||||
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
|
||||
}
|
||||
}
|
||||
Z._().opn_shortest = newopn;
|
||||
Z.z().opn_shortest = newopn;
|
||||
} finally {
|
||||
LEAVING("d7vtt8xqxbdnx9kwtt1zzof75","growops");
|
||||
}
|
||||
|
84
src/net/sourceforge/plantuml/BaseFile.java
Normal file
84
src/net/sourceforge/plantuml/BaseFile.java
Normal file
@ -0,0 +1,84 @@
|
||||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 9997 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class BaseFile {
|
||||
|
||||
private final String basename;
|
||||
private final File basedir;
|
||||
|
||||
public BaseFile() {
|
||||
this.basedir = null;
|
||||
this.basename = null;
|
||||
}
|
||||
|
||||
public BaseFile(File file) {
|
||||
this.basedir = file.getParentFile();
|
||||
this.basename = extractBasename(file.getName());
|
||||
}
|
||||
|
||||
private static String extractBasename(String name) {
|
||||
final int idx = name.lastIndexOf('.');
|
||||
if (idx == -1) {
|
||||
return name;
|
||||
}
|
||||
return name.substring(0, idx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (basedir == null || basename == null) {
|
||||
return "(DEFAULT)";
|
||||
}
|
||||
return basedir + " " + basename;
|
||||
}
|
||||
|
||||
public String getBasename() {
|
||||
return basename;
|
||||
}
|
||||
|
||||
public File getBasedir() {
|
||||
return basedir;
|
||||
}
|
||||
|
||||
public File getTraceFile(String tail) {
|
||||
if (basedir == null || basename == null) {
|
||||
return new File(tail);
|
||||
}
|
||||
return new File(basedir, basename + "_" + tail);
|
||||
}
|
||||
|
||||
}
|
@ -53,6 +53,10 @@ public enum Direction {
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
||||
public String getShortCode() {
|
||||
return name().substring(0, 1);
|
||||
}
|
||||
|
||||
public static Direction fromChar(char c) {
|
||||
if (c == '<') {
|
||||
|
@ -56,7 +56,6 @@ import net.sourceforge.plantuml.ugraphic.html5.UGraphicHtml5;
|
||||
import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg;
|
||||
import net.sourceforge.plantuml.ugraphic.tikz.UGraphicTikz;
|
||||
import net.sourceforge.plantuml.ugraphic.visio.UGraphicVdx;
|
||||
import net.sourceforge.plantuml.StringUtils;
|
||||
|
||||
/**
|
||||
* A FileFormat with some parameters.
|
||||
@ -74,7 +73,7 @@ public class FileFormatOption implements Serializable {
|
||||
private final String svgLinkTarget;
|
||||
|
||||
public FileFormatOption(FileFormat fileFormat) {
|
||||
this(fileFormat, null, true, false, "_top");
|
||||
this(fileFormat, null, true, false, "_top", false);
|
||||
}
|
||||
|
||||
public String getSvgLinkTarget() {
|
||||
@ -86,24 +85,25 @@ public class FileFormatOption implements Serializable {
|
||||
}
|
||||
|
||||
public FileFormatOption(FileFormat fileFormat, boolean withMetadata) {
|
||||
this(fileFormat, null, false, false, "_top");
|
||||
this(fileFormat, null, false, false, "_top", false);
|
||||
}
|
||||
|
||||
private FileFormatOption(FileFormat fileFormat, AffineTransform at, boolean withMetadata, boolean useRedForError,
|
||||
String svgLinkTarget) {
|
||||
String svgLinkTarget, boolean debugsvek) {
|
||||
this.fileFormat = fileFormat;
|
||||
this.affineTransform = at;
|
||||
this.withMetadata = withMetadata;
|
||||
this.useRedForError = useRedForError;
|
||||
this.svgLinkTarget = svgLinkTarget;
|
||||
this.debugsvek = debugsvek;
|
||||
}
|
||||
|
||||
public FileFormatOption withUseRedForError() {
|
||||
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget);
|
||||
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek);
|
||||
}
|
||||
|
||||
public FileFormatOption withSvgLinkTarget(String target) {
|
||||
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, target);
|
||||
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, target, debugsvek);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -213,4 +213,14 @@ public class FileFormatOption implements Serializable {
|
||||
return useRedForError;
|
||||
}
|
||||
|
||||
private boolean debugsvek = false;
|
||||
|
||||
public void setDebugSvek(boolean debugsvek) {
|
||||
this.debugsvek = debugsvek;
|
||||
}
|
||||
|
||||
public boolean isDebugSvek() {
|
||||
return debugsvek;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -67,9 +67,7 @@ public class FileUtils {
|
||||
f = new File(name);
|
||||
}
|
||||
Log.info("Creating temporary file: " + f);
|
||||
if (OptionFlags.getInstance().isKeepTmpFiles() == false) {
|
||||
f.deleteOnExit();
|
||||
}
|
||||
f.deleteOnExit();
|
||||
return f;
|
||||
}
|
||||
|
||||
|
@ -127,5 +127,8 @@ public interface ISkinParam extends ISkinSimple {
|
||||
public int getTabSize();
|
||||
|
||||
public int maxAsciiMessageLength();
|
||||
|
||||
public int colorArrowSeparationSpace();
|
||||
|
||||
|
||||
}
|
80
src/net/sourceforge/plantuml/NamedOutputStream.java
Normal file
80
src/net/sourceforge/plantuml/NamedOutputStream.java
Normal file
@ -0,0 +1,80 @@
|
||||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 9997 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
public class NamedOutputStream extends OutputStream {
|
||||
|
||||
private final OutputStream os;
|
||||
private final BaseFile basefile;
|
||||
|
||||
public NamedOutputStream(File file) throws FileNotFoundException {
|
||||
this.os = new BufferedOutputStream(new FileOutputStream(file));
|
||||
this.basefile = new BaseFile(file);
|
||||
}
|
||||
|
||||
public void close() throws IOException {
|
||||
os.close();
|
||||
|
||||
}
|
||||
|
||||
public void flush() throws IOException {
|
||||
os.flush();
|
||||
|
||||
}
|
||||
|
||||
public void write(byte[] b) throws IOException {
|
||||
os.write(b);
|
||||
|
||||
}
|
||||
|
||||
public void write(byte[] b, int off, int len) throws IOException {
|
||||
os.write(b, off, len);
|
||||
}
|
||||
|
||||
public void write(int b) throws IOException {
|
||||
os.write(b);
|
||||
}
|
||||
|
||||
public BaseFile getBasefile() {
|
||||
return basefile;
|
||||
}
|
||||
|
||||
}
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19543 $
|
||||
* Revision $Revision: 19636 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
@ -65,6 +65,7 @@ public class Option {
|
||||
private boolean failfast2 = false;
|
||||
private boolean pattern = false;
|
||||
private boolean duration = false;
|
||||
private boolean debugsvek = false;
|
||||
private int nbThreads = 0;
|
||||
private int ftpPort = -1;
|
||||
|
||||
@ -200,8 +201,10 @@ public class Option {
|
||||
OptionFlags.getInstance().setQuiet(true);
|
||||
} else if (s.equalsIgnoreCase("-duration")) {
|
||||
duration = true;
|
||||
} else if (s.equalsIgnoreCase("-debugsvek") || s.equalsIgnoreCase("-debug_svek")) {
|
||||
debugsvek = true;
|
||||
} else if (s.equalsIgnoreCase("-keepfiles") || s.equalsIgnoreCase("-keepfile")) {
|
||||
OptionFlags.getInstance().setKeepTmpFiles(true);
|
||||
System.err.println("-keepfiles option has been removed. Please consider -debugsvek instead");
|
||||
} else if (s.equalsIgnoreCase("-metadata")) {
|
||||
OptionFlags.getInstance().setMetadata(true);
|
||||
} else if (s.equalsIgnoreCase("-logdata")) {
|
||||
@ -369,7 +372,11 @@ public class Option {
|
||||
}
|
||||
|
||||
public FileFormatOption getFileFormatOption() {
|
||||
return new FileFormatOption(getFileFormat());
|
||||
final FileFormatOption fileFormatOption = new FileFormatOption(getFileFormat());
|
||||
if (debugsvek) {
|
||||
fileFormatOption.setDebugSvek(true);
|
||||
}
|
||||
return fileFormatOption;
|
||||
}
|
||||
|
||||
public final boolean isDuration() {
|
||||
@ -416,4 +423,12 @@ public class Option {
|
||||
return outputFile;
|
||||
}
|
||||
|
||||
public final void setDebugSvek(boolean debugsvek) {
|
||||
this.debugsvek = debugsvek;
|
||||
}
|
||||
|
||||
boolean isDebugSvek() {
|
||||
return debugsvek;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19396 $
|
||||
* Revision $Revision: 19636 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
@ -46,7 +46,7 @@ public class OptionFlags {
|
||||
|
||||
// static public final boolean PBBACK = false;
|
||||
// static public boolean GRAPHVIZCACHE = false;
|
||||
static public final boolean TRACE_DOT = false;
|
||||
// static public final boolean TRACE_DOT = false;
|
||||
|
||||
static public boolean ALLOW_INCLUDE = true;
|
||||
|
||||
@ -61,6 +61,7 @@ public class OptionFlags {
|
||||
static public final boolean SWI2 = false;
|
||||
// static public final boolean USE_COMPOUND = false;
|
||||
static public final boolean OMEGA_CROSSING = false;
|
||||
|
||||
// static public final boolean USE_JDOT = false;
|
||||
|
||||
public void reset() {
|
||||
@ -68,7 +69,7 @@ public class OptionFlags {
|
||||
}
|
||||
|
||||
private void reset(boolean exit) {
|
||||
keepTmpFiles = false;
|
||||
// keepTmpFiles = false;
|
||||
verbose = false;
|
||||
metadata = false;
|
||||
word = false;
|
||||
@ -90,7 +91,7 @@ public class OptionFlags {
|
||||
|
||||
private static final OptionFlags singleton = new OptionFlags();
|
||||
|
||||
private boolean keepTmpFiles;
|
||||
// private boolean keepTmpFiles;
|
||||
private boolean verbose;
|
||||
private boolean metadata;
|
||||
private boolean word;
|
||||
@ -113,13 +114,13 @@ public class OptionFlags {
|
||||
return singleton;
|
||||
}
|
||||
|
||||
public synchronized final boolean isKeepTmpFiles() {
|
||||
return keepTmpFiles;
|
||||
}
|
||||
|
||||
public synchronized final void setKeepTmpFiles(boolean keepTmpFiles) {
|
||||
this.keepTmpFiles = keepTmpFiles;
|
||||
}
|
||||
// public synchronized final boolean isKeepTmpFiles() {
|
||||
// return keepTmpFiles;
|
||||
// }
|
||||
//
|
||||
// public synchronized final void setKeepTmpFiles(boolean keepTmpFiles) {
|
||||
// this.keepTmpFiles = keepTmpFiles;
|
||||
// }
|
||||
|
||||
public final boolean isVerbose() {
|
||||
return verbose;
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19604 $
|
||||
* Revision $Revision: 19636 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
@ -93,7 +93,7 @@ public class OptionPrint {
|
||||
System.out.println(" -checkversion\tTo check if a newer version is available for download");
|
||||
System.out.println(" -v[erbose]\t\tTo have log information");
|
||||
System.out.println(" -quiet\t\tTo NOT print error message into the console");
|
||||
System.out.println(" -keepfiles\t\tTo NOT delete temporary files after process");
|
||||
System.out.println(" -debugsvek\t\tTo generate intermediate svek files");
|
||||
System.out.println(" -h[elp]\t\tTo display this help message");
|
||||
System.out.println(" -testdot\t\tTo test the installation of graphviz");
|
||||
System.out.println(" -graphvizdot \"exe\"\tTo specify dot executable");
|
||||
|
@ -186,7 +186,7 @@ public class PSystemUtils {
|
||||
return result;
|
||||
}
|
||||
|
||||
static public List<File> exportDiagramsCuca(CucaDiagram system, File suggestedFile, FileFormatOption fileFormat)
|
||||
static private List<File> exportDiagramsCuca(CucaDiagram system, File suggestedFile, FileFormatOption fileFormat)
|
||||
throws IOException {
|
||||
if (suggestedFile.exists() && suggestedFile.isDirectory()) {
|
||||
throw new IllegalArgumentException("File is a directory " + suggestedFile);
|
||||
@ -202,7 +202,9 @@ public class PSystemUtils {
|
||||
if (canFileBeWritten(suggestedFile) == false) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
os = new BufferedOutputStream(new FileOutputStream(suggestedFile));
|
||||
// System.err.println("FOO11=" + suggestedFile);
|
||||
// os = new BufferedOutputStream(new FileOutputStream(suggestedFile));
|
||||
os = new NamedOutputStream(suggestedFile);
|
||||
cmap = system.exportDiagram(os, 0, fileFormat);
|
||||
} finally {
|
||||
if (os != null) {
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19602 $
|
||||
* Revision $Revision: 19670 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
@ -36,6 +36,7 @@ package net.sourceforge.plantuml;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
@ -60,11 +61,23 @@ public class SignatureUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSignatureSha512(String s) {
|
||||
public static String getSignatureSha512(File f) throws IOException {
|
||||
final InputStream is = new FileInputStream(f);
|
||||
try {
|
||||
return getSignatureSha512(is);
|
||||
} finally {
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
|
||||
public static String getSignatureSha512(InputStream is) throws IOException {
|
||||
try {
|
||||
final AsciiEncoder coder = new AsciiEncoder();
|
||||
final MessageDigest msgDigest = MessageDigest.getInstance("SHA-512");
|
||||
msgDigest.update(s.getBytes("UTF-8"));
|
||||
int read = 0;
|
||||
while ((read = is.read()) != -1) {
|
||||
msgDigest.update((byte) read);
|
||||
}
|
||||
final byte[] digest = msgDigest.digest();
|
||||
return coder.encode(digest);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19398 $
|
||||
* Revision $Revision: 19706 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
@ -726,4 +726,12 @@ public class SkinParam implements ISkinParam {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public int colorArrowSeparationSpace() {
|
||||
final String value = getValue("colorarrowseparationspace");
|
||||
if (value != null && value.matches("\\d+")) {
|
||||
return Integer.parseInt(value);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -236,4 +236,8 @@ public class SkinParamDelegator implements ISkinParam {
|
||||
return skinParam.maxAsciiMessageLength();
|
||||
}
|
||||
|
||||
public int colorArrowSeparationSpace() {
|
||||
return skinParam.colorArrowSeparationSpace();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19591 $
|
||||
* Revision $Revision: 19753 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml;
|
||||
@ -46,7 +46,6 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
@ -68,7 +67,6 @@ import net.sourceforge.plantuml.graphic.GraphicPosition;
|
||||
import net.sourceforge.plantuml.graphic.GraphicStrings;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
import net.sourceforge.plantuml.graphic.QuoteUtils;
|
||||
import net.sourceforge.plantuml.graphic.UDrawable;
|
||||
import net.sourceforge.plantuml.graphic.VerticalAlignment;
|
||||
import net.sourceforge.plantuml.mjpeg.MJPEGGenerator;
|
||||
@ -286,43 +284,32 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann
|
||||
}
|
||||
|
||||
static private List<String> getFailureText1(Throwable exception, String graphvizVersion) {
|
||||
final List<String> strings = new ArrayList<String>();
|
||||
strings.add("An error has occured : " + exception);
|
||||
final String quote = QuoteUtils.getSomeQuote();
|
||||
strings.add("<i>" + quote);
|
||||
strings.add(" ");
|
||||
final List<String> strings = GraphvizCrash.anErrorHasOccured(exception);
|
||||
strings.add("PlantUML (" + Version.versionString() + ") cannot parse result from dot/GraphViz.");
|
||||
if (exception instanceof EmptySvgException) {
|
||||
strings.add("Because dot/GraphViz returns an empty string.");
|
||||
}
|
||||
GraphvizCrash.checkOldVersionWarning(strings);
|
||||
if (graphvizVersion != null) {
|
||||
strings.add(" ");
|
||||
strings.add("GraphViz version used : " + graphvizVersion);
|
||||
}
|
||||
strings.add(" ");
|
||||
GraphvizCrash.pleaseGoTo(strings);
|
||||
GraphvizCrash.addProperties(strings);
|
||||
strings.add(" ");
|
||||
strings.add("This may be caused by :");
|
||||
strings.add(" - a bug in PlantUML");
|
||||
strings.add(" - a problem in GraphViz");
|
||||
GraphvizCrash.thisMayBeCaused(strings);
|
||||
strings.add(" ");
|
||||
strings.add("You should send this diagram and this image to <b>plantuml@gmail.com</b> or");
|
||||
strings.add("post to <b>http://plantuml.com/qa</b> to solve this issue.");
|
||||
GraphvizCrash.youShouldSendThisDiagram(strings);
|
||||
strings.add(" ");
|
||||
return strings;
|
||||
}
|
||||
|
||||
public static List<String> getFailureText2(Throwable exception) {
|
||||
final List<String> strings = new ArrayList<String>();
|
||||
strings.add("An error has occured : " + exception);
|
||||
final String quote = QuoteUtils.getSomeQuote();
|
||||
strings.add("<i>" + quote);
|
||||
strings.add(" ");
|
||||
final List<String> strings = GraphvizCrash.anErrorHasOccured(exception);
|
||||
strings.add("PlantUML (" + Version.versionString() + ") has crashed.");
|
||||
GraphvizCrash.checkOldVersionWarning(strings);
|
||||
strings.add(" ");
|
||||
strings.add("You should send this diagram and this image to <b>plantuml@gmail.com</b> or");
|
||||
strings.add("post to <b>http://plantuml.com/qa</b> to solve this issue.");
|
||||
strings.add("You can try to turn arround this issue by simplifing your diagram.");
|
||||
GraphvizCrash.youShouldSendThisDiagram(strings);
|
||||
strings.add(" ");
|
||||
return strings;
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
|
||||
import net.sourceforge.plantuml.AnnotatedWorker;
|
||||
import net.sourceforge.plantuml.ColorParam;
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.FileFormatOption;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
@ -54,6 +53,8 @@ import net.sourceforge.plantuml.core.DiagramDescriptionImpl;
|
||||
import net.sourceforge.plantuml.core.ImageData;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockCompressed;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockRecentred;
|
||||
@ -108,7 +109,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
final InstructionSimple ins = new InstructionSimple(activity, nextLinkRenderer(),
|
||||
swinlanes.getCurrentSwimlane(), style, url, colors);
|
||||
current().add(ins);
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
manageHasUrl(activity);
|
||||
if (url != null) {
|
||||
hasUrl = true;
|
||||
@ -118,14 +119,14 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
public CommandExecutionResult addGoto(String name) {
|
||||
final InstructionGoto ins = new InstructionGoto(swinlanes.getCurrentSwimlane(), name);
|
||||
current().add(ins);
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
||||
public CommandExecutionResult addLabel(String name) {
|
||||
final InstructionLabel ins = new InstructionLabel(swinlanes.getCurrentSwimlane(), name);
|
||||
current().add(ins);
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
||||
@ -200,7 +201,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
public void fork() {
|
||||
final InstructionFork instructionFork = new InstructionFork(current(), nextLinkRenderer());
|
||||
current().add(instructionFork);
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
setCurrent(instructionFork);
|
||||
}
|
||||
|
||||
@ -208,7 +209,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
if (current() instanceof InstructionFork) {
|
||||
final InstructionFork currentFork = (InstructionFork) current();
|
||||
currentFork.manageOutRendering(nextLinkRenderer());
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
currentFork.forkAgain();
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
@ -219,7 +220,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
if (current() instanceof InstructionFork) {
|
||||
final InstructionFork currentFork = (InstructionFork) current();
|
||||
currentFork.manageOutRendering(nextLinkRenderer());
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
setCurrent(currentFork.getParent());
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
@ -228,7 +229,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
|
||||
public void split() {
|
||||
final InstructionSplit instructionSplit = new InstructionSplit(current(), nextLinkRenderer());
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
current().add(instructionSplit);
|
||||
setCurrent(instructionSplit);
|
||||
}
|
||||
@ -236,7 +237,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
public CommandExecutionResult splitAgain() {
|
||||
if (current() instanceof InstructionSplit) {
|
||||
((InstructionSplit) current()).splitAgain(nextLinkRenderer());
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
return CommandExecutionResult.error("Cannot find split");
|
||||
@ -245,7 +246,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
public CommandExecutionResult endSplit() {
|
||||
if (current() instanceof InstructionSplit) {
|
||||
((InstructionSplit) current()).endSplit(nextLinkRenderer());
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
setCurrent(((InstructionSplit) current()).getParent());
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
@ -257,7 +258,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
final InstructionIf instructionIf = new InstructionIf(swinlanes.getCurrentSwimlane(), current(), test,
|
||||
whenThen, nextLinkRenderer(), color, getSkinParam());
|
||||
current().add(instructionIf);
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
setCurrent(instructionIf);
|
||||
}
|
||||
|
||||
@ -267,7 +268,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
if (ok == false) {
|
||||
return CommandExecutionResult.error("You cannot put an elseIf here");
|
||||
}
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
return CommandExecutionResult.error("Cannot find if");
|
||||
@ -279,7 +280,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
if (result == false) {
|
||||
return CommandExecutionResult.error("Cannot find if");
|
||||
}
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
return CommandExecutionResult.error("Cannot find if");
|
||||
@ -289,7 +290,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
// System.err.println("Activity3::endif");
|
||||
if (current() instanceof InstructionIf) {
|
||||
((InstructionIf) current()).endif(nextLinkRenderer());
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
setCurrent(((InstructionIf) current()).getParent());
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
@ -302,7 +303,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
nextLinkRenderer(), color);
|
||||
current().add(instructionRepeat);
|
||||
setCurrent(instructionRepeat);
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
|
||||
}
|
||||
|
||||
@ -311,11 +312,10 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
manageSwimlaneStrategy();
|
||||
if (current() instanceof InstructionRepeat) {
|
||||
final InstructionRepeat instructionRepeat = (InstructionRepeat) current();
|
||||
final LinkRendering back = new LinkRendering(linkColor);
|
||||
back.setDisplay(linkLabel);
|
||||
final LinkRendering back = new LinkRendering(HtmlColorAndStyle.fromColor(linkColor)).withDisplay(linkLabel);
|
||||
instructionRepeat.setTest(label, yes, out, nextLinkRenderer(), back);
|
||||
setCurrent(instructionRepeat.getParent());
|
||||
this.setNextLinkRendererInternal(null);
|
||||
this.setNextLinkRendererInternal(LinkRendering.none());
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
return CommandExecutionResult.error("Cannot find repeat");
|
||||
@ -333,7 +333,7 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
public CommandExecutionResult endwhile(Display out) {
|
||||
if (current() instanceof InstructionWhile) {
|
||||
((InstructionWhile) current()).endwhile(nextLinkRenderer(), out);
|
||||
setNextLinkRendererInternal(null);
|
||||
setNextLinkRendererInternal(LinkRendering.none());
|
||||
setCurrent(((InstructionWhile) current()).getParent());
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
@ -364,11 +364,17 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
}
|
||||
|
||||
private void setNextLinkRendererInternal(LinkRendering link) {
|
||||
if (link == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
// System.err.println("setNextLinkRendererInternal=" + link);
|
||||
swinlanes.setNextLinkRenderer(link);
|
||||
}
|
||||
|
||||
private void setNextLink(LinkRendering linkRenderer) {
|
||||
if (linkRenderer == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
// System.err.println("setNextLink=" + linkRenderer);
|
||||
if (current() instanceof InstructionCollection) {
|
||||
final Instruction last = ((InstructionCollection) current()).getLast();
|
||||
@ -381,22 +387,16 @@ public class ActivityDiagram3 extends UmlDiagram {
|
||||
this.setNextLinkRendererInternal(linkRenderer);
|
||||
}
|
||||
|
||||
private final Rose rose = new Rose();
|
||||
|
||||
public void setLabelNextArrow(Display label) {
|
||||
if (current() instanceof InstructionWhile && ((InstructionWhile) current()).getLast() == null) {
|
||||
((InstructionWhile) current()).overwriteYes(label);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nextLinkRenderer() == null) {
|
||||
final HtmlColor arrowColor = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
||||
this.setNextLink(new LinkRendering(arrowColor));
|
||||
}
|
||||
nextLinkRenderer().setDisplay(label);
|
||||
setNextLinkRendererInternal(nextLinkRenderer().withDisplay(label));
|
||||
}
|
||||
|
||||
public void setColorNextArrow(HtmlColor color) {
|
||||
public void setColorNextArrow(Rainbow color) {
|
||||
if (color == null) {
|
||||
return;
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.sequencediagram.NotePosition;
|
||||
|
||||
public class Branch {
|
||||
@ -48,7 +49,7 @@ public class Branch {
|
||||
private final Display labelTest;
|
||||
private final Display labelPositive;
|
||||
private final HtmlColor color;
|
||||
private LinkRendering inlinkRendering;
|
||||
private LinkRendering inlinkRendering = LinkRendering.none();
|
||||
|
||||
private Ftile ftile;
|
||||
|
||||
@ -82,6 +83,9 @@ public class Branch {
|
||||
}
|
||||
|
||||
public final void setInlinkRendering(LinkRendering inlinkRendering) {
|
||||
if (inlinkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.inlinkRendering = inlinkRendering;
|
||||
}
|
||||
|
||||
@ -105,8 +109,8 @@ public class Branch {
|
||||
return labelTest;
|
||||
}
|
||||
|
||||
public final HtmlColor getInlinkRenderingColor() {
|
||||
return inlinkRendering == null ? null : inlinkRendering.getColor();
|
||||
public final Rainbow getInlinkRenderingColorAndStyle() {
|
||||
return inlinkRendering == null ? null : inlinkRendering.getRainbow();
|
||||
}
|
||||
|
||||
public final Ftile getFtile() {
|
||||
|
@ -46,6 +46,9 @@ public class InstructionEnd extends MonoSwimable implements Instruction {
|
||||
public InstructionEnd(Swimlane swimlane, LinkRendering inlinkRendering) {
|
||||
super(swimlane);
|
||||
this.inlinkRendering = inlinkRendering;
|
||||
if (inlinkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public Ftile createFtile(FtileFactory factory) {
|
||||
|
@ -53,6 +53,9 @@ public class InstructionFork implements Instruction {
|
||||
this.parent = parent;
|
||||
this.inlinkRendering = inlinkRendering;
|
||||
this.forks.add(new InstructionList());
|
||||
if (inlinkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
private InstructionList getLast() {
|
||||
|
@ -62,7 +62,7 @@ public class InstructionGoto extends MonoSwimable implements Instruction {
|
||||
}
|
||||
|
||||
public LinkRendering getInLinkRendering() {
|
||||
return null;
|
||||
return LinkRendering.none();
|
||||
}
|
||||
|
||||
public boolean addNote(Display note, NotePosition position) {
|
||||
|
@ -80,7 +80,7 @@ public class InstructionGroup implements Instruction, InstructionCollection {
|
||||
}
|
||||
|
||||
public LinkRendering getInLinkRendering() {
|
||||
return null;
|
||||
return LinkRendering.none();
|
||||
}
|
||||
|
||||
public boolean addNote(Display note, NotePosition position) {
|
||||
|
@ -52,13 +52,14 @@ public class InstructionIf implements Instruction, InstructionCollection {
|
||||
|
||||
private final List<Branch> thens = new ArrayList<Branch>();
|
||||
private Branch elseBranch;
|
||||
private boolean endifCalled = false;
|
||||
private final ISkinParam skinParam;
|
||||
|
||||
private final Instruction parent;
|
||||
|
||||
private Branch current;
|
||||
private final LinkRendering topInlinkRendering;
|
||||
private LinkRendering afterEndwhile;
|
||||
private LinkRendering afterEndwhile = LinkRendering.none();
|
||||
|
||||
private final Swimlane swimlane;
|
||||
|
||||
@ -67,6 +68,9 @@ public class InstructionIf implements Instruction, InstructionCollection {
|
||||
this.parent = parent;
|
||||
this.skinParam = skinParam;
|
||||
this.topInlinkRendering = inlinkRendering;
|
||||
if (inlinkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.swimlane = swimlane;
|
||||
this.thens.add(new Branch(swimlane, whenThen, labelTest, color));
|
||||
this.current = this.thens.get(0);
|
||||
@ -120,6 +124,7 @@ public class InstructionIf implements Instruction, InstructionCollection {
|
||||
}
|
||||
|
||||
public void endif(LinkRendering nextLinkRenderer) {
|
||||
endifCalled = true;
|
||||
if (elseBranch == null) {
|
||||
this.elseBranch = new Branch(swimlane, Display.NULL, Display.NULL, null);
|
||||
}
|
||||
@ -127,6 +132,17 @@ public class InstructionIf implements Instruction, InstructionCollection {
|
||||
}
|
||||
|
||||
final public boolean kill() {
|
||||
if (endifCalled) {
|
||||
for (Branch branch : thens) {
|
||||
if (branch.getLast().kill() == false) {
|
||||
return false;
|
||||
}
|
||||
if (elseBranch != null && elseBranch.getLast().kill() == false) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return current.kill();
|
||||
}
|
||||
|
||||
|
@ -62,7 +62,7 @@ public class InstructionLabel extends MonoSwimable implements Instruction {
|
||||
}
|
||||
|
||||
public LinkRendering getInLinkRendering() {
|
||||
return null;
|
||||
return LinkRendering.none();
|
||||
}
|
||||
|
||||
public boolean addNote(Display note, NotePosition position) {
|
||||
|
@ -82,9 +82,10 @@ public class InstructionList implements Instruction, InstructionCollection {
|
||||
Ftile result = null;
|
||||
for (Instruction ins : all) {
|
||||
Ftile cur = ins.createFtile(factory);
|
||||
if (ins.getInLinkRendering() != null) {
|
||||
if (ins.getInLinkRendering().isNone() == false) {
|
||||
cur = factory.decorateIn(cur, ins.getInLinkRendering());
|
||||
}
|
||||
|
||||
if (result == null) {
|
||||
result = cur;
|
||||
} else {
|
||||
|
@ -56,13 +56,16 @@ public class InstructionRepeat implements Instruction {
|
||||
private Display yes = Display.NULL;
|
||||
private Display out = Display.NULL;
|
||||
private boolean testCalled = false;
|
||||
private LinkRendering endRepeatLinkRendering;
|
||||
private LinkRendering backRepeatLinkRendering;
|
||||
private LinkRendering endRepeatLinkRendering = LinkRendering.none();
|
||||
private LinkRendering backRepeatLinkRendering = LinkRendering.none();
|
||||
|
||||
public InstructionRepeat(Swimlane swimlane, Instruction parent, LinkRendering nextLinkRenderer, HtmlColor color) {
|
||||
this.parent = parent;
|
||||
this.swimlane = swimlane;
|
||||
this.nextLinkRenderer = nextLinkRenderer;
|
||||
if (nextLinkRenderer == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
@ -71,7 +74,7 @@ public class InstructionRepeat implements Instruction {
|
||||
}
|
||||
|
||||
public Ftile createFtile(FtileFactory factory) {
|
||||
final Ftile result = factory.repeat(swimlane,
|
||||
final Ftile result = factory.repeat(swimlane, repeatList.getSwimlaneOut(),
|
||||
factory.decorateOut(repeatList.createFtile(factory), endRepeatLinkRendering), test, yes, out, color,
|
||||
backRepeatLinkRendering);
|
||||
if (killed) {
|
||||
|
@ -54,8 +54,8 @@ public class InstructionSimple extends MonoSwimable implements Instruction {
|
||||
private final BoxStyle style;
|
||||
private final Url url;
|
||||
|
||||
public InstructionSimple(Display label, LinkRendering inlinkRendering, Swimlane swimlane,
|
||||
BoxStyle style, Url url, Colors colors) {
|
||||
public InstructionSimple(Display label, LinkRendering inlinkRendering, Swimlane swimlane, BoxStyle style, Url url,
|
||||
Colors colors) {
|
||||
super(swimlane);
|
||||
if (colors == null) {
|
||||
throw new IllegalArgumentException();
|
||||
@ -64,6 +64,9 @@ public class InstructionSimple extends MonoSwimable implements Instruction {
|
||||
this.style = style;
|
||||
this.label = label;
|
||||
this.inlinkRendering = inlinkRendering;
|
||||
if (inlinkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.colors = colors;
|
||||
}
|
||||
|
||||
|
@ -53,6 +53,9 @@ public class InstructionSplit implements Instruction {
|
||||
this.parent = parent;
|
||||
this.splits.add(new InstructionList());
|
||||
this.inlinkRendering = inlinkRendering;
|
||||
if (inlinkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
private InstructionList getLast() {
|
||||
|
@ -58,7 +58,7 @@ public class InstructionStart extends MonoSwimable implements Instruction {
|
||||
}
|
||||
|
||||
public LinkRendering getInLinkRendering() {
|
||||
return null;
|
||||
return LinkRendering.none();
|
||||
}
|
||||
|
||||
public boolean addNote(Display note, NotePosition position) {
|
||||
|
@ -48,6 +48,9 @@ public class InstructionStop extends MonoSwimable implements Instruction {
|
||||
public InstructionStop(Swimlane swimlane, LinkRendering inlinkRendering) {
|
||||
super(swimlane);
|
||||
this.inlinkRendering = inlinkRendering;
|
||||
if (inlinkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public Ftile createFtile(FtileFactory factory) {
|
||||
|
@ -57,8 +57,8 @@ public class InstructionWhile implements Instruction, InstructionCollection {
|
||||
private Display yes;
|
||||
private Display out = Display.NULL;
|
||||
private boolean testCalled = false;
|
||||
private LinkRendering endInlinkRendering;
|
||||
private LinkRendering afterEndwhile;
|
||||
private LinkRendering endInlinkRendering = LinkRendering.none();
|
||||
private LinkRendering afterEndwhile = LinkRendering.none();
|
||||
private final Swimlane swimlane;
|
||||
private final ISkinParam skinParam;
|
||||
|
||||
@ -77,6 +77,9 @@ public class InstructionWhile implements Instruction, InstructionCollection {
|
||||
this.parent = parent;
|
||||
this.test = test;
|
||||
this.nextLinkRenderer = nextLinkRenderer;
|
||||
if (nextLinkRenderer == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.yes = yes;
|
||||
this.swimlane = swimlane;
|
||||
this.color = color;
|
||||
@ -157,5 +160,4 @@ public class InstructionWhile implements Instruction, InstructionCollection {
|
||||
return repeatList.getLast();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -34,53 +34,54 @@
|
||||
package net.sourceforge.plantuml.activitydiagram3;
|
||||
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
|
||||
public class LinkRendering {
|
||||
|
||||
private final HtmlColor color;
|
||||
private Display display = Display.NULL;
|
||||
private final Rainbow rainbow;
|
||||
private final Display display;
|
||||
|
||||
public LinkRendering(HtmlColor color) {
|
||||
this.color = color;
|
||||
public LinkRendering(Rainbow rainbow) {
|
||||
this(rainbow, Display.NULL);
|
||||
}
|
||||
|
||||
public void setDisplay(Display display) {
|
||||
private LinkRendering(Rainbow rainbow, Display display) {
|
||||
if (rainbow == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.rainbow = rainbow;
|
||||
this.display = display;
|
||||
}
|
||||
|
||||
public static LinkRendering none() {
|
||||
return new LinkRendering(Rainbow.none());
|
||||
}
|
||||
|
||||
public LinkRendering withDisplay(Display display) {
|
||||
return new LinkRendering(rainbow, display);
|
||||
}
|
||||
|
||||
public Display getDisplay() {
|
||||
return display;
|
||||
}
|
||||
|
||||
public HtmlColor getColor() {
|
||||
return color;
|
||||
public Rainbow getRainbow() {
|
||||
return rainbow;
|
||||
}
|
||||
|
||||
public Rainbow getRainbow(Rainbow defaultColor) {
|
||||
if (rainbow.size() == 0) {
|
||||
return defaultColor;
|
||||
}
|
||||
return rainbow;
|
||||
}
|
||||
|
||||
public boolean isNone() {
|
||||
return Display.isNull(display) && rainbow.size() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return super.toString() + " " + display + " " + color;
|
||||
return super.toString() + " " + display + " " + rainbow;
|
||||
}
|
||||
|
||||
public static HtmlColor getColor(LinkRendering inLinkRendering, HtmlColor defaultColor) {
|
||||
if (inLinkRendering == null || inLinkRendering.getColor() == null) {
|
||||
return defaultColor;
|
||||
}
|
||||
return inLinkRendering.getColor();
|
||||
}
|
||||
|
||||
public static HtmlColor getColor(HtmlColor col, HtmlColor defaultColor) {
|
||||
if (col == null) {
|
||||
return defaultColor;
|
||||
}
|
||||
return col;
|
||||
}
|
||||
|
||||
public static Display getDisplay(LinkRendering linkRendering) {
|
||||
if (linkRendering == null) {
|
||||
return Display.NULL;
|
||||
}
|
||||
return linkRendering.getDisplay();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexOr;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
|
||||
public class CommandArrow3 extends SingleLineCommand2<ActivityDiagram3> {
|
||||
|
||||
@ -53,7 +53,9 @@ public class CommandArrow3 extends SingleLineCommand2<ActivityDiagram3> {
|
||||
return new RegexConcat(new RegexLeaf("^"), //
|
||||
new RegexOr(//
|
||||
new RegexLeaf("->"), //
|
||||
new RegexLeaf("COLOR", "-\\[(#\\w+)\\]->")), //
|
||||
new RegexLeaf(
|
||||
"COLOR",
|
||||
"-\\[((?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*(?:;(?:#\\w+|dotted|dashed|plain|bold|hidden)(?:,#\\w+|,dotted|,dashed|,plain|,bold|,hidden)*)*)\\]->")), //
|
||||
new RegexLeaf("[%s]*"), //
|
||||
new RegexOr(//
|
||||
new RegexLeaf("LABEL", "(.*);"), //
|
||||
@ -64,8 +66,12 @@ public class CommandArrow3 extends SingleLineCommand2<ActivityDiagram3> {
|
||||
@Override
|
||||
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
|
||||
|
||||
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
|
||||
diagram.setColorNextArrow(color);
|
||||
final String colorString = arg.get("COLOR", 0);
|
||||
if (colorString != null) {
|
||||
Rainbow rainbow = Rainbow.build(diagram.getSkinParam(), colorString, diagram.getSkinParam()
|
||||
.colorArrowSeparationSpace());
|
||||
diagram.setColorNextArrow(rainbow);
|
||||
}
|
||||
final String label = arg.get("LABEL", 0);
|
||||
if (label != null && label.length() > 0) {
|
||||
diagram.setLabelNextArrow(Display.getWithNewlines(label));
|
||||
|
@ -45,8 +45,8 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexOr;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
|
||||
public class CommandArrowLong3 extends CommandMultilines2<ActivityDiagram3> {
|
||||
|
||||
@ -73,7 +73,7 @@ public class CommandArrowLong3 extends CommandMultilines2<ActivityDiagram3> {
|
||||
lines = lines.removeEmptyColumns();
|
||||
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
|
||||
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR", 0));
|
||||
diagram.setColorNextArrow(color);
|
||||
diagram.setColorNextArrow(HtmlColorAndStyle.fromColor(color));
|
||||
lines = lines.removeStartingAndEnding2(line0.get("LABEL", 0));
|
||||
diagram.setLabelNextArrow(lines.toDisplay());
|
||||
return CommandExecutionResult.ok();
|
||||
@ -83,7 +83,7 @@ public class CommandArrowLong3 extends CommandMultilines2<ActivityDiagram3> {
|
||||
if (lines.size() == 0) {
|
||||
return;
|
||||
}
|
||||
lines.set(0, (CS)data);
|
||||
lines.set(0, (CS) data);
|
||||
}
|
||||
|
||||
private <CS extends CharSequence> void removeEnding(List<CS> lines) {
|
||||
@ -92,7 +92,7 @@ public class CommandArrowLong3 extends CommandMultilines2<ActivityDiagram3> {
|
||||
}
|
||||
final int n = lines.size() - 1;
|
||||
final CharSequence s = lines.get(n);
|
||||
lines.set(n, (CS)s.subSequence(0, s.length() - 1));
|
||||
lines.set(n, (CS) s.subSequence(0, s.length() - 1));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -40,6 +40,7 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
|
||||
import net.sourceforge.plantuml.command.regex.RegexLeaf;
|
||||
import net.sourceforge.plantuml.command.regex.RegexResult;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
|
||||
public class CommandLink3 extends SingleLineCommand2<ActivityDiagram3> {
|
||||
|
||||
@ -59,7 +60,7 @@ public class CommandLink3 extends SingleLineCommand2<ActivityDiagram3> {
|
||||
protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
|
||||
final HtmlColor color = diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(arg.get("COLOR", 0));
|
||||
if (color != null) {
|
||||
diagram.setColorNextArrow(color);
|
||||
diagram.setColorNextArrow(HtmlColorAndStyle.fromColor(color));
|
||||
}
|
||||
return CommandExecutionResult.ok();
|
||||
}
|
||||
|
@ -54,11 +54,11 @@ public abstract class AbstractFtile extends AbstractTextBlock implements Ftile {
|
||||
}
|
||||
|
||||
public LinkRendering getInLinkRendering() {
|
||||
return null;
|
||||
return LinkRendering.none();
|
||||
}
|
||||
|
||||
public LinkRendering getOutLinkRendering() {
|
||||
return null;
|
||||
return LinkRendering.none();
|
||||
}
|
||||
|
||||
public Collection<Connection> getInnerConnections() {
|
||||
|
@ -97,7 +97,7 @@ public class FtileAssemblySimple extends AbstractTextBlock implements Ftile {
|
||||
}
|
||||
|
||||
public LinkRendering getOutLinkRendering() {
|
||||
return null;
|
||||
return LinkRendering.none();
|
||||
}
|
||||
|
||||
private FtileGeometry calculateDimension;
|
||||
|
@ -69,8 +69,8 @@ public interface FtileFactory extends ISkinSimple {
|
||||
|
||||
public Ftile assembly(Ftile tile1, Ftile tile2);
|
||||
|
||||
public Ftile repeat(Swimlane swimlane, Ftile repeat, Display test, Display yes, Display out, HtmlColor color,
|
||||
LinkRendering backRepeatLinkRendering);
|
||||
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Ftile repeat, Display test, Display yes, Display out,
|
||||
HtmlColor color, LinkRendering backRepeatLinkRendering);
|
||||
|
||||
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
|
||||
LinkRendering afterEndwhile, HtmlColor color);
|
||||
|
@ -46,7 +46,9 @@ import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.IHtmlColorSet;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.color.Colors;
|
||||
@ -60,13 +62,16 @@ public class FtileFactoryDelegator implements FtileFactory {
|
||||
private final ISkinParam skinParam;
|
||||
private final Rose rose = new Rose();
|
||||
|
||||
protected HtmlColor getInLinkRenderingColor(Ftile tile) {
|
||||
final HtmlColor color;
|
||||
protected final Rainbow getInLinkRenderingColor(Ftile tile) {
|
||||
Rainbow color;
|
||||
final LinkRendering linkRendering = tile.getInLinkRendering();
|
||||
if (linkRendering == null || linkRendering.getColor() == null) {
|
||||
color = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
||||
if (linkRendering == null) {
|
||||
color = HtmlColorAndStyle.build(getSkinParam());
|
||||
} else {
|
||||
color = linkRendering.getColor();
|
||||
color = linkRendering.getRainbow();
|
||||
}
|
||||
if (color.size() == 0) {
|
||||
color = HtmlColorAndStyle.build(getSkinParam());
|
||||
}
|
||||
return color;
|
||||
}
|
||||
@ -118,10 +123,16 @@ public class FtileFactoryDelegator implements FtileFactory {
|
||||
}
|
||||
|
||||
public Ftile decorateIn(Ftile ftile, LinkRendering linkRendering) {
|
||||
if (linkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
return factory.decorateIn(ftile, linkRendering);
|
||||
}
|
||||
|
||||
public Ftile decorateOut(Ftile ftile, LinkRendering linkRendering) {
|
||||
if (linkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
return factory.decorateOut(ftile, linkRendering);
|
||||
}
|
||||
|
||||
@ -129,9 +140,9 @@ public class FtileFactoryDelegator implements FtileFactory {
|
||||
return factory.assembly(tile1, tile2);
|
||||
}
|
||||
|
||||
public Ftile repeat(Swimlane swimlane, Ftile repeat, Display test, Display yes, Display out, HtmlColor color,
|
||||
LinkRendering backRepeatLinkRendering) {
|
||||
return factory.repeat(swimlane, repeat, test, yes, out, color, backRepeatLinkRendering);
|
||||
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Ftile repeat, Display test, Display yes, Display out,
|
||||
HtmlColor color, LinkRendering backRepeatLinkRendering) {
|
||||
return factory.repeat(swimlane, swimlaneOut, repeat, test, yes, out, color, backRepeatLinkRendering);
|
||||
}
|
||||
|
||||
public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
|
||||
|
@ -59,7 +59,7 @@ public class FtileMargedVertically extends FtileDecorate {
|
||||
public FtileGeometry calculateDimension(StringBounder stringBounder) {
|
||||
final FtileGeometry orig = getFtileDelegated().calculateDimension(stringBounder);
|
||||
return new FtileGeometry(orig.getWidth(), orig.getHeight() + margin1 + margin2, orig.getLeft(), orig.getInY()
|
||||
+ margin1, orig.getOutY() + margin1);
|
||||
+ margin1, orig.hasPointOut() ? orig.getOutY() + margin1 : orig.getOutY());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,30 +37,25 @@ import java.awt.geom.Dimension2D;
|
||||
import java.awt.geom.Line2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.StringBounderUtils;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
import net.sourceforge.plantuml.ugraphic.CompressionTransform;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
import net.sourceforge.plantuml.ugraphic.UShape;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class Snake implements UShape {
|
||||
|
||||
private final List<Point2D.Double> points = new ArrayList<Point2D.Double>();
|
||||
private final Worm worm = new Worm();
|
||||
private final UPolygon endDecoration;
|
||||
private final HtmlColor color;
|
||||
private final Rainbow color;
|
||||
private TextBlock textBlock;
|
||||
private boolean mergeable = true;
|
||||
private Direction emphasizeDirection;
|
||||
@ -70,7 +65,7 @@ public class Snake implements UShape {
|
||||
result.textBlock = this.textBlock;
|
||||
result.mergeable = this.mergeable;
|
||||
result.emphasizeDirection = this.emphasizeDirection;
|
||||
for (Point2D.Double pt : points) {
|
||||
for (Point2D.Double pt : worm) {
|
||||
final double x = compressionTransform.transform(pt.x);
|
||||
final double y = pt.y;
|
||||
result.addPoint(x, y);
|
||||
@ -78,12 +73,18 @@ public class Snake implements UShape {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Snake(HtmlColor color, UPolygon endDecoration) {
|
||||
public Snake(Rainbow color, UPolygon endDecoration) {
|
||||
if (color == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if (color.size() == 0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.endDecoration = endDecoration;
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public Snake(HtmlColor color) {
|
||||
public Snake(Rainbow color) {
|
||||
this(color, null);
|
||||
}
|
||||
|
||||
@ -93,7 +94,7 @@ public class Snake implements UShape {
|
||||
|
||||
public Snake move(double dx, double dy) {
|
||||
final Snake result = new Snake(color, endDecoration);
|
||||
for (Point2D pt : points) {
|
||||
for (Point2D pt : worm) {
|
||||
result.addPoint(pt.getX() + dx, pt.getY() + dy);
|
||||
}
|
||||
result.textBlock = this.textBlock;
|
||||
@ -108,22 +109,11 @@ public class Snake implements UShape {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
result.append(getDirectionAtPoint(i) + " ");
|
||||
}
|
||||
return result + points.toString();
|
||||
}
|
||||
|
||||
SnakeDirection getDirection() {
|
||||
if (points.size() < 2) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
return SnakeDirection.getDirection(points.get(0), points.get(1));
|
||||
return worm.toString();
|
||||
}
|
||||
|
||||
public void addPoint(double x, double y) {
|
||||
this.points.add(new Point2D.Double(x, y));
|
||||
worm.addPoint(x, y);
|
||||
}
|
||||
|
||||
public void addPoint(Point2D p) {
|
||||
@ -131,25 +121,52 @@ public class Snake implements UShape {
|
||||
}
|
||||
|
||||
public void drawInternal(UGraphic ug) {
|
||||
ug = ug.apply(new UChangeColor(color));
|
||||
ug = ug.apply(new UChangeBackColor(color));
|
||||
ug = ug.apply(new UStroke(1.5));
|
||||
boolean drawn = false;
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
final java.awt.geom.Point2D.Double p1 = points.get(i);
|
||||
final java.awt.geom.Point2D.Double p2 = points.get(i + 1);
|
||||
final Line2D line = new Line2D.Double(p1, p2);
|
||||
if (drawn == false && emphasizeDirection != null && Direction.fromVector(p1, p2) == emphasizeDirection) {
|
||||
drawLine(ug, line, emphasizeDirection);
|
||||
drawn = true;
|
||||
} else {
|
||||
drawLine(ug, line, null);
|
||||
if (color.size() > 1) {
|
||||
drawRainbow(ug);
|
||||
} else {
|
||||
worm.drawInternalOneColor(ug, color.getColors().get(0), 1.5, emphasizeDirection, endDecoration);
|
||||
drawInternalLabel(ug);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void drawRainbow(UGraphic ug) {
|
||||
final List<HtmlColorAndStyle> colors = color.getColors();
|
||||
final int colorArrowSeparationSpace = color.getColorArrowSeparationSpace();
|
||||
final double move = 2 + colorArrowSeparationSpace;
|
||||
final WormMutation mutation = WormMutation.create(worm, move);
|
||||
Worm current = worm;
|
||||
for (int i = 0; i < colors.size(); i++) {
|
||||
double stroke = 1.5;
|
||||
if (colorArrowSeparationSpace == 0) {
|
||||
stroke = i == colors.size() - 1 ? 2.0 : 3.0;
|
||||
}
|
||||
current.drawInternalOneColor(ug, colors.get(i), stroke, emphasizeDirection, endDecoration);
|
||||
current = mutation.mute(current);
|
||||
}
|
||||
if (endDecoration != null) {
|
||||
final Point2D end = points.get(points.size() - 1);
|
||||
ug.apply(new UTranslate(end)).apply(new UStroke()).draw(endDecoration);
|
||||
}
|
||||
drawInternalLabel(ug.apply(new UTranslate(0, 0)));
|
||||
}
|
||||
|
||||
// private void drawRainbowOld(UGraphic ug) {
|
||||
// final HtmlColorRainbow rainbow = (HtmlColorRainbow) color;
|
||||
// final List<HtmlColor> colors = rainbow.getColors();
|
||||
// final int colorArrowSeparationSpace = rainbow.getColorArrowSeparationSpace();
|
||||
// final double move = 2 + colorArrowSeparationSpace;
|
||||
// ug = ug.apply(new UTranslate(-move * (colors.size() - 1) / 2.0, 0));
|
||||
// double dx = -move;
|
||||
// for (int i = 0; i < colors.size(); i++) {
|
||||
// dx += move;
|
||||
// double stroke = 1.5;
|
||||
// if (colorArrowSeparationSpace == 0) {
|
||||
// stroke = i == colors.size() - 1 ? 2.0 : 3.0;
|
||||
// }
|
||||
// worm.drawInternalOneColor(ug.apply(new UTranslate(dx, 0)), colors.get(i), stroke, emphasizeDirection,
|
||||
// endDecoration);
|
||||
// }
|
||||
// drawInternalLabel(ug.apply(new UTranslate(dx, 0)));
|
||||
// }
|
||||
|
||||
private void drawInternalLabel(UGraphic ug) {
|
||||
if (textBlock != null) {
|
||||
final Point2D position = getTextBlockPosition(ug.getStringBounder());
|
||||
// final double max = getMaxX(ug.getStringBounder());
|
||||
@ -164,7 +181,7 @@ public class Snake implements UShape {
|
||||
|
||||
public double getMaxX(StringBounder stringBounder) {
|
||||
double result = -Double.MAX_VALUE;
|
||||
for (Point2D pt : points) {
|
||||
for (Point2D pt : worm) {
|
||||
result = Math.max(result, pt.getX());
|
||||
}
|
||||
if (textBlock != null) {
|
||||
@ -176,8 +193,8 @@ public class Snake implements UShape {
|
||||
}
|
||||
|
||||
private Point2D getTextBlockPosition(StringBounder stringBounder) {
|
||||
final Point2D pt1 = points.get(0);
|
||||
final Point2D pt2 = points.get(1);
|
||||
final Point2D pt1 = worm.get(0);
|
||||
final Point2D pt2 = worm.get(1);
|
||||
final Dimension2D dim = textBlock.calculateDimension(stringBounder);
|
||||
final double y = (pt1.getY() + pt2.getY()) / 2 - dim.getHeight() / 2;
|
||||
return new Point2D.Double(Math.max(pt1.getX(), pt2.getX()) + 4, y);
|
||||
@ -185,9 +202,9 @@ public class Snake implements UShape {
|
||||
|
||||
public List<Line2D> getHorizontalLines() {
|
||||
final List<Line2D> result = new ArrayList<Line2D>();
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
final Point2D pt1 = points.get(i);
|
||||
final Point2D pt2 = points.get(i + 1);
|
||||
for (int i = 0; i < worm.size() - 1; i++) {
|
||||
final Point2D pt1 = worm.get(i);
|
||||
final Point2D pt2 = worm.get(i + 1);
|
||||
if (pt1.getY() == pt2.getY()) {
|
||||
final Line2D line = new Line2D.Double(pt1, pt2);
|
||||
result.add(line);
|
||||
@ -198,16 +215,15 @@ public class Snake implements UShape {
|
||||
}
|
||||
|
||||
private Point2D getFirst() {
|
||||
return points.get(0);
|
||||
return worm.get(0);
|
||||
}
|
||||
|
||||
public Point2D getLast() {
|
||||
return points.get(points.size() - 1);
|
||||
return worm.get(worm.size() - 1);
|
||||
}
|
||||
|
||||
private boolean same(Point2D pt1, Point2D pt2) {
|
||||
static boolean same(Point2D pt1, Point2D pt2) {
|
||||
return pt1.distance(pt2) < 0.001;
|
||||
// return pt1.getX() == pt2.getX() && pt1.getY() == pt2.getY();
|
||||
}
|
||||
|
||||
public Snake merge(Snake other) {
|
||||
@ -224,11 +240,8 @@ public class Snake implements UShape {
|
||||
if (same(this.getLast(), other.getFirst())) {
|
||||
final UPolygon oneOf = endDecoration == null ? other.endDecoration : endDecoration;
|
||||
final Snake result = new Snake(color, oneOf);
|
||||
result.textBlock = textBlock == null ? other.textBlock : textBlock;
|
||||
result.emphasizeDirection = emphasizeDirection == null ? other.emphasizeDirection : emphasizeDirection;
|
||||
result.points.addAll(this.points);
|
||||
result.points.addAll(other.points);
|
||||
result.mergeMe();
|
||||
result.worm.addAll(this.worm.merge(other.worm));
|
||||
return result;
|
||||
}
|
||||
if (same(this.getFirst(), other.getLast())) {
|
||||
@ -237,184 +250,6 @@ public class Snake implements UShape {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void mergeMe() {
|
||||
boolean change = false;
|
||||
do {
|
||||
change = false;
|
||||
change = change || removeNullVector();
|
||||
change = change || removeRedondantDirection();
|
||||
change = change || removePattern1();
|
||||
change = change || removePattern2();
|
||||
change = change || removePattern3();
|
||||
change = change || removePattern4();
|
||||
change = change || removePattern5();
|
||||
change = change || removePattern6();
|
||||
change = change || removePattern7();
|
||||
} while (change);
|
||||
}
|
||||
|
||||
private boolean removeNullVector() {
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
final Direction dir = getDirectionAtPoint(i);
|
||||
if (dir == null) {
|
||||
points.remove(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removeRedondantDirection() {
|
||||
for (int i = 0; i < points.size() - 2; i++) {
|
||||
final Direction dir1 = getDirectionAtPoint(i);
|
||||
final Direction dir2 = getDirectionAtPoint(i + 1);
|
||||
if (dir1 == dir2) {
|
||||
points.remove(i + 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern1() {
|
||||
for (int i = 0; i < points.size() - 5; i++) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.DOWN, Direction.LEFT, Direction.DOWN, Direction.RIGHT).equals(patternAt)
|
||||
|| Arrays.asList(Direction.DOWN, Direction.RIGHT, Direction.DOWN, Direction.LEFT).equals(patternAt)) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern7() {
|
||||
if (points.size() > 4) {
|
||||
final int i = 0;
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.RIGHT, Direction.DOWN, Direction.LEFT, Direction.DOWN).equals(patternAt)
|
||||
&& points.get(i + 3).x > points.get(i).x) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 3).x, points.get(i).y);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern2() {
|
||||
for (int i = 0; i < points.size() - 5; i++) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.RIGHT, Direction.DOWN, Direction.RIGHT, Direction.UP).equals(patternAt)
|
||||
|| Arrays.asList(Direction.LEFT, Direction.DOWN, Direction.LEFT, Direction.UP).equals(patternAt)) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 3).x, points.get(i + 1).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern3() {
|
||||
for (int i = 0; i < points.size() - 4; i++) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.DOWN, Direction.RIGHT, Direction.DOWN, Direction.RIGHT).equals(patternAt)
|
||||
|| Arrays.asList(Direction.DOWN, Direction.LEFT, Direction.DOWN, Direction.LEFT).equals(patternAt)) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern4() {
|
||||
final int i = points.size() - 5;
|
||||
if (i >= 0) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.DOWN, Direction.LEFT, Direction.DOWN, Direction.RIGHT).equals(patternAt)) {
|
||||
final Point2D.Double p1 = points.get(i + 1);
|
||||
final Point2D.Double p4 = points.get(i + 4);
|
||||
if (p4.x > p1.x) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern5() {
|
||||
final int i = points.size() - 5;
|
||||
if (i >= 0) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.DOWN, Direction.RIGHT, Direction.DOWN, Direction.LEFT).equals(patternAt)) {
|
||||
final Point2D.Double p1 = points.get(i + 1);
|
||||
final Point2D.Double p4 = points.get(i + 4);
|
||||
if (p4.x + 4 < p1.x) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern6() {
|
||||
for (int i = 0; i < points.size() - 2; i++) {
|
||||
if (isForwardAndBackwardAt(i)) {
|
||||
points.remove(i + 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<Direction> getPatternAt(int i) {
|
||||
return Arrays.asList(getDirectionAtPoint(i), getDirectionAtPoint(i + 1), getDirectionAtPoint(i + 2),
|
||||
getDirectionAtPoint(i + 3));
|
||||
}
|
||||
|
||||
private boolean isForwardAndBackwardAt(int i) {
|
||||
return getDirectionAtPoint(i) == getDirectionAtPoint(i + 1).getInv();
|
||||
}
|
||||
|
||||
private Direction getDirectionAtPoint(int i) {
|
||||
return Direction.fromVector(points.get(i), points.get(i + 1));
|
||||
}
|
||||
|
||||
private void drawLine(UGraphic ug, Line2D line, Direction direction) {
|
||||
drawLine(ug, line.getX1(), line.getY1(), line.getX2(), line.getY2(), direction);
|
||||
}
|
||||
|
||||
private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2, Direction direction) {
|
||||
ug = ug.apply(new UTranslate(x1, y1));
|
||||
if (direction != null) {
|
||||
ug.apply(new UTranslate((x2 - x1) / 2, (y2 - y1) / 2)).draw(Arrows.asTo(direction));
|
||||
}
|
||||
ug.draw(new ULine(x2 - x1, y2 - y1));
|
||||
}
|
||||
|
||||
public void goUnmergeable() {
|
||||
this.mergeable = false;
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
|
||||
private final Instruction root = new InstructionList();
|
||||
private Instruction currentInstruction = root;
|
||||
|
||||
private LinkRendering nextLinkRenderer;
|
||||
private LinkRendering nextLinkRenderer = LinkRendering.none();
|
||||
|
||||
public Swimlanes(ISkinParam skinParam, Pragma pragma) {
|
||||
this.skinParam = skinParam;
|
||||
@ -174,7 +174,7 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
|
||||
|
||||
}
|
||||
|
||||
static final double separationMargin = 10;
|
||||
static private final double separationMargin = 10;
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final FtileFactory factory = getFtileFactory();
|
||||
@ -359,6 +359,9 @@ public class Swimlanes extends AbstractTextBlock implements TextBlock {
|
||||
}
|
||||
|
||||
public void setNextLinkRenderer(LinkRendering link) {
|
||||
if (link == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.nextLinkRenderer = link;
|
||||
}
|
||||
|
||||
|
362
src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java
Normal file
362
src/net/sourceforge/plantuml/activitydiagram3/ftile/Worm.java
Normal file
@ -0,0 +1,362 @@
|
||||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 8475 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import java.awt.geom.Line2D;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.Direction;
|
||||
import net.sourceforge.plantuml.cucadiagram.LinkStyle;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UChangeColor;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.ULine;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class Worm implements Iterable<Point2D.Double> {
|
||||
|
||||
private final List<Point2D.Double> points = new ArrayList<Point2D.Double>();
|
||||
|
||||
public void drawInternalOneColor(UGraphic ug, HtmlColorAndStyle color, double stroke, Direction emphasizeDirection,
|
||||
UPolygon endDecoration) {
|
||||
final HtmlColor color2 = color.getColor();
|
||||
if (color2 == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
final LinkStyle style = color.getStyle();
|
||||
if (style == LinkStyle.INVISIBLE) {
|
||||
return;
|
||||
}
|
||||
ug = ug.apply(new UChangeColor(color2));
|
||||
ug = ug.apply(new UChangeBackColor(color2));
|
||||
if (style == LinkStyle.NORMAL) {
|
||||
ug = ug.apply(new UStroke(stroke));
|
||||
} else {
|
||||
ug = ug.apply(LinkStyle.getStroke(style, stroke));
|
||||
}
|
||||
boolean drawn = false;
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
final java.awt.geom.Point2D.Double p1 = points.get(i);
|
||||
final java.awt.geom.Point2D.Double p2 = points.get(i + 1);
|
||||
final Line2D line = new Line2D.Double(p1, p2);
|
||||
if (drawn == false && emphasizeDirection != null && Direction.fromVector(p1, p2) == emphasizeDirection) {
|
||||
drawLine(ug, line, emphasizeDirection);
|
||||
drawn = true;
|
||||
} else {
|
||||
drawLine(ug, line, null);
|
||||
}
|
||||
}
|
||||
if (endDecoration != null) {
|
||||
ug = ug.apply(new UStroke(1.5));
|
||||
final Point2D end = points.get(points.size() - 1);
|
||||
ug.apply(new UTranslate(end)).apply(new UStroke()).draw(endDecoration);
|
||||
}
|
||||
}
|
||||
|
||||
private void drawLine(UGraphic ug, Line2D line, Direction direction) {
|
||||
drawLine(ug, line.getX1(), line.getY1(), line.getX2(), line.getY2(), direction);
|
||||
}
|
||||
|
||||
private void drawLine(UGraphic ug, double x1, double y1, double x2, double y2, Direction direction) {
|
||||
ug = ug.apply(new UTranslate(x1, y1));
|
||||
if (direction != null) {
|
||||
ug.apply(new UTranslate((x2 - x1) / 2, (y2 - y1) / 2)).draw(Arrows.asTo(direction));
|
||||
}
|
||||
ug.draw(new ULine(x2 - x1, y2 - y1));
|
||||
}
|
||||
|
||||
public Worm move(double dx, double dy) {
|
||||
final Worm result = new Worm();
|
||||
for (Point2D pt : points) {
|
||||
result.addPoint(pt.getX() + dx, pt.getY() + dy);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
result.append(getDirectionAtPoint(i) + " ");
|
||||
}
|
||||
return result + points.toString();
|
||||
}
|
||||
|
||||
public void addPoint(double x, double y) {
|
||||
this.points.add(new Point2D.Double(x, y));
|
||||
}
|
||||
|
||||
public void addPoint(Point2D pt) {
|
||||
this.addPoint(pt.getX(), pt.getY());
|
||||
}
|
||||
|
||||
public Worm translate(UTranslate translate) {
|
||||
return move(translate.getDx(), translate.getDy());
|
||||
}
|
||||
|
||||
SnakeDirection getDirection() {
|
||||
if (points.size() < 2) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
return SnakeDirection.getDirection(points.get(0), points.get(1));
|
||||
}
|
||||
|
||||
String getDirectionsCode() {
|
||||
final StringBuilder result = new StringBuilder();
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
final Direction direction = Direction.fromVector(points.get(i), points.get(i + 1));
|
||||
result.append(direction.getShortCode());
|
||||
}
|
||||
return result.toString();
|
||||
}
|
||||
|
||||
private List<Direction> getPatternAt(int i) {
|
||||
return Arrays.asList(getDirectionAtPoint(i), getDirectionAtPoint(i + 1), getDirectionAtPoint(i + 2),
|
||||
getDirectionAtPoint(i + 3));
|
||||
}
|
||||
|
||||
private boolean isForwardAndBackwardAt(int i) {
|
||||
return getDirectionAtPoint(i) == getDirectionAtPoint(i + 1).getInv();
|
||||
}
|
||||
|
||||
private Direction getDirectionAtPoint(int i) {
|
||||
return Direction.fromVector(points.get(i), points.get(i + 1));
|
||||
}
|
||||
|
||||
public Iterator<Point2D.Double> iterator() {
|
||||
return Collections.unmodifiableCollection(points).iterator();
|
||||
}
|
||||
|
||||
public int size() {
|
||||
return this.points.size();
|
||||
}
|
||||
|
||||
public Point2D.Double get(int i) {
|
||||
return this.points.get(i);
|
||||
}
|
||||
|
||||
public void addAll(Worm other) {
|
||||
this.points.addAll(other.points);
|
||||
}
|
||||
|
||||
public void remove(int i) {
|
||||
this.points.remove(i);
|
||||
}
|
||||
|
||||
public void add(int i, Point2D.Double pt) {
|
||||
this.points.add(i, pt);
|
||||
}
|
||||
|
||||
private Point2D getFirst() {
|
||||
return points.get(0);
|
||||
}
|
||||
|
||||
public Point2D getLast() {
|
||||
return points.get(points.size() - 1);
|
||||
}
|
||||
|
||||
public Worm merge(Worm other) {
|
||||
if (Snake.same(this.getLast(), other.getFirst()) == false) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
final Worm result = new Worm();
|
||||
result.points.addAll(this.points);
|
||||
result.points.addAll(other.points);
|
||||
result.mergeMe();
|
||||
return result;
|
||||
}
|
||||
|
||||
private void mergeMe() {
|
||||
boolean change = false;
|
||||
do {
|
||||
change = false;
|
||||
change = change || removeNullVector();
|
||||
change = change || removeRedondantDirection();
|
||||
change = change || removePattern1();
|
||||
change = change || removePattern2();
|
||||
change = change || removePattern3();
|
||||
change = change || removePattern4();
|
||||
change = change || removePattern5();
|
||||
change = change || removePattern6();
|
||||
change = change || removePattern7();
|
||||
} while (change);
|
||||
}
|
||||
|
||||
private boolean removeNullVector() {
|
||||
for (int i = 0; i < points.size() - 1; i++) {
|
||||
final Direction dir = getDirectionAtPoint(i);
|
||||
if (dir == null) {
|
||||
points.remove(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removeRedondantDirection() {
|
||||
for (int i = 0; i < points.size() - 2; i++) {
|
||||
final Direction dir1 = getDirectionAtPoint(i);
|
||||
final Direction dir2 = getDirectionAtPoint(i + 1);
|
||||
if (dir1 == dir2) {
|
||||
points.remove(i + 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern1() {
|
||||
for (int i = 0; i < points.size() - 5; i++) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.DOWN, Direction.LEFT, Direction.DOWN, Direction.RIGHT).equals(patternAt)
|
||||
|| Arrays.asList(Direction.DOWN, Direction.RIGHT, Direction.DOWN, Direction.LEFT).equals(patternAt)) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern7() {
|
||||
if (points.size() > 4) {
|
||||
final int i = 0;
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.RIGHT, Direction.DOWN, Direction.LEFT, Direction.DOWN).equals(patternAt)
|
||||
&& points.get(i + 3).x > points.get(i).x) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 3).x, points.get(i).y);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern2() {
|
||||
for (int i = 0; i < points.size() - 5; i++) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.RIGHT, Direction.DOWN, Direction.RIGHT, Direction.UP).equals(patternAt)
|
||||
|| Arrays.asList(Direction.LEFT, Direction.DOWN, Direction.LEFT, Direction.UP).equals(patternAt)) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 3).x, points.get(i + 1).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern3() {
|
||||
for (int i = 0; i < points.size() - 4; i++) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.DOWN, Direction.RIGHT, Direction.DOWN, Direction.RIGHT).equals(patternAt)
|
||||
|| Arrays.asList(Direction.DOWN, Direction.LEFT, Direction.DOWN, Direction.LEFT).equals(patternAt)) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern4() {
|
||||
final int i = points.size() - 5;
|
||||
if (i >= 0) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.DOWN, Direction.LEFT, Direction.DOWN, Direction.RIGHT).equals(patternAt)) {
|
||||
final Point2D.Double p1 = points.get(i + 1);
|
||||
final Point2D.Double p4 = points.get(i + 4);
|
||||
if (p4.x > p1.x) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern5() {
|
||||
final int i = points.size() - 5;
|
||||
if (i >= 0) {
|
||||
final List<Direction> patternAt = getPatternAt(i);
|
||||
if (Arrays.asList(Direction.DOWN, Direction.RIGHT, Direction.DOWN, Direction.LEFT).equals(patternAt)) {
|
||||
final Point2D.Double p1 = points.get(i + 1);
|
||||
final Point2D.Double p4 = points.get(i + 4);
|
||||
if (p4.x + 4 < p1.x) {
|
||||
final Point2D.Double newPoint = new Point2D.Double(points.get(i + 1).x, points.get(i + 3).y);
|
||||
points.remove(i + 3);
|
||||
points.remove(i + 2);
|
||||
points.remove(i + 1);
|
||||
points.add(i + 1, newPoint);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean removePattern6() {
|
||||
for (int i = 0; i < points.size() - 2; i++) {
|
||||
if (isForwardAndBackwardAt(i)) {
|
||||
points.remove(i + 1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 8475 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.activitydiagram3.ftile;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class WormMutation {
|
||||
|
||||
private final List<UTranslate> translations = new ArrayList<UTranslate>();
|
||||
|
||||
private WormMutation() {
|
||||
|
||||
}
|
||||
|
||||
public static WormMutation create(Worm worm, double delta) {
|
||||
final String signature = worm.getDirectionsCode();
|
||||
final WormMutation result = new WormMutation();
|
||||
if (signature.equals("D") || signature.equals("U")) {
|
||||
final UTranslate translate = new UTranslate(delta, 0);
|
||||
result.translations.add(translate);
|
||||
result.translations.add(translate);
|
||||
return result;
|
||||
}
|
||||
if (signature.equals("L") || signature.equals("R")) {
|
||||
final UTranslate translate = new UTranslate(0, delta);
|
||||
result.translations.add(translate);
|
||||
result.translations.add(translate);
|
||||
return result;
|
||||
}
|
||||
if (signature.equals("RD")) {
|
||||
result.translations.add(new UTranslate(0, -delta));
|
||||
result.translations.add(new UTranslate(delta, -delta));
|
||||
result.translations.add(new UTranslate(delta, 0));
|
||||
return result;
|
||||
}
|
||||
if (signature.equals("LD")) {
|
||||
result.translations.add(new UTranslate(0, -delta));
|
||||
result.translations.add(new UTranslate(-delta, -delta));
|
||||
result.translations.add(new UTranslate(-delta, 0));
|
||||
return result;
|
||||
}
|
||||
if (signature.equals("DL")) {
|
||||
result.translations.add(new UTranslate(delta, 0));
|
||||
result.translations.add(new UTranslate(delta, delta));
|
||||
result.translations.add(new UTranslate(0, delta));
|
||||
return result;
|
||||
}
|
||||
if (signature.equals("DR")) {
|
||||
result.translations.add(new UTranslate(-delta, 0));
|
||||
result.translations.add(new UTranslate(-delta, delta));
|
||||
result.translations.add(new UTranslate(0, delta));
|
||||
return result;
|
||||
}
|
||||
if (signature.equals("UL")) {
|
||||
result.translations.add(new UTranslate(delta, 0));
|
||||
result.translations.add(new UTranslate(delta, -delta));
|
||||
result.translations.add(new UTranslate(0, -delta));
|
||||
return result;
|
||||
}
|
||||
if (signature.equals("UR")) {
|
||||
result.translations.add(new UTranslate(-delta, 0));
|
||||
result.translations.add(new UTranslate(-delta, -delta));
|
||||
result.translations.add(new UTranslate(0, -delta));
|
||||
return result;
|
||||
}
|
||||
throw new UnsupportedOperationException(signature);
|
||||
|
||||
}
|
||||
|
||||
public Worm mute(Worm original) {
|
||||
final Worm result = new Worm();
|
||||
for (int i = 0; i < original.size(); i++) {
|
||||
result.addPoint(translations.get(i).getTranslated(original.get(i)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
@ -37,12 +37,10 @@ import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Arrows;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Connection;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.ConnectionTranslatable;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
@ -52,12 +50,14 @@ public class ConnectionVerticalDown extends AbstractConnection implements Connec
|
||||
|
||||
private final Point2D p1;
|
||||
private final Point2D p2;
|
||||
private final HtmlColor color;
|
||||
private final Rainbow color;
|
||||
private final TextBlock textBlock;
|
||||
|
||||
public ConnectionVerticalDown(Ftile ftile1, Ftile ftile2, Point2D p1, Point2D p2, HtmlColor color,
|
||||
TextBlock textBlock) {
|
||||
public ConnectionVerticalDown(Ftile ftile1, Ftile ftile2, Point2D p1, Point2D p2, Rainbow color, TextBlock textBlock) {
|
||||
super(ftile1, ftile2);
|
||||
if (color.size() == 0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.p1 = p1;
|
||||
this.p2 = p2;
|
||||
this.color = color;
|
||||
|
@ -35,7 +35,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact;
|
||||
|
||||
import java.awt.geom.Point2D;
|
||||
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
||||
@ -43,15 +42,10 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMargedRight;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileUtils;
|
||||
import net.sourceforge.plantuml.creole.CreoleMode;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||
import net.sourceforge.plantuml.ugraphic.UFont;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class FtileFactoryDelegatorAssembly extends FtileFactoryDelegator {
|
||||
@ -80,7 +74,7 @@ public class FtileFactoryDelegatorAssembly extends FtileFactoryDelegator {
|
||||
final UTranslate translate2 = result.getTranslateFor(tile2, stringBounder);
|
||||
final Point2D p2 = tile2.calculateDimension(stringBounder).translate(translate2).getPointIn();
|
||||
|
||||
final HtmlColor color = getInLinkRenderingColor(tile2);
|
||||
final Rainbow color = getInLinkRenderingColor(tile2);
|
||||
|
||||
final ConnectionVerticalDown connection = new ConnectionVerticalDown(tile1, tile2, p1, p2, color, textBlock);
|
||||
result = FtileUtils.addConnection(result, connection);
|
||||
|
@ -51,13 +51,14 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileHeightFixed;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMarged;
|
||||
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.FtileBlackBlock;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
@ -77,7 +78,7 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
||||
@Override
|
||||
public Ftile createFork(Swimlane swimlane, List<Ftile> all) {
|
||||
final HtmlColor colorBar = rose.getHtmlColor(getSkinParam(), ColorParam.activityBar);
|
||||
final HtmlColor arrowColor = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
||||
|
||||
final Dimension2D dimSuper = super.createFork(swimlane, all).calculateDimension(getStringBounder());
|
||||
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
||||
@ -109,12 +110,12 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
||||
class ConnectionIn extends AbstractConnection implements ConnectionTranslatable {
|
||||
|
||||
private final double x;
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
private final Display label;
|
||||
|
||||
public ConnectionIn(Ftile ftile1, Ftile ftile2, double x, HtmlColor arrowColor) {
|
||||
public ConnectionIn(Ftile ftile1, Ftile ftile2, double x, Rainbow arrowColor) {
|
||||
super(ftile1, ftile2);
|
||||
label = LinkRendering.getDisplay(ftile2.getInLinkRendering());
|
||||
label = ftile2.getInLinkRendering().getDisplay();
|
||||
this.x = x;
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
@ -155,13 +156,13 @@ public class FtileFactoryDelegatorCreateFork extends FtileFactoryDelegator {
|
||||
class ConnectionOut extends AbstractConnection implements ConnectionTranslatable {
|
||||
|
||||
private final double x;
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
private final double height;
|
||||
private final Display label;
|
||||
|
||||
public ConnectionOut(Ftile ftile1, Ftile ftile2, double x, HtmlColor arrowColor, double height) {
|
||||
public ConnectionOut(Ftile ftile1, Ftile ftile2, double x, Rainbow arrowColor, double height) {
|
||||
super(ftile1, ftile2);
|
||||
label = LinkRendering.getDisplay(ftile1.getOutLinkRendering());
|
||||
label = ftile1.getOutLinkRendering().getDisplay();
|
||||
this.x = x;
|
||||
this.arrowColor = arrowColor;
|
||||
this.height = height;
|
||||
|
@ -53,13 +53,13 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileHeightFixed;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileMarged;
|
||||
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.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.skin.rose.Rose;
|
||||
@ -122,7 +122,7 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
||||
// // } else if (isSeveralSwimlanes(all)) {
|
||||
// // return severalSwimlanes(all);
|
||||
// }
|
||||
final HtmlColor arrowColor = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
||||
|
||||
final Dimension2D dimSuper = super.createSplit(all).calculateDimension(getStringBounder());
|
||||
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
||||
@ -149,10 +149,11 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
||||
x += dim.getWidth();
|
||||
}
|
||||
final double totalWidth = inner.calculateDimension(getStringBounder()).getWidth();
|
||||
conns.add(new ConnectionHline2(inner, OptionFlags.SWI2 ? HtmlColorUtils.BLUE : arrowColor, 0, list, totalWidth));
|
||||
conns.add(new ConnectionHline2(inner, OptionFlags.SWI2 ? HtmlColorAndStyle.fromColor(HtmlColorUtils.BLUE)
|
||||
: arrowColor, 0, list, totalWidth));
|
||||
if (hasOut) {
|
||||
conns.add(new ConnectionHline2(inner, OptionFlags.SWI2 ? HtmlColorUtils.GREEN : arrowColor, height1, list,
|
||||
totalWidth));
|
||||
conns.add(new ConnectionHline2(inner, OptionFlags.SWI2 ? HtmlColorAndStyle.fromColor(HtmlColorUtils.GREEN)
|
||||
: arrowColor, height1, list, totalWidth));
|
||||
}
|
||||
|
||||
inner = FtileUtils.addConnection(inner, conns);
|
||||
@ -203,14 +204,12 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
||||
|
||||
private TextBlock getTextBlock(LinkRendering linkRendering) {
|
||||
// DUP1433
|
||||
final Display display = LinkRendering.getDisplay(linkRendering);
|
||||
final Display display = linkRendering.getDisplay();
|
||||
return getTextBlock(display);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private Ftile simpleSwimlanes(List<Ftile> all) {
|
||||
final HtmlColor arrowColor = rose.getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
||||
|
||||
final Dimension2D dimSuper = new FtileSplit1(all).calculateDimension(getStringBounder());
|
||||
final double height1 = dimSuper.getHeight() + 2 * spaceArroundBlackBar;
|
||||
@ -254,11 +253,11 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
||||
|
||||
private final Ftile inner;
|
||||
private final double y;
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
private final List<Ftile> list;
|
||||
private final double totalWidth;
|
||||
|
||||
public ConnectionHline2(Ftile inner, HtmlColor arrowColor, double y, List<Ftile> list, double totalWidth) {
|
||||
public ConnectionHline2(Ftile inner, Rainbow arrowColor, double y, List<Ftile> list, double totalWidth) {
|
||||
super(null, null);
|
||||
this.inner = inner;
|
||||
this.y = y;
|
||||
@ -314,11 +313,11 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
||||
|
||||
private final Ftile inner;
|
||||
private final double y;
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
private final List<Ftile> list;
|
||||
private final double totalWidth;
|
||||
|
||||
public ConnectionHline3(Ftile inner, HtmlColor arrowColor, double y, List<Ftile> list, double totalWidth) {
|
||||
public ConnectionHline3(Ftile inner, Rainbow arrowColor, double y, List<Ftile> list, double totalWidth) {
|
||||
super(null, null);
|
||||
this.inner = inner;
|
||||
this.y = y;
|
||||
@ -360,10 +359,10 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
||||
static class ConnectionIn extends AbstractConnection {
|
||||
|
||||
private final double x;
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
private final TextBlock text;
|
||||
|
||||
public ConnectionIn(Ftile tmp, double x, HtmlColor arrowColor, TextBlock text) {
|
||||
public ConnectionIn(Ftile tmp, double x, Rainbow arrowColor, TextBlock text) {
|
||||
super(null, tmp);
|
||||
this.x = x;
|
||||
this.arrowColor = arrowColor;
|
||||
@ -385,11 +384,11 @@ public class FtileFactoryDelegatorCreateSplit extends FtileFactoryDelegator {
|
||||
static class ConnectionOut extends AbstractConnection {
|
||||
|
||||
private final double x;
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
private final double height;
|
||||
private final TextBlock text;
|
||||
|
||||
public ConnectionOut(Ftile tmp, double x, HtmlColor arrowColor, double height, TextBlock text) {
|
||||
public ConnectionOut(Ftile tmp, double x, Rainbow arrowColor, double height, TextBlock text) {
|
||||
super(tmp, null);
|
||||
this.x = x;
|
||||
this.arrowColor = arrowColor;
|
||||
|
@ -48,6 +48,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond.ConditionalBuilder;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
|
||||
public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
|
||||
@ -69,7 +71,7 @@ public class FtileFactoryDelegatorIf extends FtileFactoryDelegator {
|
||||
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
|
||||
final HtmlColor backColor = branch0.getColor() == null ? getRose().getHtmlColor(getSkinParam(),
|
||||
ColorParam.activityBackground) : branch0.getColor();
|
||||
final HtmlColor arrowColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
||||
|
||||
final FontConfiguration fcArrow = new FontConfiguration(getSkinParam(), FontParam.ACTIVITY_ARROW, null);
|
||||
// .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
|
||||
|
@ -44,6 +44,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
|
||||
public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
|
||||
@ -53,23 +55,24 @@ public class FtileFactoryDelegatorRepeat extends FtileFactoryDelegator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Ftile repeat(Swimlane swimlane, Ftile repeat, Display test, Display yes, Display out, HtmlColor color,
|
||||
LinkRendering backRepeatLinkRendering) {
|
||||
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Ftile repeat, Display test, Display yes, Display out,
|
||||
HtmlColor color, LinkRendering backRepeatLinkRendering) {
|
||||
final ConditionStyle conditionStyle = getSkinParam().getConditionStyle();
|
||||
|
||||
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
|
||||
final HtmlColor backColor = color == null ? getRose().getHtmlColor(getSkinParam(),
|
||||
ColorParam.activityBackground) : color;
|
||||
final HtmlColor arrowColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
||||
|
||||
final LinkRendering endRepeatLinkRendering = repeat.getOutLinkRendering();
|
||||
final HtmlColor endRepeatLinkColor = endRepeatLinkRendering == null ? null : endRepeatLinkRendering.getColor();
|
||||
final Rainbow endRepeatLinkColor = endRepeatLinkRendering == null ? null : endRepeatLinkRendering
|
||||
.getRainbow();
|
||||
|
||||
final FontParam fontParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
|
||||
: FontParam.ACTIVITY_ARROW;
|
||||
final FontConfiguration fc = new FontConfiguration(getSkinParam(), fontParam, null);
|
||||
|
||||
return FtileRepeat.create(backRepeatLinkRendering, swimlane, repeat, test, yes, out, borderColor, backColor,
|
||||
arrowColor, endRepeatLinkColor, conditionStyle, this, fc);
|
||||
return FtileRepeat.create(backRepeatLinkRendering, swimlane, swimlaneOut, repeat, test, yes, out, borderColor,
|
||||
backColor, arrowColor, endRepeatLinkColor, conditionStyle, this, fc);
|
||||
}
|
||||
}
|
||||
|
@ -44,6 +44,8 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
|
||||
public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
|
||||
@ -58,7 +60,7 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
|
||||
final HtmlColor borderColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityBorder);
|
||||
final HtmlColor backColor = color == null ? getRose().getHtmlColor(getSkinParam(),
|
||||
ColorParam.activityBackground) : color;
|
||||
final HtmlColor arrowColor = getRose().getHtmlColor(getSkinParam(), ColorParam.activityArrow);
|
||||
final Rainbow arrowColor = HtmlColorAndStyle.build(getSkinParam());
|
||||
|
||||
final ConditionStyle conditionStyle = getSkinParam().getConditionStyle();
|
||||
final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
|
||||
@ -66,7 +68,8 @@ public class FtileFactoryDelegatorWhile extends FtileFactoryDelegator {
|
||||
final FontConfiguration fcTest = new FontConfiguration(getSkinParam(), testParam, null);
|
||||
|
||||
final LinkRendering endInlinkRendering = whileBlock.getOutLinkRendering();
|
||||
final HtmlColor endInlinkColor = endInlinkRendering == null ? arrowColor : endInlinkRendering.getColor();
|
||||
final Rainbow endInlinkColor = endInlinkRendering == null || endInlinkRendering.getRainbow().size() == 0 ? arrowColor
|
||||
: endInlinkRendering.getRainbow();
|
||||
|
||||
final FontConfiguration fontArrow = new FontConfiguration(getSkinParam(), FontParam.ACTIVITY_ARROW, null);
|
||||
|
||||
|
@ -66,6 +66,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
@ -79,9 +80,9 @@ class FtileIfAndStop extends AbstractFtile {
|
||||
private final Ftile diamond1;
|
||||
private final Ftile stop2;
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
private FtileIfAndStop(Ftile diamond1, Ftile tile1, HtmlColor arrowColor, Ftile stopFtile) {
|
||||
private FtileIfAndStop(Ftile diamond1, Ftile tile1, Rainbow arrowColor, Ftile stopFtile) {
|
||||
super(tile1.shadowing());
|
||||
this.diamond1 = diamond1;
|
||||
this.tile1 = tile1;
|
||||
@ -108,7 +109,7 @@ class FtileIfAndStop extends AbstractFtile {
|
||||
return getSwimlaneIn();
|
||||
}
|
||||
|
||||
static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
|
||||
static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
|
||||
FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch nonStop, ISkinParam skinParam,
|
||||
StringBounder stringBounder, Display labelTest) {
|
||||
|
||||
@ -209,9 +210,9 @@ class FtileIfAndStop extends AbstractFtile {
|
||||
|
||||
class ConnectionHorizontal extends AbstractConnection {
|
||||
|
||||
private final HtmlColor color;
|
||||
private final Rainbow color;
|
||||
|
||||
public ConnectionHorizontal(HtmlColor color) {
|
||||
public ConnectionHorizontal(Rainbow color) {
|
||||
super(diamond1, stop2);
|
||||
this.color = color;
|
||||
}
|
||||
|
@ -59,11 +59,10 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.Snake;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.Swimlane;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond.FtileIfWithLinks;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInside2;
|
||||
import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
@ -79,9 +78,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
private final List<Ftile> diamonds;
|
||||
private final List<Ftile> couples = new ArrayList<Ftile>();
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
private FtileIfLongHorizontal(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, HtmlColor arrowColor) {
|
||||
private FtileIfLongHorizontal(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, Rainbow arrowColor) {
|
||||
super(tiles.get(0).shadowing() || tile2.shadowing());
|
||||
if (diamonds.size() != tiles.size()) {
|
||||
throw new IllegalArgumentException();
|
||||
@ -133,9 +132,12 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
return getSwimlaneIn();
|
||||
}
|
||||
|
||||
static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
|
||||
static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
|
||||
FtileFactory ftileFactory, ConditionStyle conditionStyle, List<Branch> thens, Branch branch2,
|
||||
FontConfiguration fc, LinkRendering topInlinkRendering, LinkRendering afterEndwhile) {
|
||||
if (afterEndwhile == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
final List<Ftile> tiles = new ArrayList<Ftile>();
|
||||
|
||||
for (Branch branch : thens) {
|
||||
@ -167,12 +169,12 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
final Ftile ftile = tiles.get(i);
|
||||
final Ftile diam = diamonds.get(i);
|
||||
|
||||
final HtmlColor color = FtileIfWithLinks.getInColor(thens.get(i), arrowColor);
|
||||
final Rainbow color = FtileIfWithLinks.getInColor(thens.get(i), arrowColor);
|
||||
conns.add(result.new ConnectionVerticalIn(diam, ftile, color == null ? arrowColor : color));
|
||||
conns.add(result.new ConnectionVerticalOut(ftile, arrowColor));
|
||||
}
|
||||
|
||||
final HtmlColor topInColor = LinkRendering.getColor(topInlinkRendering, arrowColor);
|
||||
final Rainbow topInColor = topInlinkRendering.getRainbow(arrowColor);
|
||||
for (int i = 0; i < diamonds.size() - 1; i++) {
|
||||
final Ftile diam1 = diamonds.get(i);
|
||||
final Ftile diam2 = diamonds.get(i + 1);
|
||||
@ -181,7 +183,7 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
conns.add(result.new ConnectionIn(topInColor));
|
||||
conns.add(result.new ConnectionLastElseIn(FtileIfWithLinks.getInColor(branch2, arrowColor)));
|
||||
conns.add(result.new ConnectionLastElseOut(arrowColor));
|
||||
final HtmlColor horizontalOutColor = LinkRendering.getColor(afterEndwhile, arrowColor);
|
||||
final Rainbow horizontalOutColor = afterEndwhile.getRainbow(arrowColor);
|
||||
conns.add(result.new ConnectionHline(horizontalOutColor));
|
||||
// conns.add(result.new ConnectionHline(HtmlColorUtils.BLUE));
|
||||
|
||||
@ -190,9 +192,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
class ConnectionHorizontal extends AbstractConnection {
|
||||
|
||||
private final HtmlColor color;
|
||||
private final Rainbow color;
|
||||
|
||||
public ConnectionHorizontal(Ftile diam1, Ftile diam2, HtmlColor color) {
|
||||
public ConnectionHorizontal(Ftile diam1, Ftile diam2, Rainbow color) {
|
||||
super(diam1, diam2);
|
||||
this.color = color;
|
||||
}
|
||||
@ -230,9 +232,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
class ConnectionIn extends AbstractConnection {
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionIn(HtmlColor arrowColor) {
|
||||
public ConnectionIn(Rainbow arrowColor) {
|
||||
super(null, diamonds.get(0));
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
@ -253,9 +255,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
class ConnectionLastElseIn extends AbstractConnection {
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionLastElseIn(HtmlColor arrowColor) {
|
||||
public ConnectionLastElseIn(Rainbow arrowColor) {
|
||||
super(diamonds.get(diamonds.size() - 1), tile2);
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
@ -282,9 +284,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
class ConnectionLastElseOut extends AbstractConnection {
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionLastElseOut(HtmlColor arrowColor) {
|
||||
public ConnectionLastElseOut(Rainbow arrowColor) {
|
||||
super(tile2, null);
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
@ -310,9 +312,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
class ConnectionVerticalIn extends AbstractConnection implements ConnectionTranslatable {
|
||||
|
||||
private final HtmlColor color;
|
||||
private final Rainbow color;
|
||||
|
||||
public ConnectionVerticalIn(Ftile diamond, Ftile tile, HtmlColor color) {
|
||||
public ConnectionVerticalIn(Ftile diamond, Ftile tile, Rainbow color) {
|
||||
super(diamond, tile);
|
||||
this.color = color;
|
||||
}
|
||||
@ -358,9 +360,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
class ConnectionVerticalOut extends AbstractConnection {
|
||||
|
||||
private final HtmlColor color;
|
||||
private final Rainbow color;
|
||||
|
||||
public ConnectionVerticalOut(Ftile tile, HtmlColor color) {
|
||||
public ConnectionVerticalOut(Ftile tile, Rainbow color) {
|
||||
super(tile, null);
|
||||
this.color = color;
|
||||
}
|
||||
@ -393,9 +395,9 @@ class FtileIfLongHorizontal extends AbstractFtile {
|
||||
|
||||
class ConnectionHline extends AbstractConnection {
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionHline(HtmlColor arrowColor) {
|
||||
public ConnectionHline(Rainbow arrowColor) {
|
||||
super(null, null);
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
|
@ -41,7 +41,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.sourceforge.plantuml.Dimension2DDouble;
|
||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
|
||||
@ -62,6 +61,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileDiamondInsi
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
@ -80,9 +80,9 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
private final Ftile lastDiamond;
|
||||
// private final List<Ftile> couples = new ArrayList<Ftile>();
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
private FtileIfLongVertical(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, HtmlColor arrowColor,
|
||||
private FtileIfLongVertical(List<Ftile> diamonds, List<Ftile> tiles, Ftile tile2, Rainbow arrowColor,
|
||||
Ftile lastDiamond) {
|
||||
super(tiles.get(0).shadowing() || tile2.shadowing());
|
||||
if (diamonds.size() != tiles.size()) {
|
||||
@ -136,7 +136,7 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
return getSwimlaneIn();
|
||||
}
|
||||
|
||||
static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
|
||||
static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
|
||||
FtileFactory ftileFactory, ConditionStyle conditionStyle, List<Branch> thens, Branch branch2,
|
||||
FontConfiguration fc, LinkRendering topInlinkRendering, LinkRendering afterEndwhile) {
|
||||
final List<Ftile> tiles = new ArrayList<Ftile>();
|
||||
@ -172,7 +172,7 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
final Ftile ftile = tiles.get(i);
|
||||
final Ftile diam = diamonds.get(i);
|
||||
|
||||
final HtmlColor color = FtileIfWithLinks.getInColor(thens.get(i), arrowColor);
|
||||
final Rainbow color = FtileIfWithLinks.getInColor(thens.get(i), arrowColor);
|
||||
conns.add(result.new ConnectionVerticalIn(diam, ftile, color == null ? arrowColor : color));
|
||||
// conns.add(result.new ConnectionVerticalOut(ftile, arrowColor));
|
||||
}
|
||||
@ -185,7 +185,7 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
conns.add(result.new ConnectionThenOutConnect(tiles.get(i), arrowColor));
|
||||
}
|
||||
|
||||
final HtmlColor topInColor = LinkRendering.getColor(topInlinkRendering, arrowColor);
|
||||
final Rainbow topInColor = topInlinkRendering.getRainbow(arrowColor);
|
||||
// for (int i = 0; i < diamonds.size() - 1; i++) {
|
||||
// final Ftile diam1 = diamonds.get(i);
|
||||
// final Ftile diam2 = diamonds.get(i + 1);
|
||||
@ -208,9 +208,9 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
class ConnectionIn extends AbstractConnection {
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionIn(HtmlColor arrowColor) {
|
||||
public ConnectionIn(Rainbow arrowColor) {
|
||||
super(null, diamonds.get(0));
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
@ -232,9 +232,9 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
class ConnectionVerticalIn extends AbstractConnection {
|
||||
|
||||
private final HtmlColor color;
|
||||
private final Rainbow color;
|
||||
|
||||
public ConnectionVerticalIn(Ftile diamond, Ftile tile, HtmlColor color) {
|
||||
public ConnectionVerticalIn(Ftile diamond, Ftile tile, Rainbow color) {
|
||||
super(diamond, tile);
|
||||
this.color = color;
|
||||
}
|
||||
@ -267,9 +267,9 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
class ConnectionVertical extends AbstractConnection {
|
||||
|
||||
private final HtmlColor color;
|
||||
private final Rainbow color;
|
||||
|
||||
public ConnectionVertical(Ftile diamond1, Ftile diamond2, HtmlColor color) {
|
||||
public ConnectionVertical(Ftile diamond1, Ftile diamond2, Rainbow color) {
|
||||
super(diamond1, diamond2);
|
||||
this.color = color;
|
||||
}
|
||||
@ -299,9 +299,9 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
class ConnectionLastElse extends AbstractConnection {
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionLastElse(HtmlColor arrowColor) {
|
||||
public ConnectionLastElse(Rainbow arrowColor) {
|
||||
super(diamonds.get(diamonds.size() - 1), tile2);
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
@ -327,9 +327,9 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
class ConnectionLastElseOut extends AbstractConnection {
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionLastElseOut(HtmlColor arrowColor) {
|
||||
public ConnectionLastElseOut(Rainbow arrowColor) {
|
||||
super(tile2, lastDiamond);
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
@ -356,9 +356,9 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
class ConnectionThenOut extends AbstractConnection {
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionThenOut(Ftile tile1, HtmlColor arrowColor) {
|
||||
public ConnectionThenOut(Ftile tile1, Rainbow arrowColor) {
|
||||
super(tile1, lastDiamond);
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
@ -390,9 +390,9 @@ class FtileIfLongVertical extends AbstractFtile {
|
||||
|
||||
class ConnectionThenOutConnect extends AbstractConnection {
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionThenOutConnect(Ftile tile1, HtmlColor arrowColor) {
|
||||
public ConnectionThenOutConnect(Ftile tile1, Rainbow arrowColor) {
|
||||
super(tile1, lastDiamond);
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
|
@ -62,6 +62,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -89,20 +90,19 @@ class FtileRepeat extends AbstractFtile {
|
||||
}
|
||||
|
||||
public Swimlane getSwimlaneOut() {
|
||||
return getSwimlaneIn();
|
||||
return diamond2.getSwimlaneOut();
|
||||
// return getSwimlaneIn();
|
||||
}
|
||||
|
||||
public Set<Swimlane> getSwimlanes() {
|
||||
return repeat.getSwimlanes();
|
||||
}
|
||||
|
||||
public static Ftile create(LinkRendering backRepeatLinkRendering, Swimlane swimlane, Ftile repeat, Display test,
|
||||
Display yes, Display out, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
|
||||
HtmlColor endRepeatLinkColor, ConditionStyle conditionStyle, ISkinSimple spriteContainer,
|
||||
public static Ftile create(LinkRendering backRepeatLinkRendering, Swimlane swimlane, Swimlane swimlaneOut,
|
||||
Ftile repeat, Display test, Display yes, Display out, HtmlColor borderColor, HtmlColor backColor,
|
||||
Rainbow arrowColor, Rainbow endRepeatLinkColor, ConditionStyle conditionStyle, ISkinSimple spriteContainer,
|
||||
FontConfiguration fontConfiguration) {
|
||||
|
||||
// final FontConfiguration fc = new FontConfiguration(fontTest, HtmlColorUtils.BLACK, hyperlinkColor,
|
||||
// useUnderlineForHyperlink);
|
||||
final TextBlock tbTest = (Display.isNull(test) || test.isWhite()) ? TextBlockUtils.empty(0, 0) : test.create(
|
||||
fontConfiguration, HorizontalAlignment.LEFT, spriteContainer);
|
||||
final TextBlock yesTb = yes.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer);
|
||||
@ -111,8 +111,10 @@ class FtileRepeat extends AbstractFtile {
|
||||
final Ftile diamond1 = new FtileDiamond(repeat.shadowing(), backColor, borderColor, swimlane);
|
||||
final FtileRepeat result;
|
||||
if (conditionStyle == ConditionStyle.INSIDE) {
|
||||
final Ftile diamond2 = new FtileDiamondInside(repeat.shadowing(), backColor, borderColor, swimlane, tbTest)
|
||||
.withEast(yesTb).withSouth(outTb);
|
||||
final Ftile diamond2 = new FtileDiamondInside(repeat.shadowing(), backColor, borderColor, swimlaneOut,
|
||||
tbTest).withEast(yesTb).withSouth(outTb);
|
||||
// final Ftile diamond2 = new FtileDiamondInside(repeat.shadowing(), backColor, borderColor, swimlane,
|
||||
// tbTest).withEast(yesTb).withSouth(outTb);
|
||||
result = new FtileRepeat(repeat, diamond1, diamond2, TextBlockUtils.empty(0, 0));
|
||||
} else if (conditionStyle == ConditionStyle.DIAMOND) {
|
||||
final Ftile diamond2 = new FtileDiamond(repeat.shadowing(), backColor, borderColor, swimlane)
|
||||
@ -126,29 +128,36 @@ class FtileRepeat extends AbstractFtile {
|
||||
}
|
||||
|
||||
final List<Connection> conns = new ArrayList<Connection>();
|
||||
final Display in1 = LinkRendering.getDisplay(repeat.getInLinkRendering());
|
||||
final TextBlock tbin1 = in1 == null ? null : in1.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer,
|
||||
CreoleMode.SIMPLE_LINE);
|
||||
conns.add(result.new ConnectionIn(LinkRendering.getColor(repeat.getInLinkRendering(), arrowColor), tbin1));
|
||||
|
||||
final Display backLink1 = LinkRendering.getDisplay(backRepeatLinkRendering);
|
||||
final TextBlock tbbackLink1 = backLink1 == null ? null : backLink1.create(fontConfiguration, HorizontalAlignment.LEFT,
|
||||
final Display in1 = repeat.getInLinkRendering().getDisplay();
|
||||
final TextBlock tbin1 = in1 == null ? null : in1.create(fontConfiguration, HorizontalAlignment.LEFT,
|
||||
spriteContainer, CreoleMode.SIMPLE_LINE);
|
||||
conns.add(result.new ConnectionBack(LinkRendering.getColor(backRepeatLinkRendering, arrowColor), tbbackLink1));
|
||||
conns.add(result.new ConnectionIn(repeat.getInLinkRendering().getRainbow(arrowColor), tbin1));
|
||||
|
||||
final Display out1 = LinkRendering.getDisplay(repeat.getOutLinkRendering());
|
||||
final TextBlock tbout1 = out1 == null ? null : out1.create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer,
|
||||
CreoleMode.SIMPLE_LINE);
|
||||
final Display backLink1 = backRepeatLinkRendering.getDisplay();
|
||||
final TextBlock tbbackLink1 = backLink1 == null ? null : backLink1.create(fontConfiguration,
|
||||
HorizontalAlignment.LEFT, spriteContainer, CreoleMode.SIMPLE_LINE);
|
||||
if (repeat.getSwimlaneIn() == repeat.getSwimlaneOut()) {
|
||||
conns.add(result.new ConnectionBackSimple(backRepeatLinkRendering.getRainbow(arrowColor), tbbackLink1));
|
||||
} else {
|
||||
conns.add(result.new ConnectionBackComplex1(backRepeatLinkRendering.getRainbow(arrowColor)));
|
||||
conns.add(result.new ConnectionBackComplexHorizontalOnly(backRepeatLinkRendering.getRainbow(arrowColor),
|
||||
tbbackLink1));
|
||||
}
|
||||
|
||||
conns.add(result.new ConnectionOut(LinkRendering.getColor(endRepeatLinkColor, arrowColor), tbout1));
|
||||
final Display out1 = repeat.getOutLinkRendering().getDisplay();
|
||||
final TextBlock tbout1 = out1 == null ? null : out1.create(fontConfiguration, HorizontalAlignment.LEFT,
|
||||
spriteContainer, CreoleMode.SIMPLE_LINE);
|
||||
|
||||
final Rainbow tmpColor = endRepeatLinkColor.withDefault(arrowColor);
|
||||
conns.add(result.new ConnectionOut(tmpColor, tbout1));
|
||||
return FtileUtils.addConnection(result, conns);
|
||||
}
|
||||
|
||||
class ConnectionIn extends AbstractConnection {
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
private final TextBlock tbin;
|
||||
|
||||
public ConnectionIn(HtmlColor arrowColor, TextBlock tbin) {
|
||||
public ConnectionIn(Rainbow arrowColor, TextBlock tbin) {
|
||||
super(diamond1, repeat);
|
||||
this.arrowColor = arrowColor;
|
||||
this.tbin = tbin;
|
||||
@ -177,10 +186,10 @@ class FtileRepeat extends AbstractFtile {
|
||||
}
|
||||
|
||||
class ConnectionOut extends AbstractConnection implements ConnectionTranslatable {
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
private final TextBlock tbout;
|
||||
|
||||
public ConnectionOut(HtmlColor arrowColor, TextBlock tbout) {
|
||||
public ConnectionOut(Rainbow arrowColor, TextBlock tbout) {
|
||||
super(repeat, diamond2);
|
||||
this.arrowColor = arrowColor;
|
||||
this.tbout = tbout;
|
||||
@ -235,11 +244,92 @@ class FtileRepeat extends AbstractFtile {
|
||||
|
||||
}
|
||||
|
||||
class ConnectionBack extends AbstractConnection {
|
||||
private final HtmlColor arrowColor;
|
||||
class ConnectionBackComplex1 extends AbstractConnection implements ConnectionTranslatable {
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionBackComplex1(Rainbow arrowColor) {
|
||||
super(diamond2, repeat);
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
}
|
||||
|
||||
private Point2D getP2(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond1(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
public void drawTranslate(UGraphic ug, UTranslate translate1, UTranslate translate2) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
final Snake snake = new Snake(arrowColor, Arrows.asToLeft());
|
||||
snake.emphasizeDirection(Direction.UP);
|
||||
final Dimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
|
||||
Point2D p1 = getP1(stringBounder);
|
||||
Point2D p2 = getP2(stringBounder);
|
||||
p1 = translate1.getTranslated(p1);
|
||||
p2 = translate2.getTranslated(p2);
|
||||
final Dimension2D dimDiamond1 = diamond1.calculateDimension(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double y1 = p1.getY() + dimDiamond2.getHeight() / 2;
|
||||
final double x2 = p2.getX() + dimDiamond1.getWidth();
|
||||
final double y2 = p2.getY() + dimDiamond1.getHeight() / 2;
|
||||
|
||||
final double xmax = p1.getX() + dimDiamond2.getWidth() / 2 + dimRepeat.getWidth() / 2
|
||||
+ Diamond.diamondHalfSize;
|
||||
snake.addPoint(xmax, y1);
|
||||
snake.addPoint(xmax, y2);
|
||||
snake.addPoint(x2, y2);
|
||||
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ConnectionBackComplexHorizontalOnly extends AbstractConnection {
|
||||
private final Rainbow arrowColor;
|
||||
private final TextBlock tbback;
|
||||
|
||||
public ConnectionBack(HtmlColor arrowColor, TextBlock tbback) {
|
||||
public ConnectionBackComplexHorizontalOnly(Rainbow arrowColor, TextBlock tbback) {
|
||||
super(diamond2, diamond2);
|
||||
this.arrowColor = arrowColor;
|
||||
this.tbback = tbback;
|
||||
}
|
||||
|
||||
private Point2D getP1(final StringBounder stringBounder) {
|
||||
return getTranslateDiamond2(stringBounder).getTranslated(new Point2D.Double(0, 0));
|
||||
}
|
||||
|
||||
public void drawU(UGraphic ug) {
|
||||
final StringBounder stringBounder = ug.getStringBounder();
|
||||
|
||||
final Snake snake = new Snake(arrowColor, null);
|
||||
snake.setLabel(tbback);
|
||||
final Dimension2D dimRepeat = repeat.calculateDimension(stringBounder);
|
||||
final Point2D p1 = getP1(stringBounder);
|
||||
final Dimension2D dimDiamond2 = diamond2.calculateDimension(stringBounder);
|
||||
final double x1 = p1.getX() + dimDiamond2.getWidth();
|
||||
final double y1 = p1.getY() + dimDiamond2.getHeight() / 2;
|
||||
|
||||
snake.addPoint(x1, y1);
|
||||
final double xmax = p1.getX() + dimDiamond2.getWidth() / 2 + dimRepeat.getWidth() / 2
|
||||
+ Diamond.diamondHalfSize;
|
||||
snake.addPoint(xmax, y1);
|
||||
ug.draw(snake);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ConnectionBackSimple extends AbstractConnection {
|
||||
private final Rainbow arrowColor;
|
||||
private final TextBlock tbback;
|
||||
|
||||
public ConnectionBackSimple(Rainbow arrowColor, TextBlock tbback) {
|
||||
super(diamond2, repeat);
|
||||
this.arrowColor = arrowColor;
|
||||
this.tbback = tbback;
|
||||
@ -270,14 +360,12 @@ class FtileRepeat extends AbstractFtile {
|
||||
final double y2 = p2.getY() + dimDiamond1.getHeight() / 2;
|
||||
|
||||
snake.addPoint(x1, y1);
|
||||
final double yy = dimTotal.getWidth() - Diamond.diamondHalfSize;
|
||||
snake.addPoint(yy, y1);
|
||||
snake.addPoint(yy, y2);
|
||||
final double xmax = dimTotal.getWidth() - Diamond.diamondHalfSize;
|
||||
snake.addPoint(xmax, y1);
|
||||
snake.addPoint(xmax, y2);
|
||||
snake.addPoint(x2, y2);
|
||||
|
||||
ug.draw(snake);
|
||||
// ug = ug.apply(new UChangeColor(arrowColor)).apply(new UChangeBackColor(arrowColor));
|
||||
// ug.apply(new UTranslate(yy, dimTotal.getHeight() / 2)).draw(Arrows.asToUp());
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -62,6 +62,8 @@ import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.TextBlockUtils;
|
||||
@ -109,7 +111,7 @@ class FtileWhile extends AbstractFtile {
|
||||
}
|
||||
|
||||
public static Ftile create(Swimlane swimlane, Ftile whileBlock, Display test, HtmlColor borderColor,
|
||||
HtmlColor backColor, HtmlColor arrowColor, Display yes, Display out2, HtmlColor endInlinkColor,
|
||||
HtmlColor backColor, Rainbow arrowColor, Display yes, Display out2, Rainbow endInlinkColor,
|
||||
LinkRendering afterEndwhile, FontConfiguration fontArrow, FtileFactory ftileFactory,
|
||||
ConditionStyle conditionStyle, FontConfiguration fcTest) {
|
||||
|
||||
@ -136,22 +138,22 @@ class FtileWhile extends AbstractFtile {
|
||||
}
|
||||
|
||||
final FtileWhile result = new FtileWhile(whileBlock, diamond1, supplementarySouthText);
|
||||
HtmlColor afterEndwhileColor = arrowColor;
|
||||
if (afterEndwhile != null && afterEndwhile.getColor() != null) {
|
||||
afterEndwhileColor = afterEndwhile.getColor();
|
||||
Rainbow afterEndwhileColor = arrowColor;
|
||||
if (afterEndwhile != null && afterEndwhile.getRainbow() != null && afterEndwhile.getRainbow().size() != 0) {
|
||||
afterEndwhileColor = afterEndwhile.getRainbow();
|
||||
}
|
||||
|
||||
final List<Connection> conns = new ArrayList<Connection>();
|
||||
conns.add(result.new ConnectionIn(LinkRendering.getColor(whileBlock.getInLinkRendering(), arrowColor)));
|
||||
conns.add(result.new ConnectionIn(whileBlock.getInLinkRendering().getRainbow(arrowColor)));
|
||||
conns.add(result.new ConnectionBack(endInlinkColor));
|
||||
conns.add(result.new ConnectionOut(afterEndwhileColor));
|
||||
return FtileUtils.addConnection(result, conns);
|
||||
}
|
||||
|
||||
class ConnectionIn extends AbstractConnection implements ConnectionTranslatable {
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public ConnectionIn(HtmlColor arrowColor) {
|
||||
public ConnectionIn(Rainbow arrowColor) {
|
||||
super(diamond1, whileBlock);
|
||||
this.arrowColor = arrowColor;
|
||||
}
|
||||
@ -193,9 +195,9 @@ class FtileWhile extends AbstractFtile {
|
||||
}
|
||||
|
||||
class ConnectionBack extends AbstractConnection implements ConnectionTranslatable {
|
||||
private final HtmlColor endInlinkColor;
|
||||
private final Rainbow endInlinkColor;
|
||||
|
||||
public ConnectionBack(HtmlColor endInlinkColor) {
|
||||
public ConnectionBack(Rainbow endInlinkColor) {
|
||||
super(whileBlock, diamond1);
|
||||
this.endInlinkColor = endInlinkColor;
|
||||
}
|
||||
@ -278,7 +280,8 @@ class FtileWhile extends AbstractFtile {
|
||||
|
||||
ug.apply(new UTranslate(x1, y1 + Diamond.diamondHalfSize)).draw(new UEmpty(5, Diamond.diamondHalfSize));
|
||||
|
||||
ug = ug.apply(new UChangeColor(endInlinkColor)).apply(new UChangeBackColor(endInlinkColor));
|
||||
ug = ug.apply(new UChangeColor(endInlinkColor.getColor())).apply(
|
||||
new UChangeBackColor(endInlinkColor.getColor()));
|
||||
ug.apply(new UTranslate(xx, (y1 + y2) / 2)).draw(Arrows.asToUp());
|
||||
|
||||
}
|
||||
@ -286,9 +289,9 @@ class FtileWhile extends AbstractFtile {
|
||||
}
|
||||
|
||||
class ConnectionOut extends AbstractConnection {
|
||||
private final HtmlColor afterEndwhileColor;
|
||||
private final Rainbow afterEndwhileColor;
|
||||
|
||||
public ConnectionOut(HtmlColor afterEndwhileColor) {
|
||||
public ConnectionOut(Rainbow afterEndwhileColor) {
|
||||
super(diamond1, null);
|
||||
this.afterEndwhileColor = afterEndwhileColor;
|
||||
}
|
||||
|
@ -98,8 +98,7 @@ public class VCompactFactory implements FtileFactory {
|
||||
// final HtmlColor backColor = color == null ? rose.getHtmlColor(skinParam, ColorParam.activityBackground) :
|
||||
// color;
|
||||
final UFont font = skinParam.getFont(null, false, FontParam.ACTIVITY);
|
||||
final HtmlColor arrowColor = rose.getHtmlColor(skinParam, ColorParam.activityArrow);
|
||||
return new FtileBox(shadowing(), label, font, arrowColor, swimlane, style, colors.mute(skinParam));
|
||||
return new FtileBox(shadowing(), label, font, swimlane, style, colors.mute(skinParam));
|
||||
}
|
||||
|
||||
public Ftile addNote(Ftile ftile, Display note, NotePosition notePosition) {
|
||||
@ -114,8 +113,8 @@ public class VCompactFactory implements FtileFactory {
|
||||
return new FtileAssemblySimple(tile1, tile2);
|
||||
}
|
||||
|
||||
public Ftile repeat(Swimlane swimlane, Ftile repeat, Display test, Display yes, Display out, HtmlColor color,
|
||||
LinkRendering backRepeatLinkRendering) {
|
||||
public Ftile repeat(Swimlane swimlane, Swimlane swimlaneOut, Ftile repeat, Display test, Display yes, Display out,
|
||||
HtmlColor color, LinkRendering backRepeatLinkRendering) {
|
||||
return repeat;
|
||||
}
|
||||
|
||||
@ -142,7 +141,8 @@ public class VCompactFactory implements FtileFactory {
|
||||
return new FtileForkInner(all);
|
||||
}
|
||||
|
||||
public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote, HtmlColor borderColor) {
|
||||
public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, Display headerNote,
|
||||
HtmlColor borderColor) {
|
||||
return list;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@ package net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.cond;
|
||||
|
||||
import java.awt.geom.Dimension2D;
|
||||
|
||||
import net.sourceforge.plantuml.FontParam;
|
||||
import net.sourceforge.plantuml.ISkinParam;
|
||||
import net.sourceforge.plantuml.activitydiagram3.Branch;
|
||||
import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
|
||||
@ -57,7 +56,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.svek.ConditionStyle;
|
||||
@ -68,7 +67,7 @@ public class ConditionalBuilder {
|
||||
private final Swimlane swimlane;
|
||||
private final HtmlColor borderColor;
|
||||
private final HtmlColor backColor;
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
private final FtileFactory ftileFactory;
|
||||
private final ConditionStyle conditionStyle;
|
||||
private final Branch branch1;
|
||||
@ -81,9 +80,10 @@ public class ConditionalBuilder {
|
||||
private final Ftile tile1;
|
||||
private final Ftile tile2;
|
||||
|
||||
public ConditionalBuilder(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
|
||||
FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1, Branch branch2,
|
||||
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fontArrow, FontConfiguration fontTest) {
|
||||
public ConditionalBuilder(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor,
|
||||
Rainbow arrowColor, FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1,
|
||||
Branch branch2, ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fontArrow,
|
||||
FontConfiguration fontTest) {
|
||||
this.swimlane = swimlane;
|
||||
this.borderColor = borderColor;
|
||||
this.backColor = backColor;
|
||||
@ -102,9 +102,10 @@ public class ConditionalBuilder {
|
||||
|
||||
}
|
||||
|
||||
static public Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, HtmlColor arrowColor,
|
||||
FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1, Branch branch2,
|
||||
ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fcArrow, FontConfiguration fcTest) {
|
||||
static public Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor,
|
||||
Rainbow arrowColor, FtileFactory ftileFactory, ConditionStyle conditionStyle, Branch branch1,
|
||||
Branch branch2, ISkinParam skinParam, StringBounder stringBounder, FontConfiguration fcArrow,
|
||||
FontConfiguration fcTest) {
|
||||
final ConditionalBuilder builder = new ConditionalBuilder(swimlane, borderColor, backColor, arrowColor,
|
||||
ftileFactory, conditionStyle, branch1, branch2, skinParam, stringBounder, fcArrow, fcTest);
|
||||
return builder.createWithLinks();
|
||||
@ -189,10 +190,10 @@ public class ConditionalBuilder {
|
||||
private Ftile getDiamond2() {
|
||||
final Ftile diamond2;
|
||||
if (hasTwoBranches()) {
|
||||
final Display out1 = LinkRendering.getDisplay(branch1.getFtile().getOutLinkRendering());
|
||||
final Display out1 = branch1.getFtile().getOutLinkRendering().getDisplay();
|
||||
final TextBlock tbout1 = out1 == null ? null : out1.create(fontArrow, HorizontalAlignment.LEFT,
|
||||
ftileFactory, CreoleMode.SIMPLE_LINE);
|
||||
final Display out2 = LinkRendering.getDisplay(branch2.getFtile().getOutLinkRendering());
|
||||
final Display out2 = branch2.getFtile().getOutLinkRendering().getDisplay();
|
||||
final TextBlock tbout2 = out2 == null ? null : out2.create(fontArrow, HorizontalAlignment.LEFT,
|
||||
ftileFactory, CreoleMode.SIMPLE_LINE);
|
||||
diamond2 = new FtileDiamond(tile1.shadowing(), backColor, borderColor, swimlane).withWest(tbout1).withEast(
|
||||
|
@ -51,7 +51,7 @@ import net.sourceforge.plantuml.activitydiagram3.ftile.FtileGeometry;
|
||||
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.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.Rainbow;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.ugraphic.UGraphic;
|
||||
import net.sourceforge.plantuml.ugraphic.UPolygon;
|
||||
@ -59,32 +59,41 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
|
||||
|
||||
public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
|
||||
private final HtmlColor arrowColor;
|
||||
private final Rainbow arrowColor;
|
||||
|
||||
public FtileIfWithLinks(Ftile diamond1, Ftile tile1, Ftile tile2, Ftile diamond2, Swimlane in,
|
||||
HtmlColor arrowColor, StringBounder stringBounder) {
|
||||
public FtileIfWithLinks(Ftile diamond1, Ftile tile1, Ftile tile2, Ftile diamond2, Swimlane in, Rainbow arrowColor,
|
||||
StringBounder stringBounder) {
|
||||
super(diamond1, tile1, tile2, diamond2, in, stringBounder);
|
||||
this.arrowColor = arrowColor;
|
||||
if (arrowColor.size() == 0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public static HtmlColor getInColor(Branch branch, HtmlColor arrowColor) {
|
||||
public static Rainbow getInColor(Branch branch, Rainbow arrowColor) {
|
||||
if (branch.isEmpty()) {
|
||||
return LinkRendering.getColor(branch.getFtile().getOutLinkRendering(), arrowColor);
|
||||
return branch.getFtile().getOutLinkRendering().getRainbow(arrowColor);
|
||||
}
|
||||
final LinkRendering linkIn = branch.getFtile().getInLinkRendering();
|
||||
final HtmlColor color = linkIn == null ? arrowColor : linkIn.getColor();
|
||||
final Rainbow color = linkIn == null ? arrowColor : linkIn.getRainbow();
|
||||
if (color.size() == 0) {
|
||||
return arrowColor;
|
||||
}
|
||||
return color;
|
||||
|
||||
}
|
||||
|
||||
class ConnectionHorizontalThenVertical extends AbstractConnection implements ConnectionTranslatable {
|
||||
|
||||
private final HtmlColor color;
|
||||
private final Rainbow color;
|
||||
private final UPolygon usingArrow;
|
||||
|
||||
public ConnectionHorizontalThenVertical(Ftile tile, Branch branch) {
|
||||
super(diamond1, tile);
|
||||
color = getInColor(branch, arrowColor);
|
||||
if (color.size() == 0) {
|
||||
getInColor(branch, arrowColor);
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
usingArrow = branch.isEmpty() ? null : Arrows.asToDown();
|
||||
}
|
||||
|
||||
@ -163,12 +172,12 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
}
|
||||
|
||||
class ConnectionVerticalThenHorizontal extends AbstractConnection implements ConnectionTranslatable {
|
||||
private final HtmlColor myArrowColor;
|
||||
private final Rainbow myArrowColor;
|
||||
private final boolean branchEmpty;
|
||||
|
||||
public ConnectionVerticalThenHorizontal(Ftile tile, HtmlColor myArrowColor, boolean branchEmpty) {
|
||||
public ConnectionVerticalThenHorizontal(Ftile tile, Rainbow myArrowColor, boolean branchEmpty) {
|
||||
super(tile, diamond2);
|
||||
this.myArrowColor = myArrowColor == null ? arrowColor : myArrowColor;
|
||||
this.myArrowColor = myArrowColor == null || myArrowColor.size() == 0 ? arrowColor : myArrowColor;
|
||||
this.branchEmpty = branchEmpty;
|
||||
}
|
||||
|
||||
@ -276,12 +285,12 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
}
|
||||
|
||||
class ConnectionVerticalThenHorizontalDirect extends AbstractConnection implements ConnectionTranslatable {
|
||||
private final HtmlColor myArrowColor;
|
||||
private final Rainbow myArrowColor;
|
||||
private final boolean branchEmpty;
|
||||
|
||||
public ConnectionVerticalThenHorizontalDirect(Ftile tile, HtmlColor myArrowColor, boolean branchEmpty) {
|
||||
public ConnectionVerticalThenHorizontalDirect(Ftile tile, Rainbow myArrowColor, boolean branchEmpty) {
|
||||
super(tile, diamond2);
|
||||
this.myArrowColor = myArrowColor == null ? arrowColor : myArrowColor;
|
||||
this.myArrowColor = myArrowColor == null || myArrowColor.size() == 0 ? arrowColor : myArrowColor;
|
||||
this.branchEmpty = branchEmpty;
|
||||
}
|
||||
|
||||
@ -361,16 +370,18 @@ public class FtileIfWithLinks extends FtileIfWithDiamonds {
|
||||
conns.add(new ConnectionHorizontalThenVertical(tile2, branch2));
|
||||
if (tile1.calculateDimension(stringBounder).hasPointOut()
|
||||
&& tile2.calculateDimension(stringBounder).hasPointOut()) {
|
||||
conns.add(new ConnectionVerticalThenHorizontal(tile1, branch1.getInlinkRenderingColor(), branch1.isEmpty()));
|
||||
conns.add(new ConnectionVerticalThenHorizontal(tile2, branch2.getInlinkRenderingColor(), branch2.isEmpty()));
|
||||
conns.add(new ConnectionVerticalThenHorizontal(tile1, branch1.getInlinkRenderingColorAndStyle(), branch1
|
||||
.isEmpty()));
|
||||
conns.add(new ConnectionVerticalThenHorizontal(tile2, branch2.getInlinkRenderingColorAndStyle(), branch2
|
||||
.isEmpty()));
|
||||
} else if (tile1.calculateDimension(stringBounder).hasPointOut()
|
||||
&& tile2.calculateDimension(stringBounder).hasPointOut() == false) {
|
||||
conns.add(new ConnectionVerticalThenHorizontalDirect(tile1, branch1.getInlinkRenderingColor(), branch1
|
||||
.isEmpty()));
|
||||
conns.add(new ConnectionVerticalThenHorizontalDirect(tile1, branch1.getInlinkRenderingColorAndStyle(),
|
||||
branch1.isEmpty()));
|
||||
} else if (tile1.calculateDimension(stringBounder).hasPointOut() == false
|
||||
&& tile2.calculateDimension(stringBounder).hasPointOut()) {
|
||||
conns.add(new ConnectionVerticalThenHorizontalDirect(tile2, branch2.getInlinkRenderingColor(), branch2
|
||||
.isEmpty()));
|
||||
conns.add(new ConnectionVerticalThenHorizontalDirect(tile2, branch2.getInlinkRenderingColorAndStyle(),
|
||||
branch2.isEmpty()));
|
||||
}
|
||||
|
||||
return FtileUtils.addConnection(this, conns);
|
||||
|
@ -57,6 +57,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
|
||||
import net.sourceforge.plantuml.graphic.FontConfiguration;
|
||||
import net.sourceforge.plantuml.graphic.HorizontalAlignment;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColor;
|
||||
import net.sourceforge.plantuml.graphic.HtmlColorAndStyle;
|
||||
import net.sourceforge.plantuml.graphic.StringBounder;
|
||||
import net.sourceforge.plantuml.graphic.TextBlock;
|
||||
import net.sourceforge.plantuml.graphic.UDrawable;
|
||||
@ -110,13 +111,13 @@ public class FtileBox extends AbstractFtile {
|
||||
|
||||
}
|
||||
|
||||
public FtileBox(boolean shadowing, Display label, UFont font, HtmlColor arrowColor, Swimlane swimlane,
|
||||
BoxStyle style, ISkinParam skinParam) {
|
||||
public FtileBox(boolean shadowing, Display label, UFont font, Swimlane swimlane, BoxStyle style,
|
||||
ISkinParam skinParam) {
|
||||
super(shadowing);
|
||||
this.style = style;
|
||||
this.skinParam = skinParam;
|
||||
this.swimlane = swimlane;
|
||||
this.inRenreding = new LinkRendering(arrowColor);
|
||||
this.inRenreding = new LinkRendering(HtmlColorAndStyle.build(skinParam));
|
||||
final FontConfiguration fc = new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
|
||||
final Sheet sheet = new CreoleParser(fc, HorizontalAlignment.LEFT, skinParam, CreoleMode.FULL)
|
||||
.createSheet(label);
|
||||
|
@ -43,6 +43,9 @@ public class FtileDecorateIn extends FtileDecorate {
|
||||
public FtileDecorateIn(final Ftile ftile, final LinkRendering linkRendering) {
|
||||
super(ftile);
|
||||
this.linkRendering = linkRendering;
|
||||
if (linkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
public LinkRendering getInLinkRendering() {
|
||||
|
@ -42,6 +42,9 @@ public class FtileDecorateOut extends FtileDecorate {
|
||||
|
||||
public FtileDecorateOut(final Ftile ftile, final LinkRendering linkRendering) {
|
||||
super(ftile);
|
||||
if (linkRendering == null) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.linkRendering = linkRendering;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19543 $
|
||||
* Revision $Revision: 19636 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.ant;
|
||||
@ -270,8 +270,12 @@ public class PlantUmlTask extends Task {
|
||||
}
|
||||
|
||||
public void setKeepTmpFiles(String s) {
|
||||
// Deprecated
|
||||
}
|
||||
|
||||
public void setDebugSvek(String s) {
|
||||
if ("true".equalsIgnoreCase(s)) {
|
||||
OptionFlags.getInstance().setKeepTmpFiles(true);
|
||||
option.setDebugSvek(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,6 @@ package net.sourceforge.plantuml.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.sourceforge.plantuml.OptionFlags;
|
||||
import net.sourceforge.plantuml.StringUtils;
|
||||
import net.sourceforge.plantuml.UmlDiagram;
|
||||
|
||||
|
@ -54,6 +54,9 @@ public abstract class PSystemSingleLineFactory extends PSystemAbstractFactory {
|
||||
|
||||
final public Diagram createSystem(UmlSource source) {
|
||||
|
||||
if (source.getTotalLineCount() != 3) {
|
||||
return null;
|
||||
}
|
||||
final IteratorCounter2 it = source.iterator2();
|
||||
if (source.isEmpty()) {
|
||||
return buildEmptyError(source, it.peek().getLocation());
|
||||
|
@ -296,13 +296,16 @@ public class Display implements Iterable<CharSequence> {
|
||||
return urlBuilder.getUrl(StringUtils.trin(this.get(0).toString()));
|
||||
}
|
||||
|
||||
public Display removeUrl(Url url) {
|
||||
public Display removeHeadingUrl(Url url) {
|
||||
if (url == null) {
|
||||
return this;
|
||||
}
|
||||
final Display result = new Display(this.naturalHorizontalAlignment, this.isNull, this.defaultCreoleMode);
|
||||
result.display.add(UrlBuilder.purgeUrl(this.get(0).toString()));
|
||||
result.display.addAll(this.subList(1, this.size()).display);
|
||||
if (result.isWhite() && url.getLabel() != null) {
|
||||
return Display.getWithNewlines(url.getLabel());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 19109 $
|
||||
* Revision $Revision: 19635 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.cucadiagram;
|
||||
@ -113,7 +113,7 @@ public class Link implements Hideable, Removeable {
|
||||
this.label = Display.NULL;
|
||||
} else if (doWeHaveToRemoveUrlAtStart(label)) {
|
||||
this.url = label.initUrl();
|
||||
this.label = label.removeUrl(url);
|
||||
this.label = label.removeHeadingUrl(url);
|
||||
} else {
|
||||
this.label = label;
|
||||
}
|
||||
|
@ -33,20 +33,25 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.cucadiagram;
|
||||
|
||||
import net.sourceforge.plantuml.ugraphic.UChange;
|
||||
import net.sourceforge.plantuml.ugraphic.UStroke;
|
||||
|
||||
public enum LinkStyle {
|
||||
|
||||
NORMAL, DASHED, DOTTED, BOLD, INVISIBLE,
|
||||
|
||||
|
||||
DOUBLE_tobedone, __toremove_INTERFACE_PROVIDER, __toremove_INTERFACE_USER;
|
||||
|
||||
|
||||
public static UStroke getStroke(LinkStyle style) {
|
||||
return getStroke(style, 1);
|
||||
}
|
||||
|
||||
public static UStroke getStroke(LinkStyle style, double thickness) {
|
||||
if (style == LinkStyle.DASHED) {
|
||||
return new UStroke(6, 6, 1);
|
||||
return new UStroke(6, 6, thickness);
|
||||
}
|
||||
if (style == LinkStyle.DOTTED) {
|
||||
return new UStroke(1, 3, 1);
|
||||
return new UStroke(1, 3, thickness);
|
||||
}
|
||||
if (style == LinkStyle.BOLD) {
|
||||
return new UStroke(2.5);
|
||||
@ -54,6 +59,20 @@ public enum LinkStyle {
|
||||
return new UStroke();
|
||||
}
|
||||
|
||||
|
||||
public static LinkStyle fromString(String s) {
|
||||
if ("dashed".equalsIgnoreCase(s)) {
|
||||
return DASHED;
|
||||
}
|
||||
if ("dotted".equalsIgnoreCase(s)) {
|
||||
return DOTTED;
|
||||
}
|
||||
if ("bold".equalsIgnoreCase(s)) {
|
||||
return BOLD;
|
||||
}
|
||||
if ("hidden".equalsIgnoreCase(s)) {
|
||||
return INVISIBLE;
|
||||
}
|
||||
return LinkStyle.NORMAL;
|
||||
}
|
||||
|
||||
}
|
||||
|
BIN
src/net/sourceforge/plantuml/dedication/0.png
Normal file
BIN
src/net/sourceforge/plantuml/dedication/0.png
Normal file
Binary file not shown.
@ -33,70 +33,70 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.dedication;
|
||||
|
||||
import java.io.FilterInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Random;
|
||||
|
||||
public class DecoderInputStream extends FilterInputStream {
|
||||
public class DecoderInputStream extends InputStream {
|
||||
|
||||
private final byte key[];
|
||||
private int idx;
|
||||
private final TurningBytes message;
|
||||
private final TurningBytes sha;
|
||||
private final Random rnd;
|
||||
private final InputStream source;
|
||||
|
||||
public DecoderInputStream(InputStream source, byte key[]) {
|
||||
super(source);
|
||||
this.key = key;
|
||||
this.rnd = new Random(getSeed());
|
||||
public DecoderInputStream(InputStream source, String s) {
|
||||
this.source = source;
|
||||
try {
|
||||
final byte[] text = s.getBytes("UTF-8");
|
||||
final byte[] key = getSignatureSha512(text);
|
||||
this.rnd = new Random(getSeed(key));
|
||||
this.message = new TurningBytes(text);
|
||||
this.sha = new TurningBytes(key);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private long getSeed() {
|
||||
private static byte[] getSignatureSha512(byte[] bytes) {
|
||||
try {
|
||||
final MessageDigest msgDigest = MessageDigest.getInstance("SHA-512");
|
||||
msgDigest.update(bytes);
|
||||
return msgDigest.digest();
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
throw new UnsupportedOperationException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private long getSeed(byte[] bytes) {
|
||||
long result = 17;
|
||||
for (byte b : key) {
|
||||
for (byte b : bytes) {
|
||||
result = result * 37 + b;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private byte getNextByte() {
|
||||
for (int i = 0; i < nextKey(); i++) {
|
||||
rnd.nextInt();
|
||||
}
|
||||
return (byte) rnd.nextInt();
|
||||
return (byte) (rnd.nextInt() ^ message.nextByte() ^ sha.nextByte());
|
||||
}
|
||||
|
||||
private int nextKey() {
|
||||
final int result = key[idx];
|
||||
idx++;
|
||||
if (idx >= key.length) {
|
||||
idx = 0;
|
||||
}
|
||||
if (result < 0) {
|
||||
return result + 256;
|
||||
}
|
||||
return result;
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
source.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
int b = super.read();
|
||||
int b = source.read();
|
||||
if (b == -1) {
|
||||
return -1;
|
||||
}
|
||||
b = b ^ getNextByte();
|
||||
b = (b ^ getNextByte()) & 0xFF;
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read(byte[] b, int off, int len) throws IOException {
|
||||
final int nb = super.read(b, off, len);
|
||||
if (nb == -1) {
|
||||
return nb;
|
||||
}
|
||||
for (int i = 0; i < nb; i++) {
|
||||
b[i + off] = (byte) (b[i + off] ^ getNextByte());
|
||||
}
|
||||
return nb;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,8 +34,11 @@
|
||||
package net.sourceforge.plantuml.dedication;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigInteger;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.imageio.stream.ImageInputStream;
|
||||
@ -44,28 +47,26 @@ import net.sourceforge.plantuml.webp.VP8Decoder;
|
||||
|
||||
public class Dedication {
|
||||
|
||||
private final String signature;
|
||||
private final String name;
|
||||
public static final int SIZE = 512;
|
||||
|
||||
public Dedication(String signature) {
|
||||
this.signature = signature;
|
||||
public Dedication(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return signature;
|
||||
}
|
||||
private final BigInteger E = new BigInteger("47");
|
||||
private final BigInteger N = new BigInteger(
|
||||
"64194259632025692228025828504368542164501926620236990850309916606915924860847417702229807236946186163298479808527077315212362810246237044147835839820235668271044023359607622658694578433933680627840319408427732468918341837133798296090069295727323673222224923200718714534955390633175683720810506099934813509605263799234445827953809462431871169282281822048299576307847441008670575692934434087522877910989584374673170522742162366773143807761599862833698229067475807108264396251702152180676841544743258182370105404479387062985271422237607462447989728490398294623785717593446941673706569352249533885603771123718557406286501161336667835919957553680522213067630956498293529840163155604109185561515875171125161872265975088797712442352939352686113608345330266855433849127812528823634773975825170679786399199082599910532761710473383280738663105826045325480095451410448217715495894688594898541182351588505292424154550388343455540760277051977859647543838445735549451966254020972172982014944475678385523833120793348365125754234511467512831686599126674298367512469557219326026525667529348508876650236597163509336304607610284488623800062157659286940214435134423619711736992281071131245654755167288438258292694799131521268600284444731890784171372171309");
|
||||
|
||||
public byte[] getKey(String keepLetter) {
|
||||
try {
|
||||
return keepLetter.getBytes("UTF8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
}
|
||||
|
||||
private InputStream getInputStream(String keepLetter) {
|
||||
final byte[] key = getKey(keepLetter);
|
||||
final InputStream tmp = PSystemDedication.class.getResourceAsStream(getSignature() + ".png");
|
||||
return new DecoderInputStream(tmp, key);
|
||||
public InputStream getInputStream(String keepLetter) throws IOException {
|
||||
final InputStream tmp = PSystemDedication.class.getResourceAsStream(name + ".png");
|
||||
final InputStream step1 = new DecoderInputStream(tmp, keepLetter);
|
||||
final QBlocks rsa = QBlocks.readFrom(step1, SIZE + 1);
|
||||
final QBlocks decrypted = rsa.change(E, N);
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
decrypted.writeTo(baos, SIZE);
|
||||
baos.close();
|
||||
return new ByteArrayInputStream(baos.toByteArray());
|
||||
}
|
||||
|
||||
public BufferedImage getBufferedImage(String keepLetter) {
|
||||
|
@ -33,6 +33,8 @@
|
||||
*/
|
||||
package net.sourceforge.plantuml.dedication;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -40,39 +42,64 @@ import net.sourceforge.plantuml.SignatureUtils;
|
||||
|
||||
public class Dedications {
|
||||
|
||||
private static final Map<String, Dedication> all = new HashMap<String, Dedication>();
|
||||
private static final Map<String, Dedication> normal = new HashMap<String, Dedication>();
|
||||
private static final Map<String, Dedication> crypted = new HashMap<String, Dedication>();
|
||||
|
||||
static {
|
||||
addNormal("Write your own dedication!");
|
||||
addCrypted("RyHcSMMTGTW-ZlDelq18AwlwfbZZdfo-Yo0ketavjyFxRAFoKx1mAI032reWO3p4Mog-AV6jFqjXfi8G6pKo7G00");
|
||||
addNormal("Write your own dedication!", "dedication");
|
||||
addCrypted("0", "pOhci6rKgPXw32AeYXhOpSY0suoauHq5VUSwFqHLHsLYgSO6WaJ7BW5vtHBAoU6ePbcW7d8Flx99MWjPSKQTDm00");
|
||||
}
|
||||
|
||||
private static void addNormal(String sentence) {
|
||||
final String signature = SignatureUtils.getSignatureSha512(keepLetter(sentence));
|
||||
addCrypted(signature);
|
||||
private static void addNormal(String sentence, String name) {
|
||||
normal.put(keepLetter(sentence), new Dedication(name));
|
||||
}
|
||||
|
||||
private static void addCrypted(String signature) {
|
||||
all.put(signature, new Dedication(signature));
|
||||
private static void addCrypted(String name, String contentKey) {
|
||||
crypted.put(contentKey, new Dedication(name));
|
||||
}
|
||||
|
||||
private Dedications() {
|
||||
}
|
||||
|
||||
public static Dedication get(String line) {
|
||||
final String signature = SignatureUtils.getSignatureSha512(keepLetter(line));
|
||||
return all.get(signature);
|
||||
final String keepLetter = keepLetter(line);
|
||||
final Dedication result = normal.get(keepLetter);
|
||||
if (result != null) {
|
||||
return result;
|
||||
}
|
||||
for (Map.Entry<String, Dedication> ent : crypted.entrySet()) {
|
||||
final Dedication dedication = ent.getValue();
|
||||
InputStream is = null;
|
||||
try {
|
||||
is = dedication.getInputStream(keepLetter);
|
||||
final String signature = SignatureUtils.getSignatureSha512(is);
|
||||
if (signature.equals(ent.getKey())) {
|
||||
return dedication;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
try {
|
||||
if (is != null)
|
||||
is.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String keepLetter(String s) {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
final char c = s.charAt(i);
|
||||
if (Character.isLetter(c)) {
|
||||
if (Character.isLetterOrDigit(c)) {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
return sb.toString().toUpperCase();
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
89
src/net/sourceforge/plantuml/dedication/QBlock.java
Normal file
89
src/net/sourceforge/plantuml/dedication/QBlock.java
Normal file
@ -0,0 +1,89 @@
|
||||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 4041 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.dedication;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigInteger;
|
||||
|
||||
public class QBlock {
|
||||
|
||||
private final BigInteger big;
|
||||
|
||||
public static QBlock read(InputStream source, int size) throws IOException {
|
||||
final byte[] block = new byte[size + 1];
|
||||
for (int i = 0; i < size; i++) {
|
||||
final int read = source.read();
|
||||
if (read == -1) {
|
||||
if (i == 0) {
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
block[i + 1] = (byte) read;
|
||||
}
|
||||
return new QBlock(new BigInteger(block));
|
||||
}
|
||||
|
||||
public QBlock(BigInteger number) {
|
||||
this.big = number;
|
||||
}
|
||||
|
||||
public QBlock change(BigInteger E, BigInteger N) {
|
||||
final BigInteger changed = big.modPow(E, N);
|
||||
return new QBlock(changed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return big.toByteArray().length + " " + big.toString();
|
||||
}
|
||||
|
||||
public void write(OutputStream os, int size) throws IOException {
|
||||
final byte[] data = big.toByteArray();
|
||||
final int start = data.length - size;
|
||||
if (start < 0) {
|
||||
for (int i = 0; i < -start; i++) {
|
||||
os.write(0);
|
||||
}
|
||||
}
|
||||
for (int i = Math.max(start, 0); i < data.length; i++) {
|
||||
int b = data[i];
|
||||
os.write(b);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
76
src/net/sourceforge/plantuml/dedication/QBlocks.java
Normal file
76
src/net/sourceforge/plantuml/dedication/QBlocks.java
Normal file
@ -0,0 +1,76 @@
|
||||
/* ========================================================================
|
||||
* PlantUML : a free UML diagram generator
|
||||
* ========================================================================
|
||||
*
|
||||
* (C) Copyright 2009-2017, Arnaud Roques
|
||||
*
|
||||
* Project Info: http://plantuml.com
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* [Java is a trademark or registered trademark of Sun Microsystems, Inc.
|
||||
* in the United States and other countries.]
|
||||
*
|
||||
* Original Author: Arnaud Roques
|
||||
*
|
||||
* Revision $Revision: 4041 $
|
||||
*
|
||||
*/
|
||||
package net.sourceforge.plantuml.dedication;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.math.BigInteger;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class QBlocks {
|
||||
|
||||
private final List<QBlock> all = new ArrayList<QBlock>();
|
||||
|
||||
private QBlocks() {
|
||||
|
||||
}
|
||||
|
||||
public static QBlocks readFrom(InputStream source, int size) throws IOException {
|
||||
final QBlocks result = new QBlocks();
|
||||
while (true) {
|
||||
final QBlock block = QBlock.read(source, size);
|
||||
if (block == null) {
|
||||
return result;
|
||||
}
|
||||
result.all.add(block);
|
||||
}
|
||||
}
|
||||
|
||||
public QBlocks change(BigInteger E, BigInteger N) {
|
||||
final QBlocks result = new QBlocks();
|
||||
for (QBlock rsa : all) {
|
||||
result.all.add(rsa.change(E, N));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public void writeTo(OutputStream os, int size) throws IOException {
|
||||
for (QBlock rsa : all) {
|
||||
rsa.write(os, size);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user