1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-05 21:17:52 +00:00
Arnaud Roques 2023-05-07 23:30:37 +02:00
parent c158ce4383
commit 26874fe610
9 changed files with 73 additions and 44 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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(

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -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;
}

View File

@ -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;

View File

@ -82,7 +82,7 @@ public class Version {
}
public static int beta() {
final int beta = 1;
final int beta = 2;
return beta;
}