1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-09-22 12:09:03 +00:00

Compare commits

..

No commits in common. "a0be1ed677c45b3f21ba7aebd8173789df1f6bd4" and "6c945e2508936d710789e4d6071ffb6122b953bc" have entirely different histories.

14 changed files with 21 additions and 64 deletions

View File

@ -1,4 +1,4 @@
# Warning, "version" should be the same in gradle.properties and Version.java
# Any idea anyone how to magically synchronize those :-) ?
version = 1.2024.4beta6
version = 1.2024.4beta5
org.gradle.workers.max = 3

View File

@ -127,16 +127,10 @@ public class CommandCreateClassMultilines extends CommandMultilines2<ClassDiagra
new RegexLeaf("LINECOLOR", "(?:\\[(dotted|dashed|bold)\\])?(\\w+)?"))), //
new RegexOptional(new RegexConcat(RegexLeaf.spaceOneOrMore(),
new RegexLeaf("EXTENDS",
"(extends)[%s]+(" + CommandCreateClassMultilines.CODES + "|[%g]([^%g]+)[%g])"),
new RegexOptional(new RegexConcat(RegexLeaf.spaceZeroOrMore(),
new RegexLeaf("\\<(" + GenericRegexProducer.PATTERN + ")\\>"))) //
)), //
"(extends)[%s]+(" + CommandCreateClassMultilines.CODES + "|[%g]([^%g]+)[%g])"))), //
new RegexOptional(new RegexConcat(RegexLeaf.spaceOneOrMore(),
new RegexLeaf("IMPLEMENTS",
"(implements)[%s]+(" + CommandCreateClassMultilines.CODES + "|[%g]([^%g]+)[%g])"),
new RegexOptional(new RegexConcat(RegexLeaf.spaceZeroOrMore(),
new RegexLeaf("\\<(" + GenericRegexProducer.PATTERN + ")\\>"))) //
)), //
"(implements)[%s]+(" + CommandCreateClassMultilines.CODES + "|[%g]([^%g]+)[%g])"))), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("\\{"), //
RegexLeaf.spaceZeroOrMore(), //

View File

@ -53,13 +53,13 @@ public class CommandMindMapDirection extends SingleLineCommand2<MindMapDiagram>
static IRegex getRegexConcat() {
return RegexConcat.build(CommandMindMapDirection.class.getName(), RegexLeaf.start(), //
new RegexLeaf("[^*#]*"), //
new RegexLeaf("[^*]*"), //
new RegexLeaf("\\b"), //
new RegexLeaf("DIRECTION", "(left|right|top|bottom)"), //
new RegexLeaf("\\b"), //
new RegexLeaf("[^*#]*"), //
new RegexLeaf("[^*]*"), //
new RegexLeaf("(side|direction)"), //
new RegexLeaf("[^*#]*"), //
new RegexLeaf("[^*]*"), //
RegexLeaf.end());
}

View File

@ -55,7 +55,7 @@ public class CommandMindMapOrgmode extends SingleLineCommand2<MindMapDiagram> {
static IRegex getRegexConcat() {
return RegexConcat.build(CommandMindMapOrgmode.class.getName(), RegexLeaf.start(), //
new RegexLeaf("TYPE", "([ \t]*[*#]+)"), //
new RegexLeaf("TYPE", "([ \t]*\\*+)"), //
new RegexOptional(new RegexLeaf("BACKCOLOR", "\\[(#\\w+)\\]")), //
new RegexLeaf("SHAPE", "(_)?"), //
RegexLeaf.spaceOneOrMore(), //

View File

@ -60,7 +60,7 @@ public class CommandMindMapOrgmodeMultiline extends CommandMultilines2<MindMapDi
static IRegex getRegexConcat() {
return RegexConcat.build(CommandMindMapOrgmodeMultiline.class.getName(), RegexLeaf.start(), //
new RegexLeaf("TYPE", "([*#]+)"), //
new RegexLeaf("TYPE", "(\\*+)"), //
new RegexOptional(new RegexLeaf("BACKCOLOR", "\\[(#\\w+)\\]")), //
new RegexLeaf("SHAPE", "(_)?"), //
new RegexLeaf(":"), //

View File

@ -62,11 +62,8 @@ public abstract class Player implements TimeProjected {
private final Display title;
protected int suggestedHeight;
protected final Stereotype stereotype;
private final HColor generalBackgroundColor;
public Player(String title, ISkinParam skinParam, TimingRuler ruler, boolean compact, Stereotype stereotype,
HColor generalBackgroundColor) {
this.generalBackgroundColor = generalBackgroundColor;
public Player(String title, ISkinParam skinParam, TimingRuler ruler, boolean compact, Stereotype stereotype) {
this.stereotype = stereotype;
this.skinParam = skinParam;
this.compact = compact;
@ -78,10 +75,6 @@ public abstract class Player implements TimeProjected {
return compact;
}
public HColor getGeneralBackgroundColor() {
return generalBackgroundColor;
}
protected abstract StyleSignature getStyleSignature();
final protected Style getStyle() {

View File

@ -76,7 +76,7 @@ public class PlayerAnalog extends Player {
private Integer ticksEvery;
public PlayerAnalog(String code, ISkinParam skinParam, TimingRuler ruler, boolean compact, Stereotype stereotype) {
super(code, skinParam, ruler, compact, stereotype, null);
super(code, skinParam, ruler, compact, stereotype);
this.suggestedHeight = 100;
}

View File

@ -76,7 +76,7 @@ public class PlayerBinary extends Player {
private final List<TimingNote> notes = new ArrayList<>();
public PlayerBinary(String code, ISkinParam skinParam, TimingRuler ruler, boolean compact, Stereotype stereotype) {
super(code, skinParam, ruler, compact, stereotype, null);
super(code, skinParam, ruler, compact, stereotype);
this.suggestedHeight = 30;
}

View File

@ -65,7 +65,7 @@ public class PlayerClock extends Player {
public PlayerClock(String title, ISkinParam skinParam, TimingRuler ruler, int period, int pulse, int offset,
boolean compact) {
super(title, skinParam, ruler, compact, null, null);
super(title, skinParam, ruler, compact, null);
this.displayTitle = title.length() > 0;
this.period = period;
this.pulse = pulse;

View File

@ -43,7 +43,6 @@ import java.util.TreeSet;
import net.sourceforge.plantuml.klimt.UTranslate;
import net.sourceforge.plantuml.klimt.color.Colors;
import net.sourceforge.plantuml.klimt.color.HColor;
import net.sourceforge.plantuml.klimt.creole.Display;
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
import net.sourceforge.plantuml.klimt.font.StringBounder;
@ -51,7 +50,6 @@ import net.sourceforge.plantuml.klimt.geom.XDimension2D;
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
import net.sourceforge.plantuml.klimt.shape.TextBlock;
import net.sourceforge.plantuml.klimt.shape.UDrawable;
import net.sourceforge.plantuml.klimt.shape.URectangle;
import net.sourceforge.plantuml.skin.ArrowConfiguration;
import net.sourceforge.plantuml.stereo.Stereotype;
import net.sourceforge.plantuml.style.ISkinParam;
@ -79,8 +77,8 @@ public final class PlayerRobustConcise extends Player {
private Colors initialColors;
public PlayerRobustConcise(TimingStyle type, String full, ISkinParam skinParam, TimingRuler ruler, boolean compact,
Stereotype stereotype, HColor generalBackgroundColor) {
super(full, skinParam, ruler, compact, stereotype, generalBackgroundColor);
Stereotype stereotype) {
super(full, skinParam, ruler, compact, stereotype);
this.type = type;
this.suggestedHeight = 0;
}

View File

@ -55,7 +55,6 @@ import net.sourceforge.plantuml.klimt.UStroke;
import net.sourceforge.plantuml.klimt.UTranslate;
import net.sourceforge.plantuml.klimt.color.Colors;
import net.sourceforge.plantuml.klimt.color.HColor;
import net.sourceforge.plantuml.klimt.color.HColors;
import net.sourceforge.plantuml.klimt.creole.Display;
import net.sourceforge.plantuml.klimt.drawing.UGraphic;
import net.sourceforge.plantuml.klimt.font.StringBounder;
@ -63,7 +62,6 @@ import net.sourceforge.plantuml.klimt.geom.XDimension2D;
import net.sourceforge.plantuml.klimt.shape.AbstractTextBlock;
import net.sourceforge.plantuml.klimt.shape.TextBlock;
import net.sourceforge.plantuml.klimt.shape.ULine;
import net.sourceforge.plantuml.klimt.shape.URectangle;
import net.sourceforge.plantuml.skin.UmlDiagramType;
import net.sourceforge.plantuml.stereo.Stereotype;
import net.sourceforge.plantuml.style.PName;
@ -135,15 +133,6 @@ public class TimingDiagram extends UmlDiagram implements Clocks {
ruler.ensureNotEmpty();
final StringBounder stringBounder = ug.getStringBounder();
final double part1MaxWidth = getPart1MaxWidth(stringBounder);
for (Player player : players.values()) {
final UGraphic ugPlayer = ug.apply(getUTranslateForPlayer(player, stringBounder));
final HColor generalBackgroundColor = player.getGeneralBackgroundColor();
if (generalBackgroundColor != null)
ugPlayer.apply(generalBackgroundColor).apply(generalBackgroundColor.bg())
.draw(URectangle.build(getWidthTotal(stringBounder), player.getFullHeight(stringBounder)));
}
final UTranslate widthPart1 = UTranslate.dx(part1MaxWidth);
if (compactByDefault == false)
drawBorder(ug);
@ -157,7 +146,6 @@ public class TimingDiagram extends UmlDiagram implements Clocks {
for (Player player : players.values()) {
final UGraphic ugPlayer = ug.apply(getUTranslateForPlayer(player, stringBounder));
final double caption = getHeightForCaptions(stringBounder);
if (first) {
if (player.isCompact() == false)
drawHorizontalSeparator(ugPlayer);
@ -291,9 +279,9 @@ public class TimingDiagram extends UmlDiagram implements Clocks {
}
public CommandExecutionResult createRobustConcise(String code, String full, TimingStyle type, boolean compact,
Stereotype stereotype, HColor backColor) {
Stereotype stereotype) {
final Player player = new PlayerRobustConcise(type, full, getSkinParam(), ruler, compactByDefault || compact,
stereotype, backColor);
stereotype);
players.put(code, player);
lastPlayer = player;
return CommandExecutionResult.ok();

View File

@ -59,9 +59,8 @@ public class CommandDefineStateShort extends SingleLineCommand2<TimingDiagram> {
RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("has"), //
RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("STATE", "([-%pLN_.@]+)"), //
new RegexLeaf("STATES", "((,([-%pLN_.@]+))*)"), //
RegexLeaf.end());
new RegexLeaf("STATE", "([%pLN_.@]+)"), //
new RegexLeaf("STATES", "((,([%pLN_.@]+))*)"), RegexLeaf.end());
}
@Override

View File

@ -37,15 +37,10 @@ package net.sourceforge.plantuml.timingdiagram.command;
import net.sourceforge.plantuml.command.CommandExecutionResult;
import net.sourceforge.plantuml.command.SingleLineCommand2;
import net.sourceforge.plantuml.klimt.color.ColorParser;
import net.sourceforge.plantuml.klimt.color.ColorType;
import net.sourceforge.plantuml.klimt.color.Colors;
import net.sourceforge.plantuml.klimt.color.NoSuchColorException;
import net.sourceforge.plantuml.regex.IRegex;
import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf;
import net.sourceforge.plantuml.regex.RegexOptional;
import net.sourceforge.plantuml.regex.RegexOr;
import net.sourceforge.plantuml.regex.RegexResult;
import net.sourceforge.plantuml.stereo.Stereotype;
import net.sourceforge.plantuml.stereo.StereotypePattern;
@ -75,18 +70,11 @@ public class CommandRobustConcise extends SingleLineCommand2<TimingDiagram> {
RegexLeaf.spaceOneOrMore())), //
new RegexLeaf("CODE", "([%pLN_.@]+)"), //
StereotypePattern.optional("STEREOTYPE2"), //
RegexLeaf.spaceZeroOrMore(), //
new RegexOr(color().getRegex()), //
RegexLeaf.end());
}
private static ColorParser color() {
return ColorParser.simpleColor(ColorType.BACK);
}
@Override
final protected CommandExecutionResult executeArg(TimingDiagram diagram, LineLocation location, RegexResult arg)
throws NoSuchColorException {
final protected CommandExecutionResult executeArg(TimingDiagram diagram, LineLocation location, RegexResult arg) {
final String compact = arg.get("COMPACT", 0);
final String code = arg.get("CODE", 0);
String full = arg.get("FULL", 0);
@ -100,10 +88,7 @@ public class CommandRobustConcise extends SingleLineCommand2<TimingDiagram> {
stereotype = Stereotype.build(arg.get("STEREOTYPE2", 0));
final TimingStyle type = TimingStyle.valueOf(arg.get("TYPE", 0).toUpperCase());
final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
return diagram.createRobustConcise(code, full, type, compact != null, stereotype,
colors.getColor(ColorType.BACK));
return diagram.createRobustConcise(code, full, type, compact != null, stereotype);
}
}

View File

@ -46,7 +46,7 @@ public class Version {
// Warning, "version" should be the same in gradle.properties and Version.java
// Any idea anyone how to magically synchronize those :-) ?
private static final String version = "1.2024.4beta6";
private static final String version = "1.2024.4beta5";
public static String versionString() {
return version;