diff --git a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java index 30db18ac0..0a25a1dc9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/Branch.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/Branch.java @@ -148,30 +148,30 @@ public class Branch { } public final Rainbow getOut() { - if (special != null) { + if (special != null) return special.getRainbow(); - } -// if (labelPositive.getRainbow().size() > 0) { + +// if (labelPositive.getRainbow().size() > 0) // return labelPositive.getRainbow(); -// } - if (inlinkRendering == null) { + + if (inlinkRendering == null) return null; - } + return inlinkRendering.getRainbow(); } public Rainbow getInColor(Rainbow arrowColor) { - if (isEmpty()) { + if (isEmpty()) return getFtile().getOutLinkRendering().getRainbow(arrowColor); - } - if (labelPositive.getRainbow().size() > 0) { + + if (labelPositive.getRainbow().size() > 0) return labelPositive.getRainbow(); - } + final LinkRendering linkIn = getFtile().getInLinkRendering(); final Rainbow color = linkIn.getRainbow(arrowColor); - if (color.size() == 0) { + if (color.size() == 0) return arrowColor; - } + return color; } @@ -232,17 +232,17 @@ public class Branch { public final Display getDisplayPositive() { if (ftile != null) { final LinkRendering in = ftile.getInLinkRendering(); - if (in != null && Display.isNull(in.getDisplay()) == false) { + if (in != null && Display.isNull(in.getDisplay()) == false) return in.getDisplay(); - } + } return labelPositive.getDisplay(); } public Display getSpecialDisplay() { - if (special != null && Display.isNull(special.getDisplay()) == false) { + if (special != null && Display.isNull(special.getDisplay()) == false) return special.getDisplay(); - } + return null; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java index 7a4064b4e..9ed4ddb98 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/InstructionSwitch.java @@ -176,8 +176,8 @@ public class InstructionSwitch extends WithNote implements Instruction, Instruct } public void endSwitch(LinkRendering nextLinkRenderer) { - // TODO Auto-generated method stub - + if (this.current != null) + this.current.setSpecial(nextLinkRenderer); } @Override diff --git a/src/net/sourceforge/plantuml/dedication/Dedications.java b/src/net/sourceforge/plantuml/dedication/Dedications.java index 200af377a..f2e864b43 100644 --- a/src/net/sourceforge/plantuml/dedication/Dedications.java +++ b/src/net/sourceforge/plantuml/dedication/Dedications.java @@ -59,6 +59,9 @@ public class Dedications { all.add(new DedicationSimple(load("dr_chet"), "Thank you, Dr. Chet. I wouldn't be where I am without you")); all.add(new DedicationSimple(load("ben"), "Ben and Jen 2020")); all.add(new DedicationSimple(load("baraye"), "baraye")); + all.add(new DedicationSimple(load("nothing"), "Nothing of value is ever easy")); + all.add(new DedicationSimple(load("friends"), "Have good friends and be a good friend to other people")); + all.add(new DedicationSimple(load("fatherson"), "By the time a man realizes that maybe his father was right, he usually has a son who thinks he is wrong")); all.add(secret(5, "835ff5d643b58cd35a20db6480071d05751aa6a0e01da78662ceafd0161f3f5e", new BigInteger( "1182423723677118831606503500858825217076578422970565964857326298418401529955036896808663335300684244453386039908536275400945824932191521017102701344437753036730900076162922741167523337650578479960119614237031234925702200473053235777"))); all.add(secret(3, "514816d583044efbd336882227deb822194ff63e3bdc3cf707a01f17770d5a6a", new BigInteger( diff --git a/src/net/sourceforge/plantuml/dedication/fatherson.png b/src/net/sourceforge/plantuml/dedication/fatherson.png new file mode 100644 index 000000000..ea4363378 Binary files /dev/null and b/src/net/sourceforge/plantuml/dedication/fatherson.png differ diff --git a/src/net/sourceforge/plantuml/dedication/friends.png b/src/net/sourceforge/plantuml/dedication/friends.png new file mode 100644 index 000000000..0a5eaad0b Binary files /dev/null and b/src/net/sourceforge/plantuml/dedication/friends.png differ diff --git a/src/net/sourceforge/plantuml/dedication/nothing.png b/src/net/sourceforge/plantuml/dedication/nothing.png new file mode 100644 index 000000000..7bed0c6dc Binary files /dev/null and b/src/net/sourceforge/plantuml/dedication/nothing.png differ diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/ReferenceTile.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/ReferenceTile.java index b92499d72..c22da0cc5 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/teoz/ReferenceTile.java +++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/ReferenceTile.java @@ -42,12 +42,15 @@ import net.sourceforge.plantuml.klimt.font.StringBounder; import net.sourceforge.plantuml.klimt.geom.XDimension2D; import net.sourceforge.plantuml.real.Real; import net.sourceforge.plantuml.sequencediagram.Event; +import net.sourceforge.plantuml.sequencediagram.Note; +import net.sourceforge.plantuml.sequencediagram.NotePosition; import net.sourceforge.plantuml.sequencediagram.Participant; import net.sourceforge.plantuml.sequencediagram.Reference; 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.style.ISkinParam; public class ReferenceTile extends AbstractTile implements Tile { @@ -57,6 +60,9 @@ public class ReferenceTile extends AbstractTile implements Tile { private Real last; private final YGauge yGauge; + private Component noteLeft; + private Component noteRight; + public Event getEvent() { return reference; } @@ -66,6 +72,18 @@ public class ReferenceTile extends AbstractTile implements Tile { this.reference = reference; this.tileArguments = tileArguments; this.yGauge = YGauge.create(currentY.getMax(), getPreferredHeight()); + + for (Note noteOnMessage : reference.getNoteOnMessages()) { + final ISkinParam skinParam2 = noteOnMessage.getSkinParamBackcolored(tileArguments.getSkinParam()); + final Component note = tileArguments.getSkin().createComponentNote(noteOnMessage.getUsedStyles(), + noteOnMessage.getNoteStyle().getNoteComponentType(), skinParam2, noteOnMessage.getDisplay(), + noteOnMessage.getColors()); + if (noteOnMessage.getPosition() == NotePosition.RIGHT) + noteRight = note; + else + noteLeft = note; + + } } @Override @@ -74,24 +92,24 @@ public class ReferenceTile extends AbstractTile implements Tile { } private void init(StringBounder stringBounder) { - if (first != null) { + if (first != null) return; - } + for (Participant p : reference.getParticipant()) { final LivingSpace livingSpace = tileArguments.getLivingSpace(p); final Real pos = livingSpace.getPosC(stringBounder); - if (first == null || pos.getCurrentValue() < first.getCurrentValue()) { + if (first == null || pos.getCurrentValue() < first.getCurrentValue()) this.first = livingSpace.getPosB(stringBounder); - } - if (last == null || pos.getCurrentValue() > last.getCurrentValue()) { + + if (last == null || pos.getCurrentValue() > last.getCurrentValue()) this.last = livingSpace.getPosD(stringBounder); - } + } final Component comp = getComponent(stringBounder); final XDimension2D dim = comp.getPreferredDimension(stringBounder); - if (reference.getParticipant().size() == 1) { + if (reference.getParticipant().size() == 1) this.last = this.last.addAtLeast(0); - } + this.last.ensureBiggerThan(this.first.addFixed(dim.getWidth())); } @@ -113,8 +131,22 @@ public class ReferenceTile extends AbstractTile implements Tile { final XDimension2D dim = comp.getPreferredDimension(stringBounder); final Area area = Area.create(last.getCurrentValue() - first.getCurrentValue(), dim.getHeight()); - ug = ug.apply(UTranslate.dx(first.getCurrentValue())); - comp.drawU(ug, area, (Context2D) ug); + comp.drawU(ug.apply(UTranslate.dx(first.getCurrentValue())), area, (Context2D) ug); + + if (noteLeft != null) { + final double wn = noteLeft.getPreferredWidth(stringBounder); + final double hn = noteLeft.getPreferredHeight(stringBounder); + noteLeft.drawU(ug.apply(UTranslate.dx(first.getCurrentValue() - wn)), new Area(new XDimension2D(wn, hn)), + (Context2D) ug); + } + + if (noteRight != null) { + final double wn = noteRight.getPreferredWidth(stringBounder); + final double hn = noteRight.getPreferredHeight(stringBounder); + noteRight.drawU(ug.apply(UTranslate.dx(last.getCurrentValue())), new Area(new XDimension2D(wn, hn)), + (Context2D) ug); + } + } public double getPreferredHeight() { @@ -128,11 +160,20 @@ public class ReferenceTile extends AbstractTile implements Tile { public Real getMinX() { init(getStringBounder()); + if (noteLeft != null) { + final double wn = noteLeft.getPreferredWidth(getStringBounder()); + return this.first.addFixed(-wn); + } + return this.first; } public Real getMaxX() { init(getStringBounder()); + if (noteRight != null) { + final double wn = noteRight.getPreferredWidth(getStringBounder()); + return this.last.addFixed(wn); + } return this.last; } diff --git a/src/net/sourceforge/plantuml/utils/MTRandom.java b/src/net/sourceforge/plantuml/utils/MTRandom.java index 4e566c25a..1a4967809 100644 --- a/src/net/sourceforge/plantuml/utils/MTRandom.java +++ b/src/net/sourceforge/plantuml/utils/MTRandom.java @@ -3,28 +3,13 @@ * pseudo random number generator algorithm based upon the * original C code by Makoto Matsumoto and Takuji Nishimura. * Author : David Beaumont - * Email : mersenne-at-www.goui.net * * For the original C code, see: * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html * * This version, Copyright (C) 2005, David Beaumont. * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is 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 Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ - package net.sourceforge.plantuml.utils; import java.util.Random; diff --git a/src/net/sourceforge/plantuml/version/Version.java b/src/net/sourceforge/plantuml/version/Version.java index a25dee686..982b1d2af 100644 --- a/src/net/sourceforge/plantuml/version/Version.java +++ b/src/net/sourceforge/plantuml/version/Version.java @@ -82,7 +82,7 @@ public class Version { } public static int beta() { - final int beta = 1; + final int beta = 2; return beta; }