From 092b0a79bd962b1e1b1f1c7df805cbab075b9cb5 Mon Sep 17 00:00:00 2001 From: Arnaud Roques Date: Fri, 22 Apr 2016 22:36:08 +0200 Subject: [PATCH] version 8039 --- build.xml | 14 +- pom.xml | 8 +- src/net/sourceforge/plantuml/ColorParam.java | 3 +- src/net/sourceforge/plantuml/FileFormat.java | 2 +- .../sourceforge/plantuml/NewpagedDiagram.java | 7 +- src/net/sourceforge/plantuml/Option.java | 4 +- src/net/sourceforge/plantuml/OptionPrint.java | 5 +- .../sourceforge/plantuml/PSystemBuilder.java | 2 + .../sourceforge/plantuml/SignatureUtils.java | 18 ++- src/net/sourceforge/plantuml/UmlDiagram.java | 9 +- .../plantuml/ant/PlantUmlTask.java | 5 +- .../plantuml/asciiart/ComponentTextArrow.java | 3 + .../plantuml/asciiart/ComponentTextNote.java | 19 ++- .../plantuml/asciiart/TextSkin.java | 8 +- .../plantuml/command/ProtectedCommand.java | 2 +- .../FactorySequenceNoteOnArrowCommand.java | 12 +- .../plantuml/cucadiagram/CucaDiagram.java | 14 +- .../dedication/DecoderInputStream.java | 102 +++++++++++++ .../plantuml/dedication/Dedication.java | 84 +++++++++++ .../plantuml/dedication/Dedications.java | 78 ++++++++++ ...i9rNQVH44hebtYNePymublPiBIpRDwZGKrbG00.png | Bin 0 -> 15278 bytes .../dedication/PSystemDedication.java | 80 ++++++++++ .../dedication/PSystemDedicationFactory.java | 50 +++++++ ...1mAI032reWO3p4Mog-AV6jFqjXfi8G6pKo7G00.png | Bin 0 -> 5380 bytes .../command/CommandPackageWithUSymbol.java | 2 +- .../plantuml/donors/PSystemDonors.java | 2 +- .../plantuml/graphic/QuoteUtils.java | 18 +-- .../sourceforge/plantuml/graphic/USymbol.java | 1 + .../plantuml/graphic/USymbolTogether.java | 66 +++++++++ .../jdot/CucaDiagramFileMakerJDot.java | 31 +++- .../sequencediagram/AbstractMessage.java | 11 +- .../plantuml/sequencediagram/NoteStyle.java | 13 ++ .../graphic/DrawableSetInitializer.java | 14 +- .../sequencediagram/graphic/Step1Message.java | 5 +- .../sourceforge/plantuml/skin/rose/Rose.java | 4 +- .../plantuml/svek/GraphvizCrash.java | 3 +- .../sourceforge/plantuml/ugraphic/UImage.java | 6 +- .../sourceforge/plantuml/version/License.java | 72 ++++++++- .../sourceforge/plantuml/version/Version.java | 6 +- .../xmlsc/ScxmlStateDiagramStandard.java | 138 ++++++++++++++++++ .../xmlsc/StateDiagramScxmlMaker.java | 69 +++++++++ 41 files changed, 914 insertions(+), 76 deletions(-) create mode 100644 src/net/sourceforge/plantuml/dedication/DecoderInputStream.java create mode 100644 src/net/sourceforge/plantuml/dedication/Dedication.java create mode 100644 src/net/sourceforge/plantuml/dedication/Dedications.java create mode 100644 src/net/sourceforge/plantuml/dedication/G-vlxV6y0ekXvg4jdrZhpVdo7lhOrgzdDMujAyww7DSmBwYMPUi9rNQVH44hebtYNePymublPiBIpRDwZGKrbG00.png create mode 100644 src/net/sourceforge/plantuml/dedication/PSystemDedication.java create mode 100644 src/net/sourceforge/plantuml/dedication/PSystemDedicationFactory.java create mode 100644 src/net/sourceforge/plantuml/dedication/RyHcSMMTGTW-ZlDelq18AwlwfbZZdfo-Yo0ketavjyFxRAFoKx1mAI032reWO3p4Mog-AV6jFqjXfi8G6pKo7G00.png create mode 100644 src/net/sourceforge/plantuml/graphic/USymbolTogether.java create mode 100644 src/net/sourceforge/plantuml/xmlsc/ScxmlStateDiagramStandard.java create mode 100644 src/net/sourceforge/plantuml/xmlsc/StateDiagramScxmlMaker.java diff --git a/build.xml b/build.xml index dd4dad274..2158d69fd 100644 --- a/build.xml +++ b/build.xml @@ -20,7 +20,7 @@ - + + + + + + + + + + + @@ -49,6 +59,8 @@ + + diff --git a/pom.xml b/pom.xml index dfaa7264e..f997c8cc4 100644 --- a/pom.xml +++ b/pom.xml @@ -35,7 +35,7 @@ net.sourceforge.plantuml plantuml - 8025-SNAPSHOT + 8040-SNAPSHOT jar PlantUML @@ -111,10 +111,12 @@ ${project.basedir}/src - net/sourceforge/plantuml/version/logo.png - net/sourceforge/plantuml/version/favicon.png + net/sourceforge/plantuml/version/*.png + net/sourceforge/plantuml/openiconic/data/*.txt net/sourceforge/plantuml/openiconic/data/*.svg net/sourceforge/plantuml/fun/*.png + sprite/archimate/*.png + net/sourceforge/plantuml/dedication/*.png diff --git a/src/net/sourceforge/plantuml/ColorParam.java b/src/net/sourceforge/plantuml/ColorParam.java index 9590f266f..b35e83a73 100644 --- a/src/net/sourceforge/plantuml/ColorParam.java +++ b/src/net/sourceforge/plantuml/ColorParam.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19109 $ + * Revision $Revision: 19510 $ * */ package net.sourceforge.plantuml; @@ -105,6 +105,7 @@ public enum ColorParam { sequenceDividerBorder(HtmlColorUtils.BLACK, ColorType.LINE), sequenceLifeLineBackground(HtmlColorUtils.WHITE, true, ColorType.BACK), sequenceLifeLineBorder(HtmlColorUtils.MY_RED, ColorType.LINE), + sequenceNewpageSeparator(HtmlColorUtils.BLACK, ColorType.LINE), sequenceArrow(HtmlColorUtils.MY_RED), sequenceBoxBorder(HtmlColorUtils.MY_RED, ColorType.LINE), sequenceBoxBackground(HtmlColorUtils.COL_DDDDDD, true, ColorType.BACK), diff --git a/src/net/sourceforge/plantuml/FileFormat.java b/src/net/sourceforge/plantuml/FileFormat.java index 13dade974..48f4f1667 100644 --- a/src/net/sourceforge/plantuml/FileFormat.java +++ b/src/net/sourceforge/plantuml/FileFormat.java @@ -42,7 +42,7 @@ import java.io.File; * */ public enum FileFormat { - PNG, SVG, EPS, EPS_TEXT, ATXT, UTXT, XMI_STANDARD, XMI_STAR, XMI_ARGO, + PNG, SVG, EPS, EPS_TEXT, ATXT, UTXT, XMI_STANDARD, XMI_STAR, XMI_ARGO, SCXML, PDF, MJPEG, ANIMATED_GIF, HTML, HTML5, VDX, LATEX, LATEX_NO_PREAMBLE, BASE64; /** diff --git a/src/net/sourceforge/plantuml/NewpagedDiagram.java b/src/net/sourceforge/plantuml/NewpagedDiagram.java index febc831dc..e9b640dbd 100644 --- a/src/net/sourceforge/plantuml/NewpagedDiagram.java +++ b/src/net/sourceforge/plantuml/NewpagedDiagram.java @@ -124,7 +124,12 @@ public class NewpagedDiagram extends AbstractPSystem { if (sb.length() > 0) { sb.append(" "); } - sb.append(d.getWarningOrError()); + if (d.getWarningOrError() != null) { + sb.append(d.getWarningOrError()); + } + } + if (sb.length() == 0) { + return null; } return sb.toString(); } diff --git a/src/net/sourceforge/plantuml/Option.java b/src/net/sourceforge/plantuml/Option.java index 0bcf1d7f6..0151c8072 100644 --- a/src/net/sourceforge/plantuml/Option.java +++ b/src/net/sourceforge/plantuml/Option.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19396 $ + * Revision $Revision: 19543 $ * */ package net.sourceforge.plantuml; @@ -96,6 +96,8 @@ public class Option { setFileFormat(FileFormat.SVG); } else if (s.equalsIgnoreCase("-thtml") || s.equalsIgnoreCase("-html")) { setFileFormat(FileFormat.HTML); + } else if (s.equalsIgnoreCase("-tscxml") || s.equalsIgnoreCase("-scxml")) { + setFileFormat(FileFormat.SCXML); } else if (s.equalsIgnoreCase("-txmi") || s.equalsIgnoreCase("-xmi")) { setFileFormat(FileFormat.XMI_STANDARD); } else if (s.equalsIgnoreCase("-txmi:argo") || s.equalsIgnoreCase("-xmi:argo")) { diff --git a/src/net/sourceforge/plantuml/OptionPrint.java b/src/net/sourceforge/plantuml/OptionPrint.java index 731971e1c..24a659312 100644 --- a/src/net/sourceforge/plantuml/OptionPrint.java +++ b/src/net/sourceforge/plantuml/OptionPrint.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19254 $ + * Revision $Revision: 19604 $ * */ package net.sourceforge.plantuml; @@ -75,7 +75,8 @@ public class OptionPrint { System.out.println(" -tpdf\t\tTo generate images using PDF format"); System.out.println(" -tvdx\t\tTo generate images using VDX format"); System.out.println(" -txmi\t\tTo generate XMI file for class diagram"); - System.out.println(" -thtml\t\tTo generate HTML files for class diagram"); + System.out.println(" -tscxml\t\tTo generate SCXML file for state diagram"); + System.out.println(" -thtml\t\tTo generate HTML file for class diagram"); System.out.println(" -ttxt\t\tTo generate images with ASCII art"); System.out.println(" -tutxt\t\tTo generate images with ASCII art using Unicode characters"); System.out.println(" -tlatex\t\tTo generate images using LaTeX/Tikz format"); diff --git a/src/net/sourceforge/plantuml/PSystemBuilder.java b/src/net/sourceforge/plantuml/PSystemBuilder.java index a4cd98cb4..db892a4d8 100644 --- a/src/net/sourceforge/plantuml/PSystemBuilder.java +++ b/src/net/sourceforge/plantuml/PSystemBuilder.java @@ -47,6 +47,7 @@ import net.sourceforge.plantuml.core.DiagramType; import net.sourceforge.plantuml.core.UmlSource; import net.sourceforge.plantuml.creole.PSystemCreoleFactory; import net.sourceforge.plantuml.cute.PSystemCuteFactory; +import net.sourceforge.plantuml.dedication.PSystemDedicationFactory; import net.sourceforge.plantuml.descdiagram.DescriptionDiagramFactory; import net.sourceforge.plantuml.directdot.PSystemDotFactory; import net.sourceforge.plantuml.ditaa.PSystemDitaaFactory; @@ -159,6 +160,7 @@ public class PSystemBuilder { factories.add(new FlowDiagramFactory()); factories.add(new PSystemTreeFactory(DiagramType.JUNGLE)); factories.add(new PSystemCuteFactory(DiagramType.CUTE)); + factories.add(new PSystemDedicationFactory()); return factories; } diff --git a/src/net/sourceforge/plantuml/SignatureUtils.java b/src/net/sourceforge/plantuml/SignatureUtils.java index 109e0349e..8d7c33ca9 100644 --- a/src/net/sourceforge/plantuml/SignatureUtils.java +++ b/src/net/sourceforge/plantuml/SignatureUtils.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19109 $ + * Revision $Revision: 19602 $ * */ package net.sourceforge.plantuml; @@ -60,6 +60,22 @@ public class SignatureUtils { } } + public static String getSignatureSha512(String s) { + try { + final AsciiEncoder coder = new AsciiEncoder(); + final MessageDigest msgDigest = MessageDigest.getInstance("SHA-512"); + msgDigest.update(s.getBytes("UTF-8")); + final byte[] digest = msgDigest.digest(); + return coder.encode(digest); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + throw new UnsupportedOperationException(e); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + throw new UnsupportedOperationException(e); + } + } + public static String getSignatureWithoutImgSrc(String s) { s = getSignature(purge(s)); return s; diff --git a/src/net/sourceforge/plantuml/UmlDiagram.java b/src/net/sourceforge/plantuml/UmlDiagram.java index d6a37286e..84ce517e9 100644 --- a/src/net/sourceforge/plantuml/UmlDiagram.java +++ b/src/net/sourceforge/plantuml/UmlDiagram.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19398 $ + * Revision $Revision: 19591 $ * */ package net.sourceforge.plantuml; @@ -306,8 +306,8 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann strings.add(" - a bug in PlantUML"); strings.add(" - a problem in GraphViz"); strings.add(" "); - strings.add("You should send this diagram and this image to plantuml@gmail.com to solve this issue."); - strings.add("You can try to turn arround this issue by simplifing your diagram."); + strings.add("You should send this diagram and this image to plantuml@gmail.com or"); + strings.add("post to http://plantuml.com/qa to solve this issue."); strings.add(" "); return strings; } @@ -320,7 +320,8 @@ public abstract class UmlDiagram extends AbstractPSystem implements Diagram, Ann strings.add(" "); strings.add("PlantUML (" + Version.versionString() + ") has crashed."); strings.add(" "); - strings.add("You should send this diagram and this image to plantuml@gmail.com to solve this issue."); + strings.add("You should send this diagram and this image to plantuml@gmail.com or"); + strings.add("post to http://plantuml.com/qa to solve this issue."); strings.add("You can try to turn arround this issue by simplifing your diagram."); strings.add(" "); return strings; diff --git a/src/net/sourceforge/plantuml/ant/PlantUmlTask.java b/src/net/sourceforge/plantuml/ant/PlantUmlTask.java index cd7d3e620..d692bdfe3 100644 --- a/src/net/sourceforge/plantuml/ant/PlantUmlTask.java +++ b/src/net/sourceforge/plantuml/ant/PlantUmlTask.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19396 $ + * Revision $Revision: 19543 $ * */ package net.sourceforge.plantuml.ant; @@ -282,6 +282,9 @@ public class PlantUmlTask extends Task { } public void setFormat(String s) { + if ("scxml".equalsIgnoreCase(s)) { + option.setFileFormat(FileFormat.SCXML); + } if ("xmi".equalsIgnoreCase(s)) { option.setFileFormat(FileFormat.XMI_STANDARD); } diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java index 48f31e0a5..e3a80d8ed 100644 --- a/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java +++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextArrow.java @@ -105,6 +105,9 @@ public class ComponentTextArrow extends AbstractComponentText { charArea.drawChar('>', width - 1, yarrow); } else if (config.getArrowDirection() == ArrowDirection.RIGHT_TO_LEFT_REVERSE) { charArea.drawChar('<', 1, yarrow); + } else if (config.getArrowDirection() == ArrowDirection.BOTH_DIRECTION) { + charArea.drawChar('>', width - 1, yarrow); + charArea.drawChar('<', 1, yarrow); } else { throw new UnsupportedOperationException(); } diff --git a/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java b/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java index cb84060e3..a65692ce4 100644 --- a/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java +++ b/src/net/sourceforge/plantuml/asciiart/ComponentTextNote.java @@ -36,15 +36,14 @@ package net.sourceforge.plantuml.asciiart; import java.awt.geom.Dimension2D; import net.sourceforge.plantuml.FileFormat; +import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.cucadiagram.Display; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.skin.Area; -import net.sourceforge.plantuml.skin.Component; import net.sourceforge.plantuml.skin.ComponentType; import net.sourceforge.plantuml.skin.Context2D; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.txt.UGraphicTxt; -import net.sourceforge.plantuml.StringUtils; public class ComponentTextNote extends AbstractComponentText { @@ -64,10 +63,18 @@ public class ComponentTextNote extends AbstractComponentText { final int width = (int) dimensionToUse.getWidth() - 1; final int height = (int) dimensionToUse.getHeight(); charArea.fillRect(' ', 2, 1, width - 3, height - 2); - if (fileFormat == FileFormat.UTXT) { - charArea.drawNoteSimpleUnicode(2, 0, width - 2, height); - } else { - charArea.drawNoteSimple(2, 0, width - 2, height); + if (type == ComponentType.NOTE) { + if (fileFormat == FileFormat.UTXT) { + charArea.drawNoteSimpleUnicode(2, 0, width - 2, height); + } else { + charArea.drawNoteSimple(2, 0, width - 2, height); + } + } else if (type == ComponentType.NOTE_BOX) { + if (fileFormat == FileFormat.UTXT) { + charArea.drawBoxSimpleUnicode(2, 0, width - 2, height); + } else { + charArea.drawBoxSimple(2, 0, width - 2, height); + } } charArea.drawStringsLR(stringsToDisplay.as(), 3, 1); } diff --git a/src/net/sourceforge/plantuml/asciiart/TextSkin.java b/src/net/sourceforge/plantuml/asciiart/TextSkin.java index bb8e4b643..27412332b 100644 --- a/src/net/sourceforge/plantuml/asciiart/TextSkin.java +++ b/src/net/sourceforge/plantuml/asciiart/TextSkin.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19109 $ + * Revision $Revision: 19529 $ * */ package net.sourceforge.plantuml.asciiart; @@ -60,7 +60,9 @@ public class TextSkin implements Skin { return new ComponentTextActor(type, stringsToDisplay, fileFormat); } if (type.isArrow() - && ((config.getArrowDirection() == ArrowDirection.LEFT_TO_RIGHT_NORMAL) || (config.getArrowDirection() == ArrowDirection.RIGHT_TO_LEFT_REVERSE))) { + && (config.getArrowDirection() == ArrowDirection.LEFT_TO_RIGHT_NORMAL + || config.getArrowDirection() == ArrowDirection.RIGHT_TO_LEFT_REVERSE || config + .getArrowDirection() == ArrowDirection.BOTH_DIRECTION)) { return new ComponentTextArrow(type, config, stringsToDisplay, fileFormat, param.maxAsciiMessageLength()); } if (type.isArrow() && config.isSelfArrow()) { @@ -87,7 +89,7 @@ public class TextSkin implements Skin { if (type == ComponentType.ALIVE_BOX_OPEN_OPEN) { return new ComponentTextActiveLine(fileFormat); } - if (type == ComponentType.NOTE) { + if (type == ComponentType.NOTE || type == ComponentType.NOTE_BOX) { return new ComponentTextNote(type, stringsToDisplay, fileFormat); } if (type == ComponentType.DIVIDER) { diff --git a/src/net/sourceforge/plantuml/command/ProtectedCommand.java b/src/net/sourceforge/plantuml/command/ProtectedCommand.java index 141e7a0e9..7161b05e2 100644 --- a/src/net/sourceforge/plantuml/command/ProtectedCommand.java +++ b/src/net/sourceforge/plantuml/command/ProtectedCommand.java @@ -56,7 +56,7 @@ public class ProtectedCommand implements Command { } catch (Throwable t) { Log.error("Error " + t); t.printStackTrace(); - String msg = "You should send a mail to plantuml@gmail.com with this log (V" + Version.versionString() + String msg = "You should send a mail to plantuml@gmail.com or post to http://plantuml.com/qa with this log (V" + Version.versionString() + ")"; Log.error(msg); msg += " " + t.toString(); diff --git a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java index d0d13f0dd..0d715ebb6 100644 --- a/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java +++ b/src/net/sourceforge/plantuml/command/note/sequence/FactorySequenceNoteOnArrowCommand.java @@ -51,19 +51,24 @@ import net.sourceforge.plantuml.graphic.color.ColorParser; import net.sourceforge.plantuml.sequencediagram.AbstractMessage; import net.sourceforge.plantuml.sequencediagram.EventWithDeactivate; import net.sourceforge.plantuml.sequencediagram.NotePosition; +import net.sourceforge.plantuml.sequencediagram.NoteStyle; import net.sourceforge.plantuml.sequencediagram.SequenceDiagram; public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFactoryCommand { private RegexConcat getRegexConcatMultiLine() { - return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), // + return new RegexConcat(new RegexLeaf("^[%s]*"), // + new RegexLeaf("STYLE", "(note|hnote|rnote)"), // + new RegexLeaf("[%s]+"), // new RegexLeaf("POSITION", "(right|left)[%s]*"), // ColorParser.exp1(), // new RegexLeaf("$")); } private RegexConcat getRegexConcatSingleLine() { - return new RegexConcat(new RegexLeaf("^[%s]*note[%s]+"), // + return new RegexConcat(new RegexLeaf("^[%s]*"), // + new RegexLeaf("STYLE", "(note|hnote|rnote)"), // + new RegexLeaf("[%s]+"), // new RegexLeaf("POSITION", "(right|left)[%s]*"), // ColorParser.exp1(), // new RegexLeaf("[%s]*:[%s]*"), // @@ -116,7 +121,8 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto lines = lines.subExtract(1, 0); } - ((AbstractMessage) m).setNote(lines.toDisplay(), position, line0.get("COLOR", 0), url); + final NoteStyle style = NoteStyle.getNoteStyle(line0.get("STYLE", 0)); + ((AbstractMessage) m).setNote(lines.toDisplay(), position, style, line0.get("COLOR", 0), url); } return CommandExecutionResult.ok(); diff --git a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java index ca01a340e..ac3cc583f 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java +++ b/src/net/sourceforge/plantuml/cucadiagram/CucaDiagram.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19243 $ + * Revision $Revision: 19540 $ * */ package net.sourceforge.plantuml.cucadiagram; @@ -56,10 +56,12 @@ import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory; import net.sourceforge.plantuml.graphic.USymbol; import net.sourceforge.plantuml.jdot.CucaDiagramFileMakerJDot; import net.sourceforge.plantuml.skin.VisibilityModifier; +import net.sourceforge.plantuml.statediagram.StateDiagram; import net.sourceforge.plantuml.svek.CucaDiagramFileMaker; import net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek; import net.sourceforge.plantuml.ugraphic.ColorMapper; import net.sourceforge.plantuml.xmi.CucaDiagramXmiMaker; +import net.sourceforge.plantuml.xmlsc.StateDiagramScxmlMaker; public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy, PortionShower { @@ -288,6 +290,11 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy, maker.createFiles(suggestedFile); } + private void createFilesScxml(OutputStream suggestedFile) throws IOException { + final StateDiagramScxmlMaker maker = new StateDiagramScxmlMaker((StateDiagram) this); + maker.createFiles(suggestedFile); + } + @Override protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormatOption) throws IOException { @@ -307,6 +314,11 @@ public abstract class CucaDiagram extends UmlDiagram implements GroupHierarchy, return new ImageDataSimple(); } + if (fileFormat == FileFormat.SCXML) { + createFilesScxml(os); + return new ImageDataSimple(); + } + if (getUmlDiagramType() == UmlDiagramType.COMPOSITE) { throw new UnsupportedOperationException(); } diff --git a/src/net/sourceforge/plantuml/dedication/DecoderInputStream.java b/src/net/sourceforge/plantuml/dedication/DecoderInputStream.java new file mode 100644 index 000000000..6b55c0834 --- /dev/null +++ b/src/net/sourceforge/plantuml/dedication/DecoderInputStream.java @@ -0,0 +1,102 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2017, Arnaud Roques + * + * Project Info: http://plantuml.com + * + * This file is part of PlantUML. + * + * PlantUML is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * in the United States and other countries.] + * + * Original Author: Arnaud Roques + * + * Revision $Revision: 4041 $ + * + */ +package net.sourceforge.plantuml.dedication; + +import java.io.FilterInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.Random; + +public class DecoderInputStream extends FilterInputStream { + + private final byte key[]; + private int idx; + private final Random rnd; + + public DecoderInputStream(InputStream source, byte key[]) { + super(source); + this.key = key; + this.rnd = new Random(getSeed()); + } + + private long getSeed() { + long result = 17; + for (byte b : key) { + result = result * 37 + b; + } + return result; + } + + private byte getNextByte() { + for (int i = 0; i < nextKey(); i++) { + rnd.nextInt(); + } + return (byte) rnd.nextInt(); + } + + private int nextKey() { + final int result = key[idx]; + idx++; + if (idx >= key.length) { + idx = 0; + } + if (result < 0) { + return result + 256; + } + return result; + } + + @Override + public int read() throws IOException { + int b = super.read(); + if (b == -1) { + return -1; + } + b = b ^ getNextByte(); + return b; + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + final int nb = super.read(b, off, len); + if (nb == -1) { + return nb; + } + for (int i = 0; i < nb; i++) { + b[i + off] = (byte) (b[i + off] ^ getNextByte()); + } + return nb; + } + +} diff --git a/src/net/sourceforge/plantuml/dedication/Dedication.java b/src/net/sourceforge/plantuml/dedication/Dedication.java new file mode 100644 index 000000000..f3fd602b4 --- /dev/null +++ b/src/net/sourceforge/plantuml/dedication/Dedication.java @@ -0,0 +1,84 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2017, Arnaud Roques + * + * Project Info: http://plantuml.com + * + * This file is part of PlantUML. + * + * PlantUML is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * in the United States and other countries.] + * + * Original Author: Arnaud Roques + * + * Revision $Revision: 4041 $ + * + */ +package net.sourceforge.plantuml.dedication; + +import java.awt.image.BufferedImage; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; + +import javax.imageio.ImageIO; +import javax.imageio.stream.ImageInputStream; + +import net.sourceforge.plantuml.webp.VP8Decoder; + +public class Dedication { + + private final String signature; + + public Dedication(String signature) { + this.signature = signature; + } + + public String getSignature() { + return signature; + } + + public byte[] getKey(String keepLetter) { + try { + return keepLetter.getBytes("UTF8"); + } catch (UnsupportedEncodingException e) { + throw new IllegalStateException(e); + } + } + + private InputStream getInputStream(String keepLetter) { + final byte[] key = getKey(keepLetter); + final InputStream tmp = PSystemDedication.class.getResourceAsStream(getSignature() + ".png"); + return new DecoderInputStream(tmp, key); + } + + public BufferedImage getBufferedImage(String keepLetter) { + try { + final InputStream is = getInputStream(keepLetter); + final ImageInputStream iis = ImageIO.createImageInputStream(is); + final VP8Decoder vp8Decoder = new VP8Decoder(); + vp8Decoder.decodeFrame(iis, false); + iis.close(); + return vp8Decoder.getFrame().getBufferedImage(); + } catch (Exception e) { + return null; + } + } + +} diff --git a/src/net/sourceforge/plantuml/dedication/Dedications.java b/src/net/sourceforge/plantuml/dedication/Dedications.java new file mode 100644 index 000000000..bdb5890e2 --- /dev/null +++ b/src/net/sourceforge/plantuml/dedication/Dedications.java @@ -0,0 +1,78 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2017, Arnaud Roques + * + * Project Info: http://plantuml.com + * + * This file is part of PlantUML. + * + * PlantUML is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * in the United States and other countries.] + * + * Original Author: Arnaud Roques + * + * Revision $Revision: 4041 $ + * + */ +package net.sourceforge.plantuml.dedication; + +import java.util.HashMap; +import java.util.Map; + +import net.sourceforge.plantuml.SignatureUtils; + +public class Dedications { + + private static final Map all = new HashMap(); + + static { + addNormal("Write your own dedication!"); + addCrypted("RyHcSMMTGTW-ZlDelq18AwlwfbZZdfo-Yo0ketavjyFxRAFoKx1mAI032reWO3p4Mog-AV6jFqjXfi8G6pKo7G00"); + } + + private static void addNormal(String sentence) { + final String signature = SignatureUtils.getSignatureSha512(keepLetter(sentence)); + addCrypted(signature); + } + + private static void addCrypted(String signature) { + all.put(signature, new Dedication(signature)); + } + + private Dedications() { + } + + public static Dedication get(String line) { + final String signature = SignatureUtils.getSignatureSha512(keepLetter(line)); + return all.get(signature); + } + + public static String keepLetter(String s) { + final StringBuilder sb = new StringBuilder(); + for (int i = 0; i < s.length(); i++) { + final char c = s.charAt(i); + if (Character.isLetter(c)) { + sb.append(c); + } + } + return sb.toString().toUpperCase(); + } + +} diff --git a/src/net/sourceforge/plantuml/dedication/G-vlxV6y0ekXvg4jdrZhpVdo7lhOrgzdDMujAyww7DSmBwYMPUi9rNQVH44hebtYNePymublPiBIpRDwZGKrbG00.png b/src/net/sourceforge/plantuml/dedication/G-vlxV6y0ekXvg4jdrZhpVdo7lhOrgzdDMujAyww7DSmBwYMPUi9rNQVH44hebtYNePymublPiBIpRDwZGKrbG00.png new file mode 100644 index 0000000000000000000000000000000000000000..568a3bb016efe4e5e0ebd2994ec6e5eb6df29af0 GIT binary patch literal 15278 zcmV;fJ5j_6rUl_zwRawK8z7LFR^%>XHO8!8;x~3;XAh>AFVK+%Cv#*pO+8^x0eb1y zUB_KXRM?iWrbr4Yl9a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QT2Q9-D1#3)gyuc!~ir_Flr%qSplR=>Wy|5Ij>MJ!W;m=#kW;+G7D(CU0j&Hmb}J!;f}$*R?)D%9 zn{$Z096t*X7RM6={piLj1&iw{z!#x#l!CIJZO=2Gc@j~;m??YuA=rUtoMxH|Ix?Ss zaJ5JyE4whX?DY0VJGaX8(@aNmo4v|{osgYiYy5b=3G0tNAL)+TKJp#}*L^c5 z1!+^o58g|oqCmprGytT-r-bq|+l=%ibcWva7d4^3+x^NgS?j;RTiXzlm?s|GAvq0={8Rtl~fhHdZE^{r32_+GEjE z4CIXZoHB#B@cav=}$Av+J&>Tk4`3lX2iCWOW zA(VG1fFl(@$|3&B8v|9qeuOz*?*fG*o_L}hY(b?65~zN{WdATZAw({9EC=&D5h_0InKZMtmCPL@i7j>?$K}zv1?a&1 zrz^}{`ul$Z228?~=HhYy%iI^)2iMIM8p%cp%bS9?c(pQw&~f=ASX|PY|G>*;ZleY! zMj&}(G0345d7OFQmlO&LM6A)t$M`=8inXraNG5{1-93YK9JOA7rx9+(cp@Bt_=qXt=l43k+fC%Dpnya zo!$S8!rHXgcnP%-ST#9G&SAtVK1quZ^R!w&x-W|m=^m6P>*2vSeBG=(MgKh3y89@@ zuk-H`p3W(D6uJr#6%$8i6siRLb5mjbWh~zJw4Jd%ZYD#l>ZtRILydH4ShB@T-z%#* zLc&UgZs-*-uzZ=Cf&4Pgf$&sv;os881g?xH&K`NWVy-Xj9_!pSJC(9>u!R)g7_1FB zbh*Z0_6jS&uwlHQ)YEFpJ?6!FZVv$Dw-x${s#(H(Jxr&3E<4UJS_dn$odH9b$CIy5 iZ~SAfW3_@)Iu@`N(CPC dotStrings, FileFormatOption fileFormatOption) throws IOException { + lock.lock(); + try { + return createFileLocked(os, dotStrings, fileFormatOption); + } finally { + lock.unlock(); + } + } + + private ImageData createFileLocked(OutputStream os, List dotStrings, FileFormatOption fileFormatOption) + throws IOException { for (ILeaf leaf : diagram.getLeafsvalues()) { printEntityNew(leaf); @@ -399,9 +413,9 @@ public class CucaDiagramFileMakerJDot implements CucaDiagramFileMaker { // } // for (Link link : diagram.getLinks()) { - System.err.println("link=" + link); + // System.err.println("link=" + link); final Agedge_s e = createEdge(g, link); - System.err.println("Agedge_s=" + e); + // System.err.println("Agedge_s=" + e); if (e != null) { edges.put(link, e); } @@ -510,8 +524,8 @@ public class CucaDiagramFileMakerJDot implements CucaDiagramFileMaker { // if (/* pragma.horizontalLineBetweenDifferentPackageAllowed() || */link.isInvis() || length != 1) { agsafeset(e, new CString("minlen"), new CString("" + (length - 1)), new CString("")); // } - System.err.print("EDGE " + link.getEntity1().getUid() + "->" + link.getEntity2().getUid() + " minlen=" - + (length - 1) + " "); + // System.err.print("EDGE " + link.getEntity1().getUid() + "->" + link.getEntity2().getUid() + " minlen=" + // + (length - 1) + " "); final TextBlock label = getLabel(link); if (TextBlockUtils.isEmpty(label) == false) { @@ -520,9 +534,9 @@ public class CucaDiagramFileMakerJDot implements CucaDiagramFileMaker { final CString hackDim = Macro.createHackInitDimensionFromLabel((int) dimLabel.getWidth(), (int) dimLabel.getHeight()); agsafeset(e, new CString("label"), hackDim, new CString("")); - System.err.print(" label=" + hackDim.getContent()); + // System.err.print("label=" + hackDim.getContent()); } - System.err.println(); + // System.err.println(); return e; } @@ -537,7 +551,8 @@ public class CucaDiagramFileMakerJDot implements CucaDiagramFileMaker { strings.add(" "); strings.add("Sorry, the subproject Smetana is not finished yet..."); strings.add(" "); - strings.add("You should send this diagram and this image to plantuml@gmail.com to solve this issue."); + strings.add("You should send this diagram and this image to plantuml@gmail.com or"); + strings.add("post to http://plantuml.com/qa to solve this issue."); strings.add(" "); return strings; } diff --git a/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java b/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java index b31d7c413..a7fd26fa5 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java +++ b/src/net/sourceforge/plantuml/sequencediagram/AbstractMessage.java @@ -56,6 +56,7 @@ public abstract class AbstractMessage implements EventWithDeactivate { private NotePosition notePosition; private HtmlColor noteBackColor; private Url urlNote; + private NoteStyle noteStyle; private final Url url; private final String messageNumber; private boolean parallel = false; @@ -137,7 +138,7 @@ public abstract class AbstractMessage implements EventWithDeactivate { public final Display getLabel() { return label; } - + public final Display getLabelNumbered() { if (getMessageNumber() == null) { return getLabel(); @@ -148,7 +149,6 @@ public abstract class AbstractMessage implements EventWithDeactivate { return result; } - public final ArrowConfiguration getArrowConfiguration() { return arrowConfiguration; } @@ -156,15 +156,20 @@ public abstract class AbstractMessage implements EventWithDeactivate { public final Display getNote() { return notes == null ? notes : notes; } + + public final NoteStyle getNoteStyle() { + return noteStyle; + } public final Url getUrlNote() { return urlNote; } - public final void setNote(Display strings, NotePosition notePosition, String backcolor, Url url) { + public final void setNote(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 = overideNotePosition(notePosition); diff --git a/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java b/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java index 4d4e29817..4935cbae3 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java +++ b/src/net/sourceforge/plantuml/sequencediagram/NoteStyle.java @@ -33,6 +33,8 @@ */ package net.sourceforge.plantuml.sequencediagram; +import net.sourceforge.plantuml.skin.ComponentType; + public enum NoteStyle { NORMAL, HEXAGONAL, BOX; @@ -45,5 +47,16 @@ public enum NoteStyle { } return NoteStyle.NORMAL; } + + public ComponentType getNoteComponentType() { + if (this == NoteStyle.HEXAGONAL) { + return ComponentType.NOTE_HEXAGONAL; + } + if (this == NoteStyle.BOX) { + return ComponentType.NOTE_BOX; + } + return ComponentType.NOTE; + } + } diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/DrawableSetInitializer.java index d65ba37c4..ddcdf8f0b 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: 19109 $ + * Revision $Revision: 19528 $ * */ package net.sourceforge.plantuml.sequencediagram.graphic; @@ -434,7 +434,7 @@ class DrawableSetInitializer { } } final ISkinParam skinParam = n.getSkinParamBackcolored(drawableSet.getSkinParam()); - final ComponentType type = getNoteComponentType(n.getStyle()); + final ComponentType type = n.getStyle().getNoteComponentType(); final NoteBox noteBox = new NoteBox(freeY2.getFreeY(range), drawableSet.getSkin().createComponent(type, null, skinParam, n.getStrings()), p1, p2, n.getPosition(), n.getUrl()); return noteBox; @@ -456,16 +456,6 @@ class DrawableSetInitializer { freeY2 = freeY2.add(notesBoxes.getPreferredHeight(stringBounder), range); } - private ComponentType getNoteComponentType(NoteStyle noteStyle) { - if (noteStyle == NoteStyle.HEXAGONAL) { - return ComponentType.NOTE_HEXAGONAL; - } - if (noteStyle == NoteStyle.BOX) { - return ComponentType.NOTE_BOX; - } - return ComponentType.NOTE; - } - private void prepareLiveEvent(StringBounder stringBounder, LifeEvent lifeEvent, ParticipantRange range) { final double y = freeY2.getFreeY(range); final AbstractMessage message = lifeEvent.getMessage(); diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java index 968049086..43cd46620 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java +++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/Step1Message.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19109 $ + * Revision $Revision: 19528 $ * */ package net.sourceforge.plantuml.sequencediagram.graphic; @@ -73,7 +73,8 @@ class Step1Message extends Step1Abstract { if (message.getNote() != null) { final ISkinParam skinParam = message.getSkinParamNoteBackcolored(drawingSet.getSkinParam()); - setNote(drawingSet.getSkin().createComponent(ComponentType.NOTE, null, skinParam, message.getNote())); + setNote(drawingSet.getSkin().createComponent(message.getNoteStyle().getNoteComponentType(), null, + skinParam, message.getNote())); } } diff --git a/src/net/sourceforge/plantuml/skin/rose/Rose.java b/src/net/sourceforge/plantuml/skin/rose/Rose.java index 2ddf06d8a..ee66c7e22 100644 --- a/src/net/sourceforge/plantuml/skin/rose/Rose.java +++ b/src/net/sourceforge/plantuml/skin/rose/Rose.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19109 $ + * Revision $Revision: 19510 $ * */ package net.sourceforge.plantuml.skin.rose; @@ -226,7 +226,7 @@ public class Rose implements Skin { return new ComponentRoseDestroy(getHtmlColor(param, ColorParam.sequenceLifeLineBorder)); } if (type == ComponentType.NEWPAGE) { - return new ComponentRoseNewpage(getFontColor(param, FontParam.SEQUENCE_GROUP)); + return new ComponentRoseNewpage(getHtmlColor(param, ColorParam.sequenceNewpageSeparator)); } if (type == ComponentType.DIVIDER) { return new ComponentRoseDivider(getUFont2(param, FontParam.SEQUENCE_DIVIDER), getHtmlColor(param, diff --git a/src/net/sourceforge/plantuml/svek/GraphvizCrash.java b/src/net/sourceforge/plantuml/svek/GraphvizCrash.java index b0af88d25..4e37ef6b0 100644 --- a/src/net/sourceforge/plantuml/svek/GraphvizCrash.java +++ b/src/net/sourceforge/plantuml/svek/GraphvizCrash.java @@ -90,7 +90,8 @@ public class GraphvizCrash extends AbstractTextBlock implements IEntityImage { strings.add("Cannot determine dot version: " + e.toString()); } strings.add(" "); - strings.add("You should send this diagram and this image to plantuml@gmail.com to solve this issue."); + strings.add("You should send this diagram and this image to plantuml@gmail.com or"); + strings.add("post to http://plantuml.com/qa to solve this issue."); strings.add("You can try to turn arround this issue by simplifing your diagram."); if (flashCode != null) { addDecodeHint(strings); diff --git a/src/net/sourceforge/plantuml/ugraphic/UImage.java b/src/net/sourceforge/plantuml/ugraphic/UImage.java index b194a8707..6dd2df8bd 100644 --- a/src/net/sourceforge/plantuml/ugraphic/UImage.java +++ b/src/net/sourceforge/plantuml/ugraphic/UImage.java @@ -28,7 +28,7 @@ * * Original Author: Arnaud Roques * - * Revision $Revision: 19271 $ + * Revision $Revision: 19570 $ * */ package net.sourceforge.plantuml.ugraphic; @@ -69,11 +69,11 @@ public class UImage implements UShape { } public double getWidth() { - return image.getWidth(); + return image.getWidth()-1; } public double getHeight() { - return image.getHeight(); + return image.getHeight()-1; } } diff --git a/src/net/sourceforge/plantuml/version/License.java b/src/net/sourceforge/plantuml/version/License.java index 421b05c76..bc729b9a3 100644 --- a/src/net/sourceforge/plantuml/version/License.java +++ b/src/net/sourceforge/plantuml/version/License.java @@ -37,7 +37,7 @@ import java.util.List; public enum License { - GPL, LGPL, APACHE, EPL, MIT; + GPL, LGPL, APACHE, EPL, MIT, BSD; public static License getCurrent() { return GPL; @@ -114,6 +114,48 @@ public enum License { text.add("by the very same license."); } + private void addBsd(final List text) { + text.add("PlantUML is free software; you can redistribute it and/or modify it"); + text.add("under the terms of the Revised BSD License."); + text.add(""); + text.add("All rights reserved."); + text.add("Redistribution and use in source and binary forms, with or without"); + text.add("modification, are permitted provided that the following conditions are met:"); + text.add(""); + text.add("* Redistributions of source code must retain the above copyright"); + text.add(" notice, this list of conditions and the following disclaimer."); + text.add("* Redistributions in binary form must reproduce the above copyright"); + text.add(" notice, this list of conditions and the following disclaimer in the"); + text.add(" documentation and/or other materials provided with the distribution."); + text.add("* Neither the name of the University of California, Berkeley nor the"); + text.add(" names of its contributors may be used to endorse or promote products"); + text.add(" derived from this software without specific prior written permission."); + text.add(""); + text.add("THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY"); + text.add("EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED"); + text.add("WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"); + text.add("DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY"); + text.add("DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"); + text.add("(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;"); + text.add("LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND"); + text.add("ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT"); + text.add("(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS"); + text.add("SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."); + text.add(""); + text.add("Note that images (whatever their format : PNG, SVG...) generated by running PlantUML"); + text.add("are owned by the author of their corresponding sources code (that is, their"); + text.add("textual description in PlantUML language). Those images are not covered by"); + text.add("the Eclipse Public License."); + text.add(""); + text.add("The generated images can then be used without any reference to the Eclipse Public License."); + text.add("It is not even necessary to stipulate that they have been generated with PlantUML,"); + text.add("also this will be appreciate by PlantUML team."); + text.add(""); + text.add("There is an exception : if the textual description in PlantUML language is also covered"); + text.add("by a license (like the BSD), then the generated images are logically covered"); + text.add("by the very same license."); + } + private void addApache(final List text) { text.add("PlantUML is free software; you can redistribute it and/or modify it"); text.add("under the terms of the Apache Software License."); @@ -275,6 +317,32 @@ public enum License { h.add(" * See the License for the specific language governing permissions and"); h.add(" * limitations under the License."); h.add(" * "); + } else if (this == License.BSD) { + h.add(" * Licensed under the Revised BSD License (the Revised Berkeley Software Distribution)"); + h.add(" * "); + h.add(" * Redistribution and use in source and binary forms, with or without"); + h.add(" * modification, are permitted provided that the following conditions are met:"); + h.add(" * "); + h.add(" * * Redistributions of source code must retain the above copyright"); + h.add(" * notice, this list of conditions and the following disclaimer."); + h.add(" * * Redistributions in binary form must reproduce the above copyright"); + h.add(" * notice, this list of conditions and the following disclaimer in the"); + h.add(" * documentation and/or other materials provided with the distribution."); + h.add(" * * Neither the name of the University of California, Berkeley nor the"); + h.add(" * names of its contributors may be used to endorse or promote products"); + h.add(" * derived from this software without specific prior written permission."); + h.add(" * "); + h.add(" * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY"); + h.add(" * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED"); + h.add(" * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE"); + h.add(" * DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY"); + h.add(" * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES"); + h.add(" * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;"); + h.add(" * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND"); + h.add(" * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT"); + h.add(" * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS"); + h.add(" * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."); + h.add(" * "); } else if (this == License.MIT) { h.add(" * Licensed under The MIT License (Massachusetts Institute of Technology License)"); h.add(" * "); @@ -312,6 +380,8 @@ public enum License { addMit(text); } else if (this == License.EPL) { addEpl(text); + } else if (this == License.BSD) { + addBsd(text); } else if (this == License.APACHE) { addApache(text); } else if (this == License.LGPL) { diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java index f54afe0c1..9a5cbe11c 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: 19505 $ + * Revision $Revision: 19609 $ * */ package net.sourceforge.plantuml.version; @@ -39,7 +39,7 @@ import java.util.Date; public class Version { public static int version() { - return 8038; + return 8039; } public static String versionString() { @@ -63,7 +63,7 @@ public class Version { } private static long compileTime() { - return 1459789355152L; + return 1461342268180L; } public static String compileTimeString() { diff --git a/src/net/sourceforge/plantuml/xmlsc/ScxmlStateDiagramStandard.java b/src/net/sourceforge/plantuml/xmlsc/ScxmlStateDiagramStandard.java new file mode 100644 index 000000000..294cee1cd --- /dev/null +++ b/src/net/sourceforge/plantuml/xmlsc/ScxmlStateDiagramStandard.java @@ -0,0 +1,138 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2017, Arnaud Roques + * + * Project Info: http://plantuml.com + * + * This file is part of PlantUML. + * + * PlantUML is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * in the United States and other countries.] + * + * Original Author: Arnaud Roques + * + * Revision $Revision: 5616 $ + * + */ +package net.sourceforge.plantuml.xmlsc; + +import java.io.OutputStream; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Result; +import javax.xml.transform.Source; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +import net.sourceforge.plantuml.cucadiagram.Display; +import net.sourceforge.plantuml.cucadiagram.IEntity; +import net.sourceforge.plantuml.cucadiagram.LeafType; +import net.sourceforge.plantuml.cucadiagram.Link; +import net.sourceforge.plantuml.statediagram.StateDiagram; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +public class ScxmlStateDiagramStandard { + + private final StateDiagram diagram; + private final Document document; + + public ScxmlStateDiagramStandard(StateDiagram diagram) throws ParserConfigurationException { + this.diagram = diagram; + final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + + final DocumentBuilder builder = factory.newDocumentBuilder(); + this.document = builder.newDocument(); + document.setXmlVersion("1.0"); + document.setXmlStandalone(true); + + final Element scxml = document.createElement("scxml"); + scxml.setAttribute("xmlns", "http://www.w3.org/2005/07/scxml"); + scxml.setAttribute("version", "1.0"); + final String initial = getInitial(); + if (initial != null) { + scxml.setAttribute("initial", initial); + } + document.appendChild(scxml); + + for (final IEntity ent : diagram.getLeafsvalues()) { + scxml.appendChild(createState(ent)); + } + + } + + private String getInitial() { + for (final IEntity ent : diagram.getLeafsvalues()) { + if (ent.getEntityType() == LeafType.CIRCLE_START) { + return getId(ent); + } + } + return null; + } + + private Element createState(IEntity entity) { + final Element state = document.createElement("state"); + state.setAttribute("id", getId(entity)); + for (final Link link : diagram.getLinks()) { + if (link.getEntity1() == entity) { + addLink(state, link); + } + } + return state; + } + + private void addLink(Element state, Link link) { + final Element transition = document.createElement("transition"); + final Display label = link.getLabel(); + if (Display.isNull(label) == false) { + final String event = label.get(0).toString(); + transition.setAttribute("event", event); + } + transition.setAttribute("target", getId(link.getEntity2())); + state.appendChild(transition); + + } + + private String getId(IEntity entity) { + String result = entity.getDisplay().get(0).toString(); + result = result.replaceAll("\\*", ""); + return result; + } + + public void transformerXml(OutputStream os) throws TransformerException, ParserConfigurationException { + final Source source = new DOMSource(document); + + final Result resultat = new StreamResult(os); + + final TransformerFactory fabrique = TransformerFactory.newInstance(); + final Transformer transformer = fabrique.newTransformer(); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + transformer.transform(source, resultat); + } + +} diff --git a/src/net/sourceforge/plantuml/xmlsc/StateDiagramScxmlMaker.java b/src/net/sourceforge/plantuml/xmlsc/StateDiagramScxmlMaker.java new file mode 100644 index 000000000..4c9c22d80 --- /dev/null +++ b/src/net/sourceforge/plantuml/xmlsc/StateDiagramScxmlMaker.java @@ -0,0 +1,69 @@ +/* ======================================================================== + * PlantUML : a free UML diagram generator + * ======================================================================== + * + * (C) Copyright 2009-2017, Arnaud Roques + * + * Project Info: http://plantuml.com + * + * This file is part of PlantUML. + * + * PlantUML is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PlantUML distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + * License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * [Java is a trademark or registered trademark of Sun Microsystems, Inc. + * in the United States and other countries.] + * + * Original Author: Arnaud Roques + * + * Revision $Revision: 5079 $ + * + */ +package net.sourceforge.plantuml.xmlsc; + +import java.io.IOException; +import java.io.OutputStream; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.TransformerException; + +import net.sourceforge.plantuml.Log; +import net.sourceforge.plantuml.statediagram.StateDiagram; + +public final class StateDiagramScxmlMaker { + + private final StateDiagram diagram; + + public StateDiagramScxmlMaker(StateDiagram diagram) throws IOException { + this.diagram = diagram; + } + + public void createFiles(OutputStream fos) throws IOException { + try { + final ScxmlStateDiagramStandard xmi; + xmi = new ScxmlStateDiagramStandard(diagram); + xmi.transformerXml(fos); + } catch (ParserConfigurationException e) { + Log.error(e.toString()); + e.printStackTrace(); + throw new IOException(e.toString()); + } catch (TransformerException e) { + Log.error(e.toString()); + e.printStackTrace(); + throw new IOException(e.toString()); + } + } + +}