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

version 1.2018.8

This commit is contained in:
Arnaud Roques 2018-06-25 21:05:58 +02:00
parent 84e117e287
commit a363246176
73 changed files with 1056 additions and 4853 deletions

View File

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

View File

@ -45,8 +45,9 @@
*/ */
package gen.lib.gvc; package gen.lib.gvc;
import static gen.lib.cgraph.attr__c.agattr; import static gen.lib.cgraph.attr__c.agattr;
import static gen.lib.gvc.gvconfig__c.gvconfig; import static gen.lib.common.textspan__c.textfont_dict_open;
import static gen.lib.gvc.gvcontext__c.gvNEWcontext; import static gen.lib.gvc.gvcontext__c.gvNEWcontext;
import static gen.lib.gvc.gvtextlayout__c.gvtextlayout_select;
import static smetana.core.JUtilsDebug.ENTERING; import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING; import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGNODE; import static smetana.core.Macro.AGNODE;
@ -167,7 +168,10 @@ try {
agattr(null, AGNODE, new CString("label"), new CString("\\N")); agattr(null, AGNODE, new CString("label"), new CString("\\N"));
/* default to no builtins, demand loading enabled */ /* default to no builtins, demand loading enabled */
gvc = (GVC_s) gvNEWcontext(null, (NOT(0))); gvc = (GVC_s) gvNEWcontext(null, (NOT(0)));
gvconfig(gvc, false); /* configure for available plugins */ /* builtins don't require LTDL */
gvc.setInt("config_found", 0);
gvtextlayout_select(gvc); /* choose best available textlayout plugin immediately */
textfont_dict_open(gvc); /* initialize font dict */
return gvc; return gvc;
} finally { } finally {
LEAVING("f3vdhir2c7dz3pvmx9d3m4lx1","gvContext"); LEAVING("f3vdhir2c7dz3pvmx9d3m4lx1","gvContext");

View File

@ -1,241 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package gen.lib.gvc;
import static gen.lib.common.textspan__c.textfont_dict_open;
import static gen.lib.gvc.gvtextlayout__c.gvtextlayout_select;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
import h.GVC_s;
import h.lt_symlist_t;
import smetana.core.CString;
public class gvconfig__c {
//1 2digov3edok6d5srhgtlmrycs
// extern lt_symlist_t lt_preloaded_symbols[]
//1 baedz5i9est5csw3epz3cv7z
// typedef Ppoly_t Ppolyline_t
//1 9k44uhd5foylaeoekf3llonjq
// extern Dtmethod_t* Dtset
//1 1ahfywsmzcpcig2oxm7pt9ihj
// extern Dtmethod_t* Dtbag
//1 anhghfj3k7dmkudy2n7rvt31v
// extern Dtmethod_t* Dtoset
//1 5l6oj1ux946zjwvir94ykejbc
// extern Dtmethod_t* Dtobag
//1 2wtf222ak6cui8cfjnw6w377z
// extern Dtmethod_t* Dtlist
//1 d1s1s6ibtcsmst88e3057u9r7
// extern Dtmethod_t* Dtstack
//1 axa7mflo824p6fspjn1rdk0mt
// extern Dtmethod_t* Dtqueue
//1 ega812utobm4xx9oa9w9ayij6
// extern Dtmethod_t* Dtdeque
//1 cyfr996ur43045jv1tjbelzmj
// extern Dtmethod_t* Dtorder
//1 wlofoiftbjgrrabzb2brkycg
// extern Dtmethod_t* Dttree
//1 12bds94t7voj7ulwpcvgf6agr
// extern Dtmethod_t* Dthash
//1 9lqknzty480cy7zsubmabkk8h
// extern Dtmethod_t _Dttree
//1 bvn6zkbcp8vjdhkccqo1xrkrb
// extern Dtmethod_t _Dthash
//1 9lidhtd6nsmmv3e7vjv9e10gw
// extern Dtmethod_t _Dtlist
//1 34ujfamjxo7xn89u90oh2k6f8
// extern Dtmethod_t _Dtqueue
//1 3jy4aceckzkdv950h89p4wjc8
// extern Dtmethod_t _Dtstack
//1 8dfqgf3u1v830qzcjqh9o8ha7
// extern Agmemdisc_t AgMemDisc
//1 18k2oh2t6llfsdc5x0wlcnby8
// extern Agiddisc_t AgIdDisc
//1 a4r7hi80gdxtsv4hdoqpyiivn
// extern Agiodisc_t AgIoDisc
//1 bnzt5syjb7mgeru19114vd6xx
// extern Agdisc_t AgDefaultDisc
//1 35y2gbegsdjilegaribes00mg
// extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
//1 c2rygslq6bcuka3awmvy2b3ow
// typedef Agsubnode_t Agnoderef_t
//1 xam6yv0dcsx57dtg44igpbzn
// typedef Dtlink_t Agedgeref_t
//3 btaticnvqvav6giyqk5dhvl0b
// static gvplugin_package_t * gvplugin_package_record(GVC_t * gvc, char *path, char *name)
public static Object gvplugin_package_record(Object... arg) {
UNSUPPORTED("d0v4w7mmhzyohr3cydmk39msc"); // static gvplugin_package_t * gvplugin_package_record(GVC_t * gvc, char *path, char *name)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("3l201ckgkdpkadl64dgd5t34a"); // gvplugin_package_t *package = gmalloc(sizeof(gvplugin_package_t));
UNSUPPORTED("e1ux222fnf2pzhlllspc0n9z6"); // package->path = (path) ? strdup(path) : NULL;
UNSUPPORTED("6tx9kbkb680t4nrzo9h6wmxt7"); // package->name = strdup(name);
UNSUPPORTED("2ddoa0el03kdry52dvxdp02xi"); // package->next = gvc->packages;
UNSUPPORTED("2wtcp1phunrqzsy2eyeelnisd"); // gvc->packages = package;
UNSUPPORTED("1cvdn1usbhmpxzhmfo5t0qhv0"); // return package;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 7b32j8w9cd211oy7f26zd2ld6
// void gvconfig_plugin_install_from_library(GVC_t * gvc, char *path, gvplugin_library_t *library)
public static Object gvconfig_plugin_install_from_library(Object... arg) {
UNSUPPORTED("9qlio5kiswebv40u9nmcxh1um"); // void gvconfig_plugin_install_from_library(GVC_t * gvc, char *path, gvplugin_library_t *library)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("1tb07tzg54jallfz0upl62c1g"); // gvplugin_api_t *apis;
UNSUPPORTED("2ihbo5t1nbmg4dq1qvwi9sqoh"); // gvplugin_installed_t *types;
UNSUPPORTED("as58mgqb4uw4c8n4sdq7m0qz3"); // gvplugin_package_t *package;
UNSUPPORTED("b17di9c7wgtqm51bvsyxz6e2f"); // int i;
UNSUPPORTED("21xt0dglbm2xme4gg1b8b9tfl"); // package = gvplugin_package_record(gvc, path, library->packagename);
UNSUPPORTED("44g9muiwx72zahb9xx5xzmfyv"); // for (apis = library->apis; (types = apis->types); apis++) {
UNSUPPORTED("bslr2lh149d2y32qozijhg1pj"); // for (i = 0; types[i].type; i++) {
UNSUPPORTED("7xl5c8mkdfmtazqddql72rl4l"); // gvplugin_install(gvc, apis->api, types[i].type,
UNSUPPORTED("81elyir1t9mhizwx6bh2dy6fc"); // types[i].quality, package, &types[i]);
UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 a0u25p4ndz2d3mpylo4jnz9cc
// static void gvconfig_plugin_install_builtins(GVC_t * gvc)
public static void gvconfig_plugin_install_builtins(GVC_s gvc) {
ENTERING("a0u25p4ndz2d3mpylo4jnz9cc","gvconfig_plugin_install_builtins");
try {
lt_symlist_t s;
CString name;
if (gvc.getStruct("common").getPtr("builtins") == null) return;
UNSUPPORTED("5h6ty7bll7yb1rvxiy8b1a17y"); // for (s = gvc->common.builtins; (name = s->name); s++)
UNSUPPORTED("efvffxomvrmz7nbrcbcvananw"); // if (name[0] == 'g' && strstr(name, "_LTX_library"))
UNSUPPORTED("95pie5przmmzrwnym8ye97v2e"); // gvconfig_plugin_install_from_library(gvc, NULL,
UNSUPPORTED("ezsy5hnc71vs70pla8x24w5py"); // (gvplugin_library_t *)(s->address));
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
} finally {
LEAVING("a0u25p4ndz2d3mpylo4jnz9cc","gvconfig_plugin_install_builtins");
}
}
//3 f5fyxnkmknydgjt6dtc035z9w
// void gvconfig(GVC_t * gvc, boolean rescan)
public static void gvconfig(GVC_s gvc, boolean rescan) {
ENTERING("f5fyxnkmknydgjt6dtc035z9w","gvconfig");
try {
/* builtins don't require LTDL */
gvconfig_plugin_install_builtins(gvc);
gvc.setInt("config_found", 0);
gvtextlayout_select(gvc); /* choose best available textlayout plugin immediately */
textfont_dict_open(gvc); /* initialize font dict */
} finally {
LEAVING("f5fyxnkmknydgjt6dtc035z9w","gvconfig");
}
}
}

View File

@ -1,977 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package gen.lib.gvc;
import static smetana.core.Macro.UNSUPPORTED;
public class gvusershape__c {
//1 2digov3edok6d5srhgtlmrycs
// extern lt_symlist_t lt_preloaded_symbols[]
//1 baedz5i9est5csw3epz3cv7z
// typedef Ppoly_t Ppolyline_t
//1 9k44uhd5foylaeoekf3llonjq
// extern Dtmethod_t* Dtset
//1 1ahfywsmzcpcig2oxm7pt9ihj
// extern Dtmethod_t* Dtbag
//1 anhghfj3k7dmkudy2n7rvt31v
// extern Dtmethod_t* Dtoset
//1 5l6oj1ux946zjwvir94ykejbc
// extern Dtmethod_t* Dtobag
//1 2wtf222ak6cui8cfjnw6w377z
// extern Dtmethod_t* Dtlist
//1 d1s1s6ibtcsmst88e3057u9r7
// extern Dtmethod_t* Dtstack
//1 axa7mflo824p6fspjn1rdk0mt
// extern Dtmethod_t* Dtqueue
//1 ega812utobm4xx9oa9w9ayij6
// extern Dtmethod_t* Dtdeque
//1 cyfr996ur43045jv1tjbelzmj
// extern Dtmethod_t* Dtorder
//1 wlofoiftbjgrrabzb2brkycg
// extern Dtmethod_t* Dttree
//1 12bds94t7voj7ulwpcvgf6agr
// extern Dtmethod_t* Dthash
//1 9lqknzty480cy7zsubmabkk8h
// extern Dtmethod_t _Dttree
//1 bvn6zkbcp8vjdhkccqo1xrkrb
// extern Dtmethod_t _Dthash
//1 9lidhtd6nsmmv3e7vjv9e10gw
// extern Dtmethod_t _Dtlist
//1 34ujfamjxo7xn89u90oh2k6f8
// extern Dtmethod_t _Dtqueue
//1 3jy4aceckzkdv950h89p4wjc8
// extern Dtmethod_t _Dtstack
//1 8dfqgf3u1v830qzcjqh9o8ha7
// extern Agmemdisc_t AgMemDisc
//1 18k2oh2t6llfsdc5x0wlcnby8
// extern Agiddisc_t AgIdDisc
//1 a4r7hi80gdxtsv4hdoqpyiivn
// extern Agiodisc_t AgIoDisc
//1 bnzt5syjb7mgeru19114vd6xx
// extern Agdisc_t AgDefaultDisc
//1 35y2gbegsdjilegaribes00mg
// extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
//1 c2rygslq6bcuka3awmvy2b3ow
// typedef Agsubnode_t Agnoderef_t
//1 xam6yv0dcsx57dtg44igpbzn
// typedef Dtlink_t Agedgeref_t
//1 9jp96pa73kseya3w6sulxzok6
// extern char *Gvimagepath
//1 c6f8whijgjwwagjigmxlwz3gb
// extern char *HTTPServerEnVar
//1 9brvabw9vk27d2nrq4p8tf971
// static Dict_t *ImageDict
//1 9pk2f9zg2k7nxk2pay6uw1ecz
// static knowntype_t knowntypes[] =
//3 afsdkf8ez5ohl6dd2prle0bgt
// static int imagetype (usershape_t *us)
public static Object imagetype(Object... arg) {
UNSUPPORTED("7vhzi3i3q0uu1byz03i34arpi"); // static int imagetype (usershape_t *us)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("4xkzi87btn54hoh901yqje0t2"); // char header[20];
UNSUPPORTED("34btb8w1kvws7rrywxitht2dt"); // char line[200];
UNSUPPORTED("b17di9c7wgtqm51bvsyxz6e2f"); // int i;
UNSUPPORTED("ayo4w7poqzsosr46zq587rive"); // if (us->f && fread(header, 1, 20, us->f) == 20) {
UNSUPPORTED("4f6p9x65zgxhi7g72c6rr85ez"); // for (i = 0; i < sizeof(knowntypes) / sizeof(knowntype_t); i++) {
UNSUPPORTED("ken197schvdfnlj4tbd1ajsg"); // if (!memcmp (header, knowntypes[i].template, knowntypes[i].size)) {
UNSUPPORTED("boxmes4yvhbhxz864uev9jrkn"); // us->stringtype = knowntypes[i].stringtype;
UNSUPPORTED("ot0inunld2mj1q1v9ubb1meg"); // us->type = knowntypes[i].type;
UNSUPPORTED("itn78hlno7a8ug22ta41xds5"); // if (us->type == FT_XML) {
UNSUPPORTED("152itmr8zxm9bdyohwofdarej"); // /* check for SVG in case of XML */
UNSUPPORTED("3hr9t6mkxbajyo66bbwwo671x"); // while (fgets(line, sizeof(line), us->f) != (void *)0) {
UNSUPPORTED("3t6168qdbfqfv25fv7zx4xfms"); // if (!memcmp(line, "<svg", sizeof("<svg")-1)) {
UNSUPPORTED("4n0qtaiukl38cr3i4ghl56e29"); // us->stringtype = "svg";
UNSUPPORTED("ano6zabqu54wu0a40t35lj2q8"); // return (us->type = FT_SVG);
UNSUPPORTED("3rk33w1xf0jaka2h033sgnx06"); // }
UNSUPPORTED("dkxvw03k2gg9anv4dbze06axd"); // }
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("f1kxll0fswekbe2gwilmen2m7"); // else if (us->type == FT_RIFF) {
UNSUPPORTED("cm5s3kh98e66k97v45ofiyv82"); // /* check for WEBP in case of RIFF */
UNSUPPORTED("4ma0gwqxr9j5qek6xkrskevsl"); // if (!memcmp(header+8, "WEBP", sizeof("WEBP")-1)) {
UNSUPPORTED("3zasc2uxnxlgetbuyifmr97bf"); // us->stringtype = "webp";
UNSUPPORTED("cgno6et27of87vw0o38rnarxx"); // return (us->type = FT_WEBP);
UNSUPPORTED("dkxvw03k2gg9anv4dbze06axd"); // }
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("60vq78txdp1vk965f5jgtlboc"); // return us->type;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("775efiysp2o60ingiihr8o6kq"); // us->stringtype = "(lib)";
UNSUPPORTED("acr9g7qhtz1yhdxvbzfapnlad"); // us->type = FT_NULL;
UNSUPPORTED("7yivuk2g5w938mbst7quo3jxa"); // return FT_NULL;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 bnikn3k3s008dmhsa2qu6lh34
// static boolean get_int_lsb_first (FILE *f, unsigned int sz, unsigned int *val)
public static Object get_int_lsb_first(Object... arg) {
UNSUPPORTED("cj03ffwnafffjxcznknyyp45b"); // static boolean get_int_lsb_first (FILE *f, unsigned int sz, unsigned int *val)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("70g3qubiio6uxhg2gxt141bff"); // int ch, i;
UNSUPPORTED("f3wi4z18bhg0unx5i47wp28hb"); // *val = 0;
UNSUPPORTED("6p1fgfnk4itt60e21fa48roiq"); // for (i = 0; i < sz; i++) {
UNSUPPORTED("7zywfbf1jevwjemy5yzpfiiza"); // ch = fgetc(f);
UNSUPPORTED("1t7v5vi7ec6r3mhla23o1v3w2"); // if (feof(f))
UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); // return 0;
UNSUPPORTED("1ewc3hwvqjod1e2ou7c4u02h1"); // *val |= (ch << 8*i);
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("4si0cf97a5sfd9ozuunds9goz"); // return (!(0));
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 87ifzytv1xgex4vf4ffa1fx28
// static boolean get_int_msb_first (FILE *f, unsigned int sz, unsigned int *val)
public static Object get_int_msb_first(Object... arg) {
UNSUPPORTED("ad8pamcrkweeq9xmkgw9docv9"); // static boolean get_int_msb_first (FILE *f, unsigned int sz, unsigned int *val)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("70g3qubiio6uxhg2gxt141bff"); // int ch, i;
UNSUPPORTED("f3wi4z18bhg0unx5i47wp28hb"); // *val = 0;
UNSUPPORTED("6p1fgfnk4itt60e21fa48roiq"); // for (i = 0; i < sz; i++) {
UNSUPPORTED("7zywfbf1jevwjemy5yzpfiiza"); // ch = fgetc(f);
UNSUPPORTED("1t7v5vi7ec6r3mhla23o1v3w2"); // if (feof(f))
UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); // return 0;
UNSUPPORTED("ac2fcmmhoviu6vu7od03xd2fz"); // *val <<= 8;
UNSUPPORTED("2aeq31k5bdbmozogiex8thool"); // *val |= ch;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("4si0cf97a5sfd9ozuunds9goz"); // return (!(0));
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 e6zw0qebmgir30wjyodre1w3q
// static unsigned int svg_units_convert(double n, char *u)
public static Object svg_units_convert(Object... arg) {
UNSUPPORTED("1q167s10zcp2ohq3mqsaucn6q"); // static unsigned int svg_units_convert(double n, char *u)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("as83qujnkumxgvltowl9k84pa"); // if (strcmp(u, "in") == 0)
UNSUPPORTED("cz9p5u3tzm0vtfcypzsqjjznz"); // return ROUND(n * 72);
UNSUPPORTED("a3ea8buut0466me8422yze7nk"); // if (strcmp(u, "px") == 0)
UNSUPPORTED("17k340tdedf8kyw8jjau617ji"); // return ROUND(n * 72 / 96);
UNSUPPORTED("e1voxws30sz7bauvt2nz3e43i"); // if (strcmp(u, "pc") == 0)
UNSUPPORTED("dgfrr8ul58nbz256i7zg3dfnv"); // return ROUND(n * 72 / 6);
UNSUPPORTED("3zt4017at03z9nmfg4b6j33nl"); // if (strcmp(u, "pt") == 0 || strcmp(u, "\"") == 0) /* ugly!! - if there are no inits then the %2s get the trailing '"' */
UNSUPPORTED("3bme0piy1kqu5q9y4eqbrr5fm"); // return ROUND(n);
UNSUPPORTED("4kvfi7mn3m1cvs8748w6apqe6"); // if (strcmp(u, "cm") == 0)
UNSUPPORTED("40fcy0h4yq1mhgc6sig41xkiz"); // return ROUND(n * ((double)72 * 0.393700787));
UNSUPPORTED("795vmm17p8fultyx81btq2qj7"); // if (strcmp(u, "mm") == 0)
UNSUPPORTED("2p58445vgby41tw5y37sb952f"); // return ROUND(n * ((double)72 * 0.0393700787));
UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//1 48cx4t8oc5776gxxsx3wj1459
// static char* svg_attr_value_re =
//1 urpt4udx4umgv15x10ssv67m
// static regex_t re, *pre = (void *)0
//3 di4bxm03m9srcwmfu82mzqtu
// static void svg_size (usershape_t *us)
public static Object svg_size(Object... arg) {
UNSUPPORTED("3bpommb3a197xaax86ebpnapc"); // static void svg_size (usershape_t *us)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("16qpk89sms5wm32xxhdjsrhj1"); // unsigned int w = 0, h = 0;
UNSUPPORTED("3bfgwfzonzqutm2m3s241ggmq"); // double n, x0, y0, x1, y1;
UNSUPPORTED("5urpczqwzlgz812axw5w07irp"); // char u[10];
UNSUPPORTED("e7xkcvvhzn89z17vzxp5d9wqf"); // char *attribute, *value, *re_string;
UNSUPPORTED("34btb8w1kvws7rrywxitht2dt"); // char line[200];
UNSUPPORTED("1kfdqzk554dccavlk1sr8hc6k"); // boolean wFlag = 0, hFlag = 0;
UNSUPPORTED("txcitt9410z35lsx2a1qr3zb"); // regmatch_t re_pmatch[4];
UNSUPPORTED("2elnezsihato03euhhcjmczz6"); // /* compile on first use */
UNSUPPORTED("b3qk4y1nm971zossf7ba67c39"); // if (! pre) {
UNSUPPORTED("4k0rhf891tka3e5fomw7gygix"); // if (regcomp(&re, svg_attr_value_re, REG_EXTENDED) != 0) {
UNSUPPORTED("bvbawrzsgnxy8a4de3iuwaeqb"); // agerr(AGERR,"cannot compile regular expression %s", svg_attr_value_re);
UNSUPPORTED("klxoy56t7b20wxnwqm0qoofz"); // }
UNSUPPORTED("9let8u6jhsriwmr05bp3gwoy5"); // pre = &re;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("7iygf89yc0kwp5pocixawdaed"); // fseek(us->f, 0, SEEK_SET);
UNSUPPORTED("40jwwwlrum66g8u94aha46ac6"); // while (fgets(line, sizeof(line), us->f) != (void *)0 && (!wFlag || !hFlag)) {
UNSUPPORTED("1d8ii0hljelb18gmpwwrtvano"); // re_string = line;
UNSUPPORTED("5bh0ae9np7zl19gk8h3h9317e"); // while (regexec(&re, re_string, 4, re_pmatch, 0) == 0) {
UNSUPPORTED("b355fkvcamz9jmg27def9b8x3"); // re_string[re_pmatch[1].rm_eo] = '\0';
UNSUPPORTED("aef3m3p3zi96h0zt0sjw03lj4"); // re_string[re_pmatch[2].rm_eo] = '\0';
UNSUPPORTED("eipkd5535u39a7ub3xbstkeu2"); // attribute = re_string + re_pmatch[1].rm_so;
UNSUPPORTED("bqe4861o77yhd2c4hm2q9ryqg"); // value = re_string + re_pmatch[2].rm_so;
UNSUPPORTED("c9y0ykkvqmbho7jwq1hq2v8rg"); // re_string += re_pmatch[0].rm_eo + 1;
UNSUPPORTED("4x0vivqfmvb5kxu3yv8zlj0z8"); // if (strcmp(attribute,"width") == 0) {
UNSUPPORTED("cjoilrknjlp3580a79aeduafs"); // if (sscanf(value, "%lf%2s", &n, u) == 2) {
UNSUPPORTED("5804xn01sb0nsqc4oand73j71"); // w = svg_units_convert(n, u);
UNSUPPORTED("boxr36cof383w0qjpos68wr3p"); // wFlag = (!(0));
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("coem1appm7al4by2xogxcf79v"); // else if (sscanf(value, "%lf", &n) == 1) {
UNSUPPORTED("d20bsvecsbla4zfrgr8vs0axk"); // w = svg_units_convert(n, "pt");
UNSUPPORTED("boxr36cof383w0qjpos68wr3p"); // wFlag = (!(0));
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("bokpcg0aj7i7sody2nk55sn1m"); // if (hFlag)
UNSUPPORTED("czyohktf9bkx4udfqhx42f4lu"); // break;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("349wmcj9pjfzzogsgqytbecep"); // else if (strcmp(attribute,"height") == 0) {
UNSUPPORTED("cjoilrknjlp3580a79aeduafs"); // if (sscanf(value, "%lf%2s", &n, u) == 2) {
UNSUPPORTED("4e8rpne5p90nqhwswzkila8du"); // h = svg_units_convert(n, u);
UNSUPPORTED("75lsnpofiu7aq6tvk1bytezfx"); // hFlag = (!(0));
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("318wbwzbtyt293618awt8oi7j"); // else if (sscanf(value, "%lf", &n) == 1) {
UNSUPPORTED("8roq2ozo7ghuukkquxg4vi3o8"); // h = svg_units_convert(n, "pt");
UNSUPPORTED("75lsnpofiu7aq6tvk1bytezfx"); // hFlag = (!(0));
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("3f72eveov59pnntffs33fh1o9"); // if (wFlag)
UNSUPPORTED("czyohktf9bkx4udfqhx42f4lu"); // break;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("evrgwvbtefbhi8c4vpurqyncz"); // else if (strcmp(attribute,"viewBox") == 0
UNSUPPORTED("7knynrz6icv4twtp5re2u2tyu"); // && sscanf(value, "%lf %lf %lf %lf", &x0,&y0,&x1,&y1) == 4) {
UNSUPPORTED("b75jl7dtq9qf4ike38i53sb5b"); // w = x1 - x0 + 1;
UNSUPPORTED("ccjsgjzpqovbgplagso2d6wvk"); // h = y1 - y0 + 1;
UNSUPPORTED("agh2p3816w463hvgmt7pji00p"); // wFlag = (!(0));
UNSUPPORTED("b0kbr8vydi49ibjics3e3mlip"); // hFlag = (!(0));
UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
UNSUPPORTED("avyq4e4me4o2pteunxjmfehds"); // us->w = w;
UNSUPPORTED("evkuhplkb5xfea6ln3h8f6ly2"); // us->h = h;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 2phgl4coa8enkvltpf0938lit
// static void png_size (usershape_t *us)
public static Object png_size(Object... arg) {
UNSUPPORTED("5qra9bwfkjw5syv0odudm6gam"); // static void png_size (usershape_t *us)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("8l3f9beos057zjxgk0cdj323o"); // unsigned int w, h;
UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
UNSUPPORTED("3135bp24afhqdzs2uj5l7sjr1"); // fseek(us->f, 16, SEEK_SET);
UNSUPPORTED("1luxqut1mknrn8qp0yakx9czw"); // if (get_int_msb_first(us->f, 4, &w) && get_int_msb_first(us->f, 4, &h)) {
UNSUPPORTED("73axoa9apyrx2829eqsezmfik"); // us->w = w;
UNSUPPORTED("993qcme7jlmcsi918hu491ld5"); // us->h = h;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 lqow6tkjqnnbqz6msa6cmzlk
// static void ico_size (usershape_t *us)
public static Object ico_size(Object... arg) {
UNSUPPORTED("6eqck7knu0bxd3sib3fpca2hf"); // static void ico_size (usershape_t *us)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("8l3f9beos057zjxgk0cdj323o"); // unsigned int w, h;
UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
UNSUPPORTED("bunso4je5hrb29m4984fw7bh6"); // fseek(us->f, 6, SEEK_SET);
UNSUPPORTED("875b5zt62o9flpi731becymv4"); // if (get_int_msb_first(us->f, 1, &w) && get_int_msb_first(us->f, 1, &h)) {
UNSUPPORTED("73axoa9apyrx2829eqsezmfik"); // us->w = w;
UNSUPPORTED("993qcme7jlmcsi918hu491ld5"); // us->h = h;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 dleljswqxf1oa4gzr8l8fomcl
// static void webp_size (usershape_t *us)
public static Object webp_size(Object... arg) {
UNSUPPORTED("dl59ajg8cu2fj1vuagj6pumce"); // static void webp_size (usershape_t *us)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("8l3f9beos057zjxgk0cdj323o"); // unsigned int w, h;
UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
UNSUPPORTED("3mt62dnri0kt6p9g6nmf6x78i"); // fseek(us->f, 15, SEEK_SET);
UNSUPPORTED("bro476e5tdpqu4kqzjhadepr8"); // if (fgetc(us->f) == 'X') { //VP8X
UNSUPPORTED("ciyvs7xrf1sc336ipavk7gjbs"); // fseek(us->f, 24, SEEK_SET);
UNSUPPORTED("77gjxe5g6u7c6371ziwedefxf"); // if (get_int_lsb_first(us->f, 4, &w) && get_int_lsb_first(us->f, 4, &h)) {
UNSUPPORTED("9htwijlhm4ad9uo70xn5d5tvl"); // us->w = w;
UNSUPPORTED("3hh8nl3qystuq8wcwsm411fej"); // us->h = h;
UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("bwt2eurukj3m7fsbr441rf1pj"); // else { //VP8
UNSUPPORTED("5fthwx7kwgddogs4n4fsbb0o8"); // fseek(us->f, 26, SEEK_SET);
UNSUPPORTED("621fvdyd12vnbfyxpw6j0z7cr"); // if (get_int_lsb_first(us->f, 2, &w) && get_int_lsb_first(us->f, 2, &h)) {
UNSUPPORTED("9htwijlhm4ad9uo70xn5d5tvl"); // us->w = w;
UNSUPPORTED("3hh8nl3qystuq8wcwsm411fej"); // us->h = h;
UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 2s3ms72agp5gyfqz15zbpp3u1
// static void gif_size (usershape_t *us)
public static Object gif_size(Object... arg) {
UNSUPPORTED("ac8be5d24wrrx24tnddiukvl7"); // static void gif_size (usershape_t *us)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("8l3f9beos057zjxgk0cdj323o"); // unsigned int w, h;
UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
UNSUPPORTED("bunso4je5hrb29m4984fw7bh6"); // fseek(us->f, 6, SEEK_SET);
UNSUPPORTED("ezkdvuggkyj11n6ca6xrhm72g"); // if (get_int_lsb_first(us->f, 2, &w) && get_int_lsb_first(us->f, 2, &h)) {
UNSUPPORTED("73axoa9apyrx2829eqsezmfik"); // us->w = w;
UNSUPPORTED("993qcme7jlmcsi918hu491ld5"); // us->h = h;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 bpjeya6em7jp6m6l86m6t4u4a
// static void bmp_size (usershape_t *us)
public static Object bmp_size(Object... arg) {
UNSUPPORTED("ba2pylwi2xu10asnonw92pxw1"); // static void bmp_size (usershape_t *us) {
UNSUPPORTED("ct1272vz7j34sqkcwzdiq2x0i"); // unsigned int size_x_msw, size_x_lsw, size_y_msw, size_y_lsw;
UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
UNSUPPORTED("9b418veiss4t0o7s8cqq28owo"); // fseek (us->f, 16, SEEK_SET);
UNSUPPORTED("1q9kmvi2ajod9wlev8s5p50rv"); // if ( get_int_lsb_first (us->f, 2, &size_x_msw) &&
UNSUPPORTED("5f5k6cp1ota9f8a2ciircybdh"); // get_int_lsb_first (us->f, 2, &size_x_lsw) &&
UNSUPPORTED("9n6cqmhzmbkf1vt9fyu6zw0kp"); // get_int_lsb_first (us->f, 2, &size_y_msw) &&
UNSUPPORTED("cid929pl3ogyk2kecod7opvz0"); // get_int_lsb_first (us->f, 2, &size_y_lsw) ) {
UNSUPPORTED("a6g25f4k8ew6jja5m9rnccf5o"); // us->w = size_x_msw << 16 | size_x_lsw;
UNSUPPORTED("8exqj264llut5d629ydwne5k2"); // us->h = size_y_msw << 16 | size_y_lsw;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 c7yvo5wd816hjqxejnluaol0a
// static void jpeg_size (usershape_t *us)
public static Object jpeg_size(Object... arg) {
UNSUPPORTED("c8uakwctlakoj06f07juq8r2a"); // static void jpeg_size (usershape_t *us) {
UNSUPPORTED("3o57tczyjy6z9uvry23b9xkw5"); // unsigned int marker, length, size_x, size_y, junk;
UNSUPPORTED("4ylph99ph3r2v7uhxyd2hq0io"); // /* These are the markers that follow 0xff in the file.
UNSUPPORTED("1pzctl0feh1bhiqnxtmawvxg4"); // * Other markers implicitly have a 2-byte length field that follows.
UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
UNSUPPORTED("1lgv3mem6buwpyuef4b9h8rzp"); // static unsigned char standalone_markers [] = {
UNSUPPORTED("e00djw6cjtdaxejgnewp8nus6"); // 0x01, /* Temporary */
UNSUPPORTED("1urwngq6m3z6m5mr3egwgq9mr"); // 0xd0, 0xd1, 0xd2, 0xd3, /* Reset */
UNSUPPORTED("e1vwc4842h5c84ojr8w3onuno"); // 0xd4, 0xd5, 0xd6,
UNSUPPORTED("1uig2kz9nbo8j6vj3r7493n8"); // 0xd7,
UNSUPPORTED("927bzm317ui2xj8ugbwhm5xb7"); // 0xd8, /* Start of image */
UNSUPPORTED("9ybi9mcsggfw3zbh6zn9hotef"); // 0xd9, /* End of image */
UNSUPPORTED("fbagrxdnmyjkvt7zaukczscg"); // 0
UNSUPPORTED("9u8qqu9tw95qjbv3cxv3hj4bd"); // };
UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
UNSUPPORTED("5owjshc6gmd9o9lmekzcl6rvg"); // while ((!(0))) {
UNSUPPORTED("7kq4b2hkhf3vcx97hwoelgcxz"); // /* Now we must be at a 0xff or at a series of 0xff's.
UNSUPPORTED("cga1geam6con9djkcofzmw0ko"); // * If that is not the case, or if we're at EOF, then there's
UNSUPPORTED("exr8s1ongonmgsucjdf4zsmb4"); // * a parsing error.
UNSUPPORTED("3vesx4cskuo1q42jvwmoum2xs"); // */
UNSUPPORTED("79jgtuw1xg9dgik49e3hx1068"); // if (! get_int_msb_first (us->f, 1, &marker))
UNSUPPORTED("3zyp4vhegf9dl2g8a4ffmxah8"); // return;
UNSUPPORTED("e7cevpg68ih107a2ggfgkq1la"); // if (marker == 0xff)
UNSUPPORTED("9j8yk6fxm4tnpr3yrev0f9bhm"); // continue;
UNSUPPORTED("99hdbrpbwvb3lwfyhz43xnoxf"); // /* Ok.. marker now read. If it is not a stand-alone marker,
UNSUPPORTED("b7dntxmllxk3wzmg9mclxs71r"); // * then continue. If it's a Start Of Frame (0xc?), then we're there.
UNSUPPORTED("8aramua11q89c43osky6tgha5"); // * If it's another marker with a length field, then skip ahead
UNSUPPORTED("5w0fy7m3152rri519xzsydb2w"); // * over that length field.
UNSUPPORTED("3vesx4cskuo1q42jvwmoum2xs"); // */
UNSUPPORTED("7itrbaa4e2u9uh86wydx2r1wq"); // /* A stand-alone... */
UNSUPPORTED("7m1dttkv67ixwryn1ukl94hel"); // if (strchr ((char*)standalone_markers, marker))
UNSUPPORTED("9j8yk6fxm4tnpr3yrev0f9bhm"); // continue;
UNSUPPORTED("sb3rjk9k59soh7qvm0qpkzoh"); // /* Incase of a 0xc0 marker: */
UNSUPPORTED("6u3lv1x78jskc1qjam25s00h1"); // if (marker == 0xc0) {
UNSUPPORTED("4kucipi8uw6ujeuh489csoowf"); // /* Skip length and 2 lengths. */
UNSUPPORTED("30gcyw02iuybxoyj28nhlbwbl"); // if ( get_int_msb_first (us->f, 3, &junk) &&
UNSUPPORTED("b6ypup1v81rta7mfh68arftfd"); // get_int_msb_first (us->f, 2, &size_x) &&
UNSUPPORTED("f2mbg2ezlyocn5228wkhy658f"); // get_int_msb_first (us->f, 2, &size_y) ) {
UNSUPPORTED("eps17wh894vxn0oojbitsn1lr"); // /* Store length. */
UNSUPPORTED("danamcguxf0st13b0euh47y8v"); // us->h = size_x;
UNSUPPORTED("gva1bl1ygb6xzrrjwpma3dpp"); // us->w = size_y;
UNSUPPORTED("7g94ubxa48a1yi3mf9v521b7c"); // }
UNSUPPORTED("6cprbghvenu9ldc0ez1ifc63q"); // return;
UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
UNSUPPORTED("7jc4v9i136pgfvwakfui3aupm"); // /* Incase of a 0xc2 marker: */
UNSUPPORTED("a1ww3q31w3xsq697vt32phj9d"); // if (marker == 0xc2) {
UNSUPPORTED("7xwfuqyvolr45lp6gdcnmqyna"); // /* Skip length and one more byte */
UNSUPPORTED("dhyz02dvhk6z01p9nh8knpdnp"); // if (! get_int_msb_first (us->f, 3, &junk))
UNSUPPORTED("6an8ocqq0sjru42k4aathe94m"); // return;
UNSUPPORTED("7b106vc3jzqz2eyjlo758xw2n"); // /* Get length and store. */
UNSUPPORTED("akbj7dadm0nq5ujmuwiw50ukl"); // if ( get_int_msb_first (us->f, 2, &size_x) &&
UNSUPPORTED("f2mbg2ezlyocn5228wkhy658f"); // get_int_msb_first (us->f, 2, &size_y) ) {
UNSUPPORTED("danamcguxf0st13b0euh47y8v"); // us->h = size_x;
UNSUPPORTED("gva1bl1ygb6xzrrjwpma3dpp"); // us->w = size_y;
UNSUPPORTED("7g94ubxa48a1yi3mf9v521b7c"); // }
UNSUPPORTED("6cprbghvenu9ldc0ez1ifc63q"); // return;
UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
UNSUPPORTED("9qz6tc2665rtirz7egtertjyl"); // /* Any other marker is assumed to be followed by 2 bytes length. */
UNSUPPORTED("5xvajayqclvcxxqkozzorzbdi"); // if (! get_int_msb_first (us->f, 2, &length))
UNSUPPORTED("3zyp4vhegf9dl2g8a4ffmxah8"); // return;
UNSUPPORTED("cv5sg5k6hy1kwgiinb4i5xr6"); // fseek (us->f, length - 2, SEEK_CUR);
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 9vi0gtfjnp35ie6bx15grm4gp
// static void ps_size (usershape_t *us)
public static Object ps_size(Object... arg) {
UNSUPPORTED("8kctdt9asc26knxxydik2v8ug"); // static void ps_size (usershape_t *us)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("18vi5vqd0r4k0kxsl3h3rwa4y"); // char line[BUFSIZ];
UNSUPPORTED("4qk2wsv83bxm1lchsnd6splfr"); // boolean saw_bb;
UNSUPPORTED("5rcgzsa5rlhtyjz964tcthts2"); // int lx, ly, ux, uy;
UNSUPPORTED("5fewhg0dt0vbugqk2bmyfr34l"); // char* linep;
UNSUPPORTED("891wob6d9fi1zsdfvumw7tx5y"); // us->dpi = 72;
UNSUPPORTED("7iygf89yc0kwp5pocixawdaed"); // fseek(us->f, 0, SEEK_SET);
UNSUPPORTED("w6asn9e9wasakvoc3kn19lwt"); // saw_bb = 0;
UNSUPPORTED("cpypiyiyiq875wcq5pix66en2"); // while (fgets(line, sizeof(line), us->f)) {
UNSUPPORTED("7vmkqwijdn7elebqrq3q3qqlv"); // /* PostScript accepts \r as EOL, so using fgets () and looking for a
UNSUPPORTED("ccqysd4ji4ezs2u937a1tq93k"); // * bounding box comment at the beginning doesn't work in this case.
UNSUPPORTED("a548nncd0y8n2a01c5z3akmhg"); // * As a heuristic, we first search for a bounding box comment in line.
UNSUPPORTED("djrf0gim2rh71i0skg41uw6zn"); // * This obviously fails if not all of the numbers make it into the
UNSUPPORTED("x3dg0lfzyp7yc2hldpo3cbge"); // * current buffer. This shouldn't be a problem, as the comment is
UNSUPPORTED("4uvbwtwj71pylu4bfe3pu79le"); // * typically near the beginning, and so should be read within the first
UNSUPPORTED("426auswwt3iw0kmtesztdy9ff"); // * BUFSIZ bytes (even on Windows where this is 512).
UNSUPPORTED("62wb43w2xc6ex6hootjubbx22"); // */
UNSUPPORTED("8iwr2d3ooqy0tw5eisixpectn"); // if (!(linep = strstr (line, "%%BoundingBox:")))
UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
UNSUPPORTED("2s519tr2mhoj177f79vzllnyq"); // if (sscanf (linep, "%%%%BoundingBox: %d %d %d %d", &lx, &ly, &ux, &uy) == 4) {
UNSUPPORTED("6dekl3sp6brld4uq5ep5859l3"); // saw_bb = (!(0));
UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break;
UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("8p3jjm43yrzygpor71hdkfs1g"); // if (saw_bb) {
UNSUPPORTED("5dym7sjpxsgdgav57jvyuohe8"); // us->x = lx;
UNSUPPORTED("da04q03gf0w4upkkrsn74w1dc"); // us->y = ly;
UNSUPPORTED("6mpj1u4n7cyggpme1vsa6je8t"); // us->w = ux - lx;
UNSUPPORTED("dqnhfatraydhv6fdx3gsi22ao"); // us->h = uy - ly;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 87i5xtm6lbxo4asqfnu0v9rz1
// static unsigned char nxtc (stream_t* str)
public static Object nxtc(Object... arg) {
UNSUPPORTED("at0aua2ntxsp0j1h4yidmr4si"); // static unsigned char
UNSUPPORTED("9rrtdlhn8kugpol3lky8rgp5n"); // nxtc (stream_t* str)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("9jyosg56ecd165ua22kq89ggj"); // if (fgets(str->buf, BUFSIZ, str->fp)) {
UNSUPPORTED("bo88dnmxymbe4e1rppc0ex9ve"); // str->s = str->buf;
UNSUPPORTED("8tdhptj2ed5dv8sew624q4jec"); // return *(str->s);
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("278hcy3fayv5vclqcgtpjbzdi"); // return '\0';
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 2fq3qaeuu4gjr89xmwwy7i4xe
// static void skipWS (stream_t* str)
public static Object skipWS(Object... arg) {
UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
UNSUPPORTED("cactz8998uk8ou1c5zwtwg601"); // skipWS (stream_t* str)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("10sir32iwi5l2jyfgp65pihto"); // unsigned char c;
UNSUPPORTED("91zm214vvm6477gtei1ggjkef"); // while ((c = (*(str->s)?*(str->s):nxtc(str)))) {
UNSUPPORTED("dilzs0pemy12rvmpnko0iel59"); // if (isspace(c)) (str->s++);
UNSUPPORTED("9wafzg86cpce49qfuv8wsl6in"); // else return;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 dwmuhk2xjfndhxozxfrdz5nk8
// static int scanNum (char* tok, double* dp)
public static Object scanNum(Object... arg) {
UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
UNSUPPORTED("eq0ltrbhzwt422rffdlm4d20e"); // scanNum (char* tok, double* dp)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("bkz9mqmemp1ljxdwdbu8xv3e9"); // char* endp;
UNSUPPORTED("avrsd77b596s5g291ozzdpxf8"); // double d = strtod(tok, &endp);
UNSUPPORTED("2qoq2nf2jpfoyc68njwm2ajkq"); // if (tok == endp) return 1;
UNSUPPORTED("636uh4i1x8w844yxwd2u322d1"); // *dp = d;
UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 dhjmc8hrpmiohrejyu72mrhno
// static void getNum (stream_t* str, char* buf)
public static Object getNum(Object... arg) {
UNSUPPORTED("e2z2o5ybnr5tgpkt8ty7hwan1"); // static void
UNSUPPORTED("doymhclp9a2fukna3vd3r7xf8"); // getNum (stream_t* str, char* buf)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("bsj3r19ko668lwj5fqk8tlbhc"); // int len = 0;
UNSUPPORTED("wrvu9u7a8j6i6y6552zncxfk"); // char c;
UNSUPPORTED("936voey3mecmlo6hla9hyrmun"); // skipWS(str);
UNSUPPORTED("tuyymjn2lfs038e1rm6hbw8w"); // while ((c = (*(str->s)?*(str->s):nxtc(str))) && (isdigit(c) || (c == '.'))) {
UNSUPPORTED("4rvasxp4ert1zz5jaasrqeft1"); // buf[len++] = c;
UNSUPPORTED("8vm8y5ewr5ra87d4f8exah65d"); // (str->s++);
UNSUPPORTED("5zs9wc8ip6zkde4o33aadh30c"); // if (len == BUFSIZ-1) break;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("3w01p3l63zt07scumxz12foyc"); // buf[len] = '\0';
UNSUPPORTED("b9185t6i77ez1ac587ul8ndnc"); // return;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 6kdhce4shbkw92wtfgufyqecs
// static int boxof (stream_t* str, boxf* bp)
public static Object boxof(Object... arg) {
UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
UNSUPPORTED("d810hoc5e8uu0odpm097odpfu"); // boxof (stream_t* str, boxf* bp)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("1z7b1t0srtne632sd3ma9jbp7"); // char tok[BUFSIZ];
UNSUPPORTED("araz8ffm0d5v424qzgyh7bsvy"); // skipWS(str);
UNSUPPORTED("1uwfhdftjs4loqhg7ecaermjd"); // if ((*(str->s)?*(str->s):nxtc(str)) != '[') return 1;
UNSUPPORTED("8vm8y5ewr5ra87d4f8exah65d"); // (str->s++);
UNSUPPORTED("6jh13u8w5qiy4ij2ebx6zmqwa"); // getNum(str, tok);
UNSUPPORTED("1m5wgiebygd9j5o6m68etvwh0"); // if (scanNum(tok,&bp->LL.x)) return 1;
UNSUPPORTED("6jh13u8w5qiy4ij2ebx6zmqwa"); // getNum(str, tok);
UNSUPPORTED("9bcg5vhxd4fqd8ykkbivfm3d4"); // if (scanNum(tok,&bp->LL.y)) return 1;
UNSUPPORTED("6jh13u8w5qiy4ij2ebx6zmqwa"); // getNum(str, tok);
UNSUPPORTED("1z0q9nrhj393zbs1mok3h84tf"); // if (scanNum(tok,&bp->UR.x)) return 1;
UNSUPPORTED("6jh13u8w5qiy4ij2ebx6zmqwa"); // getNum(str, tok);
UNSUPPORTED("247082ftkwl5jzjorvyt3sgcl"); // if (scanNum(tok,&bp->UR.y)) return 1;
UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 dedr09vl6y9ax357arh6tayi
// static int bboxPDF (FILE* fp, boxf* bp)
public static Object bboxPDF(Object... arg) {
UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
UNSUPPORTED("9icxkxwqm6flp3sl9ulkp4fyd"); // bboxPDF (FILE* fp, boxf* bp)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("f3gl6562biaxa4139uus0d370"); // stream_t str;
UNSUPPORTED("5pjh3c3u4lxh1jdyyk966intb"); // char* s;
UNSUPPORTED("8c7x8di5w36ib05qan9z4sl9"); // char buf[BUFSIZ];
UNSUPPORTED("8w39jbbwqjx63enrf5fdvcm9r"); // while (fgets(buf, BUFSIZ, fp)) {
UNSUPPORTED("b7wioadlc5j3p2q8w7tsq1gam"); // if ((s = strstr(buf,"/MediaBox"))) {
UNSUPPORTED("ecmojjd7fnaeah045va2t5eg8"); // str.buf = buf;
UNSUPPORTED("5k89yh945d2crbir8397vkavv"); // str.s = s+(sizeof("/MediaBox")-1);
UNSUPPORTED("dj08qw9n5j8nlqx752hipu46u"); // str.fp = fp;
UNSUPPORTED("uhua7rc3vef3nawzjyh3w1k5"); // return boxof(&str,bp);
UNSUPPORTED("yoqd73ulpi5tn8snro7dt3jc"); // }
UNSUPPORTED("8nzcpbtoi924xzu8ze3z6dbft"); // }
UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 3fdvwmb09jpyu6h40pj206vv3
// static void pdf_size (usershape_t *us)
public static Object pdf_size(Object... arg) {
UNSUPPORTED("97swmsrhwped1e1n72fyev1ai"); // static void pdf_size (usershape_t *us)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("2lzsl1e035wt5epd1h8f4bn8m"); // boxf bb;
UNSUPPORTED("7337vyphkrv1lekq0dncy8j6s"); // us->dpi = 0;
UNSUPPORTED("7iygf89yc0kwp5pocixawdaed"); // fseek(us->f, 0, SEEK_SET);
UNSUPPORTED("cu1kld68jk8qm12c9f0n61vyd"); // if ( ! bboxPDF (us->f, &bb)) {
UNSUPPORTED("14kgzu9x57imt127uyibumhif"); // us->x = bb.LL.x;
UNSUPPORTED("51rq1d6stvtvjgfta18hxoiyg"); // us->y = bb.LL.y;
UNSUPPORTED("encm75ymc6wgridj70fk0jf47"); // us->w = bb.UR.x - bb.LL.x;
UNSUPPORTED("dy52i81burd516zy265e83wel"); // us->h = bb.UR.y - bb.LL.y;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 cxhbj2es2sky90cnd8qf89prs
// static void usershape_close (Dict_t * dict, void * p, Dtdisc_t * disc)
public static Object usershape_close(Object... arg) {
UNSUPPORTED("b7or8sf6zjmnj6wjf08brm0r"); // static void usershape_close (Dict_t * dict, void * p, Dtdisc_t * disc)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("58pwyr0d4numnoai5v987l5ml"); // usershape_t *us = (usershape_t *)p;
UNSUPPORTED("ad2wgtudijnm3bp4549lrva3l"); // if (us->f)
UNSUPPORTED("13i1v3mxl0sjnx4rgaden880d"); // fclose(us->f);
UNSUPPORTED("e5bs4fy1a1v5ptm2bcrm2m9ai"); // if (us->data && us->datafree)
UNSUPPORTED("1wod8ffcoluizmoc72db2htxb"); // us->datafree(us);
UNSUPPORTED("73p2w162ujnuoboekx5udlion"); // free (us);
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//1 es7jtx4lx7bg26412fcjit8ri
// static Dtdisc_t ImageDictDisc =
//3 9msk7qh9auq8w21r32k0ffcsa
// usershape_t *gvusershape_find(char *name)
public static Object gvusershape_find(Object... arg) {
UNSUPPORTED("a9366bkr4gt4nvcj5bnkjrtrd"); // usershape_t *gvusershape_find(char *name)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("exneoozy5g8al0a8y6fxb88zv"); // usershape_t *us;
UNSUPPORTED("265kxn69043hh3vmr1ma8pbpg"); // assert(name);
UNSUPPORTED("1av8we70pcc0ni7489zk2ttcg"); // assert(name[0]);
UNSUPPORTED("4qhyd93m9v57fwb1anljrxfd3"); // if (!ImageDict)
UNSUPPORTED("45tfw7tcm68298aro2tdiv8pc"); // return (void *)0;
UNSUPPORTED("dzt5b4nn4x2oidxk4g4wzt8et"); // us = (*(((Dt_t*)(ImageDict))->searchf))((ImageDict),(void*)(name),0001000);
UNSUPPORTED("2iqrgjc97xskxvw6791yf0sl7"); // return us;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 3cgay03dg8pq23kln9kuc0ym5
// boolean gvusershape_file_access(usershape_t *us)
public static Object gvusershape_file_access(Object... arg) {
UNSUPPORTED("dm8po5i2hu4arliyfc2ea2a47"); // boolean gvusershape_file_access(usershape_t *us)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("8u0o5i27i1no60qjs9r4os0f9"); // static int usershape_files_open_cnt;
UNSUPPORTED("vadeh8lzzwz0ugk6azcwaayu"); // const char *fn;
UNSUPPORTED("7gqi0ait1bhc4v9zl8rnn0wbs"); // assert(us);
UNSUPPORTED("xlffgd4fqdckxg2nbs0mxtlj"); // assert(us->name);
UNSUPPORTED("fk4kdjctgb13swd2h14t0yvh"); // assert(us->name[0]);
UNSUPPORTED("ad2wgtudijnm3bp4549lrva3l"); // if (us->f)
UNSUPPORTED("1te90msr6mhllwn4y3ghlahc0"); // fseek(us->f, 0, SEEK_SET);
UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
UNSUPPORTED("d6n6b94e02ntmefeqcoo0ueon"); // if (! (fn = safefile(us->name))) {
UNSUPPORTED("778vwup2lml5qa9eyxd88416u"); // agerr(AGWARN, "Filename \"%s\" is unsafe\n", us->name);
UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); // return 0;
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("31rnydpzhmzclqs3q4flw9ce2"); // us->f = fopen(fn, "r");
UNSUPPORTED("cmb2imwpnm4tgu1dm9r5tgtj5"); // if (us->f == (void *)0) {
UNSUPPORTED("ebzon8h2oywxvasmfmyhnw5pq"); // agerr(AGWARN, "%s while opening %s\n", strerror(errno), fn);
UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); // return 0;
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("e17a7n92m8ieuby8sa8jm1r3o"); // if (usershape_files_open_cnt >= 50)
UNSUPPORTED("c9jo9gbhp1on7wctnk1o7q8vu"); // us->nocache = (!(0));
UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
UNSUPPORTED("81eb64f0supcvkt4drj4djmby"); // usershape_files_open_cnt++;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("3ebwn2weruwgdz4tfaxj2htek"); // assert(us->f);
UNSUPPORTED("4si0cf97a5sfd9ozuunds9goz"); // return (!(0));
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 9y4wcbk4jp03lbul2i25xzmp6
// void gvusershape_file_release(usershape_t *us)
public static Object gvusershape_file_release(Object... arg) {
UNSUPPORTED("6i3sc3o39zrjf80hb57rmbe1t"); // void gvusershape_file_release(usershape_t *us)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("5a8j5zrw7vbgoyy4ogtlsywui"); // if (us->nocache) {
UNSUPPORTED("47xp2oczqdec6db0z36u2n84r"); // if (us->f) {
UNSUPPORTED("bzvrsl2iafc3pw0qughvm761m"); // fclose(us->f);
UNSUPPORTED("amwbxewujlnkm7a19q6zl4xq0"); // us->f = (void *)0;
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 8gvu7lmp0zomg3yy0a76n8pjh
// static usershape_t *gvusershape_open (char *name)
public static Object gvusershape_open(Object... arg) {
UNSUPPORTED("5kyko9vxn3aqt1awhp5hd8c6a"); // static usershape_t *gvusershape_open (char *name)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("exneoozy5g8al0a8y6fxb88zv"); // usershape_t *us;
UNSUPPORTED("265kxn69043hh3vmr1ma8pbpg"); // assert(name);
UNSUPPORTED("4qhyd93m9v57fwb1anljrxfd3"); // if (!ImageDict)
UNSUPPORTED("7tvne0duj1fh44ndje8hlq8nt"); // ImageDict = dtopen(&ImageDictDisc, Dttree);
UNSUPPORTED("be9pwrhxzz4ia299kongm87uq"); // if (! (us = gvusershape_find(name))) {
UNSUPPORTED("9suqlrwjg77jwdm7tlgzsc0by"); // if (! (us = zmalloc(sizeof(usershape_t))))
UNSUPPORTED("7f8nrnyuywny79cpzv6a49d8v"); // return (void *)0;
UNSUPPORTED("6viwgw3bdyvknckol3dsh1s5v"); // us->name = agstrdup (0, name);
UNSUPPORTED("ewc238znlsx5axoejodocqoyp"); // if (!gvusershape_file_access(us))
UNSUPPORTED("7f8nrnyuywny79cpzv6a49d8v"); // return (void *)0;
UNSUPPORTED("4i933mk1cyf6xcljbpn69na20"); // assert(us->f);
UNSUPPORTED("43qnzsg978s9yom42c0n33wx3"); // switch(imagetype(us)) {
UNSUPPORTED("7eenfnk5yzoj21g2agitce6kx"); // case FT_NULL:
UNSUPPORTED("azdoxaxgz4fzzdoeyruqj36jk"); // if (!(us->data = (void*)find_user_shape(us->name)))
UNSUPPORTED("9mepm6hu7uqhpdwcg60h6pc3o"); // agerr(AGWARN, "\"%s\" was not found as a file or as a shape library member\n", us->name);
UNSUPPORTED("9bu5332flxhc1ivhmzuiqcjdh"); // free(us);
UNSUPPORTED("6948880uywn56ppo1fuqbm2rt"); // return (void *)0;
UNSUPPORTED("9ekmvj13iaml5ndszqyxa8eq"); // break;
UNSUPPORTED("4p4ayucon7vqli1ylni5hjrfb"); // case FT_GIF:
UNSUPPORTED("c68gkmazl6aratmtonsx4fan9"); // gif_size(us);
UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
UNSUPPORTED("7da7e6aavwlcxg7eglorxy23g"); // case FT_PNG:
UNSUPPORTED("ubixbe52lmq7uzqie7h12582"); // png_size(us);
UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
UNSUPPORTED("9ysbcxl45mbfo0lhfihqfby4d"); // case FT_BMP:
UNSUPPORTED("9xqkpupuhywfcx0rkky4pnu5q"); // bmp_size(us);
UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
UNSUPPORTED("bhf95qvvxhf47ek76yf2a45l0"); // case FT_JPEG:
UNSUPPORTED("bq0stf6n5x5tzvjir50smcifq"); // jpeg_size(us);
UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
UNSUPPORTED("bazpzxo4uq0pwp7j4k94ngrtz"); // case FT_PS:
UNSUPPORTED("7bs1bijtavu2jceudpors0jbp"); // ps_size(us);
UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
UNSUPPORTED("8xv8jf3eindz5gftkzluercwh"); // case FT_WEBP:
UNSUPPORTED("91d89xyv6dtk8a479p0cfwyy7"); // webp_size(us);
UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
UNSUPPORTED("c8km9iw5nmks5lp6jl9j5s5q2"); // case FT_SVG:
UNSUPPORTED("a147xv5hgfkmevlpr3jb7fzci"); // svg_size(us);
UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
UNSUPPORTED("242ztnyfnn9hx8sb3u5z3omun"); // case FT_PDF:
UNSUPPORTED("9ef2eux36pp9nf00d1ijmfbhm"); // pdf_size(us);
UNSUPPORTED("9ekmvj13iaml5ndszqyxa8eq"); // break;
UNSUPPORTED("3h2lioytqam297xdu0a7l0y6w"); // case FT_ICO:
UNSUPPORTED("dj7xjql9twvpafx4qoyb07ra8"); // ico_size(us);
UNSUPPORTED("9ekmvj13iaml5ndszqyxa8eq"); // break;
UNSUPPORTED("90yyikfl7j30g6npbi9n0jxyw"); // // case FT_TIFF:
UNSUPPORTED("72cnoy8x3q67t6323yzwcdim8"); // // tiff_size(us);
UNSUPPORTED("1sbah8d4teszwq6tgzsohjpba"); // // break;
UNSUPPORTED("2hkvwieff33mlzyovvk76tpzn"); // case FT_EPS: /* no eps_size code available */
UNSUPPORTED("bt2g0yhsy3c7keqyftf3c98ut"); // default:
UNSUPPORTED("7f9nr53m374zf5jnncru7yfn6"); // break;
UNSUPPORTED("4mhlpjofolwivhm0tl8cxznly"); // }
UNSUPPORTED("1ju3i4hja8fc5wwdkk9ed70t0"); // gvusershape_file_release(us);
UNSUPPORTED("6ovs68xjm9urfsh1qtosv57gi"); // (*(((Dt_t*)(ImageDict))->searchf))((ImageDict),(void*)(us),0000001);
UNSUPPORTED("e7wyuaoyszuqilaizfjv1mnp9"); // return us;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("7xahvc82av8lspjlm80i6ycqx"); // gvusershape_file_release(us);
UNSUPPORTED("2iqrgjc97xskxvw6791yf0sl7"); // return us;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 1uc6t1ylgvem0d3xb73wkh6k5
// point gvusershape_size_dpi (usershape_t* us, pointf dpi)
public static Object gvusershape_size_dpi(Object... arg) {
UNSUPPORTED("5vjx3ewef6ht20ld1et4ghr4y"); // point
UNSUPPORTED("5mxbu6cb95ay6dfs0i5n8icbs"); // gvusershape_size_dpi (usershape_t* us, pointf dpi)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("e5r3mj8btrkw973m7l0rritko"); // point rv;
UNSUPPORTED("6n6sowowfpx2bppltl0zu5v7v"); // if (!us) {
UNSUPPORTED("4zusj5p9eg9pazvp0px1fxvhy"); // rv.x = rv.y = -1;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
UNSUPPORTED("8egqtg148lkga2f8fnti0xikl"); // if (us->dpi != 0) {
UNSUPPORTED("appsmczgq79si2bttb9rrlf1n"); // dpi.x = dpi.y = us->dpi;
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("8z1a50vlhe7l1e7lnn7h5r90w"); // rv.x = us->w * 72 / dpi.x;
UNSUPPORTED("b8wlsi5z8klt27ehe7vr9ue61"); // rv.y = us->h * 72 / dpi.y;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
//3 1vqiwf4q9iqmxqvd9e5qa1vo7
// point gvusershape_size(graph_t * g, char *name)
public static Object gvusershape_size(Object... arg) {
UNSUPPORTED("3a8kgtxwhe9qi1f5wde0npt4d"); // point gvusershape_size(graph_t * g, char *name)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("e5r3mj8btrkw973m7l0rritko"); // point rv;
UNSUPPORTED("aj7pw6lpv6z6nan96bx4pdfu2"); // pointf dpi;
UNSUPPORTED("114dkd9d0mrkmtgl0ncfy2y88"); // static char* oldpath;
UNSUPPORTED("709e07k0mmaqqdi3botr9zj87"); // usershape_t* us;
UNSUPPORTED("d5ucq7enfbvarib2hwpi6y9qi"); // /* no shape file, no shape size */
UNSUPPORTED("crs7cps8buaugcwtbezaqxd0q"); // if (!name || (*name == '\0')) {
UNSUPPORTED("4zusj5p9eg9pazvp0px1fxvhy"); // rv.x = rv.y = -1;
UNSUPPORTED("cs1ejkx9cw658cl8cagdzqrzm"); // return rv;
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("24me4s4cte11xoie4uxxwajbs"); // if (!HTTPServerEnVar && (oldpath != Gvimagepath)) {
UNSUPPORTED("ba3zx115acxf5hiob55lfwvhd"); // oldpath = Gvimagepath;
UNSUPPORTED("63hyc3s3c95h5g1lp6aypzd8k"); // if (ImageDict) {
UNSUPPORTED("50x4kwt6y5jkwbeqmhvki188q"); // dtclose(ImageDict);
UNSUPPORTED("75t9qfgcu2fz0o59mjqh5rruv"); // ImageDict = (void *)0;
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
UNSUPPORTED("d77jz2hp035qgnn72uyy7evkj"); // if ((dpi.y = GD_drawing(g)->dpi) >= 1.0)
UNSUPPORTED("8kboj4mypdab20ax7qfuq8oyp"); // dpi.x = dpi.y;
UNSUPPORTED("div10atae09n36x269sl208r1"); // else
UNSUPPORTED("6buslnzh8a0nuwlk9wkfaytt8"); // dpi.x = dpi.y = (double)DEFAULT_DPI;
UNSUPPORTED("16h3qy8ek57tauhtrw8xkodar"); // us = gvusershape_open (name);
UNSUPPORTED("6tq0lkl6cmjltetu68liok738"); // rv = gvusershape_size_dpi (us, dpi);
UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
}
}

File diff suppressed because it is too large Load Diff

View File

@ -72,7 +72,6 @@ public class OptionFlags {
static public final boolean OMEGA_CROSSING = false; static public final boolean OMEGA_CROSSING = false;
// static public final boolean LINK_BETWEEN_FIELDS = true; // static public final boolean LINK_BETWEEN_FIELDS = true;
// static public final boolean USE_JDOT = false;
public void reset() { public void reset() {
reset(false); reset(false);

View File

@ -63,6 +63,30 @@ public class SignatureUtils {
} }
} }
public static String getMD5(String s) {
try {
final MessageDigest msgDigest = MessageDigest.getInstance("MD5");
msgDigest.update(s.getBytes("UTF-8"));
final byte[] digest = msgDigest.digest();
final StringBuilder result = new StringBuilder(32);
for (byte b : digest) {
final String tmp = Integer.toHexString(b & 0xFF);
if (tmp.length() == 1) {
result.append("0");
}
result.append(tmp);
}
assert result.length() == 32;
return result.toString();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
throw new UnsupportedOperationException(e);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
throw new UnsupportedOperationException(e);
}
}
public static String getSignatureSha512(File f) throws IOException { public static String getSignatureSha512(File f) throws IOException {
final InputStream is = new FileInputStream(f); final InputStream is = new FileInputStream(f);
try { try {

View File

@ -85,7 +85,7 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.sprite.Sprite; import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
import net.sourceforge.plantuml.version.Version; import net.sourceforge.plantuml.version.Version;
public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Annotated { public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Annotated, WithSprite {
private boolean rotation; private boolean rotation;
private boolean hideUnlinkedData; private boolean hideUnlinkedData;

View File

@ -0,0 +1,44 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml;
import net.sourceforge.plantuml.core.Diagram;
import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
public interface WithSprite extends Diagram {
public void addSprite(String name, Sprite sprite);
}

View File

@ -167,7 +167,7 @@ public class CommandLinkActivity extends SingleLineCommand2<ActivityDiagram> {
link.setUrl(urlLink); link.setUrl(urlLink);
} }
CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link); link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link); diagram.addLink(link);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -217,7 +217,7 @@ public class CommandLinkLongActivity extends CommandMultilines2<ActivityDiagram>
link.setUrl(urlLink); link.setUrl(urlLink);
} }
CommandLinkClass.applyStyle(line0.getLazzy("ARROW_STYLE", 0), link); link.applyStyle(line0.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link); diagram.addLink(link);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -86,7 +86,8 @@ public class BasicCharAreaImpl implements BasicCharArea {
if (wc == 2) { if (wc == 2) {
return true; return true;
} }
throw new IllegalArgumentException("warning width=" + wc + " char=" + ((int) c)); return false;
// throw new IllegalArgumentException("warning width=" + wc + " char=" + ((int) c));
} }
private void ensurePossible(int x, int y) { private void ensurePossible(int x, int y) {

View File

@ -35,8 +35,6 @@
*/ */
package net.sourceforge.plantuml.classdiagram.command; package net.sourceforge.plantuml.classdiagram.command;
import java.util.StringTokenizer;
import net.sourceforge.plantuml.Direction; import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.UmlDiagramType;
@ -60,7 +58,6 @@ import net.sourceforge.plantuml.cucadiagram.LinkArrow;
import net.sourceforge.plantuml.cucadiagram.LinkDecor; import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType; import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement; import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.color.ColorParser; import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
@ -177,7 +174,7 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
.eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""))) : diagram.getOrCreateLeaf( .eventuallyRemoveStartingAndEndingDoubleQuote(arg.get("ENT2", 0), "\""))) : diagram.getOrCreateLeaf(
ent2, null, null); ent2, null, null);
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); // Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
final LinkType linkType = getLinkType(arg); final LinkType linkType = getLinkType(arg);
final Direction dir = getDirection(arg); final Direction dir = getDirection(arg);
@ -260,8 +257,8 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
link = link.getInv(); link = link.getInv();
} }
link.setLinkArrow(linkArrow); link.setLinkArrow(linkArrow);
colors = applyStyle(arg.getLazzy("ARROW_STYLE", 0), link, colors); link.setColors(color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()));
link.setColors(colors); link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
addLink(diagram, link, arg.get("HEADER", 0)); addLink(diagram, link, arg.get("HEADER", 0));
@ -332,18 +329,16 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
queue = getQueueLength(arg); queue = getQueueLength(arg);
} }
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
final Display labelLink = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); final Display labelLink = Display.getWithNewlines(arg.get("LABEL_LINK", 0));
final String firstLabel = arg.get("FIRST_LABEL", 0); final String firstLabel = arg.get("FIRST_LABEL", 0);
final String secondLabel = arg.get("SECOND_LABEL", 0); final String secondLabel = arg.get("SECOND_LABEL", 0);
final Link link = new Link(cl1, cl2, linkType, labelLink, queue, firstLabel, secondLabel, final Link link = new Link(cl1, cl2, linkType, labelLink, queue, firstLabel, secondLabel,
diagram.getLabeldistance(), diagram.getLabelangle()); diagram.getLabeldistance(), diagram.getLabelangle());
link.setColors(color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()));
diagram.resetPragmaLabel(); diagram.resetPragmaLabel();
colors = applyStyle(arg.getLazzy("ARROW_STYLE", 0), link, colors); link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
link.setColors(colors);
addLink(diagram, link, arg.get("HEADER", 0)); addLink(diagram, link, arg.get("HEADER", 0));
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
@ -582,42 +577,6 @@ final public class CommandLinkClass extends SingleLineCommand2<AbstractClassOrOb
return s; return s;
} }
@Deprecated
public static Colors applyStyle(String arrowStyle, Link link) {
return applyStyle(arrowStyle, link, null);
}
public static Colors applyStyle(String arrowStyle, Link link, Colors colors) {
if (arrowStyle == null) {
return colors;
}
final StringTokenizer st = new StringTokenizer(arrowStyle, ",");
while (st.hasMoreTokens()) {
final String s = st.nextToken();
if (s.equalsIgnoreCase("dashed")) {
link.goDashed();
} else if (s.equalsIgnoreCase("bold")) {
link.goBold();
} else if (s.equalsIgnoreCase("dotted")) {
link.goDotted();
} else if (s.equalsIgnoreCase("hidden")) {
link.goHidden();
} else if (s.equalsIgnoreCase("plain")) {
// Do nothing
} else if (s.equalsIgnoreCase("norank")) {
link.goNorank();
} else if (s.startsWith("thickness=")) {
link.goThickness(Double.parseDouble(s.substring("thickness=".length())));
} else {
link.setSpecificColor(s);
if (colors != null) {
colors = colors.add(ColorType.LINE, HtmlColorSet.getInstance().getColorIfValid(s));
}
}
}
return colors;
}
private boolean isInversed(LinkDecor decors1, LinkDecor decors2) { private boolean isInversed(LinkDecor decors1, LinkDecor decors2) {
if (decors1 == LinkDecor.ARROW && decors2 != LinkDecor.ARROW) { if (decors1 == LinkDecor.ARROW && decors2 != LinkDecor.ARROW) {
return true; return true;

View File

@ -40,7 +40,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.WithSprite;
import net.sourceforge.plantuml.command.note.SingleMultiFactoryCommand; import net.sourceforge.plantuml.command.note.SingleMultiFactoryCommand;
import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexLeaf;
@ -49,7 +49,7 @@ import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
import net.sourceforge.plantuml.ugraphic.sprite.SpriteColorBuilder4096; import net.sourceforge.plantuml.ugraphic.sprite.SpriteColorBuilder4096;
import net.sourceforge.plantuml.ugraphic.sprite.SpriteGrayLevel; import net.sourceforge.plantuml.ugraphic.sprite.SpriteGrayLevel;
public final class FactorySpriteCommand implements SingleMultiFactoryCommand<UmlDiagram> { public final class FactorySpriteCommand implements SingleMultiFactoryCommand<WithSprite> {
private RegexConcat getRegexConcatMultiLine() { private RegexConcat getRegexConcatMultiLine() {
return new RegexConcat(new RegexLeaf("^"), // return new RegexConcat(new RegexLeaf("^"), //
@ -70,26 +70,26 @@ public final class FactorySpriteCommand implements SingleMultiFactoryCommand<Uml
new RegexLeaf("$")); new RegexLeaf("$"));
} }
public Command<UmlDiagram> createSingleLine() { public Command<WithSprite> createSingleLine() {
return new SingleLineCommand2<UmlDiagram>(getRegexConcatSingleLine()) { return new SingleLineCommand2<WithSprite>(getRegexConcatSingleLine()) {
@Override @Override
protected CommandExecutionResult executeArg(final UmlDiagram system, RegexResult arg) { protected CommandExecutionResult executeArg(final WithSprite system, RegexResult arg) {
return executeInternal(system, arg, Arrays.asList((CharSequence) arg.get("DATA", 0))); return executeInternal(system, arg, Arrays.asList((CharSequence) arg.get("DATA", 0)));
} }
}; };
} }
public Command<UmlDiagram> createMultiLine(boolean withBracket) { public Command<WithSprite> createMultiLine(boolean withBracket) {
return new CommandMultilines2<UmlDiagram>(getRegexConcatMultiLine(), MultilinesStrategy.REMOVE_STARTING_QUOTE) { return new CommandMultilines2<WithSprite>(getRegexConcatMultiLine(), MultilinesStrategy.REMOVE_STARTING_QUOTE) {
@Override @Override
public String getPatternEnd() { public String getPatternEnd() {
return "(?i)^end[%s]?sprite|\\}$"; return "(?i)^end[%s]?sprite|\\}$";
} }
protected CommandExecutionResult executeNow(final UmlDiagram system, BlocLines lines) { protected CommandExecutionResult executeNow(final WithSprite system, BlocLines lines) {
lines = lines.trim(true); lines = lines.trim(true);
final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499())); final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
@ -104,7 +104,7 @@ public final class FactorySpriteCommand implements SingleMultiFactoryCommand<Uml
}; };
} }
private CommandExecutionResult executeInternal(UmlDiagram system, RegexResult line0, private CommandExecutionResult executeInternal(WithSprite system, RegexResult line0,
final List<CharSequence> strings) { final List<CharSequence> strings) {
try { try {
final Sprite sprite; final Sprite sprite;

View File

@ -141,7 +141,6 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
final String stereotypeString = arg.get("STEREO", 0); final String stereotypeString = arg.get("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = new Stereotype(stereotypeString); final Stereotype stereotype = new Stereotype(stereotypeString);
note.setStereotype(stereotype);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), FontParam.NOTE, colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), FontParam.NOTE,
ColorParam.noteBackground, ColorParam.noteBorder); ColorParam.noteBackground, ColorParam.noteBorder);
} }

View File

@ -35,6 +35,8 @@
*/ */
package net.sourceforge.plantuml.command.note.sequence; package net.sourceforge.plantuml.command.note.sequence;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.FontParam;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.UrlBuilder; import net.sourceforge.plantuml.UrlBuilder;
@ -50,10 +52,15 @@ import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.color.ColorParser; import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage; import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.EventWithDeactivate; import net.sourceforge.plantuml.sequencediagram.EventWithDeactivate;
import net.sourceforge.plantuml.sequencediagram.GroupingLeaf; import net.sourceforge.plantuml.sequencediagram.GroupingLeaf;
import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.NoteStyle; import net.sourceforge.plantuml.sequencediagram.NoteStyle;
import net.sourceforge.plantuml.sequencediagram.SequenceDiagram; import net.sourceforge.plantuml.sequencediagram.SequenceDiagram;
@ -63,6 +70,8 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
private RegexConcat getRegexConcatMultiLine() { private RegexConcat getRegexConcatMultiLine() {
return new RegexConcat(new RegexLeaf("^[%s]*"), // return new RegexConcat(new RegexLeaf("^[%s]*"), //
new RegexLeaf("STYLE", "(note|hnote|rnote)"), // new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
new RegexLeaf("[%s]+"), // new RegexLeaf("[%s]+"), //
new RegexLeaf("POSITION", "(right|left)[%s]*"), // new RegexLeaf("POSITION", "(right|left)[%s]*"), //
ColorParser.exp1(), // ColorParser.exp1(), //
@ -73,6 +82,8 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
private RegexConcat getRegexConcatSingleLine() { private RegexConcat getRegexConcatSingleLine() {
return new RegexConcat(new RegexLeaf("^[%s]*"), // return new RegexConcat(new RegexLeaf("^[%s]*"), //
new RegexLeaf("STYLE", "(note|hnote|rnote)"), // new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
new RegexLeaf("[%s]*"), //
new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
new RegexLeaf("[%s]+"), // new RegexLeaf("[%s]+"), //
new RegexLeaf("POSITION", "(right|left)[%s]*"), // new RegexLeaf("POSITION", "(right|left)[%s]*"), //
ColorParser.exp1(), // ColorParser.exp1(), //
@ -124,10 +135,21 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
final NoteStyle style = NoteStyle.getNoteStyle(line0.get("STYLE", 0)); final NoteStyle style = NoteStyle.getNoteStyle(line0.get("STYLE", 0));
final Display display = system.manageVariable(lines.toDisplay()); final Display display = system.manageVariable(lines.toDisplay());
final String backcolor0 = line0.get("COLOR", 0);
Colors colors = Colors.empty().add(ColorType.BACK, HtmlColorSet.getInstance().getColorIfValid(backcolor0));
final String stereotypeString = line0.get("STEREO", 0);
if (stereotypeString != null) {
final Stereotype stereotype = new Stereotype(stereotypeString);
colors = colors.applyStereotypeForNote(stereotype, system.getSkinParam(), FontParam.NOTE,
ColorParam.noteBackground, ColorParam.noteBorder);
}
final Note note = new Note(display, position, style);
note.setUrl(url);
note.setColors(colors);
if (m instanceof AbstractMessage) { if (m instanceof AbstractMessage) {
((AbstractMessage) m).setNote(display, position, style, line0.get("COLOR", 0), url); ((AbstractMessage) m).setNote(note);
} else { } else {
((GroupingLeaf) m).setNote(display, position, style, line0.get("COLOR", 0), url); ((GroupingLeaf) m).setNote(note);
} }
} }

View File

@ -158,7 +158,7 @@ public class AtomImg implements Atom {
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
// final double h = calculateDimension(ug.getStringBounder()).getHeight(); // final double h = calculateDimension(ug.getStringBounder()).getHeight();
ug.draw(new UImage(image).scale(scale)); ug.draw(new UImage(image).scale(scale * ug.dpiFactor()));
// tileImage.drawU(ug.apply(new UTranslate(0, -h))); // tileImage.drawU(ug.apply(new UTranslate(0, -h)));
} }

View File

@ -39,29 +39,31 @@ import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
public class AtomSprite implements Atom { public class AtomSprite implements Atom {
private final TextBlock sprite;
private final FontConfiguration fontConfiguration; private final FontConfiguration fontConfiguration;
private final Sprite sprite;
private final double scale;
public AtomSprite(TextBlock sprite, FontConfiguration fontConfiguration) { public AtomSprite(double scale, FontConfiguration fontConfiguration, Sprite sprite) {
this.sprite = sprite; this.scale = scale;
this.fontConfiguration = fontConfiguration; this.fontConfiguration = fontConfiguration;
this.sprite = sprite;
} }
public Dimension2D calculateDimension(StringBounder stringBounder) { public Dimension2D calculateDimension(StringBounder stringBounder) {
return sprite.calculateDimension(stringBounder); return sprite.asTextBlock(fontConfiguration.getColor(), scale).calculateDimension(stringBounder);
} }
public double getStartingAltitude(StringBounder stringBounder) { public double getStartingAltitude(StringBounder stringBounder) {
return -3; return 0;
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
sprite.drawU(ug); sprite.asTextBlock(fontConfiguration.getColor(), scale * ug.dpiFactor()).drawU(ug);
} }
} }

View File

@ -83,7 +83,7 @@ public class CommandCreoleImg implements Command {
if (s == null) { if (s == null) {
return 1; return 1;
} }
final Pattern p = Pattern.compile("scale=([0-9.]+)"); final Pattern p = Pattern.compile("(?:scale=|\\*)([0-9.]+)");
final Matcher m = p.matcher(s); final Matcher m = p.matcher(s);
if (m.find()) { if (m.find()) {
return Double.parseDouble(m.group(1)); return Double.parseDouble(m.group(1));

View File

@ -179,7 +179,7 @@ public class StripeSimple implements Stripe {
public void addSprite(String src, double scale) { public void addSprite(String src, double scale) {
final Sprite sprite = skinParam.getSprite(src); final Sprite sprite = skinParam.getSprite(src);
if (sprite != null) { if (sprite != null) {
atoms.add(new AtomSprite(sprite.asTextBlock(fontConfiguration.getColor(), scale), fontConfiguration)); atoms.add(new AtomSprite(scale, fontConfiguration, sprite));
} }
} }

View File

@ -55,7 +55,7 @@ import net.sourceforge.plantuml.svek.Bibliotekon;
import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.utils.UniqueSequence; import net.sourceforge.plantuml.utils.UniqueSequence;
public class Link implements Hideable, Removeable { public class Link extends WithLinkType implements Hideable, Removeable {
final private IEntity cl1; final private IEntity cl1;
final private IEntity cl2; final private IEntity cl2;
@ -63,7 +63,6 @@ public class Link implements Hideable, Removeable {
private String port1; private String port1;
private String port2; private String port2;
private LinkType type;
final private Display label; final private Display label;
private int length; private int length;
@ -82,7 +81,6 @@ public class Link implements Hideable, Removeable {
private final String labeldistance; private final String labeldistance;
private final String labelangle; private final String labelangle;
private HtmlColor specificColor;
private boolean constraint = true; private boolean constraint = true;
private boolean inverted = false; private boolean inverted = false;
private LinkArrow linkArrow = LinkArrow.NONE; private LinkArrow linkArrow = LinkArrow.NONE;
@ -130,7 +128,7 @@ public class Link implements Hideable, Removeable {
this.qualifier2 = qualifier2; this.qualifier2 = qualifier2;
this.labeldistance = labeldistance; this.labeldistance = labeldistance;
this.labelangle = labelangle; this.labelangle = labelangle;
this.specificColor = specificColor; this.setSpecificColor(specificColor);
if (qualifier1 != null) { if (qualifier1 != null) {
((ILeaf) cl1).setNearDecoration(true); ((ILeaf) cl1).setNearDecoration(true);
} }
@ -159,7 +157,7 @@ public class Link implements Hideable, Removeable {
// cl2.setXposition(x-1); // cl2.setXposition(x-1);
// } // }
final Link result = new Link(cl2, cl1, getType().getInversed(), label, length, qualifier2, qualifier1, final Link result = new Link(cl2, cl1, getType().getInversed(), label, length, qualifier2, qualifier1,
labeldistance, labelangle, specificColor); labeldistance, labelangle, getSpecificColor());
result.inverted = !this.inverted; result.inverted = !this.inverted;
result.port1 = this.port2; result.port1 = this.port2;
result.port2 = this.port1; result.port2 = this.port1;
@ -167,32 +165,11 @@ public class Link implements Hideable, Removeable {
return result; return result;
} }
public void goDashed() { @Override
type = type.goDashed();
}
public void goDotted() {
type = type.goDotted();
}
public void goThickness(double thickness) {
type = type.goThickness(thickness);
}
private boolean hidden = false;
public void goHidden() {
this.hidden = true;
}
public void goNorank() { public void goNorank() {
setConstraint(false); setConstraint(false);
} }
public void goBold() {
type = type.goBold();
}
public String getLabeldistance() { public String getLabeldistance() {
// Default in dot 1.0 // Default in dot 1.0
return labeldistance; return labeldistance;
@ -249,6 +226,7 @@ public class Link implements Hideable, Removeable {
return new EntityPort(bibliotekon.getShapeUid((ILeaf) cl2), port2); return new EntityPort(bibliotekon.getShapeUid((ILeaf) cl2), port2);
} }
@Override
public LinkType getType() { public LinkType getType() {
if (opale) { if (opale) {
return new LinkType(LinkDecor.NONE, LinkDecor.NONE); return new LinkType(LinkDecor.NONE, LinkDecor.NONE);
@ -392,20 +370,6 @@ public class Link implements Hideable, Removeable {
return false; return false;
} }
// public boolean containsWithDecors(ILeaf leaf) {
// LinkType linkType = this.getType();
// if (isInverted()) {
// linkType = linkType.getInversed();
// }
// if (getEntity2() == leaf && linkType.getDecor1() != LinkDecor.NONE) {
// return true;
// }
// if (getEntity1() == leaf && linkType.getDecor2() != LinkDecor.NONE) {
// return true;
// }
// return false;
// }
public IEntity getOther(IEntity entity) { public IEntity getOther(IEntity entity) {
if (getEntity1() == entity) { if (getEntity1() == entity) {
return getEntity2(); return getEntity2();
@ -439,14 +403,6 @@ public class Link implements Hideable, Removeable {
return 0; return 0;
} }
public HtmlColor getSpecificColor() {
return specificColor;
}
public void setSpecificColor(String s) {
this.specificColor = HtmlColorSet.getInstance().getColorIfValid(s);
}
public final boolean isConstraint() { public final boolean isConstraint() {
return constraint; return constraint;
} }
@ -555,16 +511,6 @@ public class Link implements Hideable, Removeable {
this.sametail = sametail; this.sametail = sametail;
} }
private Colors colors;
public void setColors(Colors colors) {
this.colors = colors;
}
public final Colors getColors() {
return colors;
}
public void setPortMembers(String port1, String port2) { public void setPortMembers(String port1, String port2) {
this.port1 = port1; this.port1 = port1;
this.port2 = port2; this.port2 = port2;

View File

@ -0,0 +1,122 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.cucadiagram;
import java.util.StringTokenizer;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
public abstract class WithLinkType {
protected LinkType type;
protected boolean hidden = false;
private Colors colors = Colors.empty();
public final HtmlColor getSpecificColor() {
return colors.getColor(ColorType.LINE);
}
public final void setSpecificColor(HtmlColor specificColor) {
colors = colors.add(ColorType.LINE, specificColor);
}
public void setColors(Colors colors) {
this.colors = colors;
}
public final Colors getColors() {
return colors;
}
final public void goDashed() {
type = type.goDashed();
}
final public void goDotted() {
type = type.goDotted();
}
final public void goThickness(double thickness) {
type = type.goThickness(thickness);
}
final public void goHidden() {
this.hidden = true;
}
public abstract void goNorank();
final public void goBold() {
type = type.goBold();
}
public void applyStyle(String arrowStyle) {
if (arrowStyle == null) {
return;
}
final StringTokenizer st = new StringTokenizer(arrowStyle, ",");
while (st.hasMoreTokens()) {
final String s = st.nextToken();
if (s.equalsIgnoreCase("dashed")) {
this.goDashed();
} else if (s.equalsIgnoreCase("bold")) {
this.goBold();
} else if (s.equalsIgnoreCase("dotted")) {
this.goDotted();
} else if (s.equalsIgnoreCase("hidden")) {
this.goHidden();
} else if (s.equalsIgnoreCase("plain")) {
// Do nothing
} else if (s.equalsIgnoreCase("norank")) {
this.goNorank();
} else if (s.startsWith("thickness=")) {
this.goThickness(Double.parseDouble(s.substring("thickness=".length())));
} else {
final HtmlColor tmp = HtmlColorSet.getInstance().getColorIfValid(s);
setSpecificColor(tmp);
}
}
}
public LinkType getType() {
return type;
}
}

View File

@ -37,7 +37,6 @@ package net.sourceforge.plantuml.descdiagram.command;
import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Direction; import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
@ -60,7 +59,6 @@ import net.sourceforge.plantuml.descdiagram.DescriptionDiagram;
import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.color.ColorParser; import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType; import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.graphic.color.Colors;
public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> { public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
@ -316,14 +314,12 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
if (dir == Direction.LEFT || dir == Direction.UP) { if (dir == Direction.LEFT || dir == Direction.UP) {
link = link.getInv(); link = link.getInv();
} }
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); link.setColors(color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()));
colors = CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link, colors); link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
if (arg.get("STEREOTYPE", 0) != null) { if (arg.get("STEREOTYPE", 0) != null) {
final Stereotype stereotype = new Stereotype(arg.get("STEREOTYPE", 0)); final Stereotype stereotype = new Stereotype(arg.get("STEREOTYPE", 0));
colors = colors.applyStereotype(stereotype, diagram.getSkinParam(), ColorParam.arrow); link.setColors(link.getColors().applyStereotype(stereotype, diagram.getSkinParam(), ColorParam.arrow));
} }
link.setColors(colors);
diagram.addLink(link); diagram.addLink(link);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
@ -367,7 +363,7 @@ public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
if (dir == Direction.LEFT || dir == Direction.UP) { if (dir == Direction.LEFT || dir == Direction.UP) {
link = link.getInv(); link = link.getInv();
} }
CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link); link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link); diagram.addLink(link);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -67,19 +67,21 @@ import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.version.PSystemVersion; import net.sourceforge.plantuml.version.PSystemVersion;
public class PSystemDonors extends AbstractPSystem { public class PSystemDonors extends AbstractPSystem {
public static final String DONORS = "6tC70AmEU9ELAuNYZT_MZn6AGOgeeHNOWjgQuZoZA1P0SxnDhXdMoRgDdR45mND5SGKL8Az2C-THCiPX"
+ "qGYJjjcQVk6-VTu2CLLilsL2UtyTQ4BoLZ2km4tbpF_b0XiJv0R8GZti1NIpXNlZcZIctJyBxB_e5sW1" public static final String DONORS = "6vG70AmEU9ELAuNYZT_MZn6AGOgeeHNOWjgQuZoZA1P0SxnDhXdMoRgDdR45mND5SGKL8Az2C-THCiPX"
+ "JwFBbaMbGPxbz2gOv30uCySffUIX6EKhKjYwiGMmql4WLnkhGtmZTVQTMa2JrcmQChC65Cj8aMW-Dbex" + "qGYJjjcQVk6-VTu2CLLilsL2UtyTQ4BoLZ2km4tbpF_b0XiJv0R8GZti1NIZZNlZcZIc_NyMPXz_WHRm"
+ "3h1z10CdEhIhmmPaXn87UODnG7qZHacvWWQPKToC3TMyymI32JTKs8alIb9pj93CA4C7EhGjK83rPu80" + "DBfiMLGwq5cTNHLD233np1odb9A7OjnVaSBNZIs0buu7kTfO7U4RgRFlr0AQj6RJa9are5X6YaJpiT7Q"
+ "s2VbbEHiwMr0mHRPegP1KkTUTwQB_SEoL22_D9m07JG7hQ1M0FaFTCEViyrSubp7hgWPygwCSzauvBNH" + "SO3jOnWuqM5T7JOGEvGuw1kC0-eRCKh65JJ8ZE9cRAZcdIS4J3YXmavyKPAQeuLaHXawq65jWGAyFnC4"
+ "gzZVFD3NMLS6oilcnSnyBJ-gMmlfd79TurTNW_pGa9MzFOmrNbb2UFutbqBxOW4S7q37MaF5-FlX_6OX" + "n3uffoHdAsy32hR85ZKDahhmkZDTx1-MKe7yqd0ATB0Sj0Ae0F8Vw8O_PvkvnBcENL4pv5qPvx9no6kz"
+ "7S9ZIbt8mJbvPxk905bbAIpuBYvPBV3pBc6nkbWUpLayH-VNkLOoe8Ch4fkXZsi5iwjpHadLKF-yv5NN" + "Lx6_UQ2liwuCb9VDYvdnMdvKjnRIEUMwng-k1lcX8IjxUnXhlBA4yFnlBeNsnG8wFe2EjOQAyVV3-Sr2"
+ "yIboJT1itfVeHx9fIFp_BMLMqnsqteGFroM8KgElhAh5HHS1qw1_Gsu1kGFLq-JHTLg-9Bxt1-JUUv50" + "6eJ7bBgGWtFopdOJ0R7AKbZeNLnIBV3pBccnkbWUpLayH_lNXLOoi8Ch5fkXZsi5irldZ9AgeVvvoQkk"
+ "53OJx9-wPjIdtBo4UM9Bfwfu01Zj4kr6X_4WCuYg0rq7bMTas5s_tQHdsDGOEJTwHRrfDmQkZtIwSZDz" + "urFacg1PtfVeHx9fIFp_BSqCqXsqteGFrwM8KgMlhAh5HHU1qw1_Gsu1kGFLq-JHTLg-9Bxt1-JUUv50"
+ "DnVu3CEWB9e3XzfR70NSXnFCeTNYRHN3vXhUROlKU2U3_JNC6O7q6L6E8st9zAcEChCybhofIxoRsyMV" + "53OJx9-wPjIdtBo4UM9Bfwfu01Zl4kr6X_CWCuYg0rq7bMTas5s_tQHdsBGnTcxqYdhJRWnT7zDfoitq"
+ "Xox-wTsY5ZhlRly8VR_9hwIMUiHuT0s6lKMNzLkRB3eMu5iZ8u7BW9tMxSRaG2MtqAaDPqLFSGBMlQrp" + "tLpWCmo3icWE7DRUuYZWFfnG3gsMRwleDjVmRbkanZiPxAzXpWYapuXo76bBfazrb9dbiUHDNUBTt2x-"
+ "S5oBuA9ftQnaPsedrypQGGThaXzqD61KP2UIWw_jpiWp7ekgzYVddLZrKD-757yNK2o614-fKBOHKdI5" + "F7JnJ-yMjT1vT_j7wljDVYMrr2F6esimz9PTrczjikXOG6prZ0Kk0tPgjnkJ0vNSGgSsd1KznGbOzxRE"
+ "pUbamhZTC-uEtiUjpHUgs_ZcmXC61HzBj6cvmUjJAlSKya5J1v0wQrNoqiV42E1tVFq6FS-j3ZJAQ6cL" + "SNPmGsH9"; + "mN4jWukcTREIdQcT73Dh1nskINx8qO1HqPr83hwsEoFFU1G5zYVddLZrKD-757yNK2o62PvIeMmZfEWA"
+ "czF9f76hPzmTl8zRcozKj_7DXIS4XH-RQDDoWzUd0FSK-a5J1v0wgrNoqiR42E1tVFq6FS-j3ZpAQ6cL"
+ "SNQv8PRIf_S8y1ioyae0";
@Override @Override
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)

View File

@ -65,7 +65,7 @@ public class Splitter {
public static final String spritePattern = "\\<\\$" + SpriteUtils.SPRITE_NAME + "(?:\\{scale=(?:[0-9.]+)\\})?" public static final String spritePattern = "\\<\\$" + SpriteUtils.SPRITE_NAME + "(?:\\{scale=(?:[0-9.]+)\\})?"
+ "\\>"; + "\\>";
public static final String spritePattern2 = "\\<\\$(" + SpriteUtils.SPRITE_NAME + ")" public static final String spritePattern2 = "\\<\\$(" + SpriteUtils.SPRITE_NAME + ")"
+ "(\\{scale=(?:[0-9.]+)\\})?" + "\\>"; + "((?:\\{scale=|\\*)(?:[0-9.]+)\\}?)?" + "\\>";
static final String htmlTag; static final String htmlTag;
static final String linkPattern = "\\[\\[([^\\[\\]]+)\\]\\]"; static final String linkPattern = "\\[\\[([^\\[\\]]+)\\]\\]";

View File

@ -66,4 +66,8 @@ public class ComplementColors implements Complement {
public boolean isOk() { public boolean isOk() {
return center != null; return center != null;
} }
public HtmlColor getCenter() {
return center;
}
} }

View File

@ -0,0 +1,56 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.project3;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.graphic.HtmlColor;
public class ComplementInColors2 implements ComplementPattern {
public IRegex toRegex(String suffix) {
return new RegexLeaf("COMPLEMENT" + suffix, "colou?red[%s]+(?:in[%s+])?(#?\\w+)(?:/(#?\\w+))?");
}
public Failable<Complement> getComplement(GanttDiagram system, RegexResult arg, String suffix) {
final String color1 = arg.get("COMPLEMENT" + suffix, 0);
final String color2 = arg.get("COMPLEMENT" + suffix, 1);
final HtmlColor col1 = system.getIHtmlColorSet().getColorIfValid(color1);
final HtmlColor col2 = system.getIHtmlColorSet().getColorIfValid(color2);
return Failable.<Complement> ok(new ComplementColors(col1, col2));
}
}

View File

@ -0,0 +1,50 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.project3;
public class ComplementName implements Complement {
private final String name;
public ComplementName(String name) {
this.name = name;
}
public final String getName() {
return name;
}
}

View File

@ -0,0 +1,52 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.project3;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
public class ComplementNamed implements ComplementPattern {
public IRegex toRegex(String suffix) {
return new RegexLeaf("COMPLEMENT" + suffix, "\\[([^\\[\\]]+)\\]");
}
public Failable<Complement> getComplement(GanttDiagram system, RegexResult arg, String suffix) {
final String name = arg.get("COMPLEMENT" + suffix, 0);
return Failable.<Complement> ok(new ComplementName(name));
}
}

View File

@ -47,6 +47,18 @@ public class DaysAsDates implements Subject, Complement, Iterable<DayAsDate> {
this.date2 = date2; this.date2 = date2;
} }
public DaysAsDates(GanttDiagram gantt, DayAsDate date1, int count) {
this.date1 = date1;
DayAsDate tmp = date1;
while (count > 0) {
if (gantt.isOpen(tmp)) {
count--;
}
tmp = tmp.next();
}
this.date2 = tmp;
}
class MyIterator implements Iterator<DayAsDate> { class MyIterator implements Iterator<DayAsDate> {
private DayAsDate current; private DayAsDate current;

View File

@ -123,9 +123,6 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
throws IOException { throws IOException {
final double margin = 10; final double margin = 10;
// public ImageBuilder(ColorMapper colorMapper, double dpiFactor, HtmlColor mybackcolor, String metadata,
// String warningOrError, double margin1, double margin2, Animation animation, boolean useHandwritten) {
sortTasks(); sortTasks();
final Scale scale = getScale(); final Scale scale = getScale();
@ -176,7 +173,7 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
return (GCalendarSimple) calendar; return (GCalendarSimple) calendar;
} }
public LoadPlanable getDefaultPlan() { public final LoadPlanable getDefaultPlan() {
return new LoadPlanable() { return new LoadPlanable() {
public int getLoadAt(Instant instant) { public int getLoadAt(Instant instant) {
if (calendar == null) { if (calendar == null) {
@ -205,26 +202,37 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
final double xmin = timeScale.getStartingPosition(min); final double xmin = timeScale.getStartingPosition(min);
final double xmax = timeScale.getEndingPosition(max); final double xmax = timeScale.getEndingPosition(max);
ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).draw(new ULine(xmax - xmin, 0));
ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(0, getHeaderHeight() - 3))
.draw(new ULine(xmax - xmin, 0));
if (calendar == null) { if (calendar == null) {
drawSimpleDayCounter(ug, timeScale, yTotal); drawSimpleDayCounter(ug, timeScale, yTotal);
} else { } else {
drawCalendar(ug, timeScale, yTotal); drawCalendar(ug, timeScale, yTotal);
} }
ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).draw(new ULine(xmax - xmin, 0));
ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(0, getHeaderHeight() - 3))
.draw(new ULine(xmax - xmin, 0));
} }
private final HtmlColor veryLightGray = new HtmlColorSetSimple().getColorIfValid("#E0E8E8"); private final HtmlColor veryLightGray = new HtmlColorSetSimple().getColorIfValid("#E0E8E8");
private double getHeaderHeight() { private double getHeaderHeight() {
return getTimeHeaderHeight() + getHeaderNameDayHeight();
}
private double getTimeHeaderHeight() {
if (calendar != null) { if (calendar != null) {
return Y_WEEKDAY + Y_NUMDAY; return Y_WEEKDAY + Y_NUMDAY;
} }
return 16; return 16;
} }
private double getHeaderNameDayHeight() {
if (calendar != null && nameDays.size() > 0) {
return 16;
}
return 0;
}
private static final int Y_WEEKDAY = 16; private static final int Y_WEEKDAY = 16;
private static final int Y_NUMDAY = 28; private static final int Y_NUMDAY = 28;
@ -239,28 +247,33 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
final DayOfWeek dayOfWeek = day.getDayOfWeek(); final DayOfWeek dayOfWeek = day.getDayOfWeek();
final boolean isWorkingDay = getDefaultPlan().getLoadAt(i) > 0; final boolean isWorkingDay = getDefaultPlan().getLoadAt(i) > 0;
final String d1 = "" + day.getDayOfMonth(); final String d1 = "" + day.getDayOfMonth();
final TextBlock num = getTextBlock(d1, 10); final TextBlock num = getTextBlock(d1, 10, false);
final double x1 = timeScale.getStartingPosition(i); final double x1 = timeScale.getStartingPosition(i);
final double x2 = timeScale.getEndingPosition(i); final double x2 = timeScale.getEndingPosition(i);
if (i.compareTo(max2.increment()) < 0) { if (i.compareTo(max2.increment()) < 0) {
final TextBlock weekDay = getTextBlock(dayOfWeek.shortName(), 10); final TextBlock weekDay = getTextBlock(dayOfWeek.shortName(), 10, false);
final URectangle rect = new URectangle(x2 - x1 - 1, yTotal - Y_WEEKDAY);
if (isWorkingDay) { if (isWorkingDay) {
final HtmlColor back = colorDays.get(day);
if (back != null) {
ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(back))
.apply(new UTranslate(x1 + 1, Y_WEEKDAY)).draw(rect);
}
drawCenter(ug.apply(new UTranslate(0, Y_NUMDAY)), num, x1, x2); drawCenter(ug.apply(new UTranslate(0, Y_NUMDAY)), num, x1, x2);
drawCenter(ug.apply(new UTranslate(0, Y_WEEKDAY)), weekDay, x1, x2); drawCenter(ug.apply(new UTranslate(0, Y_WEEKDAY)), weekDay, x1, x2);
} else { } else {
final URectangle rect = new URectangle(x2 - x1 - 1, yTotal - Y_WEEKDAY);
ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(veryLightGray)) ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(veryLightGray))
.apply(new UTranslate(x1 + 1, Y_WEEKDAY)).draw(rect); .apply(new UTranslate(x1 + 1, Y_WEEKDAY)).draw(rect);
} }
if (lastMonth != day.getMonth()) { if (lastMonth != day.getMonth()) {
final int delta = 5; final int delta = 5;
if (lastMonth != null) { if (lastMonth != null) {
final TextBlock lastMonthBlock = getTextBlock(lastMonth.name(), 12); final TextBlock lastMonthBlock = getTextBlock(lastMonth.name(), 12, true);
lastMonthBlock.drawU(ug.apply(new UTranslate(x1 lastMonthBlock.drawU(ug.apply(new UTranslate(x1
- lastMonthBlock.calculateDimension(ug.getStringBounder()).getWidth() - delta, 0))); - lastMonthBlock.calculateDimension(ug.getStringBounder()).getWidth() - delta, 0)));
} }
final TextBlock month = getTextBlock(day.getMonth().name(), 12); final TextBlock month = getTextBlock(day.getMonth().name(), 12, true);
month.drawU(ug.apply(new UTranslate(x1 + delta, 0))); month.drawU(ug.apply(new UTranslate(x1 + delta, 0)));
ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(x1, 0)) ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(x1, 0))
.draw(new ULine(0, Y_WEEKDAY)); .draw(new ULine(0, Y_WEEKDAY));
@ -269,10 +282,29 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
} }
ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(x1, Y_WEEKDAY)).draw(vbar); ug.apply(new UChangeColor(HtmlColorUtils.LIGHT_GRAY)).apply(new UTranslate(x1, Y_WEEKDAY)).draw(vbar);
} }
if (nameDays.size() > 0) {
String last = null;
for (Instant i = min; i.compareTo(max2.increment()) <= 0; i = i.increment()) {
final DayAsDate day = calendarAll.toDayAsDate((InstantDay) i);
final String name = nameDays.get(day);
if (name != null && name.equals(last) == false) {
final double x1 = timeScale.getStartingPosition(i);
final double x2 = timeScale.getEndingPosition(i);
final TextBlock label = getTextBlock(name, 12, false);
final double h = label.calculateDimension(ug.getStringBounder()).getHeight();
double y1 = getTimeHeaderHeight();
double y2 = getHeaderHeight();
label.drawU(ug.apply(new UTranslate(x1, Y_NUMDAY + 11)));
}
last = name;
}
}
} }
private TextBlock getTextBlock(final String text, int size) { private TextBlock getTextBlock(final String text, int size, boolean bold) {
return Display.getWithNewlines(text).create(getFontConfiguration(size), HorizontalAlignment.LEFT, return Display.getWithNewlines(text).create(getFontConfiguration(size, bold), HorizontalAlignment.LEFT,
new SpriteContainerEmpty()); new SpriteContainerEmpty());
} }
@ -288,7 +320,7 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
private void drawSimpleDayCounter(final UGraphic ug, TimeScale timeScale, final double yTotal) { private void drawSimpleDayCounter(final UGraphic ug, TimeScale timeScale, final double yTotal) {
final ULine vbar = new ULine(0, yTotal); final ULine vbar = new ULine(0, yTotal);
for (Instant i = min; i.compareTo(max.increment()) <= 0; i = i.increment()) { for (Instant i = min; i.compareTo(max.increment()) <= 0; i = i.increment()) {
final TextBlock num = Display.getWithNewlines(i.toShortString()).create(getFontConfiguration(10), final TextBlock num = Display.getWithNewlines(i.toShortString()).create(getFontConfiguration(10, false),
HorizontalAlignment.LEFT, new SpriteContainerEmpty()); HorizontalAlignment.LEFT, new SpriteContainerEmpty());
final double x1 = timeScale.getStartingPosition(i); final double x1 = timeScale.getStartingPosition(i);
final double x2 = timeScale.getEndingPosition(i); final double x2 = timeScale.getEndingPosition(i);
@ -353,9 +385,9 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
} }
} }
private FontConfiguration getFontConfiguration(int size) { private FontConfiguration getFontConfiguration(int size, boolean bold) {
UFont font = UFont.serif(size); UFont font = UFont.serif(size);
if (size > 10) { if (bold) {
font = font.bold(); font = font.bold();
} }
return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false); return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
@ -456,6 +488,9 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
} }
public DayAsDate getStartingDate() { public DayAsDate getStartingDate() {
if (this.calendar == null) {
return null;
}
return this.calendar.getStartingDate(); return this.calendar.getStartingDate();
} }
@ -471,6 +506,10 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
return calendar.fromDayAsDate(day); return calendar.fromDayAsDate(day);
} }
public boolean isOpen(DayAsDate day) {
return getDefaultPlan().getLoadAt(convert(day)) > 0;
}
private final Map<String, Resource> resources = new LinkedHashMap<String, Resource>(); private final Map<String, Resource> resources = new LinkedHashMap<String, Resource>();
public void affectResource(Task result, String resourceName) { public void affectResource(Task result, String resourceName) {
@ -499,4 +538,15 @@ public class GanttDiagram extends AbstractPSystem implements Subject {
return result; return result;
} }
private final Map<DayAsDate, HtmlColor> colorDays = new HashMap<DayAsDate, HtmlColor>();
private final Map<DayAsDate, String> nameDays = new HashMap<DayAsDate, String>();
public void colorDay(DayAsDate day, HtmlColor color) {
colorDays.put(day, color);
}
public void nameDay(DayAsDate day, String name) {
nameDays.put(day, name);
}
} }

View File

@ -72,13 +72,15 @@ public class NaturalCommand extends SingleLineCommand2<GanttDiagram> {
} }
public static Command create(SubjectPattern subject, VerbPattern verb, ComplementPattern complement) { public static Command create(SubjectPattern subject, VerbPattern verb, ComplementPattern complement) {
return new NaturalCommand(new RegexConcat(// final RegexConcat pattern = new RegexConcat(//
new RegexLeaf("^"), // new RegexLeaf("^"), //
subject.toRegex(), // subject.toRegex(), //
new RegexLeaf("[%s]+"), // new RegexLeaf("[%s]+"), //
verb.toRegex(), // verb.toRegex(), //
new RegexLeaf("[%s]+"), // new RegexLeaf("[%s]+"), //
complement.toRegex("0"), // complement.toRegex("0"), //
new RegexLeaf("$")), subject, verb, complement); new RegexLeaf("$"));
// System.err.println("NaturalCommand="+pattern.getPattern());
return new NaturalCommand(pattern, subject, verb, complement);
} }
} }

View File

@ -46,7 +46,7 @@ import net.sourceforge.plantuml.command.regex.RegexResult;
public class SubjectDayAsDate implements SubjectPattern { public class SubjectDayAsDate implements SubjectPattern {
public Collection<VerbPattern> getVerbs() { public Collection<VerbPattern> getVerbs() {
return Arrays.<VerbPattern> asList(new VerbIs()); return Arrays.<VerbPattern> asList(new VerbIsOrAre());
} }
public IRegex toRegex() { public IRegex toRegex() {

View File

@ -41,15 +41,21 @@ import java.util.Collection;
import net.sourceforge.plantuml.command.regex.IRegex; import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf; 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.command.regex.RegexResult;
public class SubjectDaysAsDates implements SubjectPattern { public class SubjectDaysAsDates implements SubjectPattern {
public Collection<VerbPattern> getVerbs() { public Collection<VerbPattern> getVerbs() {
return Arrays.<VerbPattern> asList(new VerbIs()); return Arrays.<VerbPattern> asList(new VerbIsOrAre(), new VerbIsOrAreNamed());
} }
public IRegex toRegex() { public IRegex toRegex() {
return new RegexOr(regexTo(), regexAnd());
}
private IRegex regexTo() {
return new RegexConcat( // return new RegexConcat( //
new RegexLeaf("YEAR1", "([\\d]{4})"), // new RegexLeaf("YEAR1", "([\\d]{4})"), //
new RegexLeaf("\\D"), // new RegexLeaf("\\D"), //
@ -62,14 +68,33 @@ public class SubjectDaysAsDates implements SubjectPattern {
new RegexLeaf("MONTH2", "([\\d]{1,2})"), // new RegexLeaf("MONTH2", "([\\d]{1,2})"), //
new RegexLeaf("\\D"), // new RegexLeaf("\\D"), //
new RegexLeaf("DAY2", "([\\d]{1,2})") // new RegexLeaf("DAY2", "([\\d]{1,2})") //
);
}
private IRegex regexAnd() {
return new RegexConcat( //
new RegexLeaf("YEAR3", "([\\d]{4})"), //
new RegexLeaf("\\D"), //
new RegexLeaf("MONTH3", "([\\d]{1,2})"), //
new RegexLeaf("\\D"), //
new RegexLeaf("DAY3", "([\\d]{1,2})"), //
new RegexLeaf("[%s]+and[%s]+"), //
new RegexLeaf("COUNT", "([\\d]+)"), //
new RegexLeaf("[%s]+days?") //
); );
} }
public Subject getSubject(GanttDiagram project, RegexResult arg) { public Subject getSubject(GanttDiagram project, RegexResult arg) {
final DayAsDate date1 = getDate(arg, "1"); final String count = arg.get("COUNT", 0);
final DayAsDate date2 = getDate(arg, "2"); if (count == null) {
return new DaysAsDates(date1, date2); final DayAsDate date1 = getDate(arg, "1");
final DayAsDate date2 = getDate(arg, "2");
return new DaysAsDates(date1, date2);
}
final DayAsDate date3 = getDate(arg, "3");
final int nb = Integer.parseInt(count);
return new DaysAsDates(project, date3, nb);
} }
private DayAsDate getDate(RegexResult arg, String suffix) { private DayAsDate getDate(RegexResult arg, String suffix) {

View File

@ -46,20 +46,29 @@ import net.sourceforge.plantuml.command.regex.RegexResult;
public class VerbHappens implements VerbPattern { public class VerbHappens implements VerbPattern {
public Collection<ComplementPattern> getComplements() { public Collection<ComplementPattern> getComplements() {
return Arrays.<ComplementPattern> asList(new ComplementBeforeOrAfterOrAtTaskStartOrEnd()); return Arrays.<ComplementPattern> asList(new ComplementBeforeOrAfterOrAtTaskStartOrEnd(), new ComplementDate());
} }
public IRegex toRegex() { public IRegex toRegex() {
return new RegexLeaf("happens"); return new RegexLeaf("happens[%s]*(at[%s]*|the[%s]*|on[%s]*)*");
} }
public Verb getVerb(GanttDiagram project, RegexResult arg) { public Verb getVerb(final GanttDiagram project, RegexResult arg) {
return new Verb() { return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) { public CommandExecutionResult execute(Subject subject, Complement complement) {
final Task task = (Task) subject; final Task task = (Task) subject;
final TaskInstant when = (TaskInstant) complement;
task.setLoad(LoadInDays.inDay(1)); task.setLoad(LoadInDays.inDay(1));
task.setStart(when.getInstantTheorical()); if (complement instanceof DayAsDate) {
final DayAsDate start = (DayAsDate) complement;
final DayAsDate startingDate = project.getStartingDate();
if (startingDate == null) {
return CommandExecutionResult.error("No starting date for the project");
}
task.setStart(start.asInstantDay(startingDate));
} else {
final TaskInstant when = (TaskInstant) complement;
task.setStart(when.getInstantTheorical());
}
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -0,0 +1,96 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.project3;
import java.util.Arrays;
import java.util.Collection;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.graphic.HtmlColor;
public class VerbIsOrAre implements VerbPattern {
public Collection<ComplementPattern> getComplements() {
return Arrays.<ComplementPattern> asList(new ComplementClose(), new ComplementInColors2());
}
public IRegex toRegex() {
return new RegexLeaf("(is|are)");
}
public Verb getVerb(final GanttDiagram project, final RegexResult arg) {
return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) {
if (complement instanceof ComplementColors) {
final HtmlColor color = ((ComplementColors) complement).getCenter();
return manageColor(project, subject, color);
}
return manageClose(project, subject);
}
};
}
private CommandExecutionResult manageColor(final GanttDiagram project, Subject subject, HtmlColor color) {
if (subject instanceof DayAsDate) {
final DayAsDate day = (DayAsDate) subject;
project.colorDay(day, color);
}
if (subject instanceof DaysAsDates) {
final DaysAsDates days = (DaysAsDates) subject;
for (DayAsDate d : days) {
project.colorDay(d, color);
}
}
return CommandExecutionResult.ok();
}
private CommandExecutionResult manageClose(final GanttDiagram project, Subject subject) {
if (subject instanceof DayAsDate) {
final DayAsDate day = (DayAsDate) subject;
project.closeDayAsDate(day);
}
if (subject instanceof DaysAsDates) {
final DaysAsDates days = (DaysAsDates) subject;
for (DayAsDate d : days) {
project.closeDayAsDate(d);
}
}
return CommandExecutionResult.ok();
}
}

View File

@ -43,31 +43,28 @@ import net.sourceforge.plantuml.command.regex.IRegex;
import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.command.regex.RegexResult;
public class VerbIs implements VerbPattern { public class VerbIsOrAreNamed implements VerbPattern {
public Collection<ComplementPattern> getComplements() { public Collection<ComplementPattern> getComplements() {
return Arrays.<ComplementPattern> asList(new ComplementClose()); return Arrays.<ComplementPattern> asList(new ComplementNamed());
} }
public IRegex toRegex() { public IRegex toRegex() {
return new RegexLeaf("is"); return new RegexLeaf("(is|are)[%s]+named");
} }
public Verb getVerb(final GanttDiagram project, RegexResult arg) { public Verb getVerb(final GanttDiagram project, final RegexResult arg) {
return new Verb() { return new Verb() {
public CommandExecutionResult execute(Subject subject, Complement complement) { public CommandExecutionResult execute(Subject subject, Complement complement) {
if (subject instanceof DayAsDate) { final ComplementName named = (ComplementName) complement;
final DayAsDate day = (DayAsDate) subject; final String name = named.getName();
project.closeDayAsDate(day); final DaysAsDates days = (DaysAsDates) subject;
} for (DayAsDate d : days) {
if (subject instanceof DaysAsDates) { project.nameDay(d, name);
final DaysAsDates days = (DaysAsDates) subject;
for (DayAsDate d : days) {
project.closeDayAsDate(d);
}
} }
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }
}; };
} }
} }

View File

@ -50,7 +50,7 @@ public class VerbTaskStartsAbsolute implements VerbPattern {
} }
public IRegex toRegex() { public IRegex toRegex() {
return new RegexLeaf("starts[%s]*(the[%s]*|on[%s]*)*"); return new RegexLeaf("starts[%s]*(the[%s]*|on[%s]*|at[%s]*)*");
} }
public Verb getVerb(final GanttDiagram project, RegexResult arg) { public Verb getVerb(final GanttDiagram project, RegexResult arg) {
@ -58,7 +58,11 @@ public class VerbTaskStartsAbsolute implements VerbPattern {
public CommandExecutionResult execute(Subject subject, Complement complement) { public CommandExecutionResult execute(Subject subject, Complement complement) {
final Task task = (Task) subject; final Task task = (Task) subject;
final DayAsDate start = (DayAsDate) complement; final DayAsDate start = (DayAsDate) complement;
task.setStart(start.asInstantDay(project.getStartingDate())); final DayAsDate startingDate = project.getStartingDate();
if (startingDate == null) {
return CommandExecutionResult.error("No starting date for the project");
}
task.setStart(start.asInstantDay(startingDate));
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -36,10 +36,16 @@
package net.sourceforge.plantuml.salt; package net.sourceforge.plantuml.salt;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.WithSprite;
import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.FactorySpriteCommand;
import net.sourceforge.plantuml.command.regex.Matcher2; import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern; import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2; import net.sourceforge.plantuml.command.regex.Pattern2;
@ -51,6 +57,7 @@ public class DataSourceImpl implements DataSource {
public DataSourceImpl(List<String> data) { public DataSourceImpl(List<String> data) {
final Pattern2 p = MyPattern.cmpile("\\{[-+^#!*/]?"); final Pattern2 p = MyPattern.cmpile("\\{[-+^#!*/]?");
for (String s : data) { for (String s : data) {
final StringTokenizer st = new StringTokenizer(s, "|}", true); final StringTokenizer st = new StringTokenizer(s, "|}", true);
while (st.hasMoreTokens()) { while (st.hasMoreTokens()) {
@ -84,6 +91,7 @@ public class DataSourceImpl implements DataSource {
} }
} }
private void addInternal(String s, Terminator t) { private void addInternal(String s, Terminator t) {
s = StringUtils.trin(s); s = StringUtils.trin(s);
if (s.length() > 0) { if (s.length() > 0) {

View File

@ -64,7 +64,7 @@ public class Dictionary implements SpriteContainer, ISkinSimple {
} }
public Sprite getSprite(String name) { public Sprite getSprite(String name) {
return null; return sprites.get(name);
} }
public String getValue(String key) { public String getValue(String key) {
@ -95,4 +95,11 @@ public class Dictionary implements SpriteContainer, ISkinSimple {
return 96; return 96;
} }
private final Map<String, Sprite> sprites = new HashMap<String, Sprite>();
public void addSprite(String name, Sprite sprite) {
sprites.put(name, sprite);
}
} }

View File

@ -39,26 +39,54 @@ import java.awt.geom.Dimension2D;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.AbstractPSystem; import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileFormatOption; import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagram;
import net.sourceforge.plantuml.WithSprite;
import net.sourceforge.plantuml.api.ImageDataSimple; import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.command.BlocLines;
import net.sourceforge.plantuml.command.Command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.FactorySpriteCommand;
import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.HtmlColorUtils; import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.salt.element.Element; import net.sourceforge.plantuml.salt.element.Element;
import net.sourceforge.plantuml.salt.factory.AbstractElementFactoryComplex;
import net.sourceforge.plantuml.salt.factory.ElementFactory;
import net.sourceforge.plantuml.salt.factory.ElementFactoryBorder;
import net.sourceforge.plantuml.salt.factory.ElementFactoryButton;
import net.sourceforge.plantuml.salt.factory.ElementFactoryCheckboxOff;
import net.sourceforge.plantuml.salt.factory.ElementFactoryCheckboxOn;
import net.sourceforge.plantuml.salt.factory.ElementFactoryDroplist;
import net.sourceforge.plantuml.salt.factory.ElementFactoryImage;
import net.sourceforge.plantuml.salt.factory.ElementFactoryLine;
import net.sourceforge.plantuml.salt.factory.ElementFactoryMenu;
import net.sourceforge.plantuml.salt.factory.ElementFactoryPyramid;
import net.sourceforge.plantuml.salt.factory.ElementFactoryRadioOff;
import net.sourceforge.plantuml.salt.factory.ElementFactoryRadioOn;
import net.sourceforge.plantuml.salt.factory.ElementFactoryRetrieveFromDictonnary;
import net.sourceforge.plantuml.salt.factory.ElementFactoryTab;
import net.sourceforge.plantuml.salt.factory.ElementFactoryText;
import net.sourceforge.plantuml.salt.factory.ElementFactoryTextField;
import net.sourceforge.plantuml.salt.factory.ElementFactoryTree;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.UChangeColor; import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
public class PSystemSalt extends AbstractPSystem { public class PSystemSalt extends AbstractPSystem implements WithSprite {
private final List<String> data; private final List<String> data;
private final Dictionary dictionary = new Dictionary();
@Deprecated @Deprecated
public PSystemSalt(List<String> data) { public PSystemSalt(List<String> data) {
@ -77,7 +105,7 @@ public class PSystemSalt extends AbstractPSystem {
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException { throws IOException {
try { try {
final Element salt = SaltUtils.createElement(data); final Element salt = createElement(manageSprite());
final Dimension2D size = salt.getPreferredDimension(fileFormat.getDefaultStringBounder(), 0, 0); final Dimension2D size = salt.getPreferredDimension(fileFormat.getDefaultStringBounder(), 0, 0);
final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE, null, final ImageBuilder builder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE, null,
@ -102,4 +130,83 @@ public class PSystemSalt extends AbstractPSystem {
return new DiagramDescription("(Salt)"); return new DiagramDescription("(Salt)");
} }
public void addSprite(String name, Sprite sprite) {
dictionary.addSprite(name, sprite);
}
private List<String> manageSprite() {
final FactorySpriteCommand factorySpriteCommand = new FactorySpriteCommand();
Command<WithSprite> cmd = factorySpriteCommand.createMultiLine(false);
final List<String> result = new ArrayList<String>();
for (Iterator<String> it = data.iterator(); it.hasNext();) {
String s = it.next();
if (s.equals("hide stereotype")) {
// System.err.println("skipping " + s);
} else if (s.startsWith("skinparam ")) {
// System.err.println("skipping " + s);
} else if (s.startsWith("sprite $")) {
BlocLines bloc = BlocLines.single(s);
do {
s = it.next();
bloc = bloc.add2(s);
} while (s.equals("}") == false);
final CommandExecutionResult cmdResult = cmd.execute(this, bloc);
} else {
result.add(s);
}
}
return result;
}
private Element createElement(List<String> data) {
final DataSourceImpl source = new DataSourceImpl(data);
final Collection<AbstractElementFactoryComplex> cpx = new ArrayList<AbstractElementFactoryComplex>();
// cpx.add(new ElementFactorySimpleFrame(source, dictionnary));
cpx.add(new ElementFactoryPyramid(source, dictionary));
cpx.add(new ElementFactoryBorder(source, dictionary));
for (AbstractElementFactoryComplex f : cpx) {
addSimpleFactory(f, source, dictionary);
}
for (AbstractElementFactoryComplex f1 : cpx) {
for (AbstractElementFactoryComplex f2 : cpx) {
f1.addFactory(f2);
}
}
for (ElementFactory f : cpx) {
if (f.ready()) {
Log.info("Using " + f);
return f.create().getElement();
}
}
Log.println("data=" + data);
throw new IllegalArgumentException();
}
private static void addSimpleFactory(final AbstractElementFactoryComplex cpxFactory, final DataSource source,
Dictionary dictionary) {
cpxFactory.addFactory(new ElementFactoryMenu(source, dictionary));
cpxFactory.addFactory(new ElementFactoryTree(source, dictionary));
cpxFactory.addFactory(new ElementFactoryTab(source, dictionary));
cpxFactory.addFactory(new ElementFactoryLine(source));
cpxFactory.addFactory(new ElementFactoryTextField(source, dictionary));
cpxFactory.addFactory(new ElementFactoryButton(source, dictionary));
cpxFactory.addFactory(new ElementFactoryDroplist(source, dictionary));
cpxFactory.addFactory(new ElementFactoryRadioOn(source, dictionary));
cpxFactory.addFactory(new ElementFactoryRadioOff(source, dictionary));
cpxFactory.addFactory(new ElementFactoryCheckboxOn(source, dictionary));
cpxFactory.addFactory(new ElementFactoryCheckboxOff(source, dictionary));
cpxFactory.addFactory(new ElementFactoryImage(source, dictionary));
cpxFactory.addFactory(new ElementFactoryRetrieveFromDictonnary(source, dictionary));
cpxFactory.addFactory(new ElementFactoryText(source, dictionary));
}
} }

View File

@ -1,115 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.salt;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import net.sourceforge.plantuml.Log;
import net.sourceforge.plantuml.salt.element.Element;
import net.sourceforge.plantuml.salt.factory.AbstractElementFactoryComplex;
import net.sourceforge.plantuml.salt.factory.ElementFactory;
import net.sourceforge.plantuml.salt.factory.ElementFactoryBorder;
import net.sourceforge.plantuml.salt.factory.ElementFactoryButton;
import net.sourceforge.plantuml.salt.factory.ElementFactoryCheckboxOff;
import net.sourceforge.plantuml.salt.factory.ElementFactoryCheckboxOn;
import net.sourceforge.plantuml.salt.factory.ElementFactoryDroplist;
import net.sourceforge.plantuml.salt.factory.ElementFactoryImage;
import net.sourceforge.plantuml.salt.factory.ElementFactoryLine;
import net.sourceforge.plantuml.salt.factory.ElementFactoryMenu;
import net.sourceforge.plantuml.salt.factory.ElementFactoryPyramid;
import net.sourceforge.plantuml.salt.factory.ElementFactoryRadioOff;
import net.sourceforge.plantuml.salt.factory.ElementFactoryRadioOn;
import net.sourceforge.plantuml.salt.factory.ElementFactoryRetrieveFromDictonnary;
import net.sourceforge.plantuml.salt.factory.ElementFactoryTab;
import net.sourceforge.plantuml.salt.factory.ElementFactoryText;
import net.sourceforge.plantuml.salt.factory.ElementFactoryTextField;
import net.sourceforge.plantuml.salt.factory.ElementFactoryTree;
public class SaltUtils {
public static Element createElement(List<String> data) {
final DataSourceImpl source = new DataSourceImpl(data);
final Collection<AbstractElementFactoryComplex> cpx = new ArrayList<AbstractElementFactoryComplex>();
final Dictionary dictionary = new Dictionary();
// cpx.add(new ElementFactorySimpleFrame(source, dictionnary));
cpx.add(new ElementFactoryPyramid(source, dictionary));
cpx.add(new ElementFactoryBorder(source, dictionary));
for (AbstractElementFactoryComplex f : cpx) {
addSimpleFactory(f, source, dictionary);
}
for (AbstractElementFactoryComplex f1 : cpx) {
for (AbstractElementFactoryComplex f2 : cpx) {
f1.addFactory(f2);
}
}
for (ElementFactory f : cpx) {
if (f.ready()) {
Log.info("Using " + f);
return f.create().getElement();
}
}
Log.println("data=" + data);
throw new IllegalArgumentException();
}
private static void addSimpleFactory(final AbstractElementFactoryComplex cpxFactory, final DataSource source,
Dictionary dictionary) {
cpxFactory.addFactory(new ElementFactoryMenu(source, dictionary));
cpxFactory.addFactory(new ElementFactoryTree(source, dictionary));
cpxFactory.addFactory(new ElementFactoryTab(source, dictionary));
cpxFactory.addFactory(new ElementFactoryLine(source));
cpxFactory.addFactory(new ElementFactoryTextField(source, dictionary));
cpxFactory.addFactory(new ElementFactoryButton(source, dictionary));
cpxFactory.addFactory(new ElementFactoryDroplist(source, dictionary));
cpxFactory.addFactory(new ElementFactoryRadioOn(source, dictionary));
cpxFactory.addFactory(new ElementFactoryRadioOff(source, dictionary));
cpxFactory.addFactory(new ElementFactoryCheckboxOn(source, dictionary));
cpxFactory.addFactory(new ElementFactoryCheckboxOff(source, dictionary));
cpxFactory.addFactory(new ElementFactoryImage(source, dictionary));
cpxFactory.addFactory(new ElementFactoryRetrieveFromDictonnary(source, dictionary));
cpxFactory.addFactory(new ElementFactoryText(source, dictionary));
}
}

View File

@ -70,8 +70,9 @@ public class ElementButton extends AbstractElementText implements Element {
} }
final Dimension2D dim = getPreferredDimension(ug.getStringBounder(), 0, 0); final Dimension2D dim = getPreferredDimension(ug.getStringBounder(), 0, 0);
ug = ug.apply(new UStroke(stroke)); ug = ug.apply(new UStroke(stroke));
ug.apply(new UChangeBackColor(HtmlColorSet.getInstance().getColorIfValid("#EEEEEE"))).apply(new UTranslate(stroke, stroke)) ug = ug.apply(new UChangeBackColor(HtmlColorSet.getInstance().getColorIfValid("#EEEEEE")));
.draw(new URectangle(dim.getWidth() - 2 * stroke, dim.getHeight() - 2 * stroke, 10, 10)); ug.apply(new UTranslate(stroke, stroke)).draw(
new URectangle(dim.getWidth() - 2 * stroke, dim.getHeight() - 2 * stroke, 10, 10));
final Dimension2D dimPureText = getPureTextDimension(ug.getStringBounder()); final Dimension2D dimPureText = getPureTextDimension(ug.getStringBounder());
drawText(ug, (dim.getWidth() - dimPureText.getWidth()) / 2, stroke + marginY); drawText(ug, (dim.getWidth() - dimPureText.getWidth()) / 2, stroke + marginY);
} }

View File

@ -55,7 +55,7 @@ public abstract class AbstractMessage implements EventWithDeactivate {
private final String messageNumber; private final String messageNumber;
private boolean parallel = false; private boolean parallel = false;
private List<NoteOnMessage> noteOnMessages = new ArrayList<NoteOnMessage>(); private List<Note> noteOnMessages = new ArrayList<Note>();
public AbstractMessage(Display label, ArrowConfiguration arrowConfiguration, String messageNumber) { public AbstractMessage(Display label, ArrowConfiguration arrowConfiguration, String messageNumber) {
this.url = null; this.url = null;
@ -63,7 +63,7 @@ public abstract class AbstractMessage implements EventWithDeactivate {
this.arrowConfiguration = arrowConfiguration; this.arrowConfiguration = arrowConfiguration;
this.messageNumber = messageNumber; this.messageNumber = messageNumber;
} }
public final void setUrl(Url url) { public final void setUrl(Url url) {
this.url = url; this.url = url;
} }
@ -78,9 +78,9 @@ public abstract class AbstractMessage implements EventWithDeactivate {
final public Url getUrl() { final public Url getUrl() {
if (url == null) { if (url == null) {
for (NoteOnMessage n : noteOnMessages) { for (Note n : noteOnMessages) {
if (n.getUrlNote() != null) { if (n.getUrl() != null) {
return n.getUrlNote(); return n.getUrl();
} }
} }
} }
@ -88,7 +88,7 @@ public abstract class AbstractMessage implements EventWithDeactivate {
} }
public boolean hasUrl() { public boolean hasUrl() {
for (NoteOnMessage n : noteOnMessages) { for (Note n : noteOnMessages) {
if (n.hasUrl()) { if (n.hasUrl()) {
return true; return true;
} }
@ -159,16 +159,16 @@ public abstract class AbstractMessage implements EventWithDeactivate {
return arrowConfiguration; return arrowConfiguration;
} }
public final List<NoteOnMessage> getNoteOnMessages() { public final List<Note> getNoteOnMessages() {
return noteOnMessages; return noteOnMessages;
} }
public final void setNote(Display strings, NotePosition notePosition, NoteStyle noteStyle, String backcolor, Url url) { public final void setNote(Note note) {
if (notePosition != NotePosition.LEFT && notePosition != NotePosition.RIGHT) { if (note.getPosition() != NotePosition.LEFT && note.getPosition() != NotePosition.RIGHT) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
this.noteOnMessages note = note.withPosition(overideNotePosition(note.getPosition()));
.add(new NoteOnMessage(strings, overideNotePosition(notePosition), noteStyle, backcolor, url)); this.noteOnMessages.add(note);
} }
protected NotePosition overideNotePosition(NotePosition notePosition) { protected NotePosition overideNotePosition(NotePosition notePosition) {

View File

@ -40,6 +40,7 @@ import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.PaddingParam;
import net.sourceforge.plantuml.SkinParamBackcolored; import net.sourceforge.plantuml.SkinParamBackcolored;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real; import net.sourceforge.plantuml.real.Real;
@ -212,16 +213,20 @@ public class Englober {
if (titleWidth > actualWidth + 20) { if (titleWidth > actualWidth + 20) {
this.marginX = (titleWidth - actualWidth - 20) / 2; this.marginX = (titleWidth - actualWidth - 20) / 2;
} }
getX1().ensureBiggerThan(getPosAA().addFixed(10)); getX1().ensureBiggerThan(getPosAA().addFixed(10 + padding()));
final Real posZZ = getPosZZ(); final Real posZZ = getPosZZ();
final Real limit = getX2().addFixed(10); final Real limit = getX2().addFixed(10 + padding());
if (posZZ != null) { if (posZZ != null) {
posZZ.ensureBiggerThan(limit); posZZ.ensureBiggerThan(limit);
} }
} }
private double padding() {
return tileArguments.getSkinParam().getPadding(PaddingParam.BOX);
}
public void addConstraintAfter(Englober current) { public void addConstraintAfter(Englober current) {
current.getX1().ensureBiggerThan(getX2().addFixed(10)); current.getX1().ensureBiggerThan(getX2().addFixed(10 + 2 * padding()));
} }
public Real getMinX(StringBounder stringBounder) { public Real getMinX(StringBounder stringBounder) {

View File

@ -39,7 +39,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor; import net.sourceforge.plantuml.graphic.HtmlColor;
final public class GroupingLeaf extends Grouping implements EventWithDeactivate { final public class GroupingLeaf extends Grouping implements EventWithDeactivate {
@ -118,18 +117,17 @@ final public class GroupingLeaf extends Grouping implements EventWithDeactivate
return true; return true;
} }
private List<NoteOnMessage> noteOnMessages = new ArrayList<NoteOnMessage>(); private List<Note> noteOnMessages = new ArrayList<Note>();
public final void setNote(Display strings, NotePosition notePosition, NoteStyle noteStyle, String backcolor, Url url) { public final void setNote(Note note) {
if (notePosition != NotePosition.LEFT && notePosition != NotePosition.RIGHT) { if (note.getPosition() != NotePosition.LEFT && note.getPosition() != NotePosition.RIGHT) {
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
this.noteOnMessages.add(new NoteOnMessage(strings, notePosition, noteStyle, backcolor, url)); this.noteOnMessages.add(note);
} }
public final List<NoteOnMessage> getNoteOnMessages() { public final List<Note> getNoteOnMessages() {
return noteOnMessages; return noteOnMessages;
} }
} }

View File

@ -48,6 +48,7 @@ public class GroupingStart extends Grouping {
private final HtmlColor backColorGeneral; private final HtmlColor backColorGeneral;
final private GroupingStart parent; final private GroupingStart parent;
private boolean parallel = false;
public GroupingStart(String title, String comment, HtmlColor backColorGeneral, HtmlColor backColorElement, public GroupingStart(String title, String comment, HtmlColor backColorGeneral, HtmlColor backColorElement,
GroupingStart parent) { GroupingStart parent) {
@ -83,15 +84,18 @@ public class GroupingStart extends Grouping {
public Url getUrl() { public Url getUrl() {
return null; return null;
} }
public boolean hasUrl() { public boolean hasUrl() {
return false; return false;
} }
@Override @Override
public boolean isParallel() { public boolean isParallel() {
return getTitle().equals("par2"); return parallel || getTitle().equals("par2");
}
public void goParallel() {
this.parallel = true;
} }
} }

View File

@ -39,7 +39,6 @@ import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SpecificBackcolorable; import net.sourceforge.plantuml.SpecificBackcolorable;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.color.Colors; import net.sourceforge.plantuml.graphic.color.Colors;
public class Note extends AbstractEvent implements Event, SpecificBackcolorable { public class Note extends AbstractEvent implements Event, SpecificBackcolorable {
@ -51,8 +50,7 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
private final NotePosition position; private final NotePosition position;
private NoteStyle style = NoteStyle.NORMAL; private NoteStyle style = NoteStyle.NORMAL;
private Colors colors = Colors.empty();
// private Stereotype stereotype;
private Url url; private Url url;
@ -60,6 +58,11 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
this(p, null, position, strings); this(p, null, position, strings);
} }
public Note(Display strings, NotePosition position, NoteStyle style) {
this(null, null, position, strings);
this.style = style;
}
public Note(Participant p, Participant p2, Display strings) { public Note(Participant p, Participant p2, Display strings) {
this(p, p2, NotePosition.OVER_SEVERAL, strings); this(p, p2, NotePosition.OVER_SEVERAL, strings);
} }
@ -71,6 +74,17 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
this.strings = strings; this.strings = strings;
} }
public Note withPosition(NotePosition newPosition) {
if (position == newPosition) {
return this;
}
final Note result = new Note(p, p2, newPosition, strings);
result.style = this.style;
result.url = this.url;
result.colors = this.colors;
return result;
}
public Participant getParticipant() { public Participant getParticipant() {
return p; return p;
} }
@ -91,14 +105,6 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
return colors; return colors;
} }
// public void setSpecificColorTOBEREMOVED(ColorType type, HtmlColor color) {
// if (color != null) {
// this.colors = colors.add(type, color);
// }
// }
private Colors colors = Colors.empty();
public void setColors(Colors colors) { public void setColors(Colors colors) {
this.colors = colors; this.colors = colors;
} }
@ -124,14 +130,9 @@ public class Note extends AbstractEvent implements Event, SpecificBackcolorable
} }
public ISkinParam getSkinParamBackcolored(ISkinParam skinParam) { public ISkinParam getSkinParamBackcolored(ISkinParam skinParam) {
// return new SkinParamBackcolored(skinParam, getColors(skinParam).getColor(ColorType.BACK));
return colors.mute(skinParam); return colors.mute(skinParam);
} }
public void setStereotype(Stereotype stereotype) {
// this.stereotype = stereotype;
}
@Override @Override
public String toString() { public String toString() {
return super.toString() + " " + strings; return super.toString() + " " + strings;

View File

@ -1,95 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of PlantUML.
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
* License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.sequencediagram;
import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.SkinParamBackcolored;
import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorSet;
public class NoteOnMessage {
private final Display notes;
private final NotePosition notePosition;
private final NoteStyle noteStyle;
private final HtmlColor noteBackColor;
private final Url urlNote;
public NoteOnMessage(Display strings, NotePosition notePosition, NoteStyle noteStyle, String backcolor, Url url) {
if (notePosition != NotePosition.LEFT && notePosition != NotePosition.RIGHT) {
throw new IllegalArgumentException();
}
this.noteStyle = noteStyle;
this.notes = strings;
this.urlNote = url;
this.notePosition = notePosition;
this.noteBackColor = HtmlColorSet.getInstance().getColorIfValid(backcolor);
}
public SkinParamBackcolored getSkinParamNoteBackcolored(ISkinParam skinParam) {
return new SkinParamBackcolored(skinParam, noteBackColor);
}
public boolean hasUrl() {
if (notes != null && notes.hasUrl()) {
return true;
}
// if (label != null && label.hasUrl()) {
// return true;
// }
// return getUrl() != null;
return urlNote != null;
}
public Display getDisplay() {
return notes;
}
public NotePosition getNotePosition() {
return notePosition;
}
public NoteStyle getNoteStyle() {
return noteStyle;
}
public Url getUrlNote() {
return urlNote;
}
}

View File

@ -300,7 +300,7 @@ public class SequenceDiagram extends UmlDiagram {
private final List<GroupingStart> openGroupings = new ArrayList<GroupingStart>(); private final List<GroupingStart> openGroupings = new ArrayList<GroupingStart>();
public boolean grouping(String title, String comment, GroupingType type, HtmlColor backColorGeneral, public boolean grouping(String title, String comment, GroupingType type, HtmlColor backColorGeneral,
HtmlColor backColorElement) { HtmlColor backColorElement, boolean parallel) {
if (type != GroupingType.START && openGroupings.size() == 0) { if (type != GroupingType.START && openGroupings.size() == 0) {
return false; return false;
} }
@ -316,6 +316,9 @@ public class SequenceDiagram extends UmlDiagram {
events.add(g); events.add(g);
if (type == GroupingType.START) { if (type == GroupingType.START) {
if (parallel) {
((GroupingStart) g).goParallel();
}
openGroupings.add(0, (GroupingStart) g); openGroupings.add(0, (GroupingStart) g);
} else if (type == GroupingType.END) { } else if (type == GroupingType.END) {
openGroupings.remove(0); openGroupings.remove(0);

View File

@ -57,6 +57,7 @@ public class CommandGrouping extends SingleLineCommand2<SequenceDiagram> {
static RegexConcat getRegexConcat() { static RegexConcat getRegexConcat() {
return new RegexConcat(// return new RegexConcat(//
new RegexLeaf("^"), // new RegexLeaf("^"), //
new RegexLeaf("PARALLEL", "(&%s*)?"), //
new RegexLeaf("TYPE", "(opt|alt|loop|par|par2|break|critical|else|end|also|group)"), // new RegexLeaf("TYPE", "(opt|alt|loop|par|par2|break|critical|else|end|also|group)"), //
new RegexLeaf("COLORS", "((?<!else)(?<!also)(?<!end)#\\w+)?(?:[%s]+(#\\w+))?"), // new RegexLeaf("COLORS", "((?<!else)(?<!also)(?<!end)#\\w+)?(?:[%s]+(#\\w+))?"), //
new RegexLeaf("COMMENT", "(?:[%s]+(.*?))?"), // new RegexLeaf("COMMENT", "(?:[%s]+(.*?))?"), //
@ -84,7 +85,9 @@ public class CommandGrouping extends SingleLineCommand2<SequenceDiagram> {
} }
} }
} }
final boolean result = diagram.grouping(type, comment, groupingType, backColorGeneral, backColorElement);
final boolean parallel = arg.get("PARALLEL", 0) != null;
final boolean result = diagram.grouping(type, comment, groupingType, backColorGeneral, backColorElement, parallel);
if (result == false) { if (result == false) {
return CommandExecutionResult.error("Cannot create group"); return CommandExecutionResult.error("Cannot create group");
} }

View File

@ -62,7 +62,6 @@ import net.sourceforge.plantuml.sequencediagram.Message;
import net.sourceforge.plantuml.sequencediagram.MessageExo; import net.sourceforge.plantuml.sequencediagram.MessageExo;
import net.sourceforge.plantuml.sequencediagram.Newpage; import net.sourceforge.plantuml.sequencediagram.Newpage;
import net.sourceforge.plantuml.sequencediagram.Note; import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NoteOnMessage;
import net.sourceforge.plantuml.sequencediagram.Notes; import net.sourceforge.plantuml.sequencediagram.Notes;
import net.sourceforge.plantuml.sequencediagram.Participant; import net.sourceforge.plantuml.sequencediagram.Participant;
import net.sourceforge.plantuml.sequencediagram.ParticipantEnglober; import net.sourceforge.plantuml.sequencediagram.ParticipantEnglober;
@ -409,10 +408,10 @@ class DrawableSetInitializer {
inGroupableStack.addElement((GroupingGraphicalElementElse) element); inGroupableStack.addElement((GroupingGraphicalElementElse) element);
} else if (m.getType() == GroupingType.END) { } else if (m.getType() == GroupingType.END) {
final List<Component> notes = new ArrayList<Component>(); final List<Component> notes = new ArrayList<Component>();
for (NoteOnMessage noteOnMessage : m.getNoteOnMessages()) { for (Note noteOnMessage : m.getNoteOnMessages()) {
final ISkinParam sk = noteOnMessage.getSkinParamNoteBackcolored(drawableSet.getSkinParam()); final ISkinParam sk = noteOnMessage.getSkinParamBackcolored(drawableSet.getSkinParam());
final Component note = drawableSet.getSkin().createComponent( final Component note = drawableSet.getSkin().createComponent(
noteOnMessage.getNoteStyle().getNoteComponentType(), null, sk, noteOnMessage.getDisplay()); noteOnMessage.getStyle().getNoteComponentType(), null, sk, noteOnMessage.getStrings());
notes.add(note); notes.add(note);
} }
if (m.isParallel()) { if (m.isParallel()) {

View File

@ -40,7 +40,7 @@ import java.util.List;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage; import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.NoteOnMessage; import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.ArrowConfiguration; import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Component;
@ -116,12 +116,12 @@ abstract class Step1Abstract {
} }
protected final NoteBox createNoteBox(StringBounder stringBounder, Arrow arrow, Component noteComp, protected final NoteBox createNoteBox(StringBounder stringBounder, Arrow arrow, Component noteComp,
NoteOnMessage noteOnMessage) { Note noteOnMessage) {
final LivingParticipantBox p = arrow.getParticipantAt(stringBounder, noteOnMessage.getNotePosition()); final LivingParticipantBox p = arrow.getParticipantAt(stringBounder, noteOnMessage.getPosition());
final NoteBox noteBox = new NoteBox(arrow.getStartingY(), noteComp, p, null, noteOnMessage.getNotePosition(), final NoteBox noteBox = new NoteBox(arrow.getStartingY(), noteComp, p, null, noteOnMessage.getPosition(),
noteOnMessage.getUrlNote()); noteOnMessage.getUrl());
if (arrow instanceof MessageSelfArrow && noteOnMessage.getNotePosition() == NotePosition.RIGHT) { if (arrow instanceof MessageSelfArrow && noteOnMessage.getPosition() == NotePosition.RIGHT) {
noteBox.pushToRight(arrow.getPreferredWidth(stringBounder)); noteBox.pushToRight(arrow.getPreferredWidth(stringBounder));
} }
// if (arrow instanceof MessageExoArrow) { // if (arrow instanceof MessageExoArrow) {

View File

@ -45,7 +45,7 @@ import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.sequencediagram.InGroupable; import net.sourceforge.plantuml.sequencediagram.InGroupable;
import net.sourceforge.plantuml.sequencediagram.Message; import net.sourceforge.plantuml.sequencediagram.Message;
import net.sourceforge.plantuml.sequencediagram.NoteOnMessage; import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.skin.ArrowBody; import net.sourceforge.plantuml.skin.ArrowBody;
import net.sourceforge.plantuml.skin.ArrowConfiguration; import net.sourceforge.plantuml.skin.ArrowConfiguration;
@ -78,11 +78,11 @@ class Step1Message extends Step1Abstract {
getLivingParticipantBox1(), getLivingParticipantBox2(), message.getUrl(), compAliveBox); getLivingParticipantBox1(), getLivingParticipantBox2(), message.getUrl(), compAliveBox);
} }
final List<NoteOnMessage> noteOnMessages = message.getNoteOnMessages(); final List<Note> noteOnMessages = message.getNoteOnMessages();
for (NoteOnMessage noteOnMessage : noteOnMessages) { for (Note noteOnMessage : noteOnMessages) {
final ISkinParam skinParam = noteOnMessage.getSkinParamNoteBackcolored(drawingSet.getSkinParam()); final ISkinParam skinParam = noteOnMessage.getSkinParamBackcolored(drawingSet.getSkinParam());
addNote(drawingSet.getSkin().createComponent(noteOnMessage.getNoteStyle().getNoteComponentType(), null, addNote(drawingSet.getSkin().createComponent(noteOnMessage.getStyle().getNoteComponentType(), null,
skinParam, noteOnMessage.getDisplay())); skinParam, noteOnMessage.getStrings()));
} }
} }
@ -172,7 +172,7 @@ class Step1Message extends Step1Abstract {
final List<NoteBox> noteBoxes = new ArrayList<NoteBox>(); final List<NoteBox> noteBoxes = new ArrayList<NoteBox>();
for (int i = 0; i < getNotes().size(); i++) { for (int i = 0; i < getNotes().size(); i++) {
final Component note = getNotes().get(i); final Component note = getNotes().get(i);
final NoteOnMessage noteOnMessage = getMessage().getNoteOnMessages().get(i); final Note noteOnMessage = getMessage().getNoteOnMessages().get(i);
noteBoxes.add(createNoteBox(getStringBounder(), messageSelfArrow, note, noteOnMessage)); noteBoxes.add(createNoteBox(getStringBounder(), messageSelfArrow, note, noteOnMessage));
} }
return new ArrowAndNoteBox(getStringBounder(), messageSelfArrow, noteBoxes); return new ArrowAndNoteBox(getStringBounder(), messageSelfArrow, noteBoxes);
@ -180,7 +180,7 @@ class Step1Message extends Step1Abstract {
final List<NoteBox> noteBoxes = new ArrayList<NoteBox>(); final List<NoteBox> noteBoxes = new ArrayList<NoteBox>();
for (int i = 0; i < getNotes().size(); i++) { for (int i = 0; i < getNotes().size(); i++) {
final Component note = getNotes().get(i); final Component note = getNotes().get(i);
final NoteOnMessage noteOnMessage = getMessage().getNoteOnMessages().get(i); final Note noteOnMessage = getMessage().getNoteOnMessages().get(i);
noteBoxes.add(createNoteBox(getStringBounder(), messageArrow, note, noteOnMessage)); noteBoxes.add(createNoteBox(getStringBounder(), messageArrow, note, noteOnMessage));
} }
return new ArrowAndNoteBox(getStringBounder(), messageArrow, noteBoxes); return new ArrowAndNoteBox(getStringBounder(), messageArrow, noteBoxes);
@ -227,9 +227,9 @@ class Step1Message extends Step1Abstract {
final List<NoteBox> noteBoxes = new ArrayList<NoteBox>(); final List<NoteBox> noteBoxes = new ArrayList<NoteBox>();
for (int i = 0; i < getNotes().size(); i++) { for (int i = 0; i < getNotes().size(); i++) {
final Component note = getNotes().get(i); final Component note = getNotes().get(i);
final NoteOnMessage noteOnMessage = getMessage().getNoteOnMessages().get(i); final Note noteOnMessage = getMessage().getNoteOnMessages().get(i);
final NoteBox noteBox = createNoteBox(getStringBounder(), result, note, noteOnMessage); final NoteBox noteBox = createNoteBox(getStringBounder(), result, note, noteOnMessage);
if (noteOnMessage.getNotePosition() == NotePosition.RIGHT) { if (noteOnMessage.getPosition() == NotePosition.RIGHT) {
noteBox.pushToRight(getParticipantBox2().getPreferredWidth(getStringBounder()) / 2); noteBox.pushToRight(getParticipantBox2().getPreferredWidth(getStringBounder()) / 2);
} }
noteBoxes.add(noteBox); noteBoxes.add(noteBox);

View File

@ -43,7 +43,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.sequencediagram.InGroupable; import net.sourceforge.plantuml.sequencediagram.InGroupable;
import net.sourceforge.plantuml.sequencediagram.MessageExo; import net.sourceforge.plantuml.sequencediagram.MessageExo;
import net.sourceforge.plantuml.sequencediagram.MessageExoType; import net.sourceforge.plantuml.sequencediagram.MessageExoType;
import net.sourceforge.plantuml.sequencediagram.NoteOnMessage; import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.ArrowConfiguration; import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.skin.ComponentType;
@ -63,11 +63,11 @@ class Step1MessageExo extends Step1Abstract {
message.getLabelNumbered()), getLivingParticipantBox(), message.getType(), message.getUrl(), message.getLabelNumbered()), getLivingParticipantBox(), message.getType(), message.getUrl(),
message.isShortArrow(), message.getArrowConfiguration()); message.isShortArrow(), message.getArrowConfiguration());
final List<NoteOnMessage> noteOnMessages = message.getNoteOnMessages(); final List<Note> noteOnMessages = message.getNoteOnMessages();
for (NoteOnMessage noteOnMessage : noteOnMessages) { for (Note noteOnMessage : noteOnMessages) {
final ISkinParam skinParam = noteOnMessage.getSkinParamNoteBackcolored(drawingSet.getSkinParam()); final ISkinParam skinParam = noteOnMessage.getSkinParamBackcolored(drawingSet.getSkinParam());
addNote(drawingSet.getSkin().createComponent(ComponentType.NOTE, null, skinParam, addNote(drawingSet.getSkin().createComponent(ComponentType.NOTE, null, skinParam,
noteOnMessage.getDisplay())); noteOnMessage.getStrings()));
// throw new UnsupportedOperationException(); // throw new UnsupportedOperationException();
} }
@ -121,7 +121,7 @@ class Step1MessageExo extends Step1Abstract {
final List<NoteBox> noteBoxes = new ArrayList<NoteBox>(); final List<NoteBox> noteBoxes = new ArrayList<NoteBox>();
for (int i = 0; i < getNotes().size(); i++) { for (int i = 0; i < getNotes().size(); i++) {
final Component note = getNotes().get(i); final Component note = getNotes().get(i);
final NoteOnMessage noteOnMessage = getMessage().getNoteOnMessages().get(i); final Note noteOnMessage = getMessage().getNoteOnMessages().get(i);
noteBoxes.add(createNoteBox(getStringBounder(), messageArrow, note, noteOnMessage)); noteBoxes.add(createNoteBox(getStringBounder(), messageArrow, note, noteOnMessage));
} }
return new ArrowAndNoteBox(getStringBounder(), messageArrow, noteBoxes); return new ArrowAndNoteBox(getStringBounder(), messageArrow, noteBoxes);

View File

@ -42,7 +42,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real; import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage; import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.Event; import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.NoteOnMessage; import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.skin.ComponentType;
@ -58,14 +58,14 @@ public class CommunicationTileNoteLeft implements TileWithUpdateStairs, TileWith
private final Skin skin; private final Skin skin;
private final ISkinParam skinParam; private final ISkinParam skinParam;
private final LivingSpace livingSpace; private final LivingSpace livingSpace;
private final NoteOnMessage noteOnMessage; private final Note noteOnMessage;
public Event getEvent() { public Event getEvent() {
return message; return message;
} }
public CommunicationTileNoteLeft(TileWithUpdateStairs tile, AbstractMessage message, Skin skin, public CommunicationTileNoteLeft(TileWithUpdateStairs tile, AbstractMessage message, Skin skin,
ISkinParam skinParam, LivingSpace livingSpace, NoteOnMessage noteOnMessage) { ISkinParam skinParam, LivingSpace livingSpace, Note noteOnMessage) {
this.tile = tile; this.tile = tile;
this.message = message; this.message = message;
this.skin = skin; this.skin = skin;
@ -80,7 +80,7 @@ public class CommunicationTileNoteLeft implements TileWithUpdateStairs, TileWith
private Component getComponent(StringBounder stringBounder) { private Component getComponent(StringBounder stringBounder) {
final Component comp = skin.createComponent(ComponentType.NOTE, null, final Component comp = skin.createComponent(ComponentType.NOTE, null,
noteOnMessage.getSkinParamNoteBackcolored(skinParam), noteOnMessage.getDisplay()); noteOnMessage.getSkinParamBackcolored(skinParam), noteOnMessage.getStrings());
return comp; return comp;
} }

View File

@ -42,7 +42,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real; import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.AbstractMessage; import net.sourceforge.plantuml.sequencediagram.AbstractMessage;
import net.sourceforge.plantuml.sequencediagram.Event; import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.NoteOnMessage; import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.skin.ComponentType;
@ -58,7 +58,7 @@ public class CommunicationTileNoteRight implements TileWithUpdateStairs, TileWit
private final Skin skin; private final Skin skin;
private final ISkinParam skinParam; private final ISkinParam skinParam;
private final LivingSpace livingSpace; private final LivingSpace livingSpace;
private final NoteOnMessage noteOnMessage; private final Note noteOnMessage;
public Event getEvent() { public Event getEvent() {
return message; return message;
@ -69,7 +69,7 @@ public class CommunicationTileNoteRight implements TileWithUpdateStairs, TileWit
} }
public CommunicationTileNoteRight(TileWithUpdateStairs tile, AbstractMessage message, Skin skin, public CommunicationTileNoteRight(TileWithUpdateStairs tile, AbstractMessage message, Skin skin,
ISkinParam skinParam, LivingSpace livingSpace, NoteOnMessage noteOnMessage) { ISkinParam skinParam, LivingSpace livingSpace, Note noteOnMessage) {
this.tile = tile; this.tile = tile;
this.message = message; this.message = message;
this.skin = skin; this.skin = skin;
@ -84,7 +84,7 @@ public class CommunicationTileNoteRight implements TileWithUpdateStairs, TileWit
private Component getComponent(StringBounder stringBounder) { private Component getComponent(StringBounder stringBounder) {
final Component comp = skin.createComponent(ComponentType.NOTE, null, final Component comp = skin.createComponent(ComponentType.NOTE, null,
noteOnMessage.getSkinParamNoteBackcolored(skinParam), noteOnMessage.getDisplay()); noteOnMessage.getSkinParamBackcolored(skinParam), noteOnMessage.getStrings());
return comp; return comp;
} }

View File

@ -42,7 +42,7 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.real.Real; import net.sourceforge.plantuml.real.Real;
import net.sourceforge.plantuml.sequencediagram.Event; import net.sourceforge.plantuml.sequencediagram.Event;
import net.sourceforge.plantuml.sequencediagram.Message; import net.sourceforge.plantuml.sequencediagram.Message;
import net.sourceforge.plantuml.sequencediagram.NoteOnMessage; import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.skin.ComponentType;
@ -57,14 +57,14 @@ public class CommunicationTileSelfNoteRight implements TileWithUpdateStairs {
private final Message message; private final Message message;
private final Skin skin; private final Skin skin;
private final ISkinParam skinParam; private final ISkinParam skinParam;
private final NoteOnMessage noteOnMessage; private final Note noteOnMessage;
public Event getEvent() { public Event getEvent() {
return message; return message;
} }
public CommunicationTileSelfNoteRight(CommunicationTileSelf tile, Message message, Skin skin, ISkinParam skinParam, public CommunicationTileSelfNoteRight(CommunicationTileSelf tile, Message message, Skin skin, ISkinParam skinParam,
NoteOnMessage noteOnMessage) { Note noteOnMessage) {
this.tile = tile; this.tile = tile;
this.message = message; this.message = message;
this.skin = skin; this.skin = skin;
@ -78,7 +78,7 @@ public class CommunicationTileSelfNoteRight implements TileWithUpdateStairs {
private Component getComponent(StringBounder stringBounder) { private Component getComponent(StringBounder stringBounder) {
final Component comp = skin.createComponent(ComponentType.NOTE, null, final Component comp = skin.createComponent(ComponentType.NOTE, null,
noteOnMessage.getSkinParamNoteBackcolored(skinParam), noteOnMessage.getDisplay()); noteOnMessage.getSkinParamBackcolored(skinParam), noteOnMessage.getStrings());
return comp; return comp;
} }

View File

@ -50,7 +50,6 @@ import net.sourceforge.plantuml.sequencediagram.Grouping;
import net.sourceforge.plantuml.sequencediagram.GroupingLeaf; import net.sourceforge.plantuml.sequencediagram.GroupingLeaf;
import net.sourceforge.plantuml.sequencediagram.GroupingStart; import net.sourceforge.plantuml.sequencediagram.GroupingStart;
import net.sourceforge.plantuml.sequencediagram.GroupingType; import net.sourceforge.plantuml.sequencediagram.GroupingType;
import net.sourceforge.plantuml.sequencediagram.Message;
import net.sourceforge.plantuml.skin.Area; import net.sourceforge.plantuml.skin.Area;
import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.Component;
import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.skin.ComponentType;
@ -170,12 +169,12 @@ public class GroupingTile implements TileWithCallbackY {
private void drawAllElses(UGraphic ug) { private void drawAllElses(UGraphic ug) {
final StringBounder stringBounder = ug.getStringBounder(); final StringBounder stringBounder = ug.getStringBounder();
final double totalHeight = getTotalHeight(stringBounder); final double totalHeight = getTotalHeight(stringBounder);
final double suppHeight = getPreferredDimensionIfEmpty(stringBounder).getHeight() + MARGINY / 2; // final double suppHeight = getPreferredDimensionIfEmpty(stringBounder).getHeight() + MARGINY / 2;
final List<Double> ys = new ArrayList<Double>(); final List<Double> ys = new ArrayList<Double>();
for (Tile tile : tiles) { for (Tile tile : tiles) {
if (tile instanceof ElseTile) { if (tile instanceof ElseTile) {
final ElseTile elseTile = (ElseTile) tile; final ElseTile elseTile = (ElseTile) tile;
ys.add(elseTile.getCallbackY() - y + suppHeight); ys.add(elseTile.getCallbackY() - y + MARGINY / 2/* suppHeight */);
} }
} }
ys.add(totalHeight); ys.add(totalHeight);
@ -234,9 +233,10 @@ public class GroupingTile implements TileWithCallbackY {
private static List<Tile> mergeParallel(List<Tile> tiles) { private static List<Tile> mergeParallel(List<Tile> tiles) {
TileParallel pending = null; TileParallel pending = null;
tiles = removeEmptyCloseToParallel(tiles);
final List<Tile> result = new ArrayList<Tile>(); final List<Tile> result = new ArrayList<Tile>();
for (Tile tile : tiles) { for (Tile tile : tiles) {
if (tile instanceof TileParallel == false && tile.getEvent().isParallel()) { if (isParallel(tile)) {
if (pending == null) { if (pending == null) {
pending = new TileParallel(); pending = new TileParallel();
pending.add(result.get(result.size() - 1)); pending.add(result.get(result.size() - 1));
@ -251,6 +251,28 @@ public class GroupingTile implements TileWithCallbackY {
return result; return result;
} }
private static List<Tile> removeEmptyCloseToParallel(List<Tile> tiles) {
final List<Tile> result = new ArrayList<Tile>();
for (Tile tile : tiles) {
if (isParallel(tile)) {
removeHeadEmpty(result);
}
result.add(tile);
}
return result;
}
private static void removeHeadEmpty(List<Tile> tiles) {
while (tiles.size() > 0 && tiles.get(tiles.size() - 1) instanceof EmptyTile) {
tiles.remove(tiles.size() - 1);
}
}
private static boolean isParallel(Tile tile) {
return tile instanceof TileParallel == false && tile.getEvent().isParallel();
}
// public double getStartY() { // public double getStartY() {
// return y + MARGINY; // return y + MARGINY;
// } // }

View File

@ -107,6 +107,8 @@ public class LiveBoxFinder implements UGraphic {
((TileWithUpdateStairs) shape).updateStairs(stringBounder, y); ((TileWithUpdateStairs) shape).updateStairs(stringBounder, y);
} else if (shape instanceof EmptyTile) { } else if (shape instanceof EmptyTile) {
// Nothing ? // Nothing ?
} else if (shape instanceof TileParallel) {
// Nothing ?
} else if (shape instanceof NotesTile) { } else if (shape instanceof NotesTile) {
// Nothing ? // Nothing ?
} else if (shape instanceof Tile) { } else if (shape instanceof Tile) {

View File

@ -54,7 +54,6 @@ import net.sourceforge.plantuml.sequencediagram.LifeEvent;
import net.sourceforge.plantuml.sequencediagram.Message; import net.sourceforge.plantuml.sequencediagram.Message;
import net.sourceforge.plantuml.sequencediagram.MessageExo; import net.sourceforge.plantuml.sequencediagram.MessageExo;
import net.sourceforge.plantuml.sequencediagram.Note; import net.sourceforge.plantuml.sequencediagram.Note;
import net.sourceforge.plantuml.sequencediagram.NoteOnMessage;
import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.NotePosition;
import net.sourceforge.plantuml.sequencediagram.Notes; import net.sourceforge.plantuml.sequencediagram.Notes;
import net.sourceforge.plantuml.sequencediagram.Reference; import net.sourceforge.plantuml.sequencediagram.Reference;
@ -96,8 +95,8 @@ public class TileBuilder {
result = new CommunicationTile(livingSpace1, livingSpace2, msg, skin, skinParam); result = new CommunicationTile(livingSpace1, livingSpace2, msg, skin, skinParam);
reverse = ((CommunicationTile) result).isReverse(stringBounder); reverse = ((CommunicationTile) result).isReverse(stringBounder);
} }
for (NoteOnMessage noteOnMessage : msg.getNoteOnMessages()) { for (Note noteOnMessage : msg.getNoteOnMessages()) {
final NotePosition notePosition = noteOnMessage.getNotePosition(); final NotePosition notePosition = noteOnMessage.getPosition();
if (notePosition == NotePosition.LEFT) { if (notePosition == NotePosition.LEFT) {
result = new CommunicationTileNoteLeft((TileWithUpdateStairs) result, msg, skin, skinParam, result = new CommunicationTileNoteLeft((TileWithUpdateStairs) result, msg, skin, skinParam,
reverse ? livingSpace2 : livingSpace1, noteOnMessage); reverse ? livingSpace2 : livingSpace1, noteOnMessage);
@ -115,8 +114,8 @@ public class TileBuilder {
final LivingSpace livingSpace1 = livingSpaces.get(exo.getParticipant()); final LivingSpace livingSpace1 = livingSpaces.get(exo.getParticipant());
Tile result = null; Tile result = null;
result = new CommunicationExoTile(livingSpace1, exo, skin, skinParam, tileArguments); result = new CommunicationExoTile(livingSpace1, exo, skin, skinParam, tileArguments);
for (NoteOnMessage noteOnMessage : exo.getNoteOnMessages()) { for (Note noteOnMessage : exo.getNoteOnMessages()) {
final NotePosition notePosition = exo.getNoteOnMessages().get(0).getNotePosition(); final NotePosition notePosition = exo.getNoteOnMessages().get(0).getPosition();
if (notePosition == NotePosition.LEFT) { if (notePosition == NotePosition.LEFT) {
result = new CommunicationTileNoteLeft((TileWithUpdateStairs) result, exo, skin, skinParam, result = new CommunicationTileNoteLeft((TileWithUpdateStairs) result, exo, skin, skinParam,
livingSpace1, noteOnMessage); livingSpace1, noteOnMessage);

View File

@ -37,7 +37,6 @@ package net.sourceforge.plantuml.statediagram.command;
import net.sourceforge.plantuml.Direction; import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.StringUtils;
import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
import net.sourceforge.plantuml.command.CommandExecutionResult; import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2; import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexConcat;
@ -137,7 +136,7 @@ public class CommandLinkState extends SingleLineCommand2<StateDiagram> {
if (dir == Direction.LEFT || dir == Direction.UP) { if (dir == Direction.LEFT || dir == Direction.UP) {
link = link.getInv(); link = link.getInv();
} }
CommandLinkClass.applyStyle(arg.getLazzy("ARROW_STYLE", 0), link); link.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
diagram.addLink(link); diagram.addLink(link);
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();

View File

@ -43,11 +43,15 @@ import java.io.OutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.EmptyImageBuilder; import net.sourceforge.plantuml.EmptyImageBuilder;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.SpriteContainerEmpty; import net.sourceforge.plantuml.SpriteContainerEmpty;
import net.sourceforge.plantuml.TikzFontDistortion;
import net.sourceforge.plantuml.api.ImageDataSimple; import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.eps.EpsStrategy;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColorUtils; import net.sourceforge.plantuml.graphic.HtmlColorUtils;
@ -60,7 +64,10 @@ import net.sourceforge.plantuml.ugraphic.UFont;
import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle; import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.UTranslate;
import net.sourceforge.plantuml.ugraphic.eps.UGraphicEps;
import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d; import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg;
import net.sourceforge.plantuml.ugraphic.tikz.UGraphicTikz;
public class GraphicsSudoku { public class GraphicsSudoku {
@ -72,8 +79,38 @@ public class GraphicsSudoku {
this.sudoku = sudoku; this.sudoku = sudoku;
} }
public ImageData writeImage(OutputStream os) throws IOException { public ImageData writeImageEps(OutputStream os) throws IOException {
final BufferedImage im = createImage(); final UGraphicEps ug = new UGraphicEps(new ColorMapperIdentity(), EpsStrategy.WITH_MACRO_AND_TEXT);
drawInternal(ug);
os.write(ug.getEPSCode().getBytes());
return ImageDataSimple.ok();
}
public ImageData writeImageSvg(OutputStream os) throws IOException {
final UGraphicSvg ug = new UGraphicSvg(true, new Dimension2DDouble(0, 0), new ColorMapperIdentity(),
(String) null, false, 1.0, null, null, 0);
drawInternal(ug);
ug.createXml(os, null);
return ImageDataSimple.ok();
}
public ImageData writeImageLatex(OutputStream os, FileFormat fileFormat) throws IOException {
final UGraphicTikz ug = new UGraphicTikz(new ColorMapperIdentity(), 1, fileFormat == FileFormat.LATEX,
TikzFontDistortion.getDefault());
drawInternal(ug);
ug.createTikz(os);
return ImageDataSimple.ok();
}
public ImageData writeImagePng(OutputStream os) throws IOException {
final EmptyImageBuilder builder = new EmptyImageBuilder(sudoWidth, sudoHeight + textTotalHeight, Color.WHITE);
final BufferedImage im = builder.getBufferedImage();
final Graphics2D g3d = builder.getGraphics2D();
final UGraphic ug = new UGraphicG2d(new ColorMapperIdentity(), g3d, 1.0);
drawInternal(ug);
g3d.dispose();
PngIO.write(im, os, 96); PngIO.write(im, os, 96);
return new ImageDataSimple(im.getWidth(), im.getHeight()); return new ImageDataSimple(im.getWidth(), im.getHeight());
} }
@ -89,17 +126,11 @@ public class GraphicsSudoku {
final private int textTotalHeight = 50; final private int textTotalHeight = 50;
private BufferedImage createImage() { final private int boldWidth = 3;
final int boldWidth = 3; final private int sudoHeight = 9 * cellHeight + 2 * yOffset + boldWidth;
final int sudoHeight = 9 * cellHeight + 2 * yOffset + boldWidth; final private int sudoWidth = 9 * cellWidth + 2 * xOffset + boldWidth;
final int sudoWidth = 9 * cellWidth + 2 * xOffset + boldWidth;
final EmptyImageBuilder builder = new EmptyImageBuilder(sudoWidth, sudoHeight + textTotalHeight, Color.WHITE);
final BufferedImage im = builder.getBufferedImage();
final Graphics2D g3d = builder.getGraphics2D();
UGraphic ug = new UGraphicG2d(new ColorMapperIdentity(), g3d, 1.0);
private void drawInternal(UGraphic ug) {
ug = ug.apply(new UTranslate(xOffset, yOffset)); ug = ug.apply(new UTranslate(xOffset, yOffset));
for (int x = 0; x < 9; x++) { for (int x = 0; x < 9; x++) {
@ -134,8 +165,6 @@ public class GraphicsSudoku {
final TextBlock textBlock = Display.create(texts).create(FontConfiguration.blackBlueTrue(font), final TextBlock textBlock = Display.create(texts).create(FontConfiguration.blackBlueTrue(font),
HorizontalAlignment.LEFT, new SpriteContainerEmpty()); HorizontalAlignment.LEFT, new SpriteContainerEmpty());
textBlock.drawU(ug); textBlock.drawU(ug);
g3d.dispose();
return im;
} }
} }

View File

@ -39,6 +39,7 @@ import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import net.sourceforge.plantuml.AbstractPSystem; import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileFormatOption; import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.ImageData;
@ -50,7 +51,18 @@ public class PSystemSudoku extends AbstractPSystem {
@Override @Override
final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed) final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
throws IOException { throws IOException {
return new GraphicsSudoku(sudoku).writeImage(os); final GraphicsSudoku sud = new GraphicsSudoku(sudoku);
if (fileFormat.getFileFormat() == FileFormat.EPS) {
return sud.writeImageEps(os);
}
if (fileFormat.getFileFormat() == FileFormat.SVG) {
return sud.writeImageSvg(os);
}
if (fileFormat.getFileFormat() == FileFormat.LATEX
|| fileFormat.getFileFormat() == FileFormat.LATEX_NO_PREAMBLE) {
return sud.writeImageLatex(os, fileFormat.getFileFormat());
}
return sud.writeImagePng(os);
} }
public DiagramDescription getDescription() { public DiagramDescription getDescription() {

View File

@ -354,6 +354,8 @@ public class Cluster implements Moveable {
} }
} }
final boolean shadowing = group.getUSymbol() == null ? skinParam2.shadowing() : skinParam2.shadowing2(group
.getUSymbol().getSkinParameter());
if (ztitle != null || zstereo != null) { if (ztitle != null || zstereo != null) {
final HtmlColor back = getBackColor(getBackColor(umlDiagramType), skinParam2, group.getStereotype()); final HtmlColor back = getBackColor(getBackColor(umlDiagramType), skinParam2, group.getStereotype());
final double roundCorner = group.getUSymbol() == null ? 0 : group.getUSymbol().getSkinParameter() final double roundCorner = group.getUSymbol() == null ? 0 : group.getUSymbol().getSkinParameter()
@ -362,12 +364,12 @@ public class Cluster implements Moveable {
final UStroke stroke2 = getStrokeInternal(skinParam2); final UStroke stroke2 = getStrokeInternal(skinParam2);
final ClusterDecoration decoration = new ClusterDecoration(style, group.getUSymbol(), ztitle, zstereo, final ClusterDecoration decoration = new ClusterDecoration(style, group.getUSymbol(), ztitle, zstereo,
minX, minY, maxX, maxY, stroke2); minX, minY, maxX, maxY, stroke2);
decoration.drawU(ug, back, borderColor, skinParam2.shadowing(), roundCorner, decoration.drawU(ug, back, borderColor, shadowing, roundCorner,
skinParam2.getHorizontalAlignment(AlignParam.PACKAGE_TITLE_ALIGNMENT, null)); skinParam2.getHorizontalAlignment(AlignParam.PACKAGE_TITLE_ALIGNMENT, null));
return; return;
} }
final URectangle rect = new URectangle(maxX - minX, maxY - minY); final URectangle rect = new URectangle(maxX - minX, maxY - minY);
if (skinParam2.shadowing()) { if (shadowing) {
rect.setDeltaShadow(3.0); rect.setDeltaShadow(3.0);
} }
final HtmlColor backColor = getBackColor(getBackColor(umlDiagramType), skinParam2, group.getStereotype()); final HtmlColor backColor = getBackColor(getBackColor(umlDiagramType), skinParam2, group.getStereotype());

View File

@ -346,6 +346,7 @@ public class TikzGraphics {
text = text.replaceAll(">", "\\\\textgreater "); text = text.replaceAll(">", "\\\\textgreater ");
text = text.replaceAll("&", "\\\\&"); text = text.replaceAll("&", "\\\\&");
text = text.replaceAll("%", "\\\\%"); text = text.replaceAll("%", "\\\\%");
text = text.replace("$", "\\$");
text = text.replaceAll("~", "\\\\~{}"); text = text.replaceAll("~", "\\\\~{}");
return text; return text;
} }

View File

@ -40,6 +40,7 @@ import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.command.regex.RegexConcat; import net.sourceforge.plantuml.command.regex.RegexConcat;
import net.sourceforge.plantuml.command.regex.RegexLeaf; import net.sourceforge.plantuml.command.regex.RegexLeaf;
import net.sourceforge.plantuml.command.regex.RegexResult; import net.sourceforge.plantuml.command.regex.RegexResult;
import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
public class CommandTimeMessage extends SingleLineCommand2<TimingDiagram> { public class CommandTimeMessage extends SingleLineCommand2<TimingDiagram> {
@ -54,7 +55,9 @@ public class CommandTimeMessage extends SingleLineCommand2<TimingDiagram> {
new RegexLeaf("PART1", PLAYER_CODE), // new RegexLeaf("PART1", PLAYER_CODE), //
TimeTickBuilder.optionalExpressionAtWithArobase("TIME1"), // TimeTickBuilder.optionalExpressionAtWithArobase("TIME1"), //
new RegexLeaf("[%s]*"), // new RegexLeaf("[%s]*"), //
new RegexLeaf("ARROW", "(-+)\\>"), // new RegexLeaf("ARROW_BODY", "(-+)"), //
new RegexLeaf("ARROW_STYLE", "(?:\\[(" + CommandLinkElement.LINE_STYLE + ")\\])?"), //
new RegexLeaf("ARROW_HEAD", "\\>"), //
new RegexLeaf("[%s]*"), // new RegexLeaf("[%s]*"), //
new RegexLeaf("PART2", PLAYER_CODE), // new RegexLeaf("PART2", PLAYER_CODE), //
TimeTickBuilder.optionalExpressionAtWithArobase("TIME2"), // TimeTickBuilder.optionalExpressionAtWithArobase("TIME2"), //
@ -75,7 +78,8 @@ public class CommandTimeMessage extends SingleLineCommand2<TimingDiagram> {
} }
final TimeTick tick1 = TimeTickBuilder.parseTimeTick("TIME1", arg, diagram); final TimeTick tick1 = TimeTickBuilder.parseTimeTick("TIME1", arg, diagram);
final TimeTick tick2 = TimeTickBuilder.parseTimeTick("TIME2", arg, diagram); final TimeTick tick2 = TimeTickBuilder.parseTimeTick("TIME2", arg, diagram);
diagram.createTimeMessage(player1, tick1, player2, tick2, arg.get("MESSAGE", 0)); final TimeMessage result = diagram.createTimeMessage(player1, tick1, player2, tick2, arg.get("MESSAGE", 0));
result.applyStyle(arg.getLazzy("ARROW_STYLE", 0));
return CommandExecutionResult.ok(); return CommandExecutionResult.ok();
} }

View File

@ -34,15 +34,15 @@
*/ */
package net.sourceforge.plantuml.timingdiagram; package net.sourceforge.plantuml.timingdiagram;
import java.awt.Font;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import java.awt.geom.Point2D; import java.awt.geom.Point2D;
import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.WithLinkType;
import net.sourceforge.plantuml.graphic.FontConfiguration; import net.sourceforge.plantuml.graphic.FontConfiguration;
import net.sourceforge.plantuml.graphic.HorizontalAlignment; import net.sourceforge.plantuml.graphic.HorizontalAlignment;
import net.sourceforge.plantuml.graphic.HtmlColorUtils; import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor; import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
@ -60,17 +60,20 @@ public class TimeArrow implements UDrawable {
private final Point2D end; private final Point2D end;
private final Display label; private final Display label;
private final ISkinSimple spriteContainer; private final ISkinSimple spriteContainer;
private final WithLinkType type;
public static TimeArrow create(IntricatedPoint pt1, IntricatedPoint pt2, Display label, ISkinSimple spriteContainer) { public static TimeArrow create(IntricatedPoint pt1, IntricatedPoint pt2, Display label,
final TimeArrow arrow1 = new TimeArrow(pt1.getPointA(), pt2.getPointA(), label, spriteContainer); ISkinSimple spriteContainer, WithLinkType type) {
final TimeArrow arrow2 = new TimeArrow(pt1.getPointA(), pt2.getPointB(), label, spriteContainer); final TimeArrow arrow1 = new TimeArrow(pt1.getPointA(), pt2.getPointA(), label, spriteContainer, type);
final TimeArrow arrow3 = new TimeArrow(pt1.getPointB(), pt2.getPointA(), label, spriteContainer); final TimeArrow arrow2 = new TimeArrow(pt1.getPointA(), pt2.getPointB(), label, spriteContainer, type);
final TimeArrow arrow4 = new TimeArrow(pt1.getPointB(), pt2.getPointB(), label, spriteContainer); final TimeArrow arrow3 = new TimeArrow(pt1.getPointB(), pt2.getPointA(), label, spriteContainer, type);
final TimeArrow arrow4 = new TimeArrow(pt1.getPointB(), pt2.getPointB(), label, spriteContainer, type);
return shorter(arrow1, arrow2, arrow3, arrow4); return shorter(arrow1, arrow2, arrow3, arrow4);
} }
private TimeArrow(Point2D start, Point2D end, Display label, ISkinSimple spriteContainer) { private TimeArrow(Point2D start, Point2D end, Display label, ISkinSimple spriteContainer, WithLinkType type) {
this.start = start; this.start = start;
this.type = type;
this.end = end; this.end = end;
this.label = label; this.label = label;
this.spriteContainer = spriteContainer; this.spriteContainer = spriteContainer;
@ -96,7 +99,7 @@ public class TimeArrow implements UDrawable {
} }
public TimeArrow translate(UTranslate translate) { public TimeArrow translate(UTranslate translate) {
return new TimeArrow(translate.getTranslated(start), translate.getTranslated(end), label, spriteContainer); return new TimeArrow(translate.getTranslated(start), translate.getTranslated(end), label, spriteContainer, type);
} }
public static Point2D onCircle(Point2D pt, double alpha) { public static Point2D onCircle(Point2D pt, double alpha) {
@ -108,12 +111,13 @@ public class TimeArrow implements UDrawable {
private FontConfiguration getFontConfiguration() { private FontConfiguration getFontConfiguration() {
final UFont font = UFont.serif(14); final UFont font = UFont.serif(14);
return new FontConfiguration(font, HtmlColorUtils.BLUE, HtmlColorUtils.BLUE, false);
return new FontConfiguration(font, type.getSpecificColor(), type.getSpecificColor(), false);
} }
public void drawU(UGraphic ug) { public void drawU(UGraphic ug) {
final double angle = getAngle(); final double angle = getAngle();
ug = ug.apply(new UChangeColor(HtmlColorUtils.BLUE)).apply(new UStroke()); ug = ug.apply(new UChangeColor(type.getSpecificColor())).apply(type.getType().getStroke3(new UStroke()));
final ULine line = new ULine(end.getX() - start.getX(), end.getY() - start.getY()); final ULine line = new ULine(end.getX() - start.getX(), end.getY() - start.getY());
ug.apply(new UTranslate(start)).draw(line); ug.apply(new UTranslate(start)).draw(line);
@ -126,7 +130,7 @@ public class TimeArrow implements UDrawable {
polygon.addPoint(pt2.getX(), pt2.getY()); polygon.addPoint(pt2.getX(), pt2.getY());
polygon.addPoint(end.getX(), end.getY()); polygon.addPoint(end.getX(), end.getY());
ug = ug.apply(new UChangeBackColor(HtmlColorUtils.BLUE)); ug = ug.apply(new UChangeBackColor(type.getSpecificColor()));
ug.draw(polygon); ug.draw(polygon);
final TextBlock textLabel = label.create(getFontConfiguration(), HorizontalAlignment.LEFT, spriteContainer); final TextBlock textLabel = label.create(getFontConfiguration(), HorizontalAlignment.LEFT, spriteContainer);

View File

@ -35,8 +35,12 @@
package net.sourceforge.plantuml.timingdiagram; package net.sourceforge.plantuml.timingdiagram;
import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.cucadiagram.Display;
import net.sourceforge.plantuml.cucadiagram.LinkDecor;
import net.sourceforge.plantuml.cucadiagram.LinkType;
import net.sourceforge.plantuml.cucadiagram.WithLinkType;
import net.sourceforge.plantuml.graphic.HtmlColorUtils;
public class TimeMessage { public class TimeMessage extends WithLinkType {
private final TickInPlayer tickInPlayer1; private final TickInPlayer tickInPlayer1;
private final TickInPlayer tickInPlayer2; private final TickInPlayer tickInPlayer2;
@ -46,6 +50,8 @@ public class TimeMessage {
this.tickInPlayer1 = tickInPlayer1; this.tickInPlayer1 = tickInPlayer1;
this.tickInPlayer2 = tickInPlayer2; this.tickInPlayer2 = tickInPlayer2;
this.label = Display.getWithNewlines(label); this.label = Display.getWithNewlines(label);
this.setSpecificColor(HtmlColorUtils.BLUE);
this.type = new LinkType(LinkDecor.NONE, LinkDecor.NONE);
} }
public final Player getPlayer1() { public final Player getPlayer1() {
@ -68,4 +74,9 @@ public class TimeMessage {
return label; return label;
} }
@Override
public void goNorank() {
// Nothing to do
}
} }

View File

@ -44,6 +44,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import net.sourceforge.plantuml.AnnotatedWorker; import net.sourceforge.plantuml.AnnotatedWorker;
import net.sourceforge.plantuml.ColorParam;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileFormatOption; import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinParam;
@ -52,13 +53,12 @@ import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.core.DiagramDescription; import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.core.ImageData;
import net.sourceforge.plantuml.graphic.HtmlColor; import net.sourceforge.plantuml.graphic.HtmlColor;
import net.sourceforge.plantuml.graphic.HtmlColorSet;
import net.sourceforge.plantuml.graphic.HtmlColorUtils; import net.sourceforge.plantuml.graphic.HtmlColorUtils;
import net.sourceforge.plantuml.graphic.InnerStrategy; import net.sourceforge.plantuml.graphic.InnerStrategy;
import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.graphic.TextBlockCompressed; import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.graphic.TextBlockRecentred;
import net.sourceforge.plantuml.graphic.UDrawable;
import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.svek.TextBlockBackcolored;
import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.ImageBuilder;
import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.MinMax;
@ -186,7 +186,7 @@ public class TimingDiagram extends UmlDiagram implements Clock {
} }
final TimeArrow timeArrow = TimeArrow.create(pt1.translated(translate1), pt2.translated(translate2), final TimeArrow timeArrow = TimeArrow.create(pt1.translated(translate1), pt2.translated(translate2),
message.getLabel(), getSkinParam()); message.getLabel(), getSkinParam(), message);
timeArrow.drawU(ug); timeArrow.drawU(ug);
} }
@ -212,10 +212,11 @@ public class TimingDiagram extends UmlDiagram implements Clock {
lastPlayer = player; lastPlayer = player;
} }
public void createTimeMessage(Player player1, TimeTick time1, Player player2, TimeTick time2, String label) { public TimeMessage createTimeMessage(Player player1, TimeTick time1, Player player2, TimeTick time2, String label) {
final TimeMessage message = new TimeMessage(new TickInPlayer(player1, time1), new TickInPlayer(player2, time2), final TimeMessage message = new TimeMessage(new TickInPlayer(player1, time1), new TickInPlayer(player2, time2),
label); label);
messages.add(message); messages.add(message);
return message;
} }
public void addTime(TimeTick time) { public void addTime(TimeTick time) {

View File

@ -89,6 +89,7 @@ import net.sourceforge.plantuml.ugraphic.hand.UGraphicHandwritten;
import net.sourceforge.plantuml.ugraphic.html5.UGraphicHtml5; import net.sourceforge.plantuml.ugraphic.html5.UGraphicHtml5;
import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg; import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg;
import net.sourceforge.plantuml.ugraphic.tikz.UGraphicTikz; import net.sourceforge.plantuml.ugraphic.tikz.UGraphicTikz;
import net.sourceforge.plantuml.ugraphic.txt.UGraphicTxt;
import net.sourceforge.plantuml.ugraphic.visio.UGraphicVdx; import net.sourceforge.plantuml.ugraphic.visio.UGraphicVdx;
public class ImageBuilder { public class ImageBuilder {
@ -386,6 +387,8 @@ public class ImageBuilder {
return new UGraphicTikz(colorMapper, dpiFactor, false, fileFormatOption.getTikzFontDistortion()); return new UGraphicTikz(colorMapper, dpiFactor, false, fileFormatOption.getTikzFontDistortion());
case BRAILLE_PNG: case BRAILLE_PNG:
return new UGraphicBraille(colorMapper, fileFormat); return new UGraphicBraille(colorMapper, fileFormat);
case ATXT:
return new UGraphicTxt();
default: default:
throw new UnsupportedOperationException(fileFormat.toString()); throw new UnsupportedOperationException(fileFormat.toString());
} }

View File

@ -35,8 +35,12 @@
package net.sourceforge.plantuml.ugraphic.txt; package net.sourceforge.plantuml.ugraphic.txt;
import java.awt.geom.Dimension2D; import java.awt.geom.Dimension2D;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.Url; import net.sourceforge.plantuml.Url;
import net.sourceforge.plantuml.asciiart.TextStringBounder; import net.sourceforge.plantuml.asciiart.TextStringBounder;
import net.sourceforge.plantuml.asciiart.TranslatedCharArea; import net.sourceforge.plantuml.asciiart.TranslatedCharArea;
@ -47,11 +51,12 @@ import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.AbstractCommonUGraphic; import net.sourceforge.plantuml.ugraphic.AbstractCommonUGraphic;
import net.sourceforge.plantuml.ugraphic.ClipContainer; import net.sourceforge.plantuml.ugraphic.ClipContainer;
import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
import net.sourceforge.plantuml.ugraphic.UGraphic2;
import net.sourceforge.plantuml.ugraphic.UImage; import net.sourceforge.plantuml.ugraphic.UImage;
import net.sourceforge.plantuml.ugraphic.UShape; import net.sourceforge.plantuml.ugraphic.UShape;
import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.UText;
public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer { public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer, UGraphic2 {
private final UmlCharArea charArea; private final UmlCharArea charArea;
@ -79,17 +84,19 @@ public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer
if (shape instanceof UText) { if (shape instanceof UText) {
final UText txt = (UText) shape; final UText txt = (UText) shape;
final int y = ((int) (getTranslateY() + txt.getDescent())) / 10; final int y = ((int) (getTranslateY() + txt.getDescent())) / 10;
System.err.println("x=" + getDx());
if (txt.getFontConfiguration().containsStyle(FontStyle.WAVE)) { if (txt.getFontConfiguration().containsStyle(FontStyle.WAVE)) {
charArea.drawHLine('^', y, getDx(), txt.getText().length()); charArea.drawHLine('^', y, getDx(), txt.getText().length());
charArea.drawStringLR(txt.getText(), 0, y + 1); charArea.drawStringLR(txt.getText(), getDx(), y + 1);
} else { } else {
charArea.drawStringLR(txt.getText(), 0, y); charArea.drawStringLR(txt.getText(), getDx(), y);
} }
return; return;
} else if (shape instanceof UImage) { } else if (shape instanceof UImage) {
return; return;
} }
throw new UnsupportedOperationException("cl=" + shape.getClass()); return;
// throw new UnsupportedOperationException("cl=" + shape.getClass());
} }
public final UmlCharArea getCharArea() { public final UmlCharArea getCharArea() {
@ -114,4 +121,9 @@ public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer
return new Dimension2DDouble(0, 0); return new Dimension2DDouble(0, 0);
} }
public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException {
final PrintStream ps = new PrintStream(os, true, "UTF-8");
getCharArea().print(ps);
}
} }

View File

@ -43,7 +43,7 @@ public class Version {
private static final int MAJOR_SEPARATOR = 1000000; private static final int MAJOR_SEPARATOR = 1000000;
public static int version() { public static int version() {
return 1201807; return 1201808;
} }
public static int versionPatched() { public static int versionPatched() {
@ -88,7 +88,7 @@ public class Version {
} }
public static long compileTime() { public static long compileTime() {
return 1528738146344L; return 1529843460982L;
} }
public static String compileTimeString() { public static String compileTimeString() {