mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-22 04:55:10 +00:00
fix: wip
https://github.com/plantuml/plantuml/issues/1465 https://github.com/plantuml/plantuml/issues/1464 https://github.com/plantuml/plantuml/issues/1459 https://github.com/plantuml/plantuml/issues/1460
This commit is contained in:
parent
21461b83fc
commit
968a958b9d
@ -1,4 +1,4 @@
|
|||||||
# Warning, "version" should be the same in gradle.properties and Version.java
|
# Warning, "version" should be the same in gradle.properties and Version.java
|
||||||
# Any idea anyone how to magically synchronize those :-) ?
|
# Any idea anyone how to magically synchronize those :-) ?
|
||||||
version = 1.2023.9
|
version = 1.2023.10beta1
|
||||||
org.gradle.workers.max = 3
|
org.gradle.workers.max = 3
|
@ -65,6 +65,14 @@ document {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
package {
|
||||||
|
title {
|
||||||
|
FontStyle bold
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
stereotype {
|
stereotype {
|
||||||
FontStyle italic
|
FontStyle italic
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,8 @@ public class CommandPackage extends SingleLineCommand2<AbstractEntityDiagram> {
|
|||||||
if (name.length() == 0) {
|
if (name.length() == 0) {
|
||||||
idShort = "##" + diagram.getUniqueSequence();
|
idShort = "##" + diagram.getUniqueSequence();
|
||||||
display = null;
|
display = null;
|
||||||
throw new IllegalStateException("AS");
|
return CommandExecutionResult.error("Error in name");
|
||||||
|
// throw new IllegalStateException("AS");
|
||||||
} else {
|
} else {
|
||||||
idShort = name;
|
idShort = name;
|
||||||
display = idShort;
|
display = idShort;
|
||||||
|
@ -77,8 +77,8 @@ public class BodyFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static TextBlock create3(Display rawBody, ISkinSimple skinParam, HorizontalAlignment align,
|
public static TextBlock create3(Display rawBody, ISkinSimple skinParam, HorizontalAlignment align,
|
||||||
FontConfiguration titleConfig, LineBreakStrategy lineBreakStrategy, Style style) {
|
FontConfiguration fc, LineBreakStrategy lineBreakStrategy, Style style) {
|
||||||
return new BodyEnhanced2(rawBody, skinParam, align, titleConfig, lineBreakStrategy, style);
|
return new BodyEnhanced2(rawBody, skinParam, align, fc, lineBreakStrategy, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -283,14 +283,16 @@ public class CucaDiagramFileMakerElk implements CucaDiagramFileMaker {
|
|||||||
|
|
||||||
final UmlDiagramType umlDiagramType = diagram.getUmlDiagramType();
|
final UmlDiagramType umlDiagramType = diagram.getUmlDiagramType();
|
||||||
|
|
||||||
final Style style = Cluster.getDefaultStyleDefinition(umlDiagramType.getStyleName(), group.getUSymbol())
|
final Style style = Cluster
|
||||||
|
.getDefaultStyleDefinition(umlDiagramType.getStyleName(), group.getUSymbol(), group.getGroupType())
|
||||||
.getMergedStyle(skinParam.getCurrentStyleBuilder());
|
.getMergedStyle(skinParam.getCurrentStyleBuilder());
|
||||||
final double shadowing = style.value(PName.Shadowing).asDouble();
|
final double shadowing = style.value(PName.Shadowing).asDouble();
|
||||||
final UStroke stroke = Cluster.getStrokeInternal(group, style);
|
final UStroke stroke = Cluster.getStrokeInternal(group, style);
|
||||||
|
|
||||||
HColor backColor = getBackColor(umlDiagramType);
|
HColor backColor = getBackColor(umlDiagramType);
|
||||||
backColor = Cluster.getBackColor(backColor, group.getStereotype(), umlDiagramType.getStyleName(),
|
backColor = Cluster.getBackColor(backColor, group.getStereotype(), umlDiagramType.getStyleName(),
|
||||||
group.getUSymbol(), skinParam.getCurrentStyleBuilder(), skinParam.getIHtmlColorSet());
|
group.getUSymbol(), skinParam.getCurrentStyleBuilder(), skinParam.getIHtmlColorSet(),
|
||||||
|
group.getGroupType());
|
||||||
|
|
||||||
final double roundCorner = style.value(PName.RoundCorner).asDouble();
|
final double roundCorner = style.value(PName.RoundCorner).asDouble();
|
||||||
// final double roundCorner = group.getUSymbol() == null ? 0
|
// final double roundCorner = group.getUSymbol() == null ? 0
|
||||||
|
@ -43,7 +43,7 @@ import net.sourceforge.plantuml.klimt.UShape;
|
|||||||
import net.sourceforge.plantuml.utils.SignatureUtils;
|
import net.sourceforge.plantuml.utils.SignatureUtils;
|
||||||
|
|
||||||
public class UImageSvg implements UShape {
|
public class UImageSvg implements UShape {
|
||||||
// ::remove file when __HAXE__
|
// ::remove file when __HAXE__
|
||||||
|
|
||||||
private final String svg;
|
private final String svg;
|
||||||
private final double scale;
|
private final double scale;
|
||||||
@ -77,8 +77,12 @@ public class UImageSvg implements UShape {
|
|||||||
final String style = extractSvgStyle();
|
final String style = extractSvgStyle();
|
||||||
if (style != null) {
|
if (style != null) {
|
||||||
final String background = extractBackground(style);
|
final String background = extractBackground(style);
|
||||||
if (background != null)
|
if (background != null) {
|
||||||
result = result.replaceFirst("<g>", "<g><rect fill=\"" + background + "\" style=\"" + style + "\" /> ");
|
final int width = getData("width");
|
||||||
|
final int height = getData("height");
|
||||||
|
result = result.replaceFirst("<g>", "<g><rect fill=\"" + background + "\" style=\"" + style
|
||||||
|
+ "\" width=\"" + width + "\" height=\"" + height + "\"/> ");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (result.startsWith("<svg>") == false)
|
if (result.startsWith("<svg>") == false)
|
||||||
|
@ -52,6 +52,7 @@ import java.util.Set;
|
|||||||
import net.sourceforge.plantuml.abel.CucaNote;
|
import net.sourceforge.plantuml.abel.CucaNote;
|
||||||
import net.sourceforge.plantuml.abel.Entity;
|
import net.sourceforge.plantuml.abel.Entity;
|
||||||
import net.sourceforge.plantuml.abel.EntityPosition;
|
import net.sourceforge.plantuml.abel.EntityPosition;
|
||||||
|
import net.sourceforge.plantuml.abel.GroupType;
|
||||||
import net.sourceforge.plantuml.abel.Together;
|
import net.sourceforge.plantuml.abel.Together;
|
||||||
import net.sourceforge.plantuml.cucadiagram.ICucaDiagram;
|
import net.sourceforge.plantuml.cucadiagram.ICucaDiagram;
|
||||||
import net.sourceforge.plantuml.decoration.symbol.USymbol;
|
import net.sourceforge.plantuml.decoration.symbol.USymbol;
|
||||||
@ -75,7 +76,6 @@ import net.sourceforge.plantuml.klimt.shape.TextBlock;
|
|||||||
import net.sourceforge.plantuml.klimt.shape.UComment;
|
import net.sourceforge.plantuml.klimt.shape.UComment;
|
||||||
import net.sourceforge.plantuml.klimt.shape.ULine;
|
import net.sourceforge.plantuml.klimt.shape.ULine;
|
||||||
import net.sourceforge.plantuml.skin.AlignmentParam;
|
import net.sourceforge.plantuml.skin.AlignmentParam;
|
||||||
import net.sourceforge.plantuml.skin.ComponentStyle;
|
|
||||||
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
import net.sourceforge.plantuml.skin.UmlDiagramType;
|
||||||
import net.sourceforge.plantuml.stereo.Stereotype;
|
import net.sourceforge.plantuml.stereo.Stereotype;
|
||||||
import net.sourceforge.plantuml.style.ISkinParam;
|
import net.sourceforge.plantuml.style.ISkinParam;
|
||||||
@ -274,12 +274,16 @@ public class Cluster implements Moveable {
|
|||||||
this.xyNoteBottom = pos;
|
this.xyNoteBottom = pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
static public StyleSignatureBasic getDefaultStyleDefinition(SName diagramStyleName, USymbol symbol) {
|
static public StyleSignatureBasic getDefaultStyleDefinition(SName diagramStyleName, USymbol symbol,
|
||||||
|
GroupType groupType) {
|
||||||
if (diagramStyleName == SName.stateDiagram)
|
if (diagramStyleName == SName.stateDiagram)
|
||||||
return StyleSignatureBasic.of(SName.root, SName.element, SName.stateDiagram, SName.state, SName.group);
|
return StyleSignatureBasic.of(SName.root, SName.element, SName.stateDiagram, SName.state, SName.group);
|
||||||
if (symbol == null)
|
if (symbol != null)
|
||||||
return StyleSignatureBasic.of(SName.root, SName.element, diagramStyleName, SName.group);
|
return StyleSignatureBasic.of(SName.root, SName.element, diagramStyleName, SName.group, symbol.getSName());
|
||||||
return StyleSignatureBasic.of(SName.root, SName.element, diagramStyleName, SName.group, symbol.getSName());
|
if (groupType == GroupType.PACKAGE)
|
||||||
|
return StyleSignatureBasic.of(SName.root, SName.element, diagramStyleName, SName.package_, SName.group);
|
||||||
|
|
||||||
|
return StyleSignatureBasic.of(SName.root, SName.element, diagramStyleName, SName.group);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void drawU(UGraphic ug, UmlDiagramType umlDiagramType) {
|
public void drawU(UGraphic ug, UmlDiagramType umlDiagramType) {
|
||||||
@ -298,7 +302,7 @@ public class Cluster implements Moveable {
|
|||||||
ug.draw(new UComment("cluster " + fullName));
|
ug.draw(new UComment("cluster " + fullName));
|
||||||
|
|
||||||
final USymbol uSymbol = group.getUSymbol() == null ? USymbols.PACKAGE : group.getUSymbol();
|
final USymbol uSymbol = group.getUSymbol() == null ? USymbols.PACKAGE : group.getUSymbol();
|
||||||
Style style = getDefaultStyleDefinition(umlDiagramType.getStyleName(), uSymbol)
|
Style style = getDefaultStyleDefinition(umlDiagramType.getStyleName(), uSymbol, group.getGroupType())
|
||||||
.withTOBECHANGED(group.getStereotype()).getMergedStyle(skinParam.getCurrentStyleBuilder());
|
.withTOBECHANGED(group.getStereotype()).getMergedStyle(skinParam.getCurrentStyleBuilder());
|
||||||
final double shadowing = style.value(PName.Shadowing).asDouble();
|
final double shadowing = style.value(PName.Shadowing).asDouble();
|
||||||
HColor borderColor;
|
HColor borderColor;
|
||||||
@ -341,7 +345,8 @@ public class Cluster implements Moveable {
|
|||||||
|
|
||||||
HColor backColor = getBackColor(umlDiagramType, style);
|
HColor backColor = getBackColor(umlDiagramType, style);
|
||||||
backColor = getBackColor(backColor, group.getStereotype(), umlDiagramType.getStyleName(),
|
backColor = getBackColor(backColor, group.getStereotype(), umlDiagramType.getStyleName(),
|
||||||
group.getUSymbol(), skinParam.getCurrentStyleBuilder(), skinParam.getIHtmlColorSet());
|
group.getUSymbol(), skinParam.getCurrentStyleBuilder(), skinParam.getIHtmlColorSet(),
|
||||||
|
group.getGroupType());
|
||||||
|
|
||||||
final ClusterDecoration decoration = new ClusterDecoration(packageStyle, group.getUSymbol(),
|
final ClusterDecoration decoration = new ClusterDecoration(packageStyle, group.getUSymbol(),
|
||||||
clusterHeader.getTitle(), clusterHeader.getStereo(), rectangleArea, stroke);
|
clusterHeader.getTitle(), clusterHeader.getStereo(), rectangleArea, stroke);
|
||||||
@ -638,9 +643,9 @@ public class Cluster implements Moveable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static HColor getBackColor(HColor backColor, Stereotype stereotype, SName styleName, USymbol symbol,
|
public static HColor getBackColor(HColor backColor, Stereotype stereotype, SName styleName, USymbol symbol,
|
||||||
StyleBuilder styleBuilder, HColorSet colorSet) {
|
StyleBuilder styleBuilder, HColorSet colorSet, GroupType groupType) {
|
||||||
|
|
||||||
final Style style = getDefaultStyleDefinition(styleName, symbol).getMergedStyle(styleBuilder);
|
final Style style = getDefaultStyleDefinition(styleName, symbol, groupType).getMergedStyle(styleBuilder);
|
||||||
if (backColor == null)
|
if (backColor == null)
|
||||||
backColor = style.value(PName.BackGroundColor).asColor(colorSet);
|
backColor = style.value(PName.BackGroundColor).asColor(colorSet);
|
||||||
|
|
||||||
|
@ -118,6 +118,8 @@ public final class ClusterHeader {
|
|||||||
else if (uSymbol != null)
|
else if (uSymbol != null)
|
||||||
signature = StyleSignatureBasic.of(SName.root, SName.element, sname, uSymbol.getSName(), SName.composite,
|
signature = StyleSignatureBasic.of(SName.root, SName.element, sname, uSymbol.getSName(), SName.composite,
|
||||||
SName.title);
|
SName.title);
|
||||||
|
else if (g.getGroupType() == GroupType.PACKAGE)
|
||||||
|
signature = StyleSignatureBasic.of(SName.root, SName.element, sname, SName.package_, SName.title);
|
||||||
else
|
else
|
||||||
signature = StyleSignatureBasic.of(SName.root, SName.element, sname, SName.composite, SName.title);
|
signature = StyleSignatureBasic.of(SName.root, SName.element, sname, SName.composite, SName.title);
|
||||||
|
|
||||||
@ -163,7 +165,7 @@ public final class ClusterHeader {
|
|||||||
return TextBlockUtils.empty(0, 0);
|
return TextBlockUtils.empty(0, 0);
|
||||||
|
|
||||||
final Style style = Cluster
|
final Style style = Cluster
|
||||||
.getDefaultStyleDefinition(skinParam.getUmlDiagramType().getStyleName(), g.getUSymbol())
|
.getDefaultStyleDefinition(skinParam.getUmlDiagramType().getStyleName(), g.getUSymbol(), g.getGroupType())
|
||||||
.forStereotypeItself(g.getStereotype()).getMergedStyle(skinParam.getCurrentStyleBuilder());
|
.forStereotypeItself(g.getStereotype()).getMergedStyle(skinParam.getCurrentStyleBuilder());
|
||||||
|
|
||||||
final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam.getIHtmlColorSet());
|
final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam.getIHtmlColorSet());
|
||||||
|
@ -70,7 +70,7 @@ class PointListIteratorImpl implements PointListIterator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<XPoint2D> next() {
|
public List<XPoint2D> next() {
|
||||||
if (pos == -1) {
|
if (pos < 0) {
|
||||||
pos = -2;
|
pos = -2;
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ class PointListIteratorImpl implements PointListIterator {
|
|||||||
pos = svg.indexOf(SvgResult.POINTS_EQUALS, pos) + SvgResult.POINTS_EQUALS.length() + 1;
|
pos = svg.indexOf(SvgResult.POINTS_EQUALS, pos) + SvgResult.POINTS_EQUALS.length() + 1;
|
||||||
return result;
|
return result;
|
||||||
} catch (StringIndexOutOfBoundsException e) {
|
} catch (StringIndexOutOfBoundsException e) {
|
||||||
Log.error("Error " + e);
|
Log.error("ErrorString " + e);
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,8 +145,9 @@ public class EntityImageDescription extends AbstractEntityImage {
|
|||||||
final Style styleStereo = tmp.forStereotypeItself(stereotype)
|
final Style styleStereo = tmp.forStereotypeItself(stereotype)
|
||||||
.getMergedStyle(getSkinParam().getCurrentStyleBuilder());
|
.getMergedStyle(getSkinParam().getCurrentStyleBuilder());
|
||||||
|
|
||||||
final Style style = StyleSignatureBasic.of(SName.root, SName.element, styleName, symbol.getSName())
|
final StyleSignatureBasic tmp2 = StyleSignatureBasic.of(SName.root, SName.element, styleName,
|
||||||
.withTOBECHANGED(stereotype).getMergedStyle(getSkinParam().getCurrentStyleBuilder())
|
symbol.getSName());
|
||||||
|
final Style style = tmp2.withTOBECHANGED(stereotype).getMergedStyle(getSkinParam().getCurrentStyleBuilder())
|
||||||
.eventuallyOverride(colors);
|
.eventuallyOverride(colors);
|
||||||
|
|
||||||
final HColor forecolor = styleTitle.value(PName.LineColor).asColor(getSkinParam().getIHtmlColorSet());
|
final HColor forecolor = styleTitle.value(PName.LineColor).asColor(getSkinParam().getIHtmlColorSet());
|
||||||
@ -160,6 +161,7 @@ public class EntityImageDescription extends AbstractEntityImage {
|
|||||||
final double deltaShadow = styleTitle.value(PName.Shadowing).asDouble();
|
final double deltaShadow = styleTitle.value(PName.Shadowing).asDouble();
|
||||||
final UStroke stroke = styleTitle.getStroke(colors);
|
final UStroke stroke = styleTitle.getStroke(colors);
|
||||||
final FontConfiguration fcTitle = styleTitle.getFontConfiguration(getSkinParam().getIHtmlColorSet());
|
final FontConfiguration fcTitle = styleTitle.getFontConfiguration(getSkinParam().getIHtmlColorSet());
|
||||||
|
final FontConfiguration fc = style.getFontConfiguration(getSkinParam().getIHtmlColorSet());
|
||||||
final FontConfiguration fcStereo = styleStereo.getFontConfiguration(getSkinParam().getIHtmlColorSet());
|
final FontConfiguration fcStereo = styleStereo.getFontConfiguration(getSkinParam().getIHtmlColorSet());
|
||||||
final HorizontalAlignment defaultAlign = styleTitle.getHorizontalAlignment();
|
final HorizontalAlignment defaultAlign = styleTitle.getHorizontalAlignment();
|
||||||
|
|
||||||
@ -172,9 +174,11 @@ public class EntityImageDescription extends AbstractEntityImage {
|
|||||||
if ((entity.getDisplay().equalsLike(codeDisplay) && symbol.getSName() == SName.package_)
|
if ((entity.getDisplay().equalsLike(codeDisplay) && symbol.getSName() == SName.package_)
|
||||||
|| entity.getDisplay().isWhite())
|
|| entity.getDisplay().isWhite())
|
||||||
desc = TextBlockUtils.empty(style.value(PName.MinimumWidth).asDouble(), 0);
|
desc = TextBlockUtils.empty(style.value(PName.MinimumWidth).asDouble(), 0);
|
||||||
else
|
else if (entity.getDisplay().equalsLike(codeDisplay))
|
||||||
desc = BodyFactory.create3(entity.getDisplay(), getSkinParam(), defaultAlign, fcTitle, style.wrapWidth(),
|
desc = BodyFactory.create3(entity.getDisplay(), getSkinParam(), defaultAlign, fcTitle, style.wrapWidth(),
|
||||||
styleTitle);
|
styleTitle);
|
||||||
|
else
|
||||||
|
desc = BodyFactory.create3(entity.getDisplay(), getSkinParam(), defaultAlign, fc, style.wrapWidth(), style);
|
||||||
|
|
||||||
stereo = TextBlockUtils.empty(0, 0);
|
stereo = TextBlockUtils.empty(0, 0);
|
||||||
|
|
||||||
|
@ -105,10 +105,12 @@ public class PlayerAnalog extends Player {
|
|||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getFullHeight(StringBounder stringBounder) {
|
public double getFullHeight(StringBounder stringBounder) {
|
||||||
return getHeightForConstraints(stringBounder) + suggestedHeight;
|
return getHeightForConstraints(stringBounder) + suggestedHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
|
public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
|
||||||
final double x = ruler.getPosInPixel(tick);
|
final double x = ruler.getPosInPixel(tick);
|
||||||
final double value = getValueAt(stringBounder, tick);
|
final double value = getValueAt(stringBounder, tick);
|
||||||
@ -139,14 +141,17 @@ public class PlayerAnalog extends Player {
|
|||||||
return last.getValue();
|
return last.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addNote(TimeTick now, Display note, Position position) {
|
public void addNote(TimeTick now, Display note, Position position) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void defineState(String stateCode, String label) {
|
public void defineState(String stateCode, String label) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setState(TimeTick now, String comment, Colors color, String... valueString) {
|
public void setState(TimeTick now, String comment, Colors color, String... valueString) {
|
||||||
final double value = getState(valueString[0]);
|
final double value = getState(valueString[0]);
|
||||||
if (now == null)
|
if (now == null)
|
||||||
@ -256,6 +261,7 @@ public class PlayerAnalog extends Player {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public UDrawable getPart2() {
|
public UDrawable getPart2() {
|
||||||
return new UDrawable() {
|
return new UDrawable() {
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
|
@ -58,6 +58,7 @@ import net.sourceforge.plantuml.skin.ArrowConfiguration;
|
|||||||
import net.sourceforge.plantuml.stereo.Stereotype;
|
import net.sourceforge.plantuml.stereo.Stereotype;
|
||||||
import net.sourceforge.plantuml.style.ISkinParam;
|
import net.sourceforge.plantuml.style.ISkinParam;
|
||||||
import net.sourceforge.plantuml.style.SName;
|
import net.sourceforge.plantuml.style.SName;
|
||||||
|
import net.sourceforge.plantuml.style.Style;
|
||||||
import net.sourceforge.plantuml.style.StyleSignature;
|
import net.sourceforge.plantuml.style.StyleSignature;
|
||||||
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
import net.sourceforge.plantuml.style.StyleSignatureBasic;
|
||||||
import net.sourceforge.plantuml.timingdiagram.graphic.IntricatedPoint;
|
import net.sourceforge.plantuml.timingdiagram.graphic.IntricatedPoint;
|
||||||
@ -72,6 +73,8 @@ public class PlayerBinary extends Player {
|
|||||||
private final SortedMap<TimeTick, ChangeState> values = new TreeMap<>();
|
private final SortedMap<TimeTick, ChangeState> values = new TreeMap<>();
|
||||||
private ChangeState initialState;
|
private ChangeState initialState;
|
||||||
|
|
||||||
|
private final List<TimingNote> notes = new ArrayList<>();
|
||||||
|
|
||||||
public PlayerBinary(String code, ISkinParam skinParam, TimingRuler ruler, boolean compact, Stereotype stereotype) {
|
public PlayerBinary(String code, ISkinParam skinParam, TimingRuler ruler, boolean compact, Stereotype stereotype) {
|
||||||
super(code, skinParam, ruler, compact, stereotype);
|
super(code, skinParam, ruler, compact, stereotype);
|
||||||
this.suggestedHeight = 30;
|
this.suggestedHeight = 30;
|
||||||
@ -81,8 +84,10 @@ public class PlayerBinary extends Player {
|
|||||||
return TimeConstraint.getHeightForConstraints(stringBounder, constraints);
|
return TimeConstraint.getHeightForConstraints(stringBounder, constraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getFullHeight(StringBounder stringBounder) {
|
public double getFullHeight(StringBounder stringBounder) {
|
||||||
return getHeightForConstraints(stringBounder) + suggestedHeight;
|
return getHeightForConstraints(stringBounder) + getHeightForNotes(stringBounder, Position.TOP) + suggestedHeight
|
||||||
|
+ getHeightForNotes(stringBounder, Position.BOTTOM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -91,20 +96,28 @@ public class PlayerBinary extends Player {
|
|||||||
.withTOBECHANGED(stereotype);
|
.withTOBECHANGED(stereotype);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
|
public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
|
||||||
final double x = ruler.getPosInPixel(tick);
|
final double x = ruler.getPosInPixel(tick);
|
||||||
return new IntricatedPoint(new XPoint2D(x, getYpos(stringBounder, HIGH_STRING)),
|
return new IntricatedPoint(new XPoint2D(x, getYpos(stringBounder, HIGH_STRING)),
|
||||||
new XPoint2D(x, getYpos(stringBounder, HIGH_STRING)));
|
new XPoint2D(x, getYpos(stringBounder, HIGH_STRING)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addNote(TimeTick now, Display note, Position position) {
|
public void addNote(TimeTick now, Display note, Position position) {
|
||||||
throw new UnsupportedOperationException();
|
final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram,
|
||||||
|
SName.note);
|
||||||
|
final Style style = signature.getMergedStyle(skinParam.getCurrentStyleBuilder());
|
||||||
|
|
||||||
|
this.notes.add(new TimingNote(now, this, note, position, skinParam, style));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void defineState(String stateCode, String label) {
|
public void defineState(String stateCode, String label) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setState(TimeTick now, String comment, Colors color, String... states) {
|
public void setState(TimeTick now, String comment, Colors color, String... states) {
|
||||||
final ChangeState cs = new ChangeState(now, comment, color, convert(states));
|
final ChangeState cs = new ChangeState(now, comment, color, convert(states));
|
||||||
if (now == null)
|
if (now == null)
|
||||||
@ -139,14 +152,16 @@ public class PlayerBinary extends Player {
|
|||||||
return getYhigh(stringBounder);
|
return getYhigh(stringBounder);
|
||||||
}
|
}
|
||||||
|
|
||||||
private double getYlow(StringBounder stringBounder) {
|
|
||||||
return getFullHeight(stringBounder) - ymargin;
|
|
||||||
}
|
|
||||||
|
|
||||||
private double getYhigh(StringBounder stringBounder) {
|
private double getYhigh(StringBounder stringBounder) {
|
||||||
return ymargin + getHeightForConstraints(stringBounder);
|
return ymargin + getHeightForConstraints(stringBounder) + getHeightForNotes(stringBounder, Position.TOP);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double getYlow(StringBounder stringBounder) {
|
||||||
|
return getHeightForConstraints(stringBounder) + getHeightForNotes(stringBounder, Position.TOP) + suggestedHeight
|
||||||
|
- ymargin;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TextBlock getPart1(double fullAvailableWidth, double specialVSpace) {
|
public TextBlock getPart1(double fullAvailableWidth, double specialVSpace) {
|
||||||
return new AbstractTextBlock() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
@ -165,6 +180,7 @@ public class PlayerBinary extends Player {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public UDrawable getPart2() {
|
public UDrawable getPart2() {
|
||||||
return new UDrawable() {
|
return new UDrawable() {
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
@ -204,6 +220,12 @@ public class PlayerBinary extends Player {
|
|||||||
|
|
||||||
drawConstraints(ug.apply(UTranslate.dy(getHeightForConstraints(ug.getStringBounder()))));
|
drawConstraints(ug.apply(UTranslate.dy(getHeightForConstraints(ug.getStringBounder()))));
|
||||||
|
|
||||||
|
drawNotes(ug.apply(UTranslate.dy(ymargin)), Position.TOP);
|
||||||
|
drawNotes(
|
||||||
|
ug.apply(UTranslate.dy(getHeightForConstraints(stringBounder)
|
||||||
|
+ getHeightForNotes(stringBounder, Position.TOP) + suggestedHeight - ymargin / 2)),
|
||||||
|
Position.BOTTOM);
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -219,9 +241,26 @@ public class PlayerBinary extends Player {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawConstraints(final UGraphic ug) {
|
private void drawConstraints(final UGraphic ug) {
|
||||||
for (TimeConstraint constraint : constraints) {
|
for (TimeConstraint constraint : constraints)
|
||||||
constraint.drawU(ug, ruler);
|
constraint.drawU(ug, ruler);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void drawNotes(UGraphic ug, final Position position) {
|
||||||
|
for (TimingNote note : notes)
|
||||||
|
if (note.getPosition() == position) {
|
||||||
|
final TimeTick when = note.getWhen();
|
||||||
|
final double x = when == null ? 0 : ruler.getPosInPixel(when);
|
||||||
|
note.drawU(ug.apply(UTranslate.dx(x)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private double getHeightForNotes(StringBounder stringBounder, Position position) {
|
||||||
|
double height = 0;
|
||||||
|
for (TimingNote note : notes)
|
||||||
|
if (note.getPosition() == position)
|
||||||
|
height = Math.max(height, note.getHeight(stringBounder));
|
||||||
|
|
||||||
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,7 @@ public class PlayerClock extends Player {
|
|||||||
this.suggestedHeight = 30;
|
this.suggestedHeight = 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public double getFullHeight(StringBounder stringBounder) {
|
public double getFullHeight(StringBounder stringBounder) {
|
||||||
return suggestedHeight + getTitleHeight(stringBounder);
|
return suggestedHeight + getTitleHeight(stringBounder);
|
||||||
}
|
}
|
||||||
@ -87,22 +88,27 @@ public class PlayerClock extends Player {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected StyleSignatureBasic getStyleSignature() {
|
protected StyleSignatureBasic getStyleSignature() {
|
||||||
return StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram, SName.clock);
|
return StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram, SName.clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
|
public IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addNote(TimeTick now, Display note, Position position) {
|
public void addNote(TimeTick now, Display note, Position position) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void defineState(String stateCode, String label) {
|
public void defineState(String stateCode, String label) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setState(TimeTick now, String comment, Colors color, String... states) {
|
public void setState(TimeTick now, String comment, Colors color, String... states) {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
}
|
}
|
||||||
@ -116,6 +122,7 @@ public class PlayerClock extends Player {
|
|||||||
return period;
|
return period;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public TextBlock getPart1(double fullAvailableWidth, double specialVSpace) {
|
public TextBlock getPart1(double fullAvailableWidth, double specialVSpace) {
|
||||||
if (displayTitle)
|
if (displayTitle)
|
||||||
return new AbstractTextBlock() {
|
return new AbstractTextBlock() {
|
||||||
@ -131,6 +138,7 @@ public class PlayerClock extends Player {
|
|||||||
return TextBlockUtils.empty(0, 0);
|
return TextBlockUtils.empty(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public UDrawable getPart2() {
|
public UDrawable getPart2() {
|
||||||
return new UDrawable() {
|
return new UDrawable() {
|
||||||
|
|
||||||
|
@ -115,6 +115,7 @@ public final class PlayerRobustConcise extends Player {
|
|||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public final TextBlock getPart1(final double fullAvailableWidth, final double specialVSpace) {
|
public final TextBlock getPart1(final double fullAvailableWidth, final double specialVSpace) {
|
||||||
return new AbstractTextBlock() {
|
return new AbstractTextBlock() {
|
||||||
|
|
||||||
@ -132,6 +133,7 @@ public final class PlayerRobustConcise extends Player {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public UDrawable getPart2() {
|
public UDrawable getPart2() {
|
||||||
return new UDrawable() {
|
return new UDrawable() {
|
||||||
public void drawU(UGraphic ug) {
|
public void drawU(UGraphic ug) {
|
||||||
@ -145,6 +147,7 @@ public final class PlayerRobustConcise extends Player {
|
|||||||
return UTranslate.dy(getTitleHeight(stringBounder));
|
return UTranslate.dy(getTitleHeight(stringBounder));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public final double getFullHeight(StringBounder stringBounder) {
|
public final double getFullHeight(StringBounder stringBounder) {
|
||||||
return getTitleHeight(stringBounder) + getZoneHeight(stringBounder);
|
return getTitleHeight(stringBounder) + getZoneHeight(stringBounder);
|
||||||
}
|
}
|
||||||
@ -179,6 +182,7 @@ public final class PlayerRobustConcise extends Player {
|
|||||||
return getTimeDrawing().getFullHeight(stringBounder);
|
return getTimeDrawing().getFullHeight(stringBounder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public final void setState(TimeTick now, String comment, Colors color, String... states) {
|
public final void setState(TimeTick now, String comment, Colors color, String... states) {
|
||||||
for (int i = 0; i < states.length; i++)
|
for (int i = 0; i < states.length; i++)
|
||||||
states[i] = decodeState(states[i]);
|
states[i] = decodeState(states[i]);
|
||||||
@ -200,6 +204,7 @@ public final class PlayerRobustConcise extends Player {
|
|||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public final IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
|
public final IntricatedPoint getTimeProjection(StringBounder stringBounder, TimeTick tick) {
|
||||||
if (tick == null)
|
if (tick == null)
|
||||||
return null;
|
return null;
|
||||||
@ -211,6 +216,7 @@ public final class PlayerRobustConcise extends Player {
|
|||||||
return point.translated(translation);
|
return point.translated(translation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public final void addNote(TimeTick now, Display note, Position position) {
|
public final void addNote(TimeTick now, Display note, Position position) {
|
||||||
|
|
||||||
final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram,
|
final StyleSignatureBasic signature = StyleSignatureBasic.of(SName.root, SName.element, SName.timingDiagram,
|
||||||
@ -220,6 +226,7 @@ public final class PlayerRobustConcise extends Player {
|
|||||||
this.notes.add(new TimingNote(now, this, note, position, skinParam, style));
|
this.notes.add(new TimingNote(now, this, note, position, skinParam, style));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public final void defineState(String stateCode, String label) {
|
public final void defineState(String stateCode, String label) {
|
||||||
statesLabel.put(stateCode, label);
|
statesLabel.put(stateCode, label);
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ public class Version {
|
|||||||
|
|
||||||
// Warning, "version" should be the same in gradle.properties and Version.java
|
// Warning, "version" should be the same in gradle.properties and Version.java
|
||||||
// Any idea anyone how to magically synchronize those :-) ?
|
// Any idea anyone how to magically synchronize those :-) ?
|
||||||
private static final String version = "1.2023.9";
|
private static final String version = "1.2023.10beta1";
|
||||||
|
|
||||||
public static String versionString() {
|
public static String versionString() {
|
||||||
return version;
|
return version;
|
||||||
|
Loading…
Reference in New Issue
Block a user