Skip to content

Commit

Permalink
version 1.2020.7
Browse files Browse the repository at this point in the history
  • Loading branch information
arnaudroques committed Apr 19, 2020
1 parent f03afa2 commit 9077d97
Show file tree
Hide file tree
Showing 372 changed files with 1,717 additions and 1,266 deletions.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<target name="compile">
<delete dir="build" />
<mkdir dir="build" />
<javac target="1.6" srcdir="src" destdir="build" debug="on" />
<javac target="1.7" srcdir="src" destdir="build" debug="on" />
<copy file="src/net/sourceforge/plantuml/version/logo.png"
todir="build/net/sourceforge/plantuml/version" />
<copy file="src/net/sourceforge/plantuml/version/favicon.png"
Expand Down
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2020.5-SNAPSHOT</version>
<version>1.2020.8-SNAPSHOT</version>
<packaging>jar</packaging>

<name>PlantUML</name>
Expand Down Expand Up @@ -133,8 +133,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
<debug>false</debug>
</configuration>
</plugin>
Expand Down
10 changes: 5 additions & 5 deletions src/net/sourceforge/plantuml/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,26 +154,26 @@ private static String readSvg(final BufferedReader br, boolean withNewline, bool

// http://forum.plantuml.net/9048/img-tag-for-sequence-diagram-participants-does-always-render

public synchronized static BufferedImage ImageIO_read(File f) {
public synchronized static BufferedImage readRasterImageFromFile(File f) {
// https://www.experts-exchange.com/questions/26171948/Why-are-ImageIO-read-images-losing-their-transparency.html
// https://stackoverflow.com/questions/18743790/can-java-load-images-with-transparency

try {
return readImage(new ImageIcon(f.getAbsolutePath()));
return readRasterImage(new ImageIcon(f.getAbsolutePath()));
} catch (Exception e) {
return null;
}
}

public synchronized static BufferedImage ImageIO_read(URL url) {
public synchronized static BufferedImage readRasterImageFromURL(URL url) {
try {
return readImage(new ImageIcon(url));
return readRasterImage(new ImageIcon(url));
} catch (Exception e) {
return null;
}
}

private synchronized static BufferedImage readImage(final ImageIcon imageIcon) {
private synchronized static BufferedImage readRasterImage(final ImageIcon imageIcon) {
final Image tmpImage = imageIcon.getImage();
final BufferedImage image = new BufferedImage(imageIcon.getIconWidth(), imageIcon.getIconHeight(),
BufferedImage.TYPE_INT_ARGB);
Expand Down
2 changes: 1 addition & 1 deletion src/net/sourceforge/plantuml/Option.java
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ public final File getOutputDir() {
}

public final static String getPattern() {
return "(?i)^.*\\.(txt|tex|java|htm|html|c|h|cpp|apt|pu|pump|hpp|hh)$";
return "(?i)^.*\\.(txt|tex|java|htm|html|c|h|cpp|apt|pu|puml|hpp|hh)$";
}

public void setOutputDir(File f) {
Expand Down
6 changes: 3 additions & 3 deletions src/net/sourceforge/plantuml/acearth/PSystemXearth.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
import java.util.Map;
import java.util.TimeZone;

import ext.plantuml.com.ctreber.acearth.ACearth;
import ext.plantuml.com.ctreber.acearth.ConfigurationACearth;
import ext.plantuml.com.ctreber.acearth.plugins.markers.Marker;
import net.sourceforge.plantuml.AbstractPSystem;
import net.sourceforge.plantuml.FileFormatOption;
import net.sourceforge.plantuml.api.ImageDataSimple;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.core.ImageData;
import ext.plantuml.com.ctreber.acearth.ACearth;
import ext.plantuml.com.ctreber.acearth.ConfigurationACearth;
import ext.plantuml.com.ctreber.acearth.plugins.markers.Marker;

public class PSystemXearth extends AbstractPSystem {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
import java.util.List;
import java.util.Map;

import ext.plantuml.com.ctreber.acearth.plugins.markers.Marker;
import net.sourceforge.plantuml.command.PSystemBasicFactory;
import net.sourceforge.plantuml.command.regex.Matcher2;
import net.sourceforge.plantuml.command.regex.MyPattern;
import net.sourceforge.plantuml.command.regex.Pattern2;
import ext.plantuml.com.ctreber.acearth.plugins.markers.Marker;

public class PSystemXearthFactory extends PSystemBasicFactory<PSystemXearth> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

import net.sourceforge.plantuml.Direction;
import net.sourceforge.plantuml.ISkinSimple;
import net.sourceforge.plantuml.OptionFlags;
import net.sourceforge.plantuml.UmlDiagramType;
import net.sourceforge.plantuml.core.DiagramDescription;
import net.sourceforge.plantuml.cucadiagram.Code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,12 @@ public CommandExecutionResult backwardWhile(Display label, BoxStyle boxStyle) {
manageSwimlaneStrategy();
if (current() instanceof InstructionRepeat) {
final InstructionRepeat instructionRepeat = (InstructionRepeat) current();
// final LinkRendering back = new
// LinkRendering(linkColor).withDisplay(linkLabel);
instructionRepeat.setBackward(label, swinlanes.getCurrentSwimlane(), boxStyle);
// setCurrent(instructionRepeat.getParent());
// this.setNextLinkRendererInternal(LinkRendering.none());
return CommandExecutionResult.ok();
}
if (current() instanceof InstructionWhile) {
final InstructionWhile instructionWhile = (InstructionWhile) current();
instructionWhile.setBackward(label, swinlanes.getCurrentSwimlane(), boxStyle);
return CommandExecutionResult.ok();
}
return CommandExecutionResult.error("Cannot find repeat");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public class InstructionRepeat implements Instruction {
private final Swimlane swimlane;
private Swimlane swimlaneOut;
private BoxStyle boxStyle;
// private final HtmlColor color;
private boolean killed = false;
private final BoxStyle boxStyleIn;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import java.util.Set;

import net.sourceforge.plantuml.ISkinParam;
import net.sourceforge.plantuml.activitydiagram3.ftile.BoxStyle;
import net.sourceforge.plantuml.activitydiagram3.ftile.Ftile;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactory;
import net.sourceforge.plantuml.activitydiagram3.ftile.FtileKilled;
Expand Down Expand Up @@ -97,8 +98,10 @@ public void add(Instruction ins) {
}

public Ftile createFtile(FtileFactory factory) {
final Ftile back = Display.isNull(backward) ? null
: factory.activity(backward, swimlane, boxStyle, Colors.empty());
Ftile tmp = factory.decorateOut(repeatList.createFtile(factory), endInlinkRendering);
tmp = factory.createWhile(swimlane, tmp, test, yes, out, afterEndwhile, color, specialOut);
tmp = factory.createWhile(swimlane, tmp, test, yes, out, afterEndwhile, color, specialOut, back);
if (getPositionedNotes().size() > 0) {
tmp = FtileWithNoteOpale.create(tmp, getPositionedNotes(), skinParam, false);
}
Expand Down Expand Up @@ -170,4 +173,14 @@ public boolean containsBreak() {
return repeatList.containsBreak();
}

private BoxStyle boxStyle;
private Swimlane swimlaneOut;
private Display backward = Display.NULL;

public void setBackward(Display label, Swimlane swimlaneOut, BoxStyle boxStyle) {
this.backward = label;
this.swimlaneOut = swimlaneOut;
this.boxStyle = boxStyle;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UBackground;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UParam;
Expand All @@ -65,9 +64,9 @@ public UGraphic apply(UChange change) {
return new CollisionDetector(stringBounder, translate.compose((UTranslate) change), this.context);
} else if (change instanceof UStroke) {
return new CollisionDetector(this);
} else if (change instanceof UChangeBackColor) {
} else if (change instanceof UBackground) {
return new CollisionDetector(this);
} else if (change instanceof UChangeColor) {
} else if (change instanceof HColor) {
return new CollisionDetector(this);
}
throw new UnsupportedOperationException();
Expand All @@ -89,7 +88,7 @@ public void drawDebug(UGraphic ug) {
}
}
final HColor color = HColorUtils.BLACK;
ug = ug.apply(new UChangeColor(color)).apply(new UStroke(5));
ug = ug.apply(color).apply(new UStroke(5));
for (Snake snake : snakes) {
for (Line2D line : snake.getHorizontalLines()) {
if (collision(line)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public Ftile repeat(BoxStyle boxStyleIn, Swimlane swimlane, Swimlane swimlaneOut
Ftile backward, boolean noOut);

public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
LinkRendering afterEndwhile, HColor color, Instruction specialOut);
LinkRendering afterEndwhile, HColor color, Instruction specialOut, Ftile backward);

public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch, LinkRendering afterEndwhile,
LinkRendering topInlinkRendering, Url url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,15 @@ public Ftile assembly(Ftile tile1, Ftile tile2) {
}

public Ftile repeat(BoxStyle boxStyleIn, Swimlane swimlane, Swimlane swimlaneOut, Display startLabel, Ftile repeat,
Display test, Display yes, Display out, Colors colors, LinkRendering backRepeatLinkRendering, Ftile backward,
boolean noOut) {
Display test, Display yes, Display out, Colors colors, LinkRendering backRepeatLinkRendering,
Ftile backward, boolean noOut) {
return factory.repeat(boxStyleIn, swimlane, swimlaneOut, startLabel, repeat, test, yes, out, colors,
backRepeatLinkRendering, backward, noOut);
}

public Ftile createWhile(Swimlane swimlane, Ftile whileBlock, Display test, Display yes, Display out,
LinkRendering afterEndwhile, HColor color, Instruction specialOut) {
return factory.createWhile(swimlane, whileBlock, test, yes, out, afterEndwhile, color, specialOut);
LinkRendering afterEndwhile, HColor color, Instruction specialOut, Ftile back) {
return factory.createWhile(swimlane, whileBlock, test, yes, out, afterEndwhile, color, specialOut, back);
}

public Ftile createIf(Swimlane swimlane, List<Branch> thens, Branch elseBranch, LinkRendering afterEndwhile,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import net.sourceforge.plantuml.style.SName;
import net.sourceforge.plantuml.style.Style;
import net.sourceforge.plantuml.style.StyleSignature;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UEmpty;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
Expand Down Expand Up @@ -91,7 +90,7 @@ public Dimension2D calculateDimension(StringBounder stringBounder) {

public void drawU(UGraphic ug) {
// final UShape back = new URectangle(x1 + x2, height).ignoreForCompressionOnY();
// ug.apply(new UChangeColor(HColorUtils.BLUE)).draw(back);
// ug.apply(UChangeColor.nnn(HColorUtils.BLUE)).draw(back);
final UShape back = new UEmpty(x1 + x2, 1);
ug.draw(back);

Expand All @@ -104,7 +103,7 @@ public void drawU(UGraphic ug) {
color = getStyle().value(PName.LineColor).asColor(skinParam.getIHtmlColorSet());
thickness = getStyle().getStroke();
}
ug.apply(UTranslate.dx(x1)).apply(thickness).apply(new UChangeColor(color)).draw(ULine.vline(height));
ug.apply(UTranslate.dx(x1)).apply(thickness).apply(color).draw(ULine.vline(height));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@
import net.sourceforge.plantuml.ugraphic.LimitFinder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape;
Expand Down Expand Up @@ -211,8 +209,7 @@ public final void drawU(UGraphic ug) {
}

static private void printDebug(UGraphic ug, SlotSet slot, HColor col, TextBlock full) {
slot.drawDebugX(ug.apply(new UChangeColor(col)).apply(new UChangeBackColor(col)),
full.calculateDimension(ug.getStringBounder()).getHeight());
slot.drawDebugX(ug.apply(col).apply(col.bg()), full.calculateDimension(ug.getStringBounder()).getHeight());

}

Expand All @@ -224,12 +221,12 @@ protected void drawWhenSwimlanes(final UGraphic ug, TextBlock full) {
for (Swimlane swimlane : swimlanes) {
final HColor back = swimlane.getColors(skinParam).getColor(ColorType.BACK);
if (back != null) {
UGraphic background = ug.apply(new UChangeBackColor(back)).apply(new UChangeColor(back));
UGraphic background = ug.apply(back.bg()).apply(back);
background = background.apply(UTranslate.dx(x2));
drawBackColor(background, swimlane, dimensionFull);
}

full.drawU(new UGraphicInterceptorOneSwimlane(ug, swimlane).apply(swimlane.getTranslate())
full.drawU(new UGraphicInterceptorOneSwimlane(ug, swimlane, swimlanes).apply(swimlane.getTranslate())
.apply(getTitleHeightTranslate(stringBounder)));
x2 += swimlane.getActualWidth();

Expand All @@ -242,7 +239,8 @@ protected void drawWhenSwimlanes(final UGraphic ug, TextBlock full) {
protected void drawBackColor(UGraphic ug, Swimlane swimlane, Dimension2D dimensionFull) {
final StringBounder stringBounder = ug.getStringBounder();
final double height = dimensionFull.getHeight() + getTitleHeightTranslate(stringBounder).getDy();
final URectangle rectangle = new URectangle(swimlane.getActualWidth(), height).ignoreForCompressionOnX().ignoreForCompressionOnY();
final URectangle rectangle = new URectangle(swimlane.getActualWidth(), height).ignoreForCompressionOnX()
.ignoreForCompressionOnY();
ug.draw(rectangle);
}

Expand All @@ -255,7 +253,7 @@ private void computeDrawingWidths(UGraphic ug, TextBlock full) {
for (Swimlane swimlane : swimlanes) {
final LimitFinder limitFinder = new LimitFinder(stringBounder, false);
final UGraphicInterceptorOneSwimlane interceptor = new UGraphicInterceptorOneSwimlane(
new UGraphicForSnake(limitFinder), swimlane);
new UGraphicForSnake(limitFinder), swimlane, swimlanes);
full.drawU(interceptor);
interceptor.flushUg();
final MinMax minMax = limitFinder.getMinMax();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@
import net.sourceforge.plantuml.ugraphic.LimitFinder;
import net.sourceforge.plantuml.ugraphic.MinMax;
import net.sourceforge.plantuml.ugraphic.UChange;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UShape;
Expand Down Expand Up @@ -279,14 +277,14 @@ private void drawWhenSwimlanes(UGraphic ug, TextBlock full) {
final HColor back = swimlane.getColors(skinParam).getColor(ColorType.BACK);
if (back != null) {
final LaneDivider divider2 = dividers.get(i + 1);
final UGraphic background = ug.apply(new UChangeBackColor(back)).apply(new UChangeColor(back))
final UGraphic background = ug.apply(back.bg()).apply(back)
.apply(UTranslate.dx(xpos - divider1.getX2()));
final double width = swimlane.getActualWidth() + divider1.getX2() + divider2.getX1();
final double height = dimensionFull.getHeight() + titleHeightTranslate.getDy();
background.draw(new URectangle(width, height).ignoreForCompressionOnX().ignoreForCompressionOnY());
}

full.drawU(new UGraphicInterceptorOneSwimlane(ug, swimlane).apply(swimlane.getTranslate())
full.drawU(new UGraphicInterceptorOneSwimlane(ug, swimlane, swimlanes()).apply(swimlane.getTranslate())
.apply(getTitleHeightTranslate(stringBounder)));

final double dividerWith = divider1.calculateDimension(stringBounder).getWidth();
Expand All @@ -312,7 +310,7 @@ private void drawTitlesBackground(UGraphic ug) {
double fullWidth = swimlanesSpecial().get(swimlanesSpecial().size() - 1).getTranslate().getDx() - 2 * 5 - 1;
final URectangle back = new URectangle(fullWidth, titleHeight).ignoreForCompressionOnX()
.ignoreForCompressionOnY();
ug.apply(UTranslate.dx(5)).apply(new UChangeBackColor(color)).apply(new UChangeColor(color)).draw(back);
ug.apply(UTranslate.dx(5)).apply(color.bg()).apply(color).draw(back);
}
}

Expand All @@ -330,7 +328,7 @@ private void computeDrawingWidths(UGraphic ug, TextBlock full) {
for (Swimlane swimlane : swimlanes()) {
final LimitFinder limitFinder = new LimitFinder(stringBounder, false);
final UGraphicInterceptorOneSwimlane interceptor = new UGraphicInterceptorOneSwimlane(
new UGraphicForSnake(limitFinder), swimlane);
new UGraphicForSnake(limitFinder), swimlane, swimlanes());
full.drawU(interceptor);
interceptor.flushUg();
final MinMax minMax = limitFinder.getMinMax();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
import net.sourceforge.plantuml.graphic.StringBounder;
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
Expand All @@ -74,7 +72,7 @@ protected void drawWhenSwimlanes(UGraphic ug, TextBlock full) {
if (color != null) {
final double titleHeight = getTitlesHeight(stringBounder);
final URectangle back = new URectangle(getTitlesWidth(stringBounder), titleHeight).ignoreForCompressionOnX().ignoreForCompressionOnY();
ug.apply(new UChangeBackColor(color)).apply(new UChangeColor(color)).draw(back);
ug.apply(color.bg()).apply(color).draw(back);
}
for (Swimlane swimlane : swimlanes) {
final TextBlock swTitle = getTitle(swimlane);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import net.sourceforge.plantuml.graphic.TextBlock;
import net.sourceforge.plantuml.skin.rose.Rose;
import net.sourceforge.plantuml.style.PName;
import net.sourceforge.plantuml.ugraphic.UChangeColor;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.ULine;
import net.sourceforge.plantuml.ugraphic.UStroke;
Expand Down Expand Up @@ -89,6 +88,6 @@ private void drawSeparation(UGraphic ug, double height) {
color = getStyle().value(PName.LineColor).asColor(skinParam.getIHtmlColorSet());
thickness = getStyle().getStroke();
}
ug.apply(thickness).apply(new UChangeColor(color)).draw(ULine.vline(height));
ug.apply(thickness).apply(color).draw(ULine.vline(height));
}
}
Loading

0 comments on commit 9077d97

Please sign in to comment.