1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-22 04:55:10 +00:00

Import version 1.2021.4

This commit is contained in:
Arnaud Roques 2021-04-04 12:31:53 +02:00
parent 33ba37318c
commit feba01473c
14 changed files with 178 additions and 18 deletions

View File

@ -35,7 +35,7 @@
<groupId>net.sourceforge.plantuml</groupId>
<artifactId>plantuml</artifactId>
<version>1.2021.3-SNAPSHOT</version>
<version>1.2021.5-SNAPSHOT</version>
<packaging>jar</packaging>
<name>PlantUML</name>

View File

@ -296,6 +296,9 @@ yamlDiagram {
LineThickness 1
LineColor #A80036
}
highlight {
BackGroundColor #ccff02
}
}
}

View File

@ -144,6 +144,8 @@ public enum ColorParam {
rectangleBorder(HColorUtils.BLACK, ColorType.LINE),
hexagonBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
hexagonBorder(HColorUtils.BLACK, ColorType.LINE),
personBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
personBorder(HColorUtils.BLACK, ColorType.LINE),
archimateBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),
archimateBorder(HColorUtils.BLACK, ColorType.LINE),
cardBackground(HColorUtils.MY_YELLOW, true, ColorType.BACK),

View File

@ -36,7 +36,7 @@
package net.sourceforge.plantuml;
public enum CornerParam {
DEFAULT, diagramBorder, titleBorder, rectangle, hexagon, archimate, component, card, agent;
DEFAULT, diagramBorder, titleBorder, rectangle, person, hexagon, archimate, component, card, agent;
public String getRoundKey() {
if (this == DEFAULT) {

View File

@ -81,6 +81,7 @@ public enum FontParam {
RECTANGLE(14, Font.PLAIN), //
LABEL(14, Font.PLAIN), //
HEXAGON(14, Font.PLAIN), //
PERSON(14, Font.PLAIN), //
ARCHIMATE(14, Font.PLAIN), //
CARD(14, Font.PLAIN), //
NODE(14, Font.PLAIN), //
@ -116,6 +117,7 @@ public enum FontParam {
AGENT_STEREOTYPE(14, Font.ITALIC), //
RECTANGLE_STEREOTYPE(14, Font.ITALIC), //
LABEL_STEREOTYPE(14, Font.ITALIC), //
PERSON_STEREOTYPE(14, Font.ITALIC), //
HEXAGON_STEREOTYPE(14, Font.ITALIC), //
ARCHIMATE_STEREOTYPE(14, Font.ITALIC), //
CARD_STEREOTYPE(14, Font.ITALIC), //

View File

@ -56,6 +56,7 @@ public enum LineParam {
diagramBorder,
rectangleBorder,
hexagonBorder,
personBorder,
archimateBorder,
componentBorder,
cardBorder,

View File

@ -70,7 +70,7 @@ import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
public class CommandCreateElementFull extends SingleLineCommand2<DescriptionDiagram> {
public static final String ALL_TYPES = "artifact|actor/|actor|folder|card|file|package|rectangle|hexagon|label|node|frame|cloud|database|queue|stack|storage|agent|usecase/|usecase|component|boundary|control|entity|interface|circle|collections|port|portin|portout";
public static final String ALL_TYPES = "person|artifact|actor/|actor|folder|card|file|package|rectangle|hexagon|label|node|frame|cloud|database|queue|stack|storage|agent|usecase/|usecase|component|boundary|control|entity|interface|circle|collections|port|portin|portout";
public CommandCreateElementFull() {
super(getRegexConcat());

View File

@ -104,10 +104,14 @@ public class SkinParameter {
public static final SkinParameter LABEL = new SkinParameter(SName.label, "LABEL", ColorParam.rectangleBackground,
ColorParam.rectangleBorder, FontParam.LABEL, FontParam.LABEL_STEREOTYPE);
public static final SkinParameter HEXAGON = new SkinParameter(SName.rectangle, "HEXAGON",
public static final SkinParameter HEXAGON = new SkinParameter(SName.hexagon, "HEXAGON",
ColorParam.hexagonBackground, ColorParam.hexagonBorder, FontParam.HEXAGON, FontParam.HEXAGON_STEREOTYPE,
CornerParam.hexagon, LineParam.hexagonBorder);
public static final SkinParameter PERSON = new SkinParameter(SName.person, "PERSON",
ColorParam.personBackground, ColorParam.personBorder, FontParam.PERSON, FontParam.PERSON_STEREOTYPE,
CornerParam.person, LineParam.personBorder);
public static final SkinParameter ARCHIMATE = new SkinParameter(SName.archimate, "ARCHIMATE",
ColorParam.archimateBackground, ColorParam.archimateBorder, FontParam.ARCHIMATE,
FontParam.ARCHIMATE_STEREOTYPE, CornerParam.archimate, LineParam.archimateBorder);

View File

@ -67,6 +67,7 @@ public abstract class USymbol {
public final static USymbol RECTANGLE = record("RECTANGLE", SkinParameter.RECTANGLE,
new USymbolRectangle(SkinParameter.RECTANGLE));
public final static USymbol HEXAGON = record("HEXAGON", SkinParameter.HEXAGON, new USymbolHexagon());
public final static USymbol PERSON = record("PERSON", SkinParameter.PERSON, new USymbolPerson());
public final static USymbol LABEL = record("LABEL", SkinParameter.LABEL,
new USymbolLabel(SkinParameter.LABEL));
public final static USymbol ARCHIMATE = record("ARCHIMATE", SkinParameter.ARCHIMATE,
@ -218,6 +219,8 @@ public abstract class USymbol {
usymbol = USymbol.PACKAGE;
} else if (symbol.equalsIgnoreCase("rectangle")) {
usymbol = USymbol.RECTANGLE;
} else if (symbol.equalsIgnoreCase("person")) {
usymbol = USymbol.PERSON;
} else if (symbol.equalsIgnoreCase("hexagon")) {
usymbol = USymbol.HEXAGON;
} else if (symbol.equalsIgnoreCase("label")) {

View File

@ -0,0 +1,139 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* (C) Copyright 2009-2020, Arnaud Roques
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* 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.
*
*
* Original Author: Arnaud Roques
*
*
*/
package net.sourceforge.plantuml.graphic;
import java.awt.geom.Dimension2D;
import net.sourceforge.plantuml.Dimension2DDouble;
import net.sourceforge.plantuml.ugraphic.UEllipse;
import net.sourceforge.plantuml.ugraphic.UGraphic;
import net.sourceforge.plantuml.ugraphic.UGraphicStencil;
import net.sourceforge.plantuml.ugraphic.URectangle;
import net.sourceforge.plantuml.ugraphic.UTranslate;
class USymbolPerson extends USymbol {
@Override
public SkinParameter getSkinParameter() {
return SkinParameter.PERSON;
}
private void drawRect(UGraphic ug, double width, double height, boolean shadowing, double roundCorner,
double diagonalCorner) {
final UEllipse head = new UEllipse(headSize(), headSize());
final URectangle body = new URectangle(width, height - headSize()).rounded(headSize());
if (shadowing) {
body.setDeltaShadow(3.0);
head.setDeltaShadow(1.0);
}
final double posx = (width - headSize()) / 2;
ug.apply(UTranslate.dx(posx)).draw(head);
ug.apply(UTranslate.dy(headSize())).draw(body);
}
private double headSize() {
return 20;
}
private Margin getMargin() {
return new Margin(10, 10, 10, 10);
}
@Override
public TextBlock asSmall(TextBlock name, final TextBlock label, final TextBlock stereotype,
final SymbolContext symbolContext, final HorizontalAlignment stereoAlignment) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = UGraphicStencil.create(ug, dim);
ug = symbolContext.apply(ug);
drawRect(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
symbolContext.getRoundCorner(), symbolContext.getDiagonalCorner());
final Margin margin = getMargin();
final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, stereoAlignment);
tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1() + headSize())));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
final Dimension2D dimLabel = label.calculateDimension(stringBounder);
final Dimension2D dimStereo = stereotype.calculateDimension(stringBounder);
return Dimension2DDouble.delta(getMargin().addDimension(Dimension2DDouble.mergeTB(dimStereo, dimLabel)),
0, headSize());
}
};
}
@Override
public TextBlock asBig(final TextBlock title, final HorizontalAlignment labelAlignment, final TextBlock stereotype,
final double width, final double height, final SymbolContext symbolContext,
final HorizontalAlignment stereoAlignment) {
return new AbstractTextBlock() {
public void drawU(UGraphic ug) {
final Dimension2D dim = calculateDimension(ug.getStringBounder());
ug = symbolContext.apply(ug);
drawRect(ug, dim.getWidth(), dim.getHeight(), symbolContext.isShadowing(),
symbolContext.getRoundCorner(), 0);
final Dimension2D dimStereo = stereotype.calculateDimension(ug.getStringBounder());
final double posStereoX;
final double posStereoY;
if (stereoAlignment == HorizontalAlignment.RIGHT) {
posStereoX = width - dimStereo.getWidth() - getMargin().getX1() / 2;
posStereoY = getMargin().getY1() / 2;
} else {
posStereoX = (width - dimStereo.getWidth()) / 2;
posStereoY = 2;
}
stereotype.drawU(ug.apply(new UTranslate(posStereoX, posStereoY)));
final Dimension2D dimTitle = title.calculateDimension(ug.getStringBounder());
final double posTitle;
if (labelAlignment == HorizontalAlignment.LEFT) {
posTitle = 3;
} else if (labelAlignment == HorizontalAlignment.RIGHT) {
posTitle = width - dimTitle.getWidth() - 3;
} else {
posTitle = (width - dimTitle.getWidth()) / 2;
}
title.drawU(ug.apply(new UTranslate(posTitle, 2 + dimStereo.getHeight())));
}
public Dimension2D calculateDimension(StringBounder stringBounder) {
return new Dimension2DDouble(width, height);
}
};
}
}

View File

@ -35,6 +35,8 @@
*/
package net.sourceforge.plantuml.project;
import static net.sourceforge.plantuml.ugraphic.ImageBuilder.styledImageBuilder;
import java.awt.geom.Dimension2D;
import java.awt.geom.Rectangle2D;
import java.io.IOException;
@ -100,8 +102,6 @@ import net.sourceforge.plantuml.ugraphic.color.HColor;
import net.sourceforge.plantuml.ugraphic.color.HColorSet;
import net.sourceforge.plantuml.ugraphic.color.HColorUtils;
import static net.sourceforge.plantuml.ugraphic.ImageBuilder.styledImageBuilder;
public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprite {
private final Map<Task, TaskDraw> draws = new LinkedHashMap<Task, TaskDraw>();
@ -169,15 +169,13 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
protected ImageData exportDiagramNow(OutputStream os, int index, FileFormatOption fileFormatOption)
throws IOException {
final StringBounder stringBounder = fileFormatOption.getDefaultStringBounder(getSkinParam());
return styledImageBuilder(this, getTextBlock(stringBounder), index, fileFormatOption)
.write(os);
return styledImageBuilder(this, getTextBlock(stringBounder), index, fileFormatOption).write(os);
}
public void setPrintScale(PrintScale printScale) {
this.printScale = printScale;
}
public void setCompress(int compress) {
this.compress = compress;
}
@ -188,6 +186,7 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
}
return printScale.getCompress();
}
private boolean isHidden(Task task) {
if (printStart == null || task instanceof TaskSeparator) {
return false;
@ -247,13 +246,17 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit
if (openClose.getCalendar() == null) {
return new TimeHeaderSimple(min, max);
} else if (printScale == PrintScale.WEEKLY) {
return new TimeHeaderWeekly(openClose.getCalendar(), min, max, openClose, colorDays, colorDaysOfWeek, getCompress());
return new TimeHeaderWeekly(openClose.getCalendar(), min, max, openClose, colorDays, colorDaysOfWeek,
getCompress());
} else if (printScale == PrintScale.MONTHLY) {
return new TimeHeaderMonthly(openClose.getCalendar(), min, max, openClose, colorDays, colorDaysOfWeek, getCompress());
return new TimeHeaderMonthly(openClose.getCalendar(), min, max, openClose, colorDays, colorDaysOfWeek,
getCompress());
} else if (printScale == PrintScale.QUARTERLY) {
return new TimeHeaderQuarterly(openClose.getCalendar(), min, max, openClose, colorDays, colorDaysOfWeek, getCompress());
return new TimeHeaderQuarterly(openClose.getCalendar(), min, max, openClose, colorDays, colorDaysOfWeek,
getCompress());
} else if (printScale == PrintScale.YEARLY) {
return new TimeHeaderYearly(openClose.getCalendar(), min, max, openClose, colorDays, colorDaysOfWeek, getCompress());
return new TimeHeaderYearly(openClose.getCalendar(), min, max, openClose, colorDays, colorDaysOfWeek,
getCompress());
} else {
return new TimeHeaderDaily(openClose.getCalendar(), min, max, openClose, colorDays, colorDaysOfWeek,
nameDays, printStart, printEnd);

View File

@ -79,7 +79,8 @@ public class CommandPrintScale extends SingleLineCommand2<GanttDiagram> {
final String scaleString = arg.get("SCALE", 0);
final PrintScale scale = PrintScale.fromString(scaleString);
diagram.setPrintScale(scale);
RegexPartialMatch compress = arg.get("COMPRESS");
final RegexPartialMatch compress = arg.get("COMPRESS");
if (compress.size() > 0 && compress.get(0) != null) {
diagram.setCompress(Integer.parseInt(compress.get(0)));
}

View File

@ -73,6 +73,7 @@ public enum SName {
ganttDiagram, //
group, //
groupHeader, //
hexagon, //
highlight, //
header, //
interface_, //
@ -90,6 +91,7 @@ public enum SName {
package_, //
participant, //
partition, //
person, //
queue, //
rectangle, //
reference, //

View File

@ -44,7 +44,7 @@ public class Version {
private static final int MAJOR_SEPARATOR = 1000000;
public static int version() {
return 1202103;
return 1202104;
}
public static int versionPatched() {
@ -80,7 +80,7 @@ public class Version {
}
public static int beta() {
final int beta = 4;
final int beta = 0;
return beta;
}
@ -93,7 +93,7 @@ public class Version {
}
public static long compileTime() {
return 1616431999785L;
return 1617526179012L;
}
public static String compileTimeString() {