");
sb.append("");
- if (entity.fields2().size() > 0) {
+ if (entity.getFieldsToDisplay().size() > 0) {
sb.append("|");
- for (Member att : entity.fields2()) {
+ for (Member att : entity.getFieldsToDisplay()) {
sb.append(manageHtmlIB(att.getDisplayWithVisibilityChar(), FontParam.STATE_ATTRIBUTE, stereotype));
sb.append(" ");
}
@@ -1046,7 +1051,7 @@ final public class DotMaker implements GraphvizMaker {
sb.append("");
}
- if (entity.fields2().size() == 0 && cFile == null) {
+ if (entity.getFieldsToDisplay().size() == 0 && cFile == null) {
sb.append("|");
}
@@ -1252,9 +1257,9 @@ final public class DotMaker implements GraphvizMaker {
// if (fileFormat == FileFormat.EPS) {
// sb.append(addFieldsEps(entity.fields2(), true));
// } else {
- final boolean hasStatic = hasStatic(entity.fields2());
+ final boolean hasStatic = hasStatic(entity.getFieldsToDisplay());
sb.append("
");
- for (Member att : entity.fields2()) {
+ for (Member att : entity.getFieldsToDisplay()) {
sb.append(manageHtmlIBspecial(att, FontParam.CLASS_ATTRIBUTE, hasStatic, getColorString(
ColorParam.classBackground, stereo), true));
sb.append(" ");
@@ -1266,9 +1271,9 @@ final public class DotMaker implements GraphvizMaker {
// if (fileFormat == FileFormat.EPS) {
// sb.append(addFieldsEps(entity.methods2(), true));
// } else {
- final boolean hasStatic = hasStatic(entity.methods2());
+ final boolean hasStatic = hasStatic(entity.getMethodsToDisplay());
sb.append("
");
- for (Member att : entity.methods2()) {
+ for (Member att : entity.getMethodsToDisplay()) {
sb.append(manageHtmlIBspecial(att, FontParam.CLASS_ATTRIBUTE, hasStatic, getColorString(
ColorParam.classBackground, stereo), true));
sb.append(" ");
@@ -1365,14 +1370,14 @@ final public class DotMaker implements GraphvizMaker {
if (showFields) {
sb.append("
");
- if (entity.fields2().size() > 0) {
+ if (entity.getFieldsToDisplay().size() > 0) {
buildTableVisibility(entity, true, sb, springField);
}
sb.append("
");
}
if (showMethods) {
sb.append("
");
- if (entity.methods2().size() > 0) {
+ if (entity.getMethodsToDisplay().size() > 0) {
buildTableVisibility(entity, false, sb, springMethod);
}
sb.append("
");
@@ -1400,9 +1405,9 @@ final public class DotMaker implements GraphvizMaker {
throws IOException {
sb.append("
");
- final boolean hasStatic = hasStatic(entity.methods2());
+ final boolean hasStatic = hasStatic(entity.getMethodsToDisplay());
final boolean dpiNormal = data.getDpi() == 96;
- for (Member att : isField ? entity.fields2() : entity.methods2()) {
+ for (Member att : isField ? entity.getFieldsToDisplay() : entity.getMethodsToDisplay()) {
sb.append("
");
if (dpiNormal) {
sb.append("
");
@@ -1454,7 +1459,7 @@ final public class DotMaker implements GraphvizMaker {
private int getLongestMethods(IEntity entity) {
int result = 0;
- for (Member att : entity.methods2()) {
+ for (Member att : entity.getMethodsToDisplay()) {
final int size = att.getDisplayWithVisibilityChar().length();
if (size > result) {
result = size;
@@ -1466,7 +1471,7 @@ final public class DotMaker implements GraphvizMaker {
private int getLongestField(IEntity entity) {
int result = 0;
- for (Member att : entity.fields2()) {
+ for (Member att : entity.getFieldsToDisplay()) {
final int size = att.getDisplayWithVisibilityChar().length();
if (size > result) {
result = size;
@@ -1501,7 +1506,7 @@ final public class DotMaker implements GraphvizMaker {
sb.append("
");
sb.append("
");
- if (entity.fields2().size() == 0) {
+ if (entity.getFieldsToDisplay().size() == 0) {
sb.append(manageHtmlIB(" ", FontParam.OBJECT_ATTRIBUTE, stereo));
} else {
buildTableVisibility(entity, true, sb, springField);
@@ -1532,10 +1537,10 @@ final public class DotMaker implements GraphvizMaker {
sb.append("
");
sb.append("
");
- if (entity.fields2().size() == 0) {
+ if (entity.getFieldsToDisplay().size() == 0) {
sb.append(manageHtmlIB(" ", FontParam.OBJECT_ATTRIBUTE, stereo));
} else {
- for (Member att : entity.fields2()) {
+ for (Member att : entity.getFieldsToDisplay()) {
sb.append(manageHtmlIB(att.getDisplayWithVisibilityChar(), FontParam.OBJECT_ATTRIBUTE, stereo));
sb.append(" ");
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/Executable.java b/src/net/sourceforge/plantuml/cucadiagram/dot/Executable.java
new file mode 100644
index 000000000..297102b17
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/Executable.java
@@ -0,0 +1,135 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 6104 $
+ *
+ */
+package net.sourceforge.plantuml.cucadiagram.dot;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.OptionFlags;
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.graphic.GraphicStrings;
+
+abstract class Executable {
+
+ private final File dotExe;
+
+ static boolean isWindows() {
+ return File.separatorChar == '\\';
+ }
+
+ Executable(String dotString, String... type) {
+ if (type == null) {
+ throw new IllegalArgumentException();
+ }
+ this.dotExe = searchDotExe();
+ }
+
+ private File searchDotExe() {
+ if (OptionFlags.getInstance().getDotExecutable() == null) {
+ final String getenv = GraphvizUtils.getenvGraphvizDot();
+ if (getenv == null) {
+ return specificDotExe();
+ }
+ return new File(getenv);
+ }
+
+ return new File(OptionFlags.getInstance().getDotExecutable());
+
+ }
+
+ abstract protected File specificDotExe();
+
+
+ final public String dotVersion() throws IOException, InterruptedException {
+ final String cmd = getCommandLineVersion();
+ return executeCmd(cmd);
+ }
+
+ private String executeCmd(final String cmd) throws IOException, InterruptedException {
+ final ProcessRunner p = new ProcessRunner(cmd);
+ p.run(null, null);
+ final StringBuilder sb = new StringBuilder();
+ if (StringUtils.isNotEmpty(p.getOut())) {
+ sb.append(p.getOut());
+ }
+ if (StringUtils.isNotEmpty(p.getError())) {
+ if (sb.length() > 0) {
+ sb.append(' ');
+ }
+ sb.append(p.getError());
+ }
+ return sb.toString().replace('\n', ' ').trim();
+ }
+
+ final private void createPngNoGraphviz(OutputStream os, FileFormatOption format) throws IOException {
+ final List msg = new ArrayList();
+ msg.add("Dot Executable: " + dotExe);
+ if (dotExe != null) {
+ if (dotExe.exists() == false) {
+ msg.add("File does not exist");
+ } else if (dotExe.isDirectory()) {
+ msg.add("It should be an executable, not a directory");
+ } else if (dotExe.isFile() == false) {
+ msg.add("Not a valid file");
+ } else if (dotExe.canRead() == false) {
+ msg.add("File cannot be read");
+ }
+ }
+ msg.add("Cannot find Graphviz. You should try");
+ msg.add(" ");
+ msg.add("@startuml");
+ msg.add("testdot");
+ msg.add("@enduml");
+ msg.add(" ");
+ msg.add(" or ");
+ msg.add(" ");
+ msg.add("java -jar plantuml.jar -testdot");
+ final GraphicStrings errorResult = new GraphicStrings(msg);
+ errorResult.writeImage(os, format);
+ }
+
+ abstract String getCommandLine();
+
+ abstract String getCommandLineVersion();
+
+ public final File getDotExe() {
+ return dotExe;
+ }
+
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLayoutStrategy.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLayoutStrategy.java
new file mode 100644
index 000000000..cc3da797c
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizLayoutStrategy.java
@@ -0,0 +1,73 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 3977 $
+ *
+ */
+package net.sourceforge.plantuml.cucadiagram.dot;
+
+import java.io.File;
+import java.util.List;
+
+import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.OptionFlags;
+
+public enum GraphvizLayoutStrategy {
+ DOT, NEATO;
+
+ public GraphvizMaker getGraphvizMaker(DotData data,
+ List dotStrings, FileFormat fileFormat) {
+ if (this == DOT) {
+ return new DotMaker(data, dotStrings, fileFormat);
+ }
+ throw new UnsupportedOperationException(this.toString());
+ }
+
+ public File getSystemForcedExecutable() {
+ if (this == DOT) {
+ return getSystemForcedDot();
+ }
+ throw new UnsupportedOperationException(this.toString());
+ }
+
+ private File getSystemForcedDot() {
+ if (OptionFlags.getInstance().getDotExecutable() == null) {
+ final String getenv = GraphvizUtils.getenvGraphvizDot();
+ if (getenv == null) {
+ return null;
+ }
+ return new File(getenv);
+ }
+
+ return new File(OptionFlags.getInstance().getDotExecutable());
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java
index e044ba344..7ef787bc3 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GraphvizUtils.java
@@ -28,7 +28,7 @@
*
* Original Author: Arnaud Roques
*
- * Revision $Revision: 6007 $
+ * Revision $Revision: 6200 $
*
*/
package net.sourceforge.plantuml.cucadiagram.dot;
@@ -51,6 +51,7 @@ public class GraphvizUtils {
return File.separatorChar == '\\';
}
+ @Deprecated
public static Graphviz create(String dotString, String... type) {
if (isWindows()) {
return new GraphvizWindows(dotString, type);
@@ -58,6 +59,10 @@ public class GraphvizUtils {
return new GraphvizLinux(dotString, type);
}
+ public static Graphviz create2(GraphvizLayoutStrategy strategy, String dotString, String... type) {
+ return new AbstractGraphviz2(getOS(), strategy, dotString, type);
+ }
+
static public File getDotExe() {
return create(null, "png").getDotExe();
}
@@ -161,5 +166,12 @@ public class GraphvizUtils {
return Collections.unmodifiableList(result);
}
+
+ public static OS getOS() {
+ if (isWindows()) {
+ return new OSWindows();
+ }
+ return new OSLinux();
+ }
}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/GroupPngMaker.java b/src/net/sourceforge/plantuml/cucadiagram/dot/GroupPngMaker.java
index 336040262..be12ae745 100644
--- a/src/net/sourceforge/plantuml/cucadiagram/dot/GroupPngMaker.java
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/GroupPngMaker.java
@@ -28,7 +28,7 @@
*
* Original Author: Arnaud Roques
*
- * Revision $Revision: 5872 $
+ * Revision $Revision: 6197 $
*
*/
package net.sourceforge.plantuml.cucadiagram.dot;
@@ -47,6 +47,8 @@ import java.util.Map;
import javax.imageio.ImageIO;
+import com.sun.org.apache.bcel.internal.generic.GETSTATIC;
+
import net.sourceforge.plantuml.FileFormat;
import net.sourceforge.plantuml.FileUtils;
import net.sourceforge.plantuml.ISkinParam;
@@ -214,7 +216,8 @@ public final class GroupPngMaker {
// dotData.putAllStaticImages(staticImages);
// dotData.putAllImagesLink(imagesLink);
- return new DotMaker(dotData, dotStrings, fileFormat);
+ // return new DotMaker(dotData, dotStrings, fileFormat);
+ return diagram.getStrategy().getGraphvizMaker(dotData, dotStrings, fileFormat);
}
private List getPureInnerLinks() {
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/OS.java b/src/net/sourceforge/plantuml/cucadiagram/dot/OS.java
new file mode 100644
index 000000000..65885e7b3
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/OS.java
@@ -0,0 +1,50 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 6104 $
+ *
+ */
+package net.sourceforge.plantuml.cucadiagram.dot;
+
+import java.io.File;
+
+abstract class OS {
+
+ static boolean isWindows() {
+ return File.separatorChar == '\\';
+ }
+
+ abstract String getFileName(GraphvizLayoutStrategy strategy);
+
+ abstract File getExecutable(GraphvizLayoutStrategy strategy);
+
+ public abstract String getCommand(GraphvizLayoutStrategy strategy);
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/OSLinux.java b/src/net/sourceforge/plantuml/cucadiagram/dot/OSLinux.java
new file mode 100644
index 000000000..5979c42e5
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/OSLinux.java
@@ -0,0 +1,66 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 6104 $
+ *
+ */
+package net.sourceforge.plantuml.cucadiagram.dot;
+
+import java.io.File;
+
+class OSLinux extends OS {
+
+ @Override
+ File getExecutable(GraphvizLayoutStrategy strategy) {
+ File result = strategy.getSystemForcedExecutable();
+ if (result != null) {
+ return result;
+ }
+ final String fileName = getFileName(strategy);
+ final File usrLocalBin = new File("/usr/local/bin/" + fileName);
+
+ if (usrLocalBin.exists()) {
+ return usrLocalBin;
+ }
+ final File usrBin = new File("/usr/bin/" + fileName);
+ return usrBin;
+ }
+
+ @Override
+ String getFileName(GraphvizLayoutStrategy strategy) {
+ return strategy.name().toLowerCase();
+ }
+
+ @Override
+ public String getCommand(GraphvizLayoutStrategy strategy) {
+ return getExecutable(strategy).getAbsolutePath();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/cucadiagram/dot/OSWindows.java b/src/net/sourceforge/plantuml/cucadiagram/dot/OSWindows.java
new file mode 100644
index 000000000..b6cddcefd
--- /dev/null
+++ b/src/net/sourceforge/plantuml/cucadiagram/dot/OSWindows.java
@@ -0,0 +1,94 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 6104 $
+ *
+ */
+package net.sourceforge.plantuml.cucadiagram.dot;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+class OSWindows extends OS {
+
+ @Override
+ File getExecutable(GraphvizLayoutStrategy strategy) {
+ File result = strategy.getSystemForcedExecutable();
+ if (result != null) {
+ return result;
+ }
+ result = searchInDir(new File("c:/Program Files"), strategy);
+ if (result != null) {
+ return result;
+ }
+ result = searchInDir(new File("c:/Program Files (x86)"), strategy);
+ return result;
+ }
+
+ private File searchInDir(final File programFile, GraphvizLayoutStrategy strategy) {
+ if (programFile.exists() == false || programFile.isDirectory() == false) {
+ return null;
+ }
+ final List dots = new ArrayList();
+ for (File f : programFile.listFiles(new FileFilter() {
+ public boolean accept(File pathname) {
+ return pathname.isDirectory() && pathname.getName().startsWith("Graphviz");
+ }
+ })) {
+ final File result = new File(new File(f, "bin"), getFileName(strategy));
+ if (result.exists() && result.canRead()) {
+ dots.add(result.getAbsoluteFile());
+ }
+ }
+ return higherVersion(dots);
+ }
+
+ static File higherVersion(List dots) {
+ if (dots.size() == 0) {
+ return null;
+ }
+ Collections.sort(dots, Collections.reverseOrder());
+ return dots.get(0);
+ }
+
+ @Override
+ String getFileName(GraphvizLayoutStrategy strategy) {
+ return strategy.name().toLowerCase() + ".exe";
+ }
+
+ @Override
+ public String getCommand(GraphvizLayoutStrategy strategy) {
+ return "\"" + getExecutable(strategy).getAbsolutePath() + "\"";
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/graph/EntityImageClass.java b/src/net/sourceforge/plantuml/graph/EntityImageClass.java
index f8cfb47a6..00d1417c7 100644
--- a/src/net/sourceforge/plantuml/graph/EntityImageClass.java
+++ b/src/net/sourceforge/plantuml/graph/EntityImageClass.java
@@ -28,7 +28,7 @@
*
* Original Author: Arnaud Roques
*
- * Revision $Revision: 6009 $
+ * Revision $Revision: 6168 $
*
*/
package net.sourceforge.plantuml.graph;
@@ -63,8 +63,8 @@ class EntityImageClass extends AbstractEntityImage {
super(entity);
this.name = TextBlockUtils.create(StringUtils.getWithNewlines(entity.getDisplay()), new FontConfiguration(
getFont14(), Color.BLACK), HorizontalAlignement.CENTER);
- this.methods = new MethodsOrFieldsArea(entity.methods2(), getFont14());
- this.fields = new MethodsOrFieldsArea(entity.fields2(), getFont14());
+ this.methods = new MethodsOrFieldsArea(entity.getMethodsToDisplay(), getFont14());
+ this.fields = new MethodsOrFieldsArea(entity.getFieldsToDisplay(), getFont14());
circledCharacter = getCircledCharacter(entity);
diff --git a/src/net/sourceforge/plantuml/posimo/EntityImageClass2.java b/src/net/sourceforge/plantuml/posimo/EntityImageClass2.java
index 0f075ddf5..195572a4c 100644
--- a/src/net/sourceforge/plantuml/posimo/EntityImageClass2.java
+++ b/src/net/sourceforge/plantuml/posimo/EntityImageClass2.java
@@ -82,8 +82,8 @@ public class EntityImageClass2 extends AbstractEntityImage2 {
getFont(FontParam.CLASS_STEREOTYPE), getFontColor(FontParam.CLASS_STEREOTYPE)),
HorizontalAlignement.CENTER);
}
- this.methods = new MethodsOrFieldsArea2(entity.methods2(), FontParam.CLASS_ATTRIBUTE, skinParam);
- this.fields = new MethodsOrFieldsArea2(entity.fields2(), FontParam.CLASS_ATTRIBUTE, skinParam);
+ this.methods = new MethodsOrFieldsArea2(entity.getMethodsToDisplay(), FontParam.CLASS_ATTRIBUTE, skinParam);
+ this.fields = new MethodsOrFieldsArea2(entity.getFieldsToDisplay(), FontParam.CLASS_ATTRIBUTE, skinParam);
circledCharacter = getCircledCharacter(entity);
}
diff --git a/src/net/sourceforge/plantuml/postit/Area.java b/src/net/sourceforge/plantuml/postit/Area.java
new file mode 100644
index 000000000..ac8c29913
--- /dev/null
+++ b/src/net/sourceforge/plantuml/postit/Area.java
@@ -0,0 +1,112 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 4167 $
+ *
+ */
+package net.sourceforge.plantuml.postit;
+
+import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+
+public class Area implements Elastic {
+
+ private final String title;
+ private final char id;
+
+ private Dimension2D minimunDimension;
+
+ private final List postIts = new ArrayList();
+
+ public Area(char id, String title) {
+ this.id = id;
+ this.title = title;
+ }
+
+ public char getId() {
+ return id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public Dimension2D getMinimunDimension() {
+ return minimunDimension;
+ }
+
+ public void setMinimunDimension(Dimension2D minimunDimension) {
+ this.minimunDimension = minimunDimension;
+ }
+
+ public Dimension2D getDimension() {
+ throw new UnsupportedOperationException();
+ }
+
+ public double heightWhenWidthIs(double width, StringBounder stringBounder) {
+ final AreaLayoutFixedWidth layout = new AreaLayoutFixedWidth();
+ final Map pos = layout.getPositions(postIts, stringBounder);
+ double max = 10;
+ for (Map.Entry ent : pos.entrySet()) {
+ final double y = ent.getKey().getDimension(stringBounder).getHeight() + ent.getValue().getY();
+ max = Math.max(max, y);
+ }
+
+ return max + 10;
+ }
+
+ public double widthWhenHeightIs(double height, StringBounder stringBounder) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void add(PostIt postIt) {
+ postIts.add(postIt);
+ }
+
+ public void drawU(UGraphic ug) {
+ final AreaLayout layout = new AreaLayoutFixedWidth();
+ final Map pos = layout.getPositions(postIts, ug.getStringBounder());
+ final double tx = ug.getTranslateX();
+ final double ty = ug.getTranslateY();
+ for (Map.Entry ent : pos.entrySet()) {
+ ug.translate(ent.getValue().getX(), ent.getValue().getY());
+ ent.getKey().drawU(ug);
+ ug.setTranslate(tx, ty);
+ }
+
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/postit/AreaLayout.java b/src/net/sourceforge/plantuml/postit/AreaLayout.java
new file mode 100644
index 000000000..28cf5c010
--- /dev/null
+++ b/src/net/sourceforge/plantuml/postit/AreaLayout.java
@@ -0,0 +1,46 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 4167 $
+ *
+ */
+package net.sourceforge.plantuml.postit;
+
+import java.awt.geom.Point2D;
+import java.util.Collection;
+import java.util.Map;
+
+import net.sourceforge.plantuml.graphic.StringBounder;
+
+public interface AreaLayout {
+
+ Map getPositions(Collection all, StringBounder stringBounder);
+
+}
diff --git a/src/net/sourceforge/plantuml/postit/AreaLayoutFixedWidth.java b/src/net/sourceforge/plantuml/postit/AreaLayoutFixedWidth.java
new file mode 100644
index 000000000..3272b9507
--- /dev/null
+++ b/src/net/sourceforge/plantuml/postit/AreaLayoutFixedWidth.java
@@ -0,0 +1,61 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 4167 $
+ *
+ */
+package net.sourceforge.plantuml.postit;
+
+import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import net.sourceforge.plantuml.graphic.StringBounder;
+
+public class AreaLayoutFixedWidth implements AreaLayout {
+
+ public Map getPositions(Collection all, StringBounder stringBounder) {
+ double x = 0;
+ double y = 0;
+ final Map result = new LinkedHashMap();
+
+ for (PostIt p : all) {
+ result.put(p, new Point2D.Double(x, y));
+ final Dimension2D dim = p.getDimension(stringBounder);
+ x += dim.getWidth() + 10;
+ }
+
+ return Collections.unmodifiableMap(result);
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/postit/CommandCreatePostIt.java b/src/net/sourceforge/plantuml/postit/CommandCreatePostIt.java
new file mode 100644
index 000000000..086d93836
--- /dev/null
+++ b/src/net/sourceforge/plantuml/postit/CommandCreatePostIt.java
@@ -0,0 +1,67 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 5424 $
+ *
+ */
+package net.sourceforge.plantuml.postit;
+
+import java.util.Map;
+
+import net.sourceforge.plantuml.StringUtils;
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand2;
+import net.sourceforge.plantuml.command.regex.RegexConcat;
+import net.sourceforge.plantuml.command.regex.RegexLeaf;
+import net.sourceforge.plantuml.command.regex.RegexPartialMatch;
+
+public class CommandCreatePostIt extends SingleLineCommand2 {
+
+ public CommandCreatePostIt(PostItDiagram diagram) {
+ super(diagram, getRegexConcat());
+ }
+
+ static RegexConcat getRegexConcat() {
+ return new RegexConcat(new RegexLeaf("^"), //
+ new RegexLeaf("post[- ]?it\\s+"), //
+ new RegexLeaf("ID", "([-\\p{L}0-9_./]+)"), //
+ new RegexLeaf("\\s+"), //
+ new RegexLeaf("TEXT", ":?(.*)?$"));
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(Map arg) {
+ final String id = arg.get("ID").get(0);
+ final String text = arg.get("TEXT").get(0);
+ getSystem().createPostIt(id, StringUtils.getWithNewlines(text));
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/postit/CommandWidth.java b/src/net/sourceforge/plantuml/postit/CommandWidth.java
new file mode 100644
index 000000000..67f40cb27
--- /dev/null
+++ b/src/net/sourceforge/plantuml/postit/CommandWidth.java
@@ -0,0 +1,55 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 4762 $
+ *
+ */
+package net.sourceforge.plantuml.postit;
+
+import java.util.List;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand;
+
+public class CommandWidth extends SingleLineCommand {
+
+ public CommandWidth(PostItDiagram system) {
+ super(system, "(?i)^width\\s+(\\d+)$");
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(List arg) {
+
+ final int width = Integer.parseInt(arg.get(0));
+ getSystem().setWidth(width);
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/postit/Elastic.java b/src/net/sourceforge/plantuml/postit/Elastic.java
new file mode 100644
index 000000000..e335f3697
--- /dev/null
+++ b/src/net/sourceforge/plantuml/postit/Elastic.java
@@ -0,0 +1,44 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 4167 $
+ *
+ */
+package net.sourceforge.plantuml.postit;
+
+import net.sourceforge.plantuml.graphic.StringBounder;
+
+public interface Elastic {
+
+ double widthWhenHeightIs(double height, StringBounder stringBounder);
+
+ double heightWhenWidthIs(double width, StringBounder stringBounder);
+
+}
diff --git a/src/net/sourceforge/plantuml/postit/PostIdDiagramFactory.java b/src/net/sourceforge/plantuml/postit/PostIdDiagramFactory.java
new file mode 100644
index 000000000..c1182b6f3
--- /dev/null
+++ b/src/net/sourceforge/plantuml/postit/PostIdDiagramFactory.java
@@ -0,0 +1,55 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 6137 $
+ *
+ */
+package net.sourceforge.plantuml.postit;
+
+import net.sourceforge.plantuml.command.AbstractUmlSystemCommandFactory;
+
+public class PostIdDiagramFactory extends AbstractUmlSystemCommandFactory {
+
+ private PostItDiagram system;
+
+ @Override
+ protected void initCommands() {
+ system = new PostItDiagram();
+
+ addCommonCommands(system);
+ addCommand(new CommandCreatePostIt(system));
+ addCommand(new CommandWidth(system));
+ }
+
+ public PostItDiagram getSystem() {
+ return system;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/postit/PostIt.java b/src/net/sourceforge/plantuml/postit/PostIt.java
new file mode 100644
index 000000000..3a17d596d
--- /dev/null
+++ b/src/net/sourceforge/plantuml/postit/PostIt.java
@@ -0,0 +1,114 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 4167 $
+ *
+ */
+package net.sourceforge.plantuml.postit;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.geom.Dimension2D;
+import java.util.Collections;
+import java.util.List;
+
+import net.sourceforge.plantuml.Dimension2DDouble;
+import net.sourceforge.plantuml.FontParam;
+import net.sourceforge.plantuml.SkinParam;
+import net.sourceforge.plantuml.graphic.HtmlColor;
+import net.sourceforge.plantuml.graphic.StringBounder;
+import net.sourceforge.plantuml.skin.Component;
+import net.sourceforge.plantuml.skin.SimpleContext2D;
+import net.sourceforge.plantuml.skin.rose.ComponentRoseNote;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+
+public class PostIt {
+
+ private final String id;
+ private final List text;
+
+ private Dimension2D minimunDimension;
+
+ public PostIt(String id, List text) {
+ this.id = id;
+ this.text = text;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public List getText() {
+ return Collections.unmodifiableList(text);
+ }
+
+ public Dimension2D getMinimunDimension() {
+ return minimunDimension;
+ }
+
+ public void setMinimunDimension(Dimension2D minimunDimension) {
+ this.minimunDimension = minimunDimension;
+ }
+
+ public Dimension2D getDimension(StringBounder stringBounder) {
+ double width = getComponent().getPreferredWidth(stringBounder);
+ double height = getComponent().getPreferredHeight(stringBounder);
+
+ if (minimunDimension != null && width < minimunDimension.getWidth()) {
+ width = minimunDimension.getWidth();
+ }
+ if (minimunDimension != null && height < minimunDimension.getHeight()) {
+ height = minimunDimension.getHeight();
+ }
+
+ return new Dimension2DDouble(width, height);
+ }
+
+ public void drawU(UGraphic ug) {
+
+ final Component note = getComponent();
+ final StringBounder stringBounder = ug.getStringBounder();
+ final Dimension2D dimensionToUse = getDimension(stringBounder);
+
+ note.drawU(ug, dimensionToUse, new SimpleContext2D(false));
+
+ }
+
+ private Component getComponent() {
+ final Color noteBackgroundColor = HtmlColor.getColorIfValid("#FBFB77").getColor();
+ final Color borderColor = HtmlColor.getColorIfValid("#A80036").getColor();
+
+ final SkinParam param = new SkinParam();
+ final Font fontNote = param.getFont(FontParam.NOTE, null);
+ final ComponentRoseNote note = new ComponentRoseNote(noteBackgroundColor, borderColor, Color.BLACK, fontNote,
+ text);
+ return note;
+ }
+}
diff --git a/src/net/sourceforge/plantuml/postit/PostItDiagram.java b/src/net/sourceforge/plantuml/postit/PostItDiagram.java
new file mode 100644
index 000000000..2e8518eff
--- /dev/null
+++ b/src/net/sourceforge/plantuml/postit/PostItDiagram.java
@@ -0,0 +1,147 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 4167 $
+ *
+ */
+package net.sourceforge.plantuml.postit;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import net.sourceforge.plantuml.EmptyImageBuilder;
+import net.sourceforge.plantuml.FileFormat;
+import net.sourceforge.plantuml.FileFormatOption;
+import net.sourceforge.plantuml.UmlDiagram;
+import net.sourceforge.plantuml.UmlDiagramType;
+import net.sourceforge.plantuml.png.PngIO;
+import net.sourceforge.plantuml.sequencediagram.graphic.SequenceDiagramFileMaker;
+import net.sourceforge.plantuml.ugraphic.UGraphic;
+import net.sourceforge.plantuml.ugraphic.eps.UGraphicEps;
+import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
+import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg;
+
+public class PostItDiagram extends UmlDiagram {
+
+ private final Area defaultArea = new Area('\0', null);
+
+ private final Map postIts = new HashMap();
+
+ @Override
+ public UmlDiagramType getUmlDiagramType() {
+ throw new UnsupportedOperationException();
+ }
+
+ public void createFile(OutputStream os, int index, FileFormatOption fileFormatOption) throws IOException {
+ final UGraphic ug = createImage(fileFormatOption);
+ drawU(ug);
+ if (ug instanceof UGraphicG2d) {
+ final BufferedImage im = ((UGraphicG2d) ug).getBufferedImage();
+ PngIO.write(im, os, this.getMetadata(), this.getDpi(fileFormatOption));
+ } else if (ug instanceof UGraphicSvg) {
+ final UGraphicSvg svg = (UGraphicSvg) ug;
+ svg.createXml(os);
+ } else if (ug instanceof UGraphicEps) {
+ final UGraphicEps eps = (UGraphicEps) ug;
+ os.write(eps.getEPSCode().getBytes());
+ }
+ }
+
+ public List createFiles(File suggestedFile, FileFormatOption fileFormatOption) throws IOException,
+ InterruptedException {
+ OutputStream os = null;
+ try {
+ os = new FileOutputStream(suggestedFile);
+ createFile(os, 0, fileFormatOption);
+ } finally {
+ if (os != null) {
+ os.close();
+ }
+ }
+ return Arrays.asList(suggestedFile);
+ }
+
+ public String getDescription() {
+ return "Board of post-it";
+ }
+
+ public Area getDefaultArea() {
+ return defaultArea;
+ }
+
+ public Area createArea(char id) {
+ throw new UnsupportedOperationException();
+ }
+
+ public PostIt createPostIt(String id, List text) {
+ if (postIts.containsKey(id)) {
+ throw new IllegalArgumentException();
+ }
+ final PostIt postIt = new PostIt(id, text);
+ postIts.put(id, postIt);
+ getDefaultArea().add(postIt);
+ return postIt;
+ }
+
+ void drawU(UGraphic ug) {
+ getDefaultArea().drawU(ug);
+ }
+
+ private UGraphic createImage(FileFormatOption fileFormatOption) {
+ final Color backColor = this.getSkinParam().getBackgroundColor().getColor();
+ final FileFormat fileFormat = fileFormatOption.getFileFormat();
+ if (fileFormat == FileFormat.PNG) {
+ final double height = getDefaultArea().heightWhenWidthIs(width,
+ SequenceDiagramFileMaker.getDummystringbounder());
+ final EmptyImageBuilder builder = new EmptyImageBuilder(width, height, backColor);
+
+ final Graphics2D graphics2D = builder.getGraphics2D();
+ final double dpiFactor = this.getDpiFactor(fileFormatOption);
+ return new UGraphicG2d(graphics2D, builder.getBufferedImage(), dpiFactor);
+ }
+ throw new UnsupportedOperationException();
+ }
+
+ private int width = 800;
+
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/preproc/StartumlExtractReader.java b/src/net/sourceforge/plantuml/preproc/StartumlExtractReader.java
new file mode 100644
index 000000000..5d3edd9df
--- /dev/null
+++ b/src/net/sourceforge/plantuml/preproc/StartumlExtractReader.java
@@ -0,0 +1,76 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ * Revision $Revision: 3835 $
+ *
+ */
+package net.sourceforge.plantuml.preproc;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+public class StartumlExtractReader implements ReadLine {
+
+ private final ReadLine raw;
+
+ public StartumlExtractReader(File f, int num) throws FileNotFoundException {
+ if (num < 0) {
+ throw new IllegalArgumentException();
+ }
+ raw = getReadLine(f);
+ }
+
+ static public boolean containsStartuml(File f) throws IOException {
+ ReadLine r = null;
+ try {
+ r = getReadLine(f);
+ } finally {
+ if (r != null) {
+ r.close();
+ }
+ }
+ return false;
+ }
+
+ private static ReadLine getReadLine(File f) throws FileNotFoundException {
+ return new UncommentReadLine(new ReadLineReader(new FileReader(f)));
+ }
+
+ public String readLine() throws IOException {
+ return raw.readLine();
+ }
+
+ public void close() throws IOException {
+ raw.close();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/ConstraintSet.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/ConstraintSet.java
index f76abb83b..23ea853de 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/ConstraintSet.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/ConstraintSet.java
@@ -28,7 +28,7 @@
*
* Original Author: Arnaud Roques
*
- * Revision $Revision: 5251 $
+ * Revision $Revision: 6198 $
*
*/
package net.sourceforge.plantuml.sequencediagram.graphic;
@@ -133,7 +133,7 @@ class ConstraintSet {
}
}
- private void pushToLeftParticipantBox(double deltaX, Pushable firstToChange) {
+ public void pushToLeftParticipantBox(double deltaX, Pushable firstToChange, boolean including) {
if (deltaX <= 0) {
throw new IllegalArgumentException();
}
@@ -145,6 +145,9 @@ class ConstraintSet {
for (Pushable box : participantList) {
if (box.equals(firstToChange)) {
founded = true;
+ if (including==false) {
+ continue;
+ }
}
if (founded) {
box.pushToLeft(deltaX);
@@ -153,7 +156,7 @@ class ConstraintSet {
}
public void pushToLeft(double delta) {
- pushToLeftParticipantBox(delta, firstBorder);
+ pushToLeftParticipantBox(delta, firstBorder, true);
}
private void ensureSpaceAfter(StringBounder stringBounder, Pushable p1, Pushable p2, double space) {
@@ -167,7 +170,7 @@ class ConstraintSet {
assert p1.getCenterX(stringBounder) < p2.getCenterX(stringBounder);
final double existingSpace = p2.getCenterX(stringBounder) - p1.getCenterX(stringBounder);
if (existingSpace < space) {
- pushToLeftParticipantBox(space - existingSpace, p2);
+ pushToLeftParticipantBox(space - existingSpace, p2, true);
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
index dbc0017ef..e11898f6c 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSet.java
@@ -28,7 +28,7 @@
*
* Original Author: Arnaud Roques
*
- * Revision $Revision: 6113 $
+ * Revision $Revision: 6198 $
*
*/
package net.sourceforge.plantuml.sequencediagram.graphic;
@@ -141,7 +141,7 @@ class DrawableSet {
return height + heightEnglober;
}
- public List getExistingParticipantEnglober2() {
+ public List getExistingParticipantEnglober() {
final List result = new ArrayList();
ParticipantEngloberContexted pending = null;
for (Map.Entry ent : participantEnglobers2.entrySet()) {
@@ -163,7 +163,7 @@ class DrawableSet {
public double getOffsetForEnglobers(StringBounder stringBounder) {
double result = 0;
- for (ParticipantEngloberContexted englober : getExistingParticipantEnglober2()) {
+ for (ParticipantEngloberContexted englober : getExistingParticipantEnglober()) {
final Component comp = skin.createComponent(ComponentType.ENGLOBER, skinParam, englober
.getParticipantEnglober().getTitle());
final double height = comp.getPreferredHeight(stringBounder);
@@ -178,7 +178,7 @@ class DrawableSet {
static private final int MARGIN_FOR_ENGLOBERS1 = 2;
public double getTailHeight(StringBounder stringBounder, boolean showTail) {
- final double marginForEnglobers = getExistingParticipantEnglober2().size() > 0 ? MARGIN_FOR_ENGLOBERS : 0;
+ final double marginForEnglobers = getExistingParticipantEnglober().size() > 0 ? MARGIN_FOR_ENGLOBERS : 0;
if (showTail == false) {
return 1 + marginForEnglobers;
@@ -315,7 +315,7 @@ class DrawableSet {
}
private void drawEnglobers(UGraphic ug, double height, Context2D context) {
- for (ParticipantEngloberContexted englober : getExistingParticipantEnglober2()) {
+ for (ParticipantEngloberContexted englober : getExistingParticipantEnglober()) {
double x1 = getX1(englober);
final double x2 = getX2(ug.getStringBounder(), englober);
@@ -325,9 +325,9 @@ class DrawableSet {
final double preferedWidth = getEngloberPreferedWidth(ug.getStringBounder(),
englober.getParticipantEnglober());
if (preferedWidth > width) {
- if (englober.getFirst2() == englober.getLast2()) {
+ //if (englober.getFirst2() == englober.getLast2()) {
x1 -= (preferedWidth - width) / 2;
- }
+ //}
final Dimension2DDouble dim = new Dimension2DDouble(preferedWidth, height);
ug.translate(x1, 1);
comp.drawU(ug, dim, context);
@@ -351,13 +351,13 @@ class DrawableSet {
return skin.createComponent(ComponentType.ENGLOBER, s, englober.getTitle());
}
- private double getX1(ParticipantEngloberContexted englober) {
+ public double getX1(ParticipantEngloberContexted englober) {
final Participant first = englober.getFirst2();
final ParticipantBox firstBox = participants.get(first).getParticipantBox();
return firstBox.getStartingX() + 1;
}
- private double getX2(StringBounder stringBounder, ParticipantEngloberContexted englober) {
+ public double getX2(StringBounder stringBounder, ParticipantEngloberContexted englober) {
final Participant last = englober.getLast2();
final ParticipantBox lastBox = participants.get(last).getParticipantBox();
return lastBox.getMaxX(stringBounder) - 1;
@@ -394,7 +394,7 @@ class DrawableSet {
// }
private ParticipantEngloberContexted getParticipantEnglober(Participant p) {
- for (ParticipantEngloberContexted pe : getExistingParticipantEnglober2()) {
+ for (ParticipantEngloberContexted pe : getExistingParticipantEnglober()) {
if (pe.contains(p)) {
return pe;
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java
index f5569daa1..d80f566b2 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java
@@ -28,7 +28,7 @@
*
* Original Author: Arnaud Roques
*
- * Revision $Revision: 6113 $
+ * Revision $Revision: 6198 $
*
*/
package net.sourceforge.plantuml.sequencediagram.graphic;
@@ -154,9 +154,10 @@ class DrawableSetInitializer {
}
}
- takeParticipantEngloberTitleWidth(stringBounder);
-
+ //takeParticipantEngloberTitleWidth(stringBounder);
constraintSet.takeConstraintIntoAccount(stringBounder);
+ //takeParticipantEngloberTitleWidth2(stringBounder);
+ takeParticipantEngloberTitleWidth3(stringBounder);
prepareMissingSpace(stringBounder);
@@ -164,26 +165,66 @@ class DrawableSetInitializer {
return drawableSet;
}
- private void takeParticipantEngloberTitleWidth(StringBounder stringBounder) {
- for (ParticipantEngloberContexted pe : drawableSet.getExistingParticipantEnglober2()) {
+ private void takeParticipantEngloberTitleWidth3(StringBounder stringBounder) {
+ for (ParticipantEngloberContexted pe : drawableSet.getExistingParticipantEnglober()) {
final double preferredWidth = drawableSet.getEngloberPreferedWidth(stringBounder,
pe.getParticipantEnglober());
final ParticipantBox first = drawableSet.getLivingParticipantBox(pe.getFirst2()).getParticipantBox();
final ParticipantBox last = drawableSet.getLivingParticipantBox(pe.getLast2()).getParticipantBox();
+ final double x1 = drawableSet.getX1(pe);
+ final double x2 = drawableSet.getX2(stringBounder, pe);
+ final double missing = preferredWidth - (x2 - x1);
+ System.err.println("x1=" + x1 + " x2=" + x2 + " preferredWidth=" + preferredWidth + " missing=" + missing);
+ if (missing>0) {
+ constraintSet
+ .pushToLeftParticipantBox(missing / 2, first, true);
+ constraintSet
+ .pushToLeftParticipantBox(missing / 2, last, false);
+ }
+ }
+ }
+
+ private void takeParticipantEngloberTitleWidth2(StringBounder stringBounder) {
+ double lastX2;
+ for (ParticipantEngloberContexted pe : drawableSet.getExistingParticipantEnglober()) {
+ final double preferredWidth = drawableSet.getEngloberPreferedWidth(stringBounder,
+ pe.getParticipantEnglober());
+ final ParticipantBox first = drawableSet.getLivingParticipantBox(pe.getFirst2()).getParticipantBox();
+ final ParticipantBox last = drawableSet.getLivingParticipantBox(pe.getLast2()).getParticipantBox();
+ final double x1 = drawableSet.getX1(pe);
+ final double x2 = drawableSet.getX2(stringBounder, pe);
+ final double missing = preferredWidth - (x2 - x1);
+ System.err.println("x1=" + x1 + " x2=" + x2 + " preferredWidth=" + preferredWidth + " missing=" + missing);
+ if (missing > 0) {
+ constraintSet.getConstraintAfter(last).push(missing);
+ constraintSet.takeConstraintIntoAccount(stringBounder);
+ }
+ lastX2 = x2;
+ }
+ }
+ private void takeParticipantEngloberTitleWidth(StringBounder stringBounder) {
+ ParticipantBox previousLast = null;
+ for (ParticipantEngloberContexted pe : drawableSet.getExistingParticipantEnglober()) {
+ final double preferredWidth = drawableSet.getEngloberPreferedWidth(stringBounder,
+ pe.getParticipantEnglober());
+ final ParticipantBox first = drawableSet.getLivingParticipantBox(pe.getFirst2()).getParticipantBox();
+ final ParticipantBox last = drawableSet.getLivingParticipantBox(pe.getLast2()).getParticipantBox();
+ final double margin = 5;
if (first == last) {
final Constraint constraint1 = constraintSet.getConstraintBefore(first);
final Constraint constraint2 = constraintSet.getConstraintAfter(last);
final double w1 = constraint1.getParticipant1().getPreferredWidth(stringBounder);
final double w2 = constraint2.getParticipant2().getPreferredWidth(stringBounder);
- constraint1.ensureValue(preferredWidth / 2 + w1 / 2 + 5);
- constraint2.ensureValue(preferredWidth / 2 + w2 / 2 + 5);
+ constraint1.ensureValue(preferredWidth / 2 + w1 / 2 + margin);
+ constraint2.ensureValue(preferredWidth / 2 + w2 / 2 + margin);
} else {
final Pushable beforeFirst = constraintSet.getPrevious(first);
final Pushable afterLast = constraintSet.getNext(last);
final Constraint constraint1 = constraintSet.getConstraint(beforeFirst, afterLast);
constraint1.ensureValue(preferredWidth + beforeFirst.getPreferredWidth(stringBounder) / 2
- + afterLast.getPreferredWidth(stringBounder) / 2 + 10);
+ + afterLast.getPreferredWidth(stringBounder) / 2 + 2 * margin);
}
+ previousLast = last;
}
}
diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMaker.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMaker.java
index d4bd3f23b..5a65bd800 100644
--- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMaker.java
+++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMaker.java
@@ -28,7 +28,7 @@
*
* Original Author: Arnaud Roques
*
- * Revision $Revision: 6113 $
+ * Revision $Revision: 6208 $
*
*/
package net.sourceforge.plantuml.sequencediagram.graphic;
@@ -408,4 +408,8 @@ public class SequenceDiagramFileMaker implements FileMaker {
text.drawU(ug, area.getHeaderX(diagram.getHeaderAlignement()), area.getHeaderY());
}
+ public static StringBounder getDummystringbounder() {
+ return dummyStringBounder;
+ }
+
}
diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState2.java b/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState2.java
index 240d35543..e41d04527 100644
--- a/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState2.java
+++ b/src/net/sourceforge/plantuml/statediagram/command/CommandLinkState2.java
@@ -34,6 +34,7 @@
package net.sourceforge.plantuml.statediagram.command;
import java.util.Map;
+import java.util.StringTokenizer;
import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.StringUtils;
@@ -57,14 +58,15 @@ public class CommandLinkState2 extends SingleLineCommand2 {
static RegexConcat getRegex() {
return new RegexConcat(
- new RegexLeaf("^"),
- getStatePattern("ENT1"),
- new RegexLeaf("\\s*"),
- new RegexLeaf("ARROW", "((-+)(left|right|up|down|le?|ri?|up?|do?)?(-*)([\\]>]))"),
- new RegexLeaf("\\s*"),
- getStatePattern("ENT2"),
- new RegexLeaf("\\s*"),
- new RegexLeaf("LABEL", "(?::\\s*([^\"]+))?"),
+ new RegexLeaf("^"), //
+ getStatePattern("ENT1"), //
+ new RegexLeaf("\\s*"), //
+ new RegexLeaf("ARROW",
+ "((-+)(left|right|up|down|le?|ri?|up?|do?)?(?:\\[((?:#\\w+|dotted|dashed|bold)(?:,#\\w+|,dotted|,dashed|,bold)*)\\])?(-*)\\>)"),
+ new RegexLeaf("\\s*"), //
+ getStatePattern("ENT2"), //
+ new RegexLeaf("\\s*"), //
+ new RegexLeaf("LABEL", "(?::\\s*([^\"]+))?"), //
new RegexLeaf("$"));
}
@@ -79,7 +81,7 @@ public class CommandLinkState2 extends SingleLineCommand2 {
final IEntity cl1 = getEntityStart(ent1);
final IEntity cl2 = getEntityEnd(ent2);
-
+
if (arg.get("ENT1").get(1) != null) {
cl1.setStereotype(new Stereotype(arg.get("ENT1").get(1)));
}
@@ -93,7 +95,7 @@ public class CommandLinkState2 extends SingleLineCommand2 {
cl2.setSpecificBackcolor(arg.get("ENT2").get(2));
}
- String queue = arg.get("ARROW").get(1) + arg.get("ARROW").get(3);
+ String queue = arg.get("ARROW").get(1) + arg.get("ARROW").get(4);
final Direction dir = getDirection(arg);
if (dir == Direction.LEFT || dir == Direction.RIGHT) {
@@ -106,6 +108,21 @@ public class CommandLinkState2 extends SingleLineCommand2 {
if (dir == Direction.LEFT || dir == Direction.UP) {
link = link.getInv();
}
+ if (arg.get("ARROW").get(3) != null) {
+ final StringTokenizer st = new StringTokenizer(arg.get("ARROW").get(3), ",");
+ while (st.hasMoreTokens()) {
+ final String s = st.nextToken();
+ if (s.equalsIgnoreCase("dashed")) {
+ link = link.getDashed();
+ } else if (s.equalsIgnoreCase("bold")) {
+ link = link.getBold();
+ } else if (s.equalsIgnoreCase("dotted")) {
+ link = link.getDotted();
+ } else {
+ link.setSpecificColor(s);
+ }
+ }
+ }
getSystem().addLink(link);
return CommandExecutionResult.ok();
diff --git a/src/net/sourceforge/plantuml/usecasediagram/UsecaseDiagramFactory.java b/src/net/sourceforge/plantuml/usecasediagram/UsecaseDiagramFactory.java
index b3a78a856..97f5f9df7 100644
--- a/src/net/sourceforge/plantuml/usecasediagram/UsecaseDiagramFactory.java
+++ b/src/net/sourceforge/plantuml/usecasediagram/UsecaseDiagramFactory.java
@@ -45,6 +45,7 @@ import net.sourceforge.plantuml.usecasediagram.command.CommandCreateUsecase2;
import net.sourceforge.plantuml.usecasediagram.command.CommandLinkUsecase2;
import net.sourceforge.plantuml.usecasediagram.command.CommandMultilinesUsecaseNoteEntity;
import net.sourceforge.plantuml.usecasediagram.command.CommandRankDirUsecase;
+import net.sourceforge.plantuml.usecasediagram.command.CommandSetStrategy;
public class UsecaseDiagramFactory extends AbstractUmlSystemCommandFactory {
@@ -77,5 +78,7 @@ public class UsecaseDiagramFactory extends AbstractUmlSystemCommandFactory {
addCommand(new CommandMultilinesUsecaseNoteEntity(system));
addCommand(new CommandMultilinesStandaloneNote(system));
- }
+
+ addCommand(new CommandSetStrategy(system));
+}
}
diff --git a/src/net/sourceforge/plantuml/usecasediagram/command/CommandSetStrategy.java b/src/net/sourceforge/plantuml/usecasediagram/command/CommandSetStrategy.java
new file mode 100644
index 000000000..917162f7e
--- /dev/null
+++ b/src/net/sourceforge/plantuml/usecasediagram/command/CommandSetStrategy.java
@@ -0,0 +1,55 @@
+/* ========================================================================
+ * PlantUML : a free UML diagram generator
+ * ========================================================================
+ *
+ * (C) Copyright 2009, Arnaud Roques
+ *
+ * Project Info: http://plantuml.sourceforge.net
+ *
+ * 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 Lesser General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * [Java is a trademark or registered trademark of Sun Microsystems, Inc.
+ * in the United States and other countries.]
+ *
+ * Original Author: Arnaud Roques
+ *
+ */
+package net.sourceforge.plantuml.usecasediagram.command;
+
+import java.util.List;
+
+import net.sourceforge.plantuml.command.CommandExecutionResult;
+import net.sourceforge.plantuml.command.SingleLineCommand;
+import net.sourceforge.plantuml.cucadiagram.CucaDiagram;
+import net.sourceforge.plantuml.cucadiagram.dot.GraphvizLayoutStrategy;
+
+public class CommandSetStrategy extends SingleLineCommand {
+
+ public CommandSetStrategy(CucaDiagram diagram) {
+ super(
+ diagram,
+ "(?i)^layout with neato$");
+ }
+
+ @Override
+ protected CommandExecutionResult executeArg(List arg) {
+ getSystem().setStrategy(GraphvizLayoutStrategy.NEATO);
+ return CommandExecutionResult.ok();
+ }
+
+}
diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java
index fa4216aec..0a0b922a6 100644
--- a/src/net/sourceforge/plantuml/version/Version.java
+++ b/src/net/sourceforge/plantuml/version/Version.java
@@ -28,7 +28,7 @@
*
* Original Author: Arnaud Roques
*
- * Revision $Revision: 6142 $
+ * Revision $Revision: 6211 $
*
*/
package net.sourceforge.plantuml.version;
@@ -36,11 +36,11 @@ package net.sourceforge.plantuml.version;
public class Version {
public static int version() {
- return 6141;
+ return 6210;
}
public static long compileTime() {
- return 1298495043843L;
+ return 1300656476468L;
}
}
diff --git a/src/net/sourceforge/plantuml/xmi/XmiClassDiagram.java b/src/net/sourceforge/plantuml/xmi/XmiClassDiagram.java
index 7583d6900..3d026f3e5 100644
--- a/src/net/sourceforge/plantuml/xmi/XmiClassDiagram.java
+++ b/src/net/sourceforge/plantuml/xmi/XmiClassDiagram.java
@@ -195,7 +195,7 @@ public class XmiClassDiagram {
final Element feature = document.createElement("UML:Classifier.feature");
cla.appendChild(feature);
- for (Member m : entity.fields2()) {
+ for (Member m : entity.getFieldsToDisplay()) {
//