diff --git a/src/net/atmp/CucaDiagram.java b/src/net/atmp/CucaDiagram.java index 57d427b8c78..d8ea7a58614 100644 --- a/src/net/atmp/CucaDiagram.java +++ b/src/net/atmp/CucaDiagram.java @@ -308,7 +308,7 @@ private void eventuallyBuildPhantomGroups() { int countChildren = quark.countChildren(); if (countChildren > 0) { // final Display display = Display.getWithNewlines(quark.getQualifiedName()); - final Display display = Display.getWithNewlines(quark.getName()); + final Display display = Display.getWithNewlines(legacyReplaceBackslashNByNewline(), quark.getName()); final Entity result = this.createGroup(quark, GroupType.PACKAGE); result.setDisplay(display); } @@ -810,7 +810,7 @@ final public Entity createLeaf(Quark quark, CucaDiagram diagram, LeafTyp else if (Objects.requireNonNull(entityType) == LeafType.JSON) bodier = new BodierJSon(); else - bodier = BodyFactory.createLeaf(entityType, hideVisibilityModifier); + bodier = BodyFactory.createLeaf(getSkinParam(), entityType, hideVisibilityModifier); final Entity result = new Entity(quark, this, bodier, entityType, diagram.rawLayout); bodier.setLeaf(result); @@ -822,7 +822,7 @@ public Entity createGroup(Quark quark, GroupType groupType) { if (quark.getData() != null) return quark.getData(); - final Bodier bodier = BodyFactory.createGroup(); + final Bodier bodier = BodyFactory.createGroup(getSkinParam()); final Entity result = new Entity(quark, this, bodier, groupType, this.rawLayout); return result; diff --git a/src/net/sourceforge/plantuml/AbstractPSystem.java b/src/net/sourceforge/plantuml/AbstractPSystem.java index ce2cc32027e..699210e0250 100644 --- a/src/net/sourceforge/plantuml/AbstractPSystem.java +++ b/src/net/sourceforge/plantuml/AbstractPSystem.java @@ -264,5 +264,4 @@ public Set getRequiredPass() { public void startingPass(ParserPass pass) { } - } diff --git a/src/net/sourceforge/plantuml/TitledDiagram.java b/src/net/sourceforge/plantuml/TitledDiagram.java index 98b1a167a35..70f6cd40a00 100644 --- a/src/net/sourceforge/plantuml/TitledDiagram.java +++ b/src/net/sourceforge/plantuml/TitledDiagram.java @@ -96,7 +96,7 @@ public Pragma getPragma() { public TitledDiagram(UmlSource source, UmlDiagramType type, Map orig) { super(source); this.type = type; - this.skinParam = SkinParam.create(type); + this.skinParam = SkinParam.create(type, getPragma()); if (orig != null) this.skinParam.copyAllFrom(orig); @@ -262,5 +262,10 @@ public void exportDiagramGraphic(UGraphic ug, FileFormatOption fileFormatOption) final TextBlock textBlock = getTextMainBlock(fileFormatOption); textBlock.drawU(ug); } + + final public boolean legacyReplaceBackslashNByNewline() { + return skinParam.legacyReplaceBackslashNByNewline(); + } + } diff --git a/src/net/sourceforge/plantuml/abel/Entity.java b/src/net/sourceforge/plantuml/abel/Entity.java index 11de0c33234..b991cc59e7c 100644 --- a/src/net/sourceforge/plantuml/abel/Entity.java +++ b/src/net/sourceforge/plantuml/abel/Entity.java @@ -603,9 +603,9 @@ public TextBlock getStateHeader(ISkinParam skinParam) { Display display = null; for (CharSequence s : details) if (display == null) - display = Display.getWithNewlines(s.toString()); + display = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), s.toString()); else - display = display.addAll(Display.getWithNewlines(s.toString())); + display = display.addAll(Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), s.toString())); final HorizontalAlignment horizontalAlignment = style.getHorizontalAlignment(); return display.create(fontConfiguration, horizontalAlignment, skinParam); diff --git a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java index ee71f980a97..7de04320d1b 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java +++ b/src/net/sourceforge/plantuml/activitydiagram/ActivityDiagram.java @@ -80,7 +80,7 @@ public void endif() { public Entity getStart() { final Quark quark = quarkInContext(true, "start"); if (quark.getData() == null) - reallyCreateLeaf(quark, Display.getWithNewlines("start"), LeafType.CIRCLE_START, null); + reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), "start"), LeafType.CIRCLE_START, null); return quark.getData(); } @@ -89,7 +89,7 @@ public Entity getEnd(String suppId) { final String tmp = suppId == null ? "end" : "end$" + suppId; final Quark quark = quarkInContext(true, tmp); if (quark.getData() == null) - reallyCreateLeaf(quark, Display.getWithNewlines("end"), LeafType.CIRCLE_END, null); + reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), "end"), LeafType.CIRCLE_END, null); return quark.getData(); } @@ -142,7 +142,7 @@ public Entity createInnerActivity() { final String idShort = "##" + this.getUniqueSequence(""); final Quark quark = quarkInContext(true, idShort); - gotoGroup(quark, Display.getWithNewlines(quark.getName()), GroupType.INNER_ACTIVITY); + gotoGroup(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), quark.getName()), GroupType.INNER_ACTIVITY); final Entity g = getCurrentGroup(); lastEntityConsulted = null; @@ -161,7 +161,7 @@ public void concurrentActivity(String name) { throw new IllegalStateException("type=" + getCurrentGroup().getGroupType()); final Quark idNewLong = quarkInContext(true, idShort); - gotoGroup(idNewLong, Display.getWithNewlines("code"), GroupType.CONCURRENT_ACTIVITY); + gotoGroup(idNewLong, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), "code"), GroupType.CONCURRENT_ACTIVITY); lastEntityConsulted = null; lastEntityBrancheConsulted = null; } diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandIf.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandIf.java index 700ec6a79b9..96cd8d31c92 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandIf.java +++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandIf.java @@ -125,7 +125,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocatio final Entity branch = diagram.getCurrentContext().getBranch(); - final LinkArg linkArg = LinkArg.build(Display.getWithNewlines(arg.get("BRACKET", 0)), lenght); + final LinkArg linkArg = LinkArg.build(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("BRACKET", 0)), lenght); Link link = new Link(diagram, diagram.getSkinParam().getCurrentStyleBuilder(), entity1, branch, new LinkType(LinkDecor.ARROW, LinkDecor.NONE), linkArg.withQuantifier(null, ifLabel) .withDistanceAngle(diagram.getLabeldistance(), diagram.getLabelangle())); diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java index 25b5cd36c1a..b29a3b2322f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java +++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkActivity.java @@ -146,7 +146,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocatio if (arg.get("STEREOTYPE2", 0) != null) entity2.setStereotype(Stereotype.build(arg.get("STEREOTYPE2", 0))); - final Display linkLabel = Display.getWithNewlines(arg.get("BRACKET", 0)); + final Display linkLabel = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("BRACKET", 0)); final String arrowBody1 = CommandLinkClass.notNull(arg.get("ARROW_BODY1", 0)); final String arrowBody2 = CommandLinkClass.notNull(arg.get("ARROW_BODY2", 0)); @@ -215,7 +215,7 @@ static Entity getEntity(ActivityDiagram diagram, RegexResult arg, final boolean final LeafType type = getTypeIfExisting(diagram, ident); Entity result = ident.getData(); if (result == null) - result = diagram.reallyCreateLeaf(ident, Display.getWithNewlines(idShort), type, null); + result = diagram.reallyCreateLeaf(ident, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), idShort), type, null); if (partition != null) diagram.endGroup(); @@ -227,7 +227,7 @@ static Entity getEntity(ActivityDiagram diagram, RegexResult arg, final boolean final Quark quark = diagram.quarkInContext(true, diagram.cleanId(bar)); Entity result = quark.getData(); if (result == null) - result = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(bar), LeafType.SYNCHRO_BAR, null); + result = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), bar), LeafType.SYNCHRO_BAR, null); return result; } final RegexPartialMatch quoted = arg.get("QUOTED" + suf); @@ -235,7 +235,7 @@ static Entity getEntity(ActivityDiagram diagram, RegexResult arg, final boolean final String quotedString = quoted.get(1) == null ? quoted.get(0) : quoted.get(1); if (partition != null) { final Quark quark = diagram.quarkInContext(true, diagram.cleanId(partition)); - diagram.gotoGroup(quark, Display.getWithNewlines(partition), GroupType.PACKAGE); + diagram.gotoGroup(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), partition), GroupType.PACKAGE); } final Quark quark = diagram.quarkInContext(true, diagram.cleanId(quotedString)); @@ -243,7 +243,7 @@ static Entity getEntity(ActivityDiagram diagram, RegexResult arg, final boolean final LeafType type = getTypeIfExisting(diagram, quark); Entity result = quark.getData(); if (result == null) - result = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quoted.get(0)), type, null); + result = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quoted.get(0)), type, null); if (partition != null) diagram.endGroup(); @@ -258,7 +258,7 @@ static Entity getEntity(ActivityDiagram diagram, RegexResult arg, final boolean final Quark identInvisible = diagram.quarkInContext(true, diagram.cleanId(quoteInvisibleString)); Entity result = identInvisible.getData(); if (result == null) - result = diagram.reallyCreateLeaf(identInvisible, Display.getWithNewlines(identInvisible.getName()), + result = diagram.reallyCreateLeaf(identInvisible, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), identInvisible.getName()), LeafType.ACTIVITY, null); if (partition != null) diagram.endGroup(); diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java index 4f8b8cce4d2..8290f966caf 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java +++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandLinkLongActivity.java @@ -178,13 +178,13 @@ protected CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocL } if (partition != null) { final Quark idNewLong = diagram.quarkInContext(true, diagram.cleanId(partition)); - diagram.gotoGroup(idNewLong, Display.getWithNewlines(partition), GroupType.PACKAGE); + diagram.gotoGroup(idNewLong, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), partition), GroupType.PACKAGE); } final Quark ident = diagram.quarkInContext(true, diagram.cleanId(idShort)); Entity entity2 = ident.getData(); if (entity2 == null) - entity2 = diagram.reallyCreateLeaf(ident, Display.getWithNewlines(displayString), LeafType.ACTIVITY, null); + entity2 = diagram.reallyCreateLeaf(ident, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayString), LeafType.ACTIVITY, null); diagram.setLastEntityConsulted(entity2); @@ -210,7 +210,7 @@ protected CommandExecutionResult executeNow(final ActivityDiagram diagram, BlocL final int lenght = arrow.length() - 1; - final Display linkLabel = Display.getWithNewlines(line0.get("BRACKET", 0)); + final Display linkLabel = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), line0.get("BRACKET", 0)); LinkType type = new LinkType(LinkDecor.ARROW, LinkDecor.NONE); if (arrow.contains(".")) diff --git a/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java b/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java index 0c6f966b7be..77c0d97601c 100644 --- a/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java +++ b/src/net/sourceforge/plantuml/activitydiagram/command/CommandPartition.java @@ -85,7 +85,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram diagram, LineLocatio throws NoSuchColorException { final Quark quark = diagram.quarkInContext(true, diagram.cleanId(arg.get("NAME", 0))); - diagram.gotoGroup(quark, Display.getWithNewlines(quark.getName()), GroupType.PACKAGE); + diagram.gotoGroup(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()), GroupType.PACKAGE); final Entity p = diagram.getCurrentGroup(); final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivity3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivity3.java index 27345bec7b0..d83124144d4 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivity3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivity3.java @@ -143,7 +143,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati if (style == BoxStyle.PLAIN) style = BoxStyle.fromString(arg.get("STYLE", 0)); - final Display display = Display.getWithNewlines2(arg.get("LABEL", 0)); + final Display display = Display.getWithNewlines2(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); return diagram.addActivity(display, style, url, colors, stereotype); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLegacy1.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLegacy1.java index d1b386a69a2..d9d0a4d8aa4 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLegacy1.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandActivityLegacy1.java @@ -63,7 +63,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { - return diagram.addActivity(Display.getWithNewlines(arg.get("LABEL", 0)), BoxStyle.PLAIN, null, Colors.empty(), + return diagram.addActivity(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)), BoxStyle.PLAIN, null, Colors.empty(), null); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java index d9eb2816d06..7265960bfe6 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandArrow3.java @@ -80,7 +80,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati } final String label = arg.get("LABEL", 0); if (label != null && label.length() > 0) - diagram.setLabelNextArrow(Display.getWithNewlines(label)); + diagram.setLabelNextArrow(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), label)); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandBackward3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandBackward3.java index 6ba34ecd56e..5dbc6b26490 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandBackward3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandBackward3.java @@ -104,7 +104,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati if (stereo != null) stereotype = Stereotype.build(stereo); - final Display label = Display.getWithNewlines(arg.get("LABEL", 0)); + final Display label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); final LinkRendering in = getBackRendering(diagram, arg, "INCOMING"); final LinkRendering out = getBackRendering(diagram, arg, "OUTCOMING"); @@ -121,7 +121,7 @@ static public LinkRendering getBackRendering(ActivityDiagram3 diagram, RegexResu else in = LinkRendering.create(incomingColor); final String label = arg.get(name, 0); - return in.withDisplay(Display.getWithNewlines(label)); + return in.withDisplay(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), label)); } static private Rainbow getRainbow(String key, ActivityDiagram3 diagram, RegexResult arg) diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCase.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCase.java index b39e4c19aa8..b191e73fccb 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCase.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandCase.java @@ -70,7 +70,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati test = null; } - return diagram.switchCase(Display.getWithNewlines(test)); + return diagram.switchCase(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), test)); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java index 7cc24fd82b7..d9528071d85 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf2.java @@ -110,7 +110,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati final LinkRendering incoming = CommandBackward3.getBackRendering(diagram, arg, "INCOMING"); final LinkRendering when = CommandBackward3.getBackRendering(diagram, arg, "WHEN"); - return diagram.elseIf(incoming, Display.getWithNewlines(test), when, color); + return diagram.elseIf(incoming, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), test), when, color); } } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf3.java index ab4733d1026..cfa45552d0f 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseIf3.java @@ -115,7 +115,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati final LinkRendering incoming = CommandBackward3.getBackRendering(diagram, arg, "INCOMING"); final LinkRendering when = CommandBackward3.getBackRendering(diagram, arg, "WHEN"); - return diagram.elseIf(incoming, Display.getWithNewlines(test), when, color); + return diagram.elseIf(incoming, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), test), when, color); } } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseLegacy1.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseLegacy1.java index dd4cafd43ea..5da889907c0 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseLegacy1.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandElseLegacy1.java @@ -70,7 +70,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati // if (getSystem().getLastEntityConsulted() == null) { // return CommandExecutionResult.error("No if for this endif"); // } - final Display when = Display.getWithNewlines(arg.get("WHEN", 0)); + final Display when = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("WHEN", 0)); return diagram.else2(LinkRendering.none().withDisplay(when)); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java index 656bf7759e1..cfe7ae2419b 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf2.java @@ -100,7 +100,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati } final Stereotype stereotype = Stereotype.build(arg.get("STEREO", 0)); - diagram.startIf(Display.getWithNewlines(test), Display.getWithNewlines(arg.get("WHEN", 0)), color, url, stereotype); + diagram.startIf(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), test), Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("WHEN", 0)), color, url, stereotype); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java index d0903dd5471..56e07291054 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIf4.java @@ -86,7 +86,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati if (test.length() == 0) test = null; - diagram.startIf(Display.getWithNewlines(test), Display.getWithNewlines(arg.get("WHEN", 0)), color, null, null); + diagram.startIf(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), test), Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("WHEN", 0)), color, null, null); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIfLegacy1.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIfLegacy1.java index ee1064b9032..aef11d356c9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIfLegacy1.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandIfLegacy1.java @@ -72,7 +72,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { - diagram.startIf(Display.getWithNewlines(arg.get("TEST", 0)), Display.getWithNewlines(arg.get("WHEN", 0)), null, + diagram.startIf(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("TEST", 0)), Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("WHEN", 0)), null, null, null); return CommandExecutionResult.ok(); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNolink.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNolink.java index a72828610c1..3f9379891a5 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNolink.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNolink.java @@ -62,7 +62,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { // diagram.setColorNextArrow(color); - diagram.setLabelNextArrow(Display.getWithNewlines("NOLINK")); + diagram.setLabelNextArrow(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), "NOLINK")); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNote3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNote3.java index 8af5eb28219..20d0b2ee184 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNote3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandNote3.java @@ -85,7 +85,7 @@ static IRegex getRegexConcat() { protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg, ParserPass currentPass) throws NoSuchColorException { final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); - final Display note = Display.getWithNewlines(arg.get("NOTE", 0)); + final Display note = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("NOTE", 0)); final NotePosition position = NotePosition.defaultLeft(arg.get("POSITION", 0)); final NoteType type = NoteType.defaultType(arg.get("TYPE", 0)); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java index eb7d067857e..784736ffbb4 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandPartition3.java @@ -132,7 +132,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati // final HColor titleColor = HColors.BLUE;// stylePartition.value(PName.FontColor).asColor(diagram.getSkinParam().getIHtmlColorSet()); // final double roundCorner = stylePartition.value(PName.RoundCorner).asDouble(); - diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, symbol, stylePartition); + diagram.startGroup(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), partitionTitle), backColor, symbol, stylePartition); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java index 2fbb891564f..e081cfd6e93 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeat3.java @@ -83,7 +83,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati throws NoSuchColorException { final String s = arg.get("COLOR", 0); final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); - final Display label = Display.getWithNewlines(arg.get("LABEL", 0)); + final Display label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); final BoxStyle boxStyle; final String styleString = arg.get("STYLE", 0); diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3.java index 8d8367a392d..f7b04c3581e 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3.java @@ -104,9 +104,9 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg, ParserPass currentPass) throws NoSuchColorException { - final Display test = Display.getWithNewlines(arg.getLazzy("TEST", 0)); - final Display yes = Display.getWithNewlines(arg.getLazzy("WHEN", 0)); - final Display out = Display.getWithNewlines(arg.getLazzy("OUT", 0)); + final Display test = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.getLazzy("TEST", 0)); + final Display yes = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.getLazzy("WHEN", 0)); + final Display out = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.getLazzy("OUT", 0)); final String colorString = arg.get("COLOR", 0); final Rainbow rainbow; @@ -117,7 +117,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati diagram.getSkinParam().colorArrowSeparationSpace()); } - final Display linkLabel = Display.getWithNewlines(arg.get("LABEL", 0)); + final Display linkLabel = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); return diagram.repeatWhile(test, yes, out, linkLabel, rainbow); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java index caeb8a6fc97..f5128362a93 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandRepeatWhile3Multilines.java @@ -93,7 +93,7 @@ protected CommandExecutionResult executeNow(ActivityDiagram3 diagram, BlocLines // 0)); final String test = line0.get("TEST1", 0); - Display testDisplay = Display.getWithNewlines(test); + Display testDisplay = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), test); for (StringLocated s : lines.subExtract(1, 1)) { testDisplay = testDisplay.add(s.getString()); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java index 2f38795fd4e..c300888144d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane.java @@ -71,7 +71,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati final String s = arg.get("COLOR", 0); final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final String name = arg.get("SWIMLANE", 0); - final Display label = Display.getWithNewlines(arg.get("LABEL", 0)); + final Display label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); return diagram.swimlane(name, color, label); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java index f446b8cbf41..86c511b7d33 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwimlane2.java @@ -79,7 +79,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati final String s = arg.get("COLOR", 0); final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); final String name = arg.get("SWIMLANE", 0); - final Display label = Display.getWithNewlines(arg.get("LABEL", 0)); + final Display label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); return diagram.swimlane(name, color, label); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java index 9686e7c3b49..21dcd7e5d39 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandSwitch.java @@ -77,7 +77,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati if (test.length() == 0) test = null; - diagram.startSwitch(Display.getWithNewlines(test), color); + diagram.startSwitch(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), test), color); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java index cdcaf12a816..013b28b2be9 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhile3.java @@ -78,7 +78,7 @@ protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocati throws NoSuchColorException { final String s = arg.get("COLOR", 0); final HColor color = s == null ? null : diagram.getSkinParam().getIHtmlColorSet().getColor(s); - diagram.doWhile(Display.getWithNewlines(arg.get("TEST", 0)), Display.getWithNewlines(arg.get("YES", 0)), color); + diagram.doWhile(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("TEST", 0)), Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("YES", 0)), color); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhileEnd3.java b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhileEnd3.java index 59e5c2a2fec..8ce9fafdc0d 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhileEnd3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/command/CommandWhileEnd3.java @@ -76,7 +76,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { - return diagram.endwhile(Display.getWithNewlines(arg.get("OUT", 0))); + return diagram.endwhile(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("OUT", 0))); } } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java index 25075065517..823142785c3 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/Swimlane.java @@ -56,7 +56,7 @@ public class Swimlane implements SpecificBackcolorable, Comparable { public Swimlane(String name, int order) { this.name = name; - this.display = Display.getWithNewlines(name); + this.display = Display.getWithNewlines(false, name); this.order = order; } diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java index 90ce41f4484..351de86f04a 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ftile/vcompact/ParallelBuilderFork.java @@ -114,7 +114,7 @@ protected Ftile doStep2(Ftile middle, Ftile result) { ((FtileBlackBlock) out).setBlackBlockDimension(result.calculateDimension(getStringBounder()).getWidth(), barHeight); if (label != null) - ((FtileBlackBlock) out).setLabel(getTextBlock(Display.getWithNewlines(label))); + ((FtileBlackBlock) out).setLabel(getTextBlock(Display.getWithNewlines(skinParam().legacyReplaceBackslashNByNewline(), label))); result = new FtileAssemblySimple(result, out); final List conns = new ArrayList<>(); diff --git a/src/net/sourceforge/plantuml/bpm/BpmDiagram.java b/src/net/sourceforge/plantuml/bpm/BpmDiagram.java index c568879e450..3b93f831de0 100644 --- a/src/net/sourceforge/plantuml/bpm/BpmDiagram.java +++ b/src/net/sourceforge/plantuml/bpm/BpmDiagram.java @@ -95,7 +95,7 @@ protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormat private UDrawable getUDrawable() { final Grid grid = createGrid(); cleanGrid(grid); - final GridArray gridArray = grid.toArray(SkinParam.create(getUmlDiagramType())); + final GridArray gridArray = grid.toArray(SkinParam.create(getUmlDiagramType(), getPragma())); // gridArray.addEdges(edges); // System.err.println("gridArray=" + gridArray); return gridArray; diff --git a/src/net/sourceforge/plantuml/bpm/BpmElement.java b/src/net/sourceforge/plantuml/bpm/BpmElement.java index 1e713879d7c..aaace643f25 100644 --- a/src/net/sourceforge/plantuml/bpm/BpmElement.java +++ b/src/net/sourceforge/plantuml/bpm/BpmElement.java @@ -70,7 +70,7 @@ public class BpmElement extends AbstractConnectorPuzzle implements ConnectorPuzz public BpmElement(String id, BpmElementType type, String label) { this.id = id; this.type = type; - this.display = Display.getWithNewlines(label); + this.display = Display.getWithNewlines(false, label); } public BpmElement(String id, BpmElementType type) { @@ -162,7 +162,7 @@ public TextBlock toTextBlockInternal(ISkinParam skinParam) { final UFont font = UFont.serif(14); final FontConfiguration fc = FontConfiguration.create(font, HColors.RED, HColors.RED, null); if (Display.isNull(display)) { - return Display.getWithNewlines(type.toString()).create(fc, HorizontalAlignment.LEFT, skinParam); + return Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), type.toString()).create(fc, HorizontalAlignment.LEFT, skinParam); } return display.create(fc, HorizontalAlignment.LEFT, skinParam); } diff --git a/src/net/sourceforge/plantuml/cheneer/command/CommandAssociate.java b/src/net/sourceforge/plantuml/cheneer/command/CommandAssociate.java index 0b28c746aa6..d9ba7999b12 100644 --- a/src/net/sourceforge/plantuml/cheneer/command/CommandAssociate.java +++ b/src/net/sourceforge/plantuml/cheneer/command/CommandAssociate.java @@ -106,7 +106,7 @@ protected CommandExecutionResult executeArg(ChenEerDiagram diagram, LineLocation linkType = linkType.goBold(); } final Link link = new Link(diagram, diagram.getCurrentStyleBuilder(), entity1, entity2, linkType, - LinkArg.build(Display.getWithNewlines(cardinality), 3)); + LinkArg.build(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), cardinality), 3)); link.setPortMembers(diagram.getPortId(entity1.getName()), diagram.getPortId(entity2.getName())); link.setColors(color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet())); diagram.addLink(link); diff --git a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java index 42b11c4a75e..d2ec4535f61 100644 --- a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java +++ b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateAttribute.java @@ -112,7 +112,7 @@ protected CommandExecutionResult executeArg(ChenEerDiagram diagram, LineLocation Entity entity = quark.getData(); if (entity == null) { - final Display display = Display.getWithNewlines(displayText); + final Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayText); entity = diagram.reallyCreateLeaf(quark, display, type, null); } else { return CommandExecutionResult.error("Attribute already exists"); diff --git a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java index e59f2b80385..8ed1dee8001 100644 --- a/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java +++ b/src/net/sourceforge/plantuml/cheneer/command/CommandCreateEntity.java @@ -112,7 +112,7 @@ protected CommandExecutionResult executeArg(ChenEerDiagram diagram, LineLocation Entity entity = quark.getData(); if (entity == null) { - Display display = Display.getWithNewlines(displayText); + Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayText); entity = diagram.reallyCreateLeaf(quark, display, type, null); } else { if (entity.muteToType(type, null) == false) diff --git a/src/net/sourceforge/plantuml/chronology/TimeHeaderChronology.java b/src/net/sourceforge/plantuml/chronology/TimeHeaderChronology.java index fca77fb2765..97eb3eda0d5 100644 --- a/src/net/sourceforge/plantuml/chronology/TimeHeaderChronology.java +++ b/src/net/sourceforge/plantuml/chronology/TimeHeaderChronology.java @@ -99,7 +99,7 @@ private void drawSimpleDayCounter(UGraphic ug, TimeScale timeScale) { for (Day i = getMin(); i.compareTo(getMax().increment()) < 0; i = i.increment(printScale)) { final UFont font = thParam.getStyle(SName.timeline, SName.day).getUFont(); final FontConfiguration fontConfiguration = getFontConfiguration(font, false, openFontColor()); - final TextBlock num = Display.getWithNewlines(i.toStringShort(thParam.getLocale())) + final TextBlock num = Display.getWithNewlines(false, i.toStringShort(thParam.getLocale())) .create(fontConfiguration, HorizontalAlignment.LEFT, new SpriteContainerEmpty()); final double x1 = timeScale.getStartingPosition(i); final double x2; diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java index eeb836ef986..57d484512b9 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClass.java @@ -126,9 +126,9 @@ protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation l Entity entity = quark.getData(); if (entity == null) { - Display display = Display.getWithNewlines(displayString); + Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayString); if (Display.isNull(display)) - display = Display.getWithNewlines(quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); + display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); entity = diagram.reallyCreateLeaf(quark, display, type, null); } else { if (entity.muteToType(type, null) == false) diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java index 0cc0c7c250e..09fcbea627d 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateClassMultilines.java @@ -164,10 +164,10 @@ protected CommandExecutionResult executeNow(ClassDiagram diagram, BlocLines line Entity entity = quark.getData(); - Display display = Display.getWithNewlines(displayString); + Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayString); if (entity == null) { if (Display.isNull(display)) - display = Display.getWithNewlines(quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); + display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); entity = diagram.reallyCreateLeaf(quark, display, type, null); } else { if (entity.muteToType(type, null) == false) @@ -274,7 +274,7 @@ public static void manageExtends(String keyword, ClassDiagram diagram, RegexResu final Quark quark = diagram.quarkInContext(false, diagram.cleanId(idShort)); Entity cl2 = quark.getData(); if (cl2 == null) - cl2 = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark.getName()), type2, null); + cl2 = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()), type2, null); LinkType typeLink = new LinkType(LinkDecor.NONE, LinkDecor.EXTENDS); if (type2 == LeafType.INTERFACE && entity.getLeafType() != LeafType.INTERFACE) @@ -308,9 +308,9 @@ private Entity executeArg0(ClassDiagram diagram, RegexResult line0) throws NoSuc final Quark quark = diagram.quarkInContext(false, idShort); - Display display = Display.getWithNewlines(displayString); + Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayString); if (Display.isNull(display)) - display = Display.getWithNewlines(quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); + display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); Entity entity = quark.getData(); diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java index d25ee09685d..21ab57f7433 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandCreateElementFull2.java @@ -192,7 +192,7 @@ protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation l } final String idShort = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw); - final Display display = Display.getWithNewlines(displayRaw == null ? idShort : displayRaw); + final Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayRaw == null ? idShort : displayRaw); final Quark quark = diagram.quarkInContext(true, idShort); Entity entity = quark.getData(); if (entity == null) diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java index a9974cd691b..b0ee654f23b 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandDiamondAssociation.java @@ -71,7 +71,7 @@ protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation l if (quark.getData() != null) return CommandExecutionResult.error("Already existing : " + quark.getName()); - diagram.reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.ASSOCIATION, null); + diagram.reallyCreateLeaf(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), ""), LeafType.ASSOCIATION, null); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java index 87e59cb7d34..aaa35375f08 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkClass.java @@ -208,10 +208,10 @@ protected CommandExecutionResult executeArg(AbstractClassOrObjectDiagram diagram Entity cl1 = quark1.get().getData(); if (cl1 == null) - cl1 = diagram.reallyCreateLeaf(quark1.get(), Display.getWithNewlines(quark1.get().getName()), LeafType.CLASS, null); + cl1 = diagram.reallyCreateLeaf(quark1.get(), Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark1.get().getName()), LeafType.CLASS, null); Entity cl2 = quark2.get().getData(); if (cl2 == null) - cl2 = diagram.reallyCreateLeaf(quark2.get(), Display.getWithNewlines(quark2.get().getName()), LeafType.CLASS, null); + cl2 = diagram.reallyCreateLeaf(quark2.get(), Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark2.get().getName()), LeafType.CLASS, null); final Direction dir = getDirection(arg); final int queue; @@ -226,7 +226,7 @@ protected CommandExecutionResult executeArg(AbstractClassOrObjectDiagram diagram final String kal2 = arg.get("QUALIFIER2", 0); final LinkArg linkArg = LinkArg - .build(labels.getDisplay(), queue, diagram.getSkinParam().classAttributeIconSize() > 0) + .build(labels.getDisplay(diagram.legacyReplaceBackslashNByNewline()), queue, diagram.getSkinParam().classAttributeIconSize() > 0) .withQuantifier(labels.getFirstLabel(), labels.getSecondLabel()) .withDistanceAngle(diagram.getLabeldistance(), diagram.getLabelangle()).withKal(kal1, kal2); @@ -296,7 +296,7 @@ private CommandExecutionResult executePackageLink(AbstractClassOrObjectDiagram d else queue = getQueueLength(arg); - final Display labelLink = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); + final Display labelLink = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL_LINK", 0)); final String firstLabel = arg.get("FIRST_LABEL", 0); final String secondLabel = arg.get("SECOND_LABEL", 0); final LinkArg linkArg = LinkArg.build(labelLink, queue, diagram.getSkinParam().classAttributeIconSize() > 0); @@ -334,10 +334,10 @@ private CommandExecutionResult executeArgSpecial1(AbstractClassOrObjectDiagram d Entity cl2 = ent2.getData(); if (cl2 == null) - cl2 = diagram.reallyCreateLeaf(ent2, Display.getWithNewlines(ent2.getName()), LeafType.CLASS, null); + cl2 = diagram.reallyCreateLeaf(ent2, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), ent2.getName()), LeafType.CLASS, null); final LinkType linkType = getLinkType(arg); - final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); + final Display label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL_LINK", 0)); final boolean result = diagram.associationClass(1, cl1A, cl1B, cl2, linkType, label); if (result == false) @@ -367,10 +367,10 @@ private CommandExecutionResult executeArgSpecial2(AbstractClassOrObjectDiagram d Entity cl1 = (Entity) ent1.getData(); if (cl1 == null) - cl1 = diagram.reallyCreateLeaf(ent1, Display.getWithNewlines(ent1.getName()), LeafType.CLASS, null); + cl1 = diagram.reallyCreateLeaf(ent1, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), ent1.getName()), LeafType.CLASS, null); final LinkType linkType = getLinkType(arg); - final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); + final Display label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL_LINK", 0)); final boolean result = diagram.associationClass(2, cl2A, cl2B, cl1, linkType, label); if (result == false) @@ -406,7 +406,7 @@ private CommandExecutionResult executeArgSpecial3(AbstractClassOrObjectDiagram d final Entity cl2B = (Entity) quark2B.getData(); final LinkType linkType = getLinkType(arg); - final Display label = Display.getWithNewlines(arg.get("LABEL_LINK", 0)); + final Display label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL_LINK", 0)); return diagram.associationClass(cl1A, cl1B, cl2A, cl2B, linkType, label); } diff --git a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java index c9573ef89ea..ed1f1d2fab0 100644 --- a/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java +++ b/src/net/sourceforge/plantuml/classdiagram/command/CommandLinkLollipop.java @@ -133,7 +133,7 @@ protected CommandExecutionResult executeArg(AbstractClassOrObjectDiagram diagram final Quark idNewLong = diagram.quarkInContext(true, diagram.cleanId(ent1) + suffix); final LeafType type = getType(arg.get("ENT_THEN_LOL", 1)); - cl2 = diagram.reallyCreateLeaf(idNewLong, Display.getWithNewlines(ent2), type, null); + cl2 = diagram.reallyCreateLeaf(idNewLong, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), ent2), type, null); normalEntity = cl1; // assert arg.get("ENT_THEN_LOL", 0) != null; @@ -152,7 +152,7 @@ protected CommandExecutionResult executeArg(AbstractClassOrObjectDiagram diagram final Quark idNewLong = diagram.quarkInContext(true, diagram.cleanId(ent2) + suffix); final LeafType type = getType(arg.get("LOL_THEN_ENT", 0)); - cl1 = diagram.reallyCreateLeaf(idNewLong, Display.getWithNewlines(ent1), type, null); + cl1 = diagram.reallyCreateLeaf(idNewLong, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), ent1), type, null); normalEntity = cl2; } @@ -200,7 +200,7 @@ protected CommandExecutionResult executeArg(AbstractClassOrObjectDiagram diagram } labelLink = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(labelLink); } - final LinkArg linkArg = LinkArg.build(Display.getWithNewlines(labelLink), length, + final LinkArg linkArg = LinkArg.build(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), labelLink), length, diagram.getSkinParam().classAttributeIconSize() > 0); final Link link = new Link(diagram, diagram.getSkinParam().getCurrentStyleBuilder(), cl1, cl2, linkType, linkArg.withQuantifier(firstLabel, secondLabel) diff --git a/src/net/sourceforge/plantuml/command/CommandCaption.java b/src/net/sourceforge/plantuml/command/CommandCaption.java index c66a95cecf2..86519d23041 100644 --- a/src/net/sourceforge/plantuml/command/CommandCaption.java +++ b/src/net/sourceforge/plantuml/command/CommandCaption.java @@ -68,7 +68,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { - final Display s = Display.getWithNewlines(arg.getLazzy("DISPLAY", 0)); + final Display s = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.getLazzy("DISPLAY", 0)); diagram.setCaption(DisplayPositioned.single(s, HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM)); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/command/CommandFooter.java b/src/net/sourceforge/plantuml/command/CommandFooter.java index fee8d7b666e..5033bc063b2 100644 --- a/src/net/sourceforge/plantuml/command/CommandFooter.java +++ b/src/net/sourceforge/plantuml/command/CommandFooter.java @@ -78,7 +78,7 @@ protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation ha = FontParam.FOOTER.getStyleDefinition(null).getMergedStyle(diagram.getCurrentStyleBuilder()) .getHorizontalAlignment(); - final Display s = Display.getWithNewlines(arg.getLazzy("LABEL", 0)); + final Display s = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.getLazzy("LABEL", 0)); diagram.getFooter().putDisplay(s, ha); return CommandExecutionResult.ok(); diff --git a/src/net/sourceforge/plantuml/command/CommandHeader.java b/src/net/sourceforge/plantuml/command/CommandHeader.java index f7769e26fd1..ea9c4efc369 100644 --- a/src/net/sourceforge/plantuml/command/CommandHeader.java +++ b/src/net/sourceforge/plantuml/command/CommandHeader.java @@ -80,7 +80,7 @@ protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation ha = FontParam.HEADER.getStyleDefinition(null).getMergedStyle(diagram.getCurrentStyleBuilder()) .getHorizontalAlignment(); - final Display s = Display.getWithNewlines(arg.getLazzy("LABEL", 0)); + final Display s = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.getLazzy("LABEL", 0)); diagram.getHeader().putDisplay(s, ha); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/command/CommandLegend.java b/src/net/sourceforge/plantuml/command/CommandLegend.java index c3b37d2aac3..e7f10052eac 100644 --- a/src/net/sourceforge/plantuml/command/CommandLegend.java +++ b/src/net/sourceforge/plantuml/command/CommandLegend.java @@ -68,7 +68,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { - final Display s = Display.getWithNewlines(arg.getLazzy("LEGEND", 0)); + final Display s = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.getLazzy("LEGEND", 0)); diagram.setLegend(DisplayPositioned.single(s, HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM)); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/command/CommandMainframe.java b/src/net/sourceforge/plantuml/command/CommandMainframe.java index 2e52134c81c..2e6cb2489d7 100644 --- a/src/net/sourceforge/plantuml/command/CommandMainframe.java +++ b/src/net/sourceforge/plantuml/command/CommandMainframe.java @@ -63,7 +63,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { - final Display label = Display.getWithNewlines(arg.get("LABEL", 0)); + final Display label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); diagram.setMainFrame(label); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/command/CommandNamespace.java b/src/net/sourceforge/plantuml/command/CommandNamespace.java index 1ad8088f1bf..d432306bfeb 100644 --- a/src/net/sourceforge/plantuml/command/CommandNamespace.java +++ b/src/net/sourceforge/plantuml/command/CommandNamespace.java @@ -87,7 +87,7 @@ protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation l final USymbol usymbol = USymbols.fromString(stereotype, diagram.getSkinParam().actorStyle(), diagram.getSkinParam().componentStyle(), diagram.getSkinParam().packageStyle()); - final CommandExecutionResult status = diagram.gotoGroup(quark, Display.getWithNewlines(quark.getName()), + final CommandExecutionResult status = diagram.gotoGroup(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()), GroupType.PACKAGE, usymbol); if (status.isOk() == false) return status; diff --git a/src/net/sourceforge/plantuml/command/CommandNamespace2.java b/src/net/sourceforge/plantuml/command/CommandNamespace2.java index 64955d00924..be8326d496d 100644 --- a/src/net/sourceforge/plantuml/command/CommandNamespace2.java +++ b/src/net/sourceforge/plantuml/command/CommandNamespace2.java @@ -88,7 +88,7 @@ protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation l final Quark quark = diagram.quarkInContext(false, diagram.cleanId(idShort)); final String disp = arg.getLazzy("DISPLAY", 0); - final Display display = Display.getWithNewlines(disp); + final Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), disp); final CommandExecutionResult status = diagram.gotoGroup(quark, display, GroupType.PACKAGE); if (status.isOk() == false) return status; diff --git a/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java b/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java index 0a29032aef3..d20c4989512 100644 --- a/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java +++ b/src/net/sourceforge/plantuml/command/CommandNamespaceEmpty.java @@ -85,7 +85,7 @@ protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation l if (quark.getData() != null) return CommandExecutionResult.error("Already exists " + quark.getName()); - final Display display = Display.getWithNewlines(quark.getQualifiedName()); + final Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getQualifiedName()); final CommandExecutionResult status = diagram.gotoGroup(quark, display, GroupType.PACKAGE); if (status.isOk() == false) return status; diff --git a/src/net/sourceforge/plantuml/command/CommandPackage.java b/src/net/sourceforge/plantuml/command/CommandPackage.java index 6639ea84abd..9ba8a526cfc 100644 --- a/src/net/sourceforge/plantuml/command/CommandPackage.java +++ b/src/net/sourceforge/plantuml/command/CommandPackage.java @@ -134,7 +134,7 @@ protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, LineL final USymbol usymbol = USymbols.fromString(stereotype, diagram.getSkinParam().actorStyle(), diagram.getSkinParam().componentStyle(), diagram.getSkinParam().packageStyle()); - final CommandExecutionResult status = diagram.gotoGroup(quark, Display.getWithNewlines(display), + final CommandExecutionResult status = diagram.gotoGroup(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display), GroupType.PACKAGE, usymbol); if (status.isOk() == false) return status; diff --git a/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java b/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java index d049da7444e..ee74808daea 100644 --- a/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java +++ b/src/net/sourceforge/plantuml/command/CommandPackageEmpty.java @@ -95,7 +95,7 @@ protected CommandExecutionResult executeArg(AbstractEntityDiagram diagram, LineL idShort = arg.get("CODE", 0); } final Quark quark = diagram.quarkInContext(false, diagram.cleanId(idShort)); - final CommandExecutionResult status = diagram.gotoGroup(quark, Display.getWithNewlines(display), + final CommandExecutionResult status = diagram.gotoGroup(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display), GroupType.PACKAGE); if (status.isOk() == false) return status; diff --git a/src/net/sourceforge/plantuml/command/CommandTitle.java b/src/net/sourceforge/plantuml/command/CommandTitle.java index 326569900d3..5b52f207a8d 100644 --- a/src/net/sourceforge/plantuml/command/CommandTitle.java +++ b/src/net/sourceforge/plantuml/command/CommandTitle.java @@ -68,7 +68,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(TitledDiagram diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { - final Display s = Display.getWithNewlines(arg.getLazzy("TITLE", 0)); + final Display s = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.getLazzy("TITLE", 0)); diagram.setTitle(DisplayPositioned.single(s, HorizontalAlignment.CENTER, VerticalAlignment.TOP)); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteActivity.java b/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteActivity.java index 269f51a8213..2633aad67d2 100644 --- a/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteActivity.java +++ b/src/net/sourceforge/plantuml/command/note/CommandFactoryNoteActivity.java @@ -139,7 +139,7 @@ protected CommandExecutionResult executeArg(final ActivityDiagram diagram, LineL final String tmp = diagram.getUniqueSequence("GN"); final Quark quark = diagram.quarkInContext(true, diagram.cleanId(tmp)); - final Entity note = diagram.createNote(quark, tmp, Display.getWithNewlines(arg.get("NOTE", 0))); + final Entity note = diagram.createNote(quark, tmp, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("NOTE", 0))); return executeInternal(diagram, arg, note); } }; diff --git a/src/net/sourceforge/plantuml/command/note/CommandFactoryTipOnEntity.java b/src/net/sourceforge/plantuml/command/note/CommandFactoryTipOnEntity.java index d03501cb96a..7424577bf90 100644 --- a/src/net/sourceforge/plantuml/command/note/CommandFactoryTipOnEntity.java +++ b/src/net/sourceforge/plantuml/command/note/CommandFactoryTipOnEntity.java @@ -177,7 +177,7 @@ private CommandExecutionResult executeInternal(RegexResult line0, AbstractEntity Entity tips = identTip.getData(); if (tips == null) { - tips = diagram.reallyCreateLeaf(identTip, Display.getWithNewlines(""), LeafType.TIPS, null); + tips = diagram.reallyCreateLeaf(identTip, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), ""), LeafType.TIPS, null); final LinkType type = new LinkType(LinkDecor.NONE, LinkDecor.NONE).getInvisible(); final Link link; if (position == Position.RIGHT) diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java index 06de6128c8c..9ef0d9cea9e 100644 --- a/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java +++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandCreatePackageBlock.java @@ -80,7 +80,7 @@ protected CommandExecutionResult executeArg(CompositeDiagram diagram, LineLocati if (display == null) display = quark.getName(); - return diagram.gotoGroup(quark, Display.getWithNewlines(display), GroupType.PACKAGE); + return diagram.gotoGroup(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display), GroupType.PACKAGE); } } diff --git a/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java b/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java index 2fccaa10b8a..d44a9505696 100644 --- a/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java +++ b/src/net/sourceforge/plantuml/compositediagram/command/CommandLinkBlock.java @@ -102,7 +102,7 @@ protected CommandExecutionResult executeArg(CompositeDiagram diagram, LineLocati final String queue = arg.get("QUEUE", 0); - final LinkArg linkArg = LinkArg.build(Display.getWithNewlines(arg.get("DISPLAY", 0)), queue.length(), + final LinkArg linkArg = LinkArg.build(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("DISPLAY", 0)), queue.length(), diagram.getSkinParam().classAttributeIconSize() > 0); final Link link = new Link(diagram, diagram.getSkinParam().getCurrentStyleBuilder(), cl1, cl2, linkType, linkArg); diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodierSimple.java b/src/net/sourceforge/plantuml/cucadiagram/BodierSimple.java index 6886a5e2c0f..15006c43026 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodierSimple.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodierSimple.java @@ -46,6 +46,7 @@ import net.sourceforge.plantuml.klimt.font.FontConfiguration; import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment; import net.sourceforge.plantuml.klimt.shape.TextBlock; +import net.sourceforge.plantuml.skin.SkinParam; import net.sourceforge.plantuml.stereo.Stereotype; import net.sourceforge.plantuml.style.ISkinParam; import net.sourceforge.plantuml.style.Style; @@ -53,6 +54,7 @@ public class BodierSimple implements Bodier { private final List rawBody = new ArrayList<>(); + private final ISkinParam skinParam; private Entity leaf; @Override @@ -60,7 +62,8 @@ public void muteClassToObject() { throw new UnsupportedOperationException(); } - BodierSimple() { + BodierSimple(ISkinParam skinParam) { + this.skinParam = skinParam; } @Override @@ -70,7 +73,8 @@ public void setLeaf(Entity leaf) { @Override public boolean addFieldOrMethod(String s) throws NoSuchColorException { - final Display display = Display.getWithNewlines2(s); + final Display display = Display + .getWithNewlines2(skinParam.legacyReplaceBackslashNByNewline(), s); rawBody.addAll(display.asList()); return true; } diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java index 26bc468d615..4b40dac6b29 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyEnhancedAbstract.java @@ -93,7 +93,7 @@ final protected TextBlock getTitle(String s, ISkinSimple spriteContainer) { return null; s = StringUtils.trin(s.substring(2, s.length() - 2)); - return Display.getWithNewlines(s).create(titleConfig, HorizontalAlignment.LEFT, spriteContainer); + return Display.getWithNewlines(spriteContainer.legacyReplaceBackslashNByNewline(), s).create(titleConfig, HorizontalAlignment.LEFT, spriteContainer); } abstract protected TextBlock getArea(StringBounder stringBounder); diff --git a/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java b/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java index 38ca04d5a8f..aea37c3c44c 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java +++ b/src/net/sourceforge/plantuml/cucadiagram/BodyFactory.java @@ -55,15 +55,15 @@ public class BodyFactory { public final static boolean BODY3 = false; - public static Bodier createLeaf(LeafType type, Set hideVisibilityModifier) { + public static Bodier createLeaf(ISkinParam skinParam, LeafType type, Set hideVisibilityModifier) { if (type.isLikeClass() || type == LeafType.OBJECT) return new BodierLikeClassOrObject(type, hideVisibilityModifier); - return new BodierSimple(); + return new BodierSimple(skinParam); } - public static Bodier createGroup() { - return new BodierSimple(); + public static Bodier createGroup(ISkinParam skinParam) { + return new BodierSimple(skinParam); } public static TextBlock create1(HorizontalAlignment align, List rawBody, ISkinParam skinParam, diff --git a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java index ae2bbafec63..07fe713925a 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java +++ b/src/net/sourceforge/plantuml/cucadiagram/MethodsOrFieldsArea.java @@ -242,7 +242,7 @@ private TextBlock createTextBlock(CharSequence cs) { if (m.isStatic()) config = config.underline(); - TextBlock bloc = Display.getWithNewlines(s).create8(config, align, skinParam, CreoleMode.SIMPLE_LINE, + TextBlock bloc = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), s).create8(config, align, skinParam, CreoleMode.SIMPLE_LINE, style.wrapWidth()); bloc = TextBlockUtils.fullInnerPosition(bloc, m.getDisplay(false)); return new TextBlockTracer(m, bloc); @@ -251,7 +251,7 @@ private TextBlock createTextBlock(CharSequence cs) { // if (cs instanceof EmbeddedDiagram) // return ((EmbeddedDiagram) cs).asDraw(skinParam); - return Display.getWithNewlines(cs.toString()).create8(config, align, skinParam, CreoleMode.SIMPLE_LINE, + return Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), cs.toString()).create8(config, align, skinParam, CreoleMode.SIMPLE_LINE, style.wrapWidth()); } diff --git a/src/net/sourceforge/plantuml/cucadiagram/TextBlockCucaJSon.java b/src/net/sourceforge/plantuml/cucadiagram/TextBlockCucaJSon.java index 2399c673ab0..620bfe4fe2f 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/TextBlockCucaJSon.java +++ b/src/net/sourceforge/plantuml/cucadiagram/TextBlockCucaJSon.java @@ -179,7 +179,7 @@ public void drawU(UGraphic ug) { } private TextBlock getTextBlock(String key) { - final Display display = Display.getWithNewlines(key); + final Display display = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), key); TextBlock result = display.create0(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam, wordWrap, CreoleMode.FULL, null, null); result = TextBlockUtils.withMargin(result, 5, 2); diff --git a/src/net/sourceforge/plantuml/cucadiagram/TextBlockMap.java b/src/net/sourceforge/plantuml/cucadiagram/TextBlockMap.java index a2d00f575d8..ea7a2084fb0 100644 --- a/src/net/sourceforge/plantuml/cucadiagram/TextBlockMap.java +++ b/src/net/sourceforge/plantuml/cucadiagram/TextBlockMap.java @@ -169,7 +169,7 @@ private TextBlock getTextBlock(String key, LineBreakStrategy wordWrap) { if (key.equals("\0")) return new Point(fontConfiguration.getColor()); - final Display display = Display.getWithNewlines(key); + final Display display = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), key); TextBlock result = display.create0(fontConfiguration, HorizontalAlignment.LEFT, skinParam, wordWrap, CreoleMode.FULL, null, null); result = TextBlockUtils.withMargin(result, 5, 2); diff --git a/src/net/sourceforge/plantuml/definition/PSystemDefinition.java b/src/net/sourceforge/plantuml/definition/PSystemDefinition.java index ee41081a4ff..6712a073c70 100644 --- a/src/net/sourceforge/plantuml/definition/PSystemDefinition.java +++ b/src/net/sourceforge/plantuml/definition/PSystemDefinition.java @@ -76,7 +76,7 @@ protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) throws IO public void drawU(UGraphic ug) { final UFont font = UFont.sansSerif(14); final FontConfiguration fc = FontConfiguration.create(font, HColors.BLACK, HColors.BLACK, null); - Display.getWithNewlines(startLine).create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()).drawU(ug); + Display.getWithNewlines(false, startLine).create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()).drawU(ug); } public void doCommandLine(String line) { diff --git a/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java b/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java index 7974c82a7d8..ccd2cac4b9a 100644 --- a/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java +++ b/src/net/sourceforge/plantuml/descdiagram/CommandCreateDomain.java @@ -119,7 +119,7 @@ protected CommandExecutionResult executeArg(DescriptionDiagram diagram, LineLoca if (quark.getData() != null) return CommandExecutionResult.error("Object already exists : " + codeString); - Display display = Display.getWithNewlines(displayString); + Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayString); final String urlString = arg.get("URL", 0); final String group = arg.get("GROUP", 0); Entity entity; diff --git a/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java b/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java index cf90012a914..2b4fd2d7a76 100644 --- a/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java +++ b/src/net/sourceforge/plantuml/descdiagram/EntityImageRequirement.java @@ -84,7 +84,7 @@ public EntityImageRequirement(Entity entity) { if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) { this.desc = tmp; } else { - final TextBlock stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().guillemet())).create( + final TextBlock stereo = Display.getWithNewlines(getSkinParam().legacyReplaceBackslashNByNewline(), stereotype.getLabel(getSkinParam().guillemet())).create( FontConfiguration.create(getSkinParam(), FontParam.REQUIREMENT_STEREOTYPE, stereotype), HorizontalAlignment.CENTER, getSkinParam()); this.desc = TextBlockUtils.mergeTB(stereo, tmp, HorizontalAlignment.CENTER); diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimate.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimate.java index 28a736e4cca..2f51bd126b0 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimate.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandArchimate.java @@ -114,12 +114,12 @@ protected CommandExecutionResult executeArg(DescriptionDiagram diagram, LineLoca Entity entity = (Entity) quark.getData(); if (entity == null) - entity = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(display), LeafType.DESCRIPTION, + entity = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display), LeafType.DESCRIPTION, USymbols.ARCHIMATE); final String icon = StereotypePattern.removeChevronBrackets(arg.getLazzy("STEREOTYPE", 0)); - entity.setDisplay(Display.getWithNewlines(display)); + entity.setDisplay(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display)); if (icon != null) entity.setStereotype( diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java index 6f499066b69..b80ca53f103 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementFull.java @@ -228,9 +228,9 @@ protected CommandExecutionResult executeArg(DescriptionDiagram diagram, LineLoca Entity entity = quark.getData(); if (entity == null) - entity = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(display), type, usymbol); + entity = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display), type, usymbol); - entity.setDisplay(Display.getWithNewlines(display)); + entity.setDisplay(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display)); if (stereotype != null) entity.setStereotype(Stereotype.build(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementParenthesis.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementParenthesis.java index 7c8424b2e4d..99c83735150 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementParenthesis.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandCreateElementParenthesis.java @@ -163,8 +163,8 @@ protected CommandExecutionResult executeArg(ClassDiagram diagram, LineLocation l if (CommandCreateElementFull.existsWithBadType3(diagram, quark, type, usymbol)) return CommandExecutionResult.error("This element (" + quark.getName() + ") is already defined"); - final Entity entity = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(display), type, usymbol); - entity.setDisplay(Display.getWithNewlines(display)); + final Entity entity = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display), type, usymbol); + entity.setDisplay(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display)); if (stereotype != null) entity.setStereotype(Stereotype.build(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java index 8615ec98ceb..3de8871f9c5 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandLinkElement.java @@ -276,7 +276,7 @@ protected CommandExecutionResult executeArg(DescriptionDiagram diagram, LineLoca cl1 = getDummy(diagram, ent1); cl2 = getDummy(diagram, ent2); } - final LinkArg linkArg = LinkArg.build(Display.getWithNewlines(labels.getLabelLink()), queue.length(), + final LinkArg linkArg = LinkArg.build(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), labels.getLabelLink()), queue.length(), diagram.getSkinParam().classAttributeIconSize() > 0); Link link = new Link(diagram, diagram.getSkinParam().getCurrentStyleBuilder(), cl1, cl2, linkType, linkArg.withQuantifier(labels.getFirstLabel(), labels.getSecondLabel()) @@ -307,7 +307,7 @@ private Entity getDummy(DescriptionDiagram diagram, String ident) { final Quark quark = diagram.quarkInContext(true, ident); if (quark.getData() != null) return quark.getData(); - return diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark.getName()), LeafType.DESCRIPTION, + return diagram.reallyCreateLeaf(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()), LeafType.DESCRIPTION, USymbols.INTERFACE); } @@ -320,7 +320,7 @@ private Entity getDummy(DescriptionDiagram diagram, String ident) { return quark.getData(); if (quark.getData() != null) return quark.getData(); - final Display display = Display.getWithNewlines(quark.getName()); + final Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()); if (codeChar == '(') { if (endWithSlash) diff --git a/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java b/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java index 57a58f2e192..1378e68c766 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/CommandPackageWithUSymbol.java @@ -154,7 +154,7 @@ else if (displayArg == null) final USymbol usymbol = USymbols.fromString(symbol, diagram.getSkinParam().actorStyle(), diagram.getSkinParam().componentStyle(), diagram.getSkinParam().packageStyle()); - final CommandExecutionResult status = diagram.gotoGroup(ident, Display.getWithNewlines(display), + final CommandExecutionResult status = diagram.gotoGroup(ident, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display), GroupType.PACKAGE, usymbol); if (status.isOk() == false) return status; diff --git a/src/net/sourceforge/plantuml/descdiagram/command/Labels.java b/src/net/sourceforge/plantuml/descdiagram/command/Labels.java index 924320f50d7..923d6acd8ee 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/Labels.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/Labels.java @@ -107,8 +107,8 @@ public final LinkArrow getLinkArrow() { return stringWithArrow.getLinkArrow(); } - public Display getDisplay() { - return stringWithArrow.getDisplay(); + public Display getDisplay(boolean flag) { + return stringWithArrow.getDisplay(flag); } } diff --git a/src/net/sourceforge/plantuml/descdiagram/command/StringWithArrow.java b/src/net/sourceforge/plantuml/descdiagram/command/StringWithArrow.java index 8239310852f..f7b420b4e25 100644 --- a/src/net/sourceforge/plantuml/descdiagram/command/StringWithArrow.java +++ b/src/net/sourceforge/plantuml/descdiagram/command/StringWithArrow.java @@ -97,8 +97,8 @@ public final LinkArrow getLinkArrow() { return linkArrow; } - public final Display getDisplay() { - return Display.getWithNewlines(label); + public final Display getDisplay(boolean flag) { + return Display.getWithNewlines(flag, label); } static public TextBlock addMagicArrow(TextBlock label, GuideLine guide, FontConfiguration font) { @@ -116,7 +116,7 @@ public static TextBlock addSeveralMagicArrows(Display label, GuideLine guide, Fo TextBlock result = TextBlockUtils.EMPTY_TEXT_BLOCK; for (CharSequence cs : label) { StringWithArrow tmp = new StringWithArrow(cs.toString()); - TextBlock block = tmp.getDisplay().create9(font, alignment, skinParam, skinParam.maxMessageSize()); + TextBlock block = tmp.getDisplay(skinParam.legacyReplaceBackslashNByNewline()).create9(font, alignment, skinParam, skinParam.maxMessageSize()); if (tmp.getLinkArrow() != LinkArrow.NONE_OR_SEVERAL) block = StringWithArrow.addMagicArrow2(block, tmp.getLinkArrow().mute(guide), font); diff --git a/src/net/sourceforge/plantuml/dot/CucaDiagramTxtMaker.java b/src/net/sourceforge/plantuml/dot/CucaDiagramTxtMaker.java index d43e1814bbd..a8440f524a2 100644 --- a/src/net/sourceforge/plantuml/dot/CucaDiagramTxtMaker.java +++ b/src/net/sourceforge/plantuml/dot/CucaDiagramTxtMaker.java @@ -211,7 +211,7 @@ private int getHeight(Entity entity) { int result = StringUtils.getHeight(entity.getDisplay()); if (showMember(entity)) { for (CharSequence att : entity.getBodier().getRawBody()) - result += StringUtils.getHeight(Display.getWithNewlines(att.toString())); + result += StringUtils.getHeight(Display.getWithNewlines(false, att.toString())); // for (Member att : entity.getBodier().getMethodsToDisplay()) { // result += StringUtils.getHeight(Display.getWithNewlines(att.getDisplay(true))); @@ -229,7 +229,7 @@ private int getWidth(Entity entity) { int result = StringUtils.getWcWidth(entity.getDisplay()); if (showMember(entity)) { for (CharSequence att : entity.getBodier().getRawBody()) { - final int w = StringUtils.getWcWidth(Display.getWithNewlines(att.toString())); + final int w = StringUtils.getWcWidth(Display.getWithNewlines(false, att.toString())); if (w > result) result = w; diff --git a/src/net/sourceforge/plantuml/ebnf/CommandComment.java b/src/net/sourceforge/plantuml/ebnf/CommandComment.java index df5180ad082..366f2460987 100644 --- a/src/net/sourceforge/plantuml/ebnf/CommandComment.java +++ b/src/net/sourceforge/plantuml/ebnf/CommandComment.java @@ -64,7 +64,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(PSystemEbnf diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { - final Display note = Display.getWithNewlines(arg.get("COMMENT", 0)); + final Display note = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("COMMENT", 0)); return diagram.addNote(note, null); } diff --git a/src/net/sourceforge/plantuml/ebnf/ETileBox.java b/src/net/sourceforge/plantuml/ebnf/ETileBox.java index 5e3a2aeaf78..ee870fdd7e6 100644 --- a/src/net/sourceforge/plantuml/ebnf/ETileBox.java +++ b/src/net/sourceforge/plantuml/ebnf/ETileBox.java @@ -195,7 +195,7 @@ private TextBlock getNoteAbove(StringBounder stringBounder) { if (commentAbove == null) return TextBlockUtils.EMPTY_TEXT_BLOCK; - final FloatingNote note = FloatingNote.createOpale(Display.getWithNewlines(commentAbove), skinParam, + final FloatingNote note = FloatingNote.createOpale(Display.getWithNewlines(false, commentAbove), skinParam, SName.ebnf); final XDimension2D dim = note.calculateDimension(stringBounder); final double pos = dim.getWidth() * .5; @@ -209,7 +209,7 @@ private TextBlock getNoteBelow(StringBounder stringBounder) { if (commentBelow == null) return TextBlockUtils.EMPTY_TEXT_BLOCK; - final FloatingNote note = FloatingNote.createOpale(Display.getWithNewlines(commentBelow), skinParam, + final FloatingNote note = FloatingNote.createOpale(Display.getWithNewlines(false, commentBelow), skinParam, SName.ebnf); final XDimension2D dim = note.calculateDimension(stringBounder); final double pos = dim.getWidth() * .5; diff --git a/src/net/sourceforge/plantuml/ebnf/ETileOptional.java b/src/net/sourceforge/plantuml/ebnf/ETileOptional.java index f432537532d..6ab8b3f3a41 100644 --- a/src/net/sourceforge/plantuml/ebnf/ETileOptional.java +++ b/src/net/sourceforge/plantuml/ebnf/ETileOptional.java @@ -151,14 +151,14 @@ protected void addCommentBelow(String comment) { private TextBlock getNoteAbove(StringBounder stringBounder) { if (commentAbove == null) return TextBlockUtils.EMPTY_TEXT_BLOCK; - final FloatingNote note = FloatingNote.create(Display.getWithNewlines(commentAbove), skinParam, SName.ebnf); + final FloatingNote note = FloatingNote.create(Display.getWithNewlines(false, commentAbove), skinParam, SName.ebnf); return TextBlockUtils.withMargin(note, 0, 0, 0, 10); } private TextBlock getNoteBelow(StringBounder stringBounder) { if (commentBelow == null) return TextBlockUtils.EMPTY_TEXT_BLOCK; - final FloatingNote note = FloatingNote.create(Display.getWithNewlines(commentBelow), skinParam, SName.ebnf); + final FloatingNote note = FloatingNote.create(Display.getWithNewlines(false, commentBelow), skinParam, SName.ebnf); return TextBlockUtils.withMargin(note, 0, 0, 10, 0); } diff --git a/src/net/sourceforge/plantuml/ebnf/EbnfExpression.java b/src/net/sourceforge/plantuml/ebnf/EbnfExpression.java index 6210d50d919..8732419ed12 100644 --- a/src/net/sourceforge/plantuml/ebnf/EbnfExpression.java +++ b/src/net/sourceforge/plantuml/ebnf/EbnfExpression.java @@ -172,14 +172,14 @@ public TextBlock getUDrawable(ISkinParam skinParam) { private TextBlock getNoteAbove(ISkinParam skinParam) { if (commentAbove == null) return null; - final FloatingNote note = FloatingNote.create(Display.getWithNewlines(commentAbove), skinParam, SName.ebnf); + final FloatingNote note = FloatingNote.create(Display.getWithNewlines(false, commentAbove), skinParam, SName.ebnf); return note; } private TextBlock getNoteBelow(ISkinParam skinParam) { if (commentBelow == null) return null; - final FloatingNote note = FloatingNote.create(Display.getWithNewlines(commentBelow), skinParam, SName.ebnf); + final FloatingNote note = FloatingNote.create(Display.getWithNewlines(false, commentBelow), skinParam, SName.ebnf); return note; } diff --git a/src/net/sourceforge/plantuml/eggs/PSystemColors.java b/src/net/sourceforge/plantuml/eggs/PSystemColors.java index 7de6983c68a..7cde486785e 100644 --- a/src/net/sourceforge/plantuml/eggs/PSystemColors.java +++ b/src/net/sourceforge/plantuml/eggs/PSystemColors.java @@ -262,7 +262,7 @@ private void drawFull(UGraphic ug) { private TextBlock getTextName(final UFont font, String name, final HColor color) { final HColor opposite = color.opposite(); final FontConfiguration fc = FontConfiguration.create(font, opposite, HColors.BLUE, UStroke.simple()); - final TextBlock tt = Display.getWithNewlines(name).create(fc, HorizontalAlignment.CENTER, + final TextBlock tt = Display.getWithNewlines(false, name).create(fc, HorizontalAlignment.CENTER, new SpriteContainerEmpty()); return tt; } diff --git a/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java b/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java index 6685778b3aa..4dfcbc7f370 100644 --- a/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java +++ b/src/net/sourceforge/plantuml/elk/CucaDiagramFileMakerElk.java @@ -260,7 +260,7 @@ private TextBlock getQuantifier(StringBounder stringBounder, Link link, int n) { final ISkinParam skinParam = diagram.getSkinParam(); final FontConfiguration labelFont = FontConfiguration.create(skinParam, FontParam.ARROW, null); - final TextBlock label = Display.getWithNewlines(tmp).create(labelFont, + final TextBlock label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), tmp).create(labelFont, skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam); if (TextBlockUtils.isEmpty(label, stringBounder)) return null; diff --git a/src/net/sourceforge/plantuml/elk/MyElkDrawing.java b/src/net/sourceforge/plantuml/elk/MyElkDrawing.java index 015f3f934ab..8e06d645de0 100644 --- a/src/net/sourceforge/plantuml/elk/MyElkDrawing.java +++ b/src/net/sourceforge/plantuml/elk/MyElkDrawing.java @@ -300,7 +300,7 @@ private TextBlock getQuantifier(StringBounder stringBounder, Link link, int n) { final ISkinParam skinParam = diagram.getSkinParam(); final FontConfiguration labelFont = FontConfiguration.create(skinParam, FontParam.ARROW, null); - final TextBlock label = Display.getWithNewlines(tmp).create(labelFont, + final TextBlock label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), tmp).create(labelFont, skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam); if (TextBlockUtils.isEmpty(label, stringBounder)) return null; diff --git a/src/net/sourceforge/plantuml/filesdiagram/FEntry.java b/src/net/sourceforge/plantuml/filesdiagram/FEntry.java index 0752e7e7d62..731e9ecb374 100644 --- a/src/net/sourceforge/plantuml/filesdiagram/FEntry.java +++ b/src/net/sourceforge/plantuml/filesdiagram/FEntry.java @@ -139,7 +139,7 @@ private TextBlock getTextBlock(FontConfiguration fontConfiguration, ISkinParam s if (type == FilesType.NOTE) return createOpale(skinParam); - final Display display = Display.getWithNewlines(getEmoticon() + getName()); + final Display display = Display.getWithNewlines(false, getEmoticon() + getName()); TextBlock result = display.create7(fontConfiguration, HorizontalAlignment.LEFT, skinParam, CreoleMode.NO_CREOLE); return result; diff --git a/src/net/sourceforge/plantuml/jaws/JawsFlags.java b/src/net/sourceforge/plantuml/jaws/JawsFlags.java index 0b358c2eb9d..81b31f4f7d4 100644 --- a/src/net/sourceforge/plantuml/jaws/JawsFlags.java +++ b/src/net/sourceforge/plantuml/jaws/JawsFlags.java @@ -39,6 +39,8 @@ public class JawsFlags { public static final boolean USE_BLOCK_E1_IN_NEWLINE_FUNCTION = true; public static final boolean USE_CommandSkinParamJaws = true; - public static final boolean OLD_DISPLAY_HACK = true; + public static final boolean PARSE_NEW_MULTILINE_TRIPLE_EXCLAMATION_MARKS = false; + + //public static final boolean OLD_DISPLAY_HACK = true; } diff --git a/src/net/sourceforge/plantuml/jsondiagram/JsonDiagram.java b/src/net/sourceforge/plantuml/jsondiagram/JsonDiagram.java index 78f91a008dd..e2a58cf39ce 100644 --- a/src/net/sourceforge/plantuml/jsondiagram/JsonDiagram.java +++ b/src/net/sourceforge/plantuml/jsondiagram/JsonDiagram.java @@ -130,7 +130,7 @@ private void drawInternal(UGraphic ug) { ug = new UGraphicHandwritten(ug); if (root == null) { final Display display = Display - .getWithNewlines("Your data does not sound like " + getUmlDiagramType() + " data"); + .getWithNewlines(false, "Your data does not sound like " + getUmlDiagramType() + " data"); final FontConfiguration fontConfiguration = FontConfiguration.blackBlueTrue(UFont.courier(14)); TextBlock result = display.create(fontConfiguration, HorizontalAlignment.LEFT, getSkinParam()); result = TextBlockUtils.withMargin(result, 5, 2); diff --git a/src/net/sourceforge/plantuml/jsondiagram/JsonDiagramFactory.java b/src/net/sourceforge/plantuml/jsondiagram/JsonDiagramFactory.java index 3a77f7f9fe4..27af719f380 100644 --- a/src/net/sourceforge/plantuml/jsondiagram/JsonDiagramFactory.java +++ b/src/net/sourceforge/plantuml/jsondiagram/JsonDiagramFactory.java @@ -101,7 +101,7 @@ public Diagram createSystem(UmlSource source, Map skinMap) { } final String title = styleExtractor.getTitle(); if (title != null) - result.setTitle(DisplayPositioned.single(Display.getWithNewlines(title), HorizontalAlignment.CENTER, + result.setTitle(DisplayPositioned.single(Display.getWithNewlines(result.legacyReplaceBackslashNByNewline(), title), HorizontalAlignment.CENTER, VerticalAlignment.CENTER)); } return result; diff --git a/src/net/sourceforge/plantuml/jsondiagram/TextBlockJson.java b/src/net/sourceforge/plantuml/jsondiagram/TextBlockJson.java index bff43eb04fc..0232b05ad53 100644 --- a/src/net/sourceforge/plantuml/jsondiagram/TextBlockJson.java +++ b/src/net/sourceforge/plantuml/jsondiagram/TextBlockJson.java @@ -339,7 +339,7 @@ public double[] getAllHeights(StringBounder stringBounder) { } private TextBlock getTextBlock(Style style, String key) { - final Display display = Display.getWithNewlines(key); + final Display display = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), key); final FontConfiguration fontConfiguration = style.getFontConfiguration(skinParam.getIHtmlColorSet()); final LineBreakStrategy wrap = style.wrapWidth(); final HorizontalAlignment horizontalAlignment = style.getHorizontalAlignment(); diff --git a/src/net/sourceforge/plantuml/klimt/creole/CreoleHorizontalLine.java b/src/net/sourceforge/plantuml/klimt/creole/CreoleHorizontalLine.java index 00c409fc377..df53287133b 100644 --- a/src/net/sourceforge/plantuml/klimt/creole/CreoleHorizontalLine.java +++ b/src/net/sourceforge/plantuml/klimt/creole/CreoleHorizontalLine.java @@ -83,7 +83,7 @@ private TextBlock getTitle() { return TextBlockUtils.empty(0, 0); final SheetBuilder parser = skinParam.sheet(fontConfiguration, HorizontalAlignment.LEFT, CreoleMode.FULL); - final Sheet sheet = parser.createSheet(Display.getWithNewlines(line)); + final Sheet sheet = parser.createSheet(Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), line)); final TextBlock tb = new SheetBlock1(sheet, LineBreakStrategy.NONE, skinParam.getPadding()); return tb; } diff --git a/src/net/sourceforge/plantuml/klimt/creole/Display.java b/src/net/sourceforge/plantuml/klimt/creole/Display.java index 420297d6159..3bceb83af06 100644 --- a/src/net/sourceforge/plantuml/klimt/creole/Display.java +++ b/src/net/sourceforge/plantuml/klimt/creole/Display.java @@ -47,6 +47,7 @@ import net.sourceforge.plantuml.abel.Entity; import net.sourceforge.plantuml.jaws.Jaws; +import net.sourceforge.plantuml.jaws.JawsFlags; import net.sourceforge.plantuml.jaws.JawsStrange; import net.sourceforge.plantuml.klimt.LineBreakStrategy; import net.sourceforge.plantuml.klimt.UStroke; @@ -201,11 +202,11 @@ public static Display create(Collection other) { } public static Display getWithNewlines(Quark s) { - return getWithNewlines(s.getName()); + return getWithNewlines(false, s.getName()); } - public static Display getWithNewlines2(String s) throws NoSuchColorException { - final Display result = getWithNewlines(s); + public static Display getWithNewlines2(boolean legacyReplaceBackslashNByNewline, String s) throws NoSuchColorException { + final Display result = getWithNewlines(legacyReplaceBackslashNByNewline, s); CreoleParser.checkColor(result); return result; } @@ -237,7 +238,7 @@ public static List getWithNewlines3(CharSequence s) { return Collections.unmodifiableList(result); } - public static Display getWithNewlines(String s) { + public static Display getWithNewlines(boolean legacyReplaceBackslashNByNewline, String s) { if (s == null) return NULL; @@ -263,7 +264,7 @@ else if (sub.startsWith("") || sub.startsWith("") || sub.startsWi current.setLength(0); i += 3; // throw new IllegalStateException(); - } else if (rawMode == false && c == '\\' && i < s.length() - 1) { + } else if (/*legacyReplaceBackslashNByNewline &&*/ rawMode == false && c == '\\' && i < s.length() - 1) { final char c2 = s.charAt(i + 1); i++; if (c2 == 'n' || c2 == 'r' || c2 == 'l') { diff --git a/src/net/sourceforge/plantuml/klimt/creole/legacy/AtomTextUtils.java b/src/net/sourceforge/plantuml/klimt/creole/legacy/AtomTextUtils.java index ec34e2d512e..2777f430b46 100644 --- a/src/net/sourceforge/plantuml/klimt/creole/legacy/AtomTextUtils.java +++ b/src/net/sourceforge/plantuml/klimt/creole/legacy/AtomTextUtils.java @@ -77,7 +77,7 @@ public static Atom create(String text, FontConfiguration fontConfiguration) { public static Atom createUrl(Url url, FontConfiguration fontConfiguration, ISkinSimple skinSimple) { fontConfiguration = fontConfiguration.hyperlink(); - final Display display = Display.getWithNewlines(url.getLabel()); + final Display display = Display.getWithNewlines(skinSimple.legacyReplaceBackslashNByNewline(), url.getLabel()); if (display.size() > 1) { final List all = new ArrayList<>(); for (CharSequence s : display.asList()) diff --git a/src/net/sourceforge/plantuml/klimt/creole/legacy/PSystemCreole.java b/src/net/sourceforge/plantuml/klimt/creole/legacy/PSystemCreole.java index 4ec0078cb81..1800036e640 100644 --- a/src/net/sourceforge/plantuml/klimt/creole/legacy/PSystemCreole.java +++ b/src/net/sourceforge/plantuml/klimt/creole/legacy/PSystemCreole.java @@ -51,6 +51,7 @@ import net.sourceforge.plantuml.klimt.font.UFont; import net.sourceforge.plantuml.klimt.geom.HorizontalAlignment; import net.sourceforge.plantuml.klimt.shape.UDrawable; +import net.sourceforge.plantuml.skin.Pragma; import net.sourceforge.plantuml.skin.SkinParam; import net.sourceforge.plantuml.skin.UmlDiagramType; @@ -76,7 +77,7 @@ protected UDrawable getRootDrawable(FileFormatOption fileFormatOption) { final Display display = Display.create(lines); final UFont font = UFont.serif(14); final FontConfiguration fontConfiguration = FontConfiguration.blackBlueTrue(font); - final SkinParam skinParam = SkinParam.create(UmlDiagramType.SEQUENCE); + final SkinParam skinParam = SkinParam.create(UmlDiagramType.SEQUENCE, new Pragma()); final Sheet sheet = skinParam.sheet(fontConfiguration, HorizontalAlignment.LEFT, CreoleMode.FULL) .createSheet(display); return new SheetBlock1(sheet, LineBreakStrategy.NONE, 0); diff --git a/src/net/sourceforge/plantuml/klimt/sprite/SpriteContainerEmpty.java b/src/net/sourceforge/plantuml/klimt/sprite/SpriteContainerEmpty.java index b92e9319faf..36040449d5d 100644 --- a/src/net/sourceforge/plantuml/klimt/sprite/SpriteContainerEmpty.java +++ b/src/net/sourceforge/plantuml/klimt/sprite/SpriteContainerEmpty.java @@ -120,5 +120,11 @@ public SheetBuilder sheet(FontConfiguration fontConfiguration, HorizontalAlignme CreoleMode creoleMode, FontConfiguration stereo) { return new CreoleParser(fontConfiguration, horizontalAlignment, this, creoleMode, stereo); } + + @Override + public boolean legacyReplaceBackslashNByNewline() { + return false; + } + } \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmode.java b/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmode.java index 9ee998b1a58..d988eb86680 100644 --- a/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmode.java +++ b/src/net/sourceforge/plantuml/mindmap/CommandMindMapOrgmode.java @@ -73,7 +73,7 @@ protected CommandExecutionResult executeArg(MindMapDiagram diagram, LineLocation if (stringColor != null) backColor = diagram.getSkinParam().getIHtmlColorSet().getColor(stringColor); - return diagram.addIdea(backColor, diagram.getSmartLevel(type), Display.getWithNewlines(label), + return diagram.addIdea(backColor, diagram.getSmartLevel(type), Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), label), IdeaShape.fromDesc(arg.get("SHAPE", 0))); } } diff --git a/src/net/sourceforge/plantuml/mindmap/CommandMindMapPlus.java b/src/net/sourceforge/plantuml/mindmap/CommandMindMapPlus.java index 34ad488b3db..3832998d824 100644 --- a/src/net/sourceforge/plantuml/mindmap/CommandMindMapPlus.java +++ b/src/net/sourceforge/plantuml/mindmap/CommandMindMapPlus.java @@ -74,7 +74,7 @@ protected CommandExecutionResult executeArg(MindMapDiagram diagram, LineLocation backColor = diagram.getSkinParam().getIHtmlColorSet().getColor(stringColor); } final boolean direction = type.contains("-") ? false : true; - return diagram.addIdea(backColor, type.length() - 1, Display.getWithNewlines(label), + return diagram.addIdea(backColor, type.length() - 1, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), label), IdeaShape.fromDesc(arg.get("SHAPE", 0)), direction); } diff --git a/src/net/sourceforge/plantuml/mindmap/CommandMindMapRoot.java b/src/net/sourceforge/plantuml/mindmap/CommandMindMapRoot.java index 2dd4f0c2425..ec73f020298 100644 --- a/src/net/sourceforge/plantuml/mindmap/CommandMindMapRoot.java +++ b/src/net/sourceforge/plantuml/mindmap/CommandMindMapRoot.java @@ -61,7 +61,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(MindMapDiagram diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { final String label = arg.get("LABEL", 0); - return diagram.addIdea(null, 0, Display.getWithNewlines(label), IdeaShape.BOX, true); + return diagram.addIdea(null, 0, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), label), IdeaShape.BOX, true); } } diff --git a/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java b/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java index 6f90745469e..0cc930e4233 100644 --- a/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java +++ b/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java @@ -359,7 +359,7 @@ private TextBlock toTextBlockForNetworkName(String name, String s) { final StyleBuilder styleBuilder = getSkinParam().getCurrentStyleBuilder(); final Style style = getStyleDefinitionNetwork(SName.network).getMergedStyle(styleBuilder); final FontConfiguration fontConfiguration = style.getFontConfiguration(getSkinParam().getIHtmlColorSet()); - return Display.getWithNewlines(name).create(fontConfiguration, HorizontalAlignment.RIGHT, + return Display.getWithNewlines(legacyReplaceBackslashNByNewline(), name).create(fontConfiguration, HorizontalAlignment.RIGHT, new SpriteContainerEmpty()); } diff --git a/src/net/sourceforge/plantuml/nwdiag/core/NServer.java b/src/net/sourceforge/plantuml/nwdiag/core/NServer.java index 13265a2b70e..bf7a2115fc9 100644 --- a/src/net/sourceforge/plantuml/nwdiag/core/NServer.java +++ b/src/net/sourceforge/plantuml/nwdiag/core/NServer.java @@ -41,6 +41,7 @@ import net.sourceforge.plantuml.decoration.symbol.USymbol; import net.sourceforge.plantuml.decoration.symbol.USymbols; +import net.sourceforge.plantuml.jaws.JawsStrange; import net.sourceforge.plantuml.klimt.Fashion; import net.sourceforge.plantuml.klimt.color.HColor; import net.sourceforge.plantuml.klimt.color.NoSuchColorException; @@ -135,6 +136,7 @@ public String getAdress(Network network) { return connections.get(network); } + @JawsStrange public TextBlock toTextBlock(SName sname, String s) { if (s == null) return null; @@ -143,7 +145,7 @@ public TextBlock toTextBlock(SName sname, String s) { return TextBlockUtils.empty(0, 0); s = s.replace(", ", "\\n"); - return Display.getWithNewlines(s).create(getFontConfiguration(sname), HorizontalAlignment.LEFT, skinParam); + return Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), s).create(getFontConfiguration(sname), HorizontalAlignment.LEFT, skinParam); } private StyleSignatureBasic getStyleDefinition(SName sname) { diff --git a/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java b/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java index 1aa4f43a19b..72b8252fc1e 100644 --- a/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java +++ b/src/net/sourceforge/plantuml/nwdiag/core/NwGroup.java @@ -168,7 +168,7 @@ private TextBlock buildHeaderName(ISkinParam skinParam) { final StyleBuilder styleBuilder = skinParam.getCurrentStyleBuilder(); final Style style = getStyleDefinition().getMergedStyle(styleBuilder); - return Display.getWithNewlines(getDescription()) + return Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), getDescription()) .create(style.getFontConfiguration(skinParam.getIHtmlColorSet()), HorizontalAlignment.LEFT, skinParam); } diff --git a/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java b/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java index c44b3db3b3a..caac11e69cf 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java +++ b/src/net/sourceforge/plantuml/objectdiagram/AbstractClassOrObjectDiagram.java @@ -118,10 +118,10 @@ public CommandExecutionResult associationClass(Entity entity1A, Entity entity1B, final String tmp2 = this.getUniqueSequence("apoint"); final Quark code1 = getCurrentGroup().getQuark().child(tmp1); - final Entity point1 = reallyCreateLeaf(code1, Display.getWithNewlines(""), LeafType.POINT_FOR_ASSOCIATION, + final Entity point1 = reallyCreateLeaf(code1, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.POINT_FOR_ASSOCIATION, null); final Quark code2 = getCurrentGroup().getQuark().child(tmp2); - final Entity point2 = reallyCreateLeaf(code2, Display.getWithNewlines(""), LeafType.POINT_FOR_ASSOCIATION, + final Entity point2 = reallyCreateLeaf(code2, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.POINT_FOR_ASSOCIATION, null); insertPointBetween(entity1A, entity1B, point1); @@ -222,7 +222,7 @@ public Association(int mode, Entity entity1, Entity entity2, Entity associed) { quark = entity1.getQuark().getParent().child(idShort); else quark = quarkInContext(true, cleanId(idShort)); - point = reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.POINT_FOR_ASSOCIATION, null); + point = reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.POINT_FOR_ASSOCIATION, null); } diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java index 17ce0e5de69..2459d41e669 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObject.java @@ -89,9 +89,9 @@ protected CommandExecutionResult executeArg(AbstractClassOrObjectDiagram diagram if (quark.getData() != null) return CommandExecutionResult.error("Object already exists : " + quark.getData()); - Display display = Display.getWithNewlines(displayString); + Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayString); if (Display.isNull(display)) - display = Display.getWithNewlines(quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); + display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); final Entity entity = diagram.reallyCreateLeaf(quark, display, LeafType.OBJECT, null); if (stereotype != null) diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java index d0d3aeae7e9..47c5c93825c 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateEntityObjectMultilines.java @@ -114,9 +114,9 @@ private Entity executeArg0(AbstractClassOrObjectDiagram diagram, RegexResult lin final String displayString = line0.getLazzy("DISPLAY", 0); final String stereotype = line0.get("STEREO", 0); - Display display = Display.getWithNewlines(displayString); + Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayString); if (Display.isNull(display)) - display = Display.getWithNewlines(quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); + display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); Entity entity = quark.getData(); if (entity == null) entity = diagram.reallyCreateLeaf(quark, display, LeafType.OBJECT, null); diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java index 43cc817c76f..7af3757c1ea 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJson.java @@ -161,9 +161,9 @@ private Entity executeArg0(AbstractEntityDiagram diagram, RegexResult line0) thr final String displayString = line0.getLazzy("DISPLAY", 0); final String stereotype = line0.get("STEREO", 0); - Display display = Display.getWithNewlines(displayString); + Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayString); if (Display.isNull(display)) - display = Display.getWithNewlines(quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); + display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()).withCreoleMode(CreoleMode.SIMPLE_LINE); final Entity entity = diagram.reallyCreateLeaf(quark, display, LeafType.JSON, null); if (stereotype != null) diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJsonSingleLine.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJsonSingleLine.java index 22c62b42fc3..999d553088d 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJsonSingleLine.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateJsonSingleLine.java @@ -127,9 +127,9 @@ private Entity executeArg0(AbstractEntityDiagram diagram, RegexResult line0) thr final String displayString = line0.get("NAME", 0); final String stereotype = line0.get("STEREO", 0); - Display display = Display.getWithNewlines(displayString); + Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayString); if (Display.isNull(display)) - display = Display.getWithNewlines(name).withCreoleMode(CreoleMode.SIMPLE_LINE); + display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), name).withCreoleMode(CreoleMode.SIMPLE_LINE); final Entity entity = diagram.reallyCreateLeaf(quark, display, LeafType.JSON, null); if (stereotype != null) diff --git a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java index 6bda80e4383..607c170e024 100644 --- a/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java +++ b/src/net/sourceforge/plantuml/objectdiagram/command/CommandCreateMap.java @@ -148,9 +148,9 @@ private Entity executeArg0(AbstractEntityDiagram diagram, RegexResult line0) thr if (quark.getData() != null) return null; - Display display = Display.getWithNewlines(displayString); + Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), displayString); if (Display.isNull(display)) - display = Display.getWithNewlines(name).withCreoleMode(CreoleMode.SIMPLE_LINE); + display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), name).withCreoleMode(CreoleMode.SIMPLE_LINE); final Entity entity = diagram.reallyCreateLeaf(quark, display, LeafType.MAP, null); if (stereotype != null) diff --git a/src/net/sourceforge/plantuml/project/draw/ResourceDrawBasic.java b/src/net/sourceforge/plantuml/project/draw/ResourceDrawBasic.java index 0c2a636e58a..6abeab90173 100644 --- a/src/net/sourceforge/plantuml/project/draw/ResourceDrawBasic.java +++ b/src/net/sourceforge/plantuml/project/draw/ResourceDrawBasic.java @@ -71,7 +71,7 @@ public ResourceDrawBasic(GanttDiagram gantt, Resource res, TimeScale timeScale, } public void drawU(UGraphic ug) { - final TextBlock title = Display.getWithNewlines(res.getName()).create(getFontConfiguration(13), + final TextBlock title = Display.getWithNewlines(gantt.legacyReplaceBackslashNByNewline(), res.getName()).create(getFontConfiguration(13), HorizontalAlignment.LEFT, new SpriteContainerEmpty()); title.drawU(ug); final ULine line = ULine.hline(timeScale.getEndingPosition(max) - timeScale.getStartingPosition(min)); @@ -91,7 +91,7 @@ public void drawU(UGraphic ug) { if (totalLoad > 0) { final FontConfiguration fontConfiguration = getFontConfiguration(9, isRed ? HColors.RED : HColors.BLACK); - final TextBlock value = Display.getWithNewlines("" + totalLoad).create(fontConfiguration, + final TextBlock value = Display.getWithNewlines(false, "" + totalLoad).create(fontConfiguration, HorizontalAlignment.LEFT, new SpriteContainerEmpty()); if (startingPosition == -1) startingPosition = timeScale.getStartingPosition(i); diff --git a/src/net/sourceforge/plantuml/project/draw/ResourceDrawVersion2.java b/src/net/sourceforge/plantuml/project/draw/ResourceDrawVersion2.java index 522fe9e91af..1521a6a2d2c 100644 --- a/src/net/sourceforge/plantuml/project/draw/ResourceDrawVersion2.java +++ b/src/net/sourceforge/plantuml/project/draw/ResourceDrawVersion2.java @@ -88,7 +88,7 @@ public void drawU(UGraphic ug) { } - final TextBlock title = Display.getWithNewlines(res.getName()).create(getFontConfiguration(13), + final TextBlock title = Display.getWithNewlines(gantt.legacyReplaceBackslashNByNewline(), res.getName()).create(getFontConfiguration(13), HorizontalAlignment.LEFT, new SpriteContainerEmpty()); title.drawU(ug); final ULine line = ULine.hline(timeScale.getEndingPosition(max) - timeScale.getStartingPosition(min)); diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java index 260579d103e..3cc2e268a69 100644 --- a/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java +++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawDiamond.java @@ -127,7 +127,7 @@ final public void drawTitle(UGraphic ug, LabelStrategy labelStrategy, double col @Override protected TextBlock getTitle() { - return Display.getWithNewlines(prettyDisplay).create(getFontConfiguration(), HorizontalAlignment.LEFT, + return Display.getWithNewlines(getStyleBuilder().getSkinParam().legacyReplaceBackslashNByNewline(), prettyDisplay).create(getFontConfiguration(), HorizontalAlignment.LEFT, new SpriteContainerEmpty()); } @@ -154,7 +154,7 @@ public void drawU(UGraphic ug) { ug = ug.apply(UTranslate.dx(delta / 2)); drawShape(applyColors(ug)); } else { - final TextBlock draw = Display.getWithNewlines(displayString).create(getFontConfiguration(), + final TextBlock draw = Display.getWithNewlines(getStyleBuilder().getSkinParam().legacyReplaceBackslashNByNewline(), displayString).create(getFontConfiguration(), HorizontalAlignment.LEFT, new SpriteContainerEmpty()); draw.drawU(ug); } diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawGroup.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawGroup.java index 346182887e7..e3c7b93e3a0 100644 --- a/src/net/sourceforge/plantuml/project/draw/TaskDrawGroup.java +++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawGroup.java @@ -114,7 +114,7 @@ public void drawTitle(UGraphic ug, LabelStrategy labelStrategy, double colTitles @Override protected TextBlock getTitle() { - return Display.getWithNewlines(prettyDisplay).create(getFontConfiguration(), HorizontalAlignment.LEFT, + return Display.getWithNewlines(false, prettyDisplay).create(getFontConfiguration(), HorizontalAlignment.LEFT, new SpriteContainerEmpty()); } diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java index 79ac8b36fce..2417b4efbc8 100644 --- a/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java +++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawRegular.java @@ -143,7 +143,7 @@ public void drawTitle(UGraphic ug, LabelStrategy labelStrategy, double colTitles @Override protected TextBlock getTitle() { - return Display.getWithNewlines(prettyDisplay).create(getFontConfiguration(), HorizontalAlignment.LEFT, + return Display.getWithNewlines(false, prettyDisplay).create(getFontConfiguration(), HorizontalAlignment.LEFT, new SpriteContainerEmpty()); } diff --git a/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java b/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java index ef815b51f18..88a109c023b 100644 --- a/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java +++ b/src/net/sourceforge/plantuml/project/draw/TaskDrawSeparator.java @@ -119,7 +119,7 @@ private TextBlock getTitle() { if (name == null) { return TextBlockUtils.empty(0, 0); } - return Display.getWithNewlines(this.name).create(getFontConfiguration(), HorizontalAlignment.LEFT, + return Display.getWithNewlines(false, this.name).create(getFontConfiguration(), HorizontalAlignment.LEFT, new SpriteContainerEmpty()); } diff --git a/src/net/sourceforge/plantuml/project/draw/TimeHeader.java b/src/net/sourceforge/plantuml/project/draw/TimeHeader.java index 9d171188e2b..dd5a1e1ad85 100644 --- a/src/net/sourceforge/plantuml/project/draw/TimeHeader.java +++ b/src/net/sourceforge/plantuml/project/draw/TimeHeader.java @@ -130,7 +130,7 @@ final protected FontConfiguration getFontConfiguration(UFont font, boolean bold, protected final TextBlock getTextBlock(SName param, String text, boolean bold, HColor color) { final UFont font = thParam.getStyle(SName.timeline, param).getUFont(); final FontConfiguration fontConfiguration = getFontConfiguration(font, bold, color); - return Display.getWithNewlines(text).create(fontConfiguration, HorizontalAlignment.LEFT, + return Display.getWithNewlines(false, text).create(fontConfiguration, HorizontalAlignment.LEFT, new SpriteContainerEmpty()); } diff --git a/src/net/sourceforge/plantuml/project/draw/TimeHeaderSimple.java b/src/net/sourceforge/plantuml/project/draw/TimeHeaderSimple.java index a837c08f113..e286fd586da 100644 --- a/src/net/sourceforge/plantuml/project/draw/TimeHeaderSimple.java +++ b/src/net/sourceforge/plantuml/project/draw/TimeHeaderSimple.java @@ -103,7 +103,7 @@ private void drawSimpleDayCounter(UGraphic ug, TimeScale timeScale) { value = i.getAbsoluteDayNum() + 1; final UFont font = thParam.getStyle(SName.timeline, SName.day).getUFont(); final FontConfiguration fontConfiguration = getFontConfiguration(font, false, openFontColor()); - final TextBlock num = Display.getWithNewlines("" + value).create(fontConfiguration, + final TextBlock num = Display.getWithNewlines(false, "" + value).create(fontConfiguration, HorizontalAlignment.LEFT, new SpriteContainerEmpty()); final double x1 = timeScale.getStartingPosition(i); final double x2; diff --git a/src/net/sourceforge/plantuml/salt/SaltDictionary.java b/src/net/sourceforge/plantuml/salt/SaltDictionary.java index 959712fc8e7..e0f02104262 100644 --- a/src/net/sourceforge/plantuml/salt/SaltDictionary.java +++ b/src/net/sourceforge/plantuml/salt/SaltDictionary.java @@ -145,4 +145,9 @@ public SheetBuilder sheet(FontConfiguration fontConfiguration, HorizontalAlignme return new CreoleParser(fontConfiguration, horizontalAlignment, this, creoleMode, stereo); } + @Override + public boolean legacyReplaceBackslashNByNewline() { + return false; + } + } diff --git a/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java b/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java index 1c51a28e3bd..fdfaa903576 100644 --- a/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java +++ b/src/net/sourceforge/plantuml/salt/element/ElementPyramid.java @@ -76,7 +76,7 @@ public ElementPyramid(Positionner2 positionner, TableStrategy tableStrategy, Str if (title != null) { final FontConfiguration fontConfiguration = FontConfiguration.blackBlueTrue(UFont.byDefault(10)); - this.title = Display.getWithNewlines(title).create(fontConfiguration, HorizontalAlignment.LEFT, + this.title = Display.getWithNewlines(false, title).create(fontConfiguration, HorizontalAlignment.LEFT, spriteContainer); } else { this.title = TextBlockUtils.empty(0, 0); diff --git a/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java b/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java index bfe6fd80f41..09593c49242 100644 --- a/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java +++ b/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java @@ -634,7 +634,7 @@ private TextBlock getQuantifier(StringBounder stringBounder, Link link, int n) { ISkinParam skinParam = diagram.getSkinParam(); final Style style = getStyle(); final FontConfiguration labelFont = style.getFontConfiguration(skinParam.getIHtmlColorSet()); - final TextBlock label = Display.getWithNewlines(tmp).create(labelFont, + final TextBlock label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), tmp).create(labelFont, skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam); if (TextBlockUtils.isEmpty(label, stringBounder)) return label; diff --git a/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java b/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java index 363584eb45a..30c1dbc6ae0 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java +++ b/src/net/sourceforge/plantuml/sequencediagram/LinkAnchor.java @@ -108,7 +108,7 @@ public void drawAnchor(UGraphic ug, CommonTile tile1, CommonTile tile2, ISkinPar final Rainbow rainbow = Rainbow.fromColor(color, null); - final Display display = Display.getWithNewlines(message); + final Display display = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), message); final TextBlock title = display.create(fontConfiguration, HorizontalAlignment.CENTER, skinParam); final Snake snake = Snake.create(skinParam, skinParam.arrows().asToUp(), rainbow, skinParam.arrows().asToDown()) .withLabel(title, HorizontalAlignment.CENTER); diff --git a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java index 11963750179..92b8ee1e374 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java +++ b/src/net/sourceforge/plantuml/sequencediagram/SequenceDiagram.java @@ -101,7 +101,7 @@ public SequenceDiagram(UmlSource source, Map skinMap) { @Deprecated public Participant getOrCreateParticipant(String code) { - return getOrCreateParticipant(code, Display.getWithNewlines(code)); + return getOrCreateParticipant(code, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), code)); } public Participant getOrCreateParticipant(String code, Display display) { @@ -145,7 +145,7 @@ public Participant createNewParticipant(ParticipantType type, String code, Displ if (Display.isNull(display)) { // display = Arrays.asList(code); - display = Display.getWithNewlines(code); + display = Display.getWithNewlines(legacyReplaceBackslashNByNewline(), code); } final Participant result = new Participant(type, code, display, hiddenPortions, order, getSkinParam().getCurrentStyleBuilder()); diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java index f8ac00c9a17..fdcd0a9df9a 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandArrow.java @@ -156,16 +156,16 @@ private Participant getOrCreateParticipant(SequenceDiagram system, RegexResult a final Display display; if (arg2.get(n + "CODE", 0) != null) { code = arg2.get(n + "CODE", 0); - display = Display.getWithNewlines(code); + display = Display.getWithNewlines(system.legacyReplaceBackslashNByNewline(), code); } else if (arg2.get(n + "LONG", 0) != null) { code = arg2.get(n + "LONG", 0); - display = Display.getWithNewlines(code); + display = Display.getWithNewlines(system.legacyReplaceBackslashNByNewline(), code); } else if (arg2.get(n + "LONGCODE", 0) != null) { - display = Display.getWithNewlines(arg2.get(n + "LONGCODE", 0)); + display = Display.getWithNewlines(system.legacyReplaceBackslashNByNewline(), arg2.get(n + "LONGCODE", 0)); code = arg2.get(n + "LONGCODE", 1); } else if (arg2.get(n + "CODELONG", 0) != null) { code = arg2.get(n + "CODELONG", 0); - display = Display.getWithNewlines(arg2.get(n + "CODELONG", 1)); + display = Display.getWithNewlines(system.legacyReplaceBackslashNByNewline(), arg2.get(n + "CODELONG", 1)); return system.getOrCreateParticipant(code, display); } else { throw new IllegalStateException(); @@ -257,7 +257,7 @@ else if (xInDressing1 || xInDressing2) } else { // final String message = UrlBuilder.multilineTooltip(arg.get("MESSAGE", 0)); final String message = arg.get("MESSAGE", 0); - labels = Display.getWithNewlines(message); + labels = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), message); } ArrowConfiguration config = hasDressing1butx && hasDressing2butx ? ArrowConfiguration.withDirectionBoth() diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxStart.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxStart.java index d9018b8f6f7..ffbc1b5661d 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxStart.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandBoxStart.java @@ -98,7 +98,7 @@ protected CommandExecutionResult executeArg(SequenceDiagram diagram, LineLocatio Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); final String title = argTitle == null ? "" : argTitle; - diagram.boxStart(Display.getWithNewlines(title), colors.getColor(ColorType.BACK), stereotype); + diagram.boxStart(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), title), colors.getColor(ColorType.BACK), stereotype); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandDelay.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandDelay.java index 8020396a82a..4c6a24bd624 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandDelay.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandDelay.java @@ -62,7 +62,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(SequenceDiagram diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { final Display strings = arg.get("LABEL", 0) == null ? Display.empty() - : Display.getWithNewlines(arg.get("LABEL", 0)); + : Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); diagram.delay(strings); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandDivider.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandDivider.java index 6cf46d6d70d..3acc705a44d 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandDivider.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandDivider.java @@ -63,7 +63,7 @@ static IRegex getRegexConcat() { @Override protected CommandExecutionResult executeArg(SequenceDiagram diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { - final Display strings = Display.getWithNewlines(arg.get("LABEL", 0)); + final Display strings = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); diagram.divider(strings); return CommandExecutionResult.ok(); } diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java index 056b8f86736..b7025fb0f20 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandExoArrowAny.java @@ -83,7 +83,7 @@ final protected CommandExecutionResult executeArg(SequenceDiagram diagram, LineL if (arg.get("LABEL", 0) == null) labels = Display.create(""); else - labels = Display.getWithNewlines(arg.get("LABEL", 0)); + labels = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); final boolean bothDirection = arg.get("ARROW_BOTHDRESSING", 0) != null; diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandNewpage.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandNewpage.java index 51cb249903f..81afd1d13e3 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandNewpage.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandNewpage.java @@ -65,11 +65,11 @@ static IRegex getRegexConcat() { } @Override - protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, LineLocation location, + protected CommandExecutionResult executeArg(SequenceDiagram diagram, LineLocation location, RegexResult arg, ParserPass currentPass) { final String label = arg.get("LABEL", 0); - final Display strings = label == null ? Display.NULL : Display.getWithNewlines(label); - sequenceDiagram.newpage(strings); + final Display strings = label == null ? Display.NULL : Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), label); + diagram.newpage(strings); return CommandExecutionResult.ok(); } } diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java index f541e78b4cf..18e0304db5f 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandParticipant.java @@ -94,7 +94,7 @@ final protected CommandExecutionResult executeArg(SequenceDiagram diagram, LineL Display strings = Display.NULL; if (arg.get("FULL", 0) != null) - strings = Display.getWithNewlines(arg.get("FULL", 0)); + strings = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("FULL", 0)); final String typeString1 = arg.get("TYPE", 0); final String typeCreate1 = arg.get("CREATE", 0); diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceOverSeveral.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceOverSeveral.java index 10f78fee75c..bcc76edba88 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceOverSeveral.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReferenceOverSeveral.java @@ -96,7 +96,7 @@ protected CommandExecutionResult executeArg(SequenceDiagram diagram, LineLocatio for (String s : participants) p.add(diagram.getOrCreateParticipant(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(s))); - final Display strings = Display.getWithNewlines(text); + final Display strings = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), text); final UrlBuilder b = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT); Url u = null; diff --git a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java index 0ceda53f451..d6c84dc5879 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java +++ b/src/net/sourceforge/plantuml/sequencediagram/command/CommandReturn.java @@ -96,7 +96,7 @@ protected CommandExecutionResult executeArg(SequenceDiagram diagram, LineLocatio if (color != null) arrow = arrow.withColor(HColorSet.instance().getColor(color)); - final Display display = Display.getWithNewlines(arg.get("MESSAGE", 0)); + final Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("MESSAGE", 0)); final AbstractMessage message2; if (message1 instanceof MessageExo) { final MessageExo exo1 = (MessageExo) message1; diff --git a/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java b/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java index a985dd70b67..088c0e8a755 100644 --- a/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java +++ b/src/net/sourceforge/plantuml/skin/AbstractTextualComponent.java @@ -69,7 +69,7 @@ public abstract class AbstractTextualComponent extends AbstractComponent { public AbstractTextualComponent(Style style, LineBreakStrategy maxMessageSize, int marginX1, int marginX2, int marginY, ISkinSimple spriteContainer, CharSequence label) { this(style, style, maxMessageSize, marginX1, marginX2, marginY, spriteContainer, - Display.getWithNewlines(label == null ? "" : label.toString()), false); + Display.getWithNewlines(spriteContainer.legacyReplaceBackslashNByNewline(), label == null ? "" : label.toString()), false); } public AbstractTextualComponent(Style style, LineBreakStrategy maxMessageSize, int marginX1, int marginX2, diff --git a/src/net/sourceforge/plantuml/skin/SkinParam.java b/src/net/sourceforge/plantuml/skin/SkinParam.java index 9373983d2d4..f2a85d9766b 100644 --- a/src/net/sourceforge/plantuml/skin/SkinParam.java +++ b/src/net/sourceforge/plantuml/skin/SkinParam.java @@ -105,9 +105,11 @@ public class SkinParam implements ISkinParam { // private String skin = "debug.skin"; private String skin = "plantuml.skin"; private StyleBuilder styleBuilder; + private final Pragma pragma; - private SkinParam(UmlDiagramType type) { + private SkinParam(UmlDiagramType type, Pragma pragma) { this.type = type; + this.pragma = pragma; } @Override @@ -207,14 +209,8 @@ public void applyPendingStyleMigration() { paramsPendingForStyleMigration.clear(); } - public static SkinParam create(UmlDiagramType type) { - return new SkinParam(type); - } - - public static SkinParam noShadowing(UmlDiagramType type) { - final SkinParam result = new SkinParam(type); - result.setParam("shadowing", "false"); - return result; + public static SkinParam create(UmlDiagramType type, Pragma pragma) { + return new SkinParam(type, pragma); } private final Map> cacheCleanForKey = new HashMap>(); @@ -1234,4 +1230,9 @@ public Arrows arrows() { return new ArrowsRegular(); } + @Override + public boolean legacyReplaceBackslashNByNewline() { + return true; + } + } diff --git a/src/net/sourceforge/plantuml/skin/SkinParamDelegator.java b/src/net/sourceforge/plantuml/skin/SkinParamDelegator.java index c049a4d354e..42cd58e618b 100644 --- a/src/net/sourceforge/plantuml/skin/SkinParamDelegator.java +++ b/src/net/sourceforge/plantuml/skin/SkinParamDelegator.java @@ -461,4 +461,9 @@ public Arrows arrows() { return skinParam.arrows(); } + @Override + public boolean legacyReplaceBackslashNByNewline() { + return skinParam.legacyReplaceBackslashNByNewline(); + } + } diff --git a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java index 1bc3f956e5e..10c394a35b9 100644 --- a/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java +++ b/src/net/sourceforge/plantuml/skin/rose/ComponentRoseGroupingHeader.java @@ -84,7 +84,7 @@ public ComponentRoseGroupingHeader(boolean teoz, Style style, Style styleHeader, if (strings.size() == 1 || strings.get(1) == null) { this.commentTextBlock = null; } else { - final Display display = Display.getWithNewlines("[" + strings.get(1) + "]"); + final Display display = Display.getWithNewlines(spriteContainer.legacyReplaceBackslashNByNewline(), "[" + strings.get(1) + "]"); this.commentTextBlock = display.create(smallFont2, HorizontalAlignment.LEFT, spriteContainer); } Objects.requireNonNull(this.background); diff --git a/src/net/sourceforge/plantuml/statediagram/StateDiagram.java b/src/net/sourceforge/plantuml/statediagram/StateDiagram.java index 4be61934c8f..b4f7acf26a6 100644 --- a/src/net/sourceforge/plantuml/statediagram/StateDiagram.java +++ b/src/net/sourceforge/plantuml/statediagram/StateDiagram.java @@ -93,13 +93,13 @@ public Entity getStart() { final String idShort = "*start*"; final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) - reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.CIRCLE_START, null); + reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.CIRCLE_START, null); return quark.getData(); } final String idShort = "*start*" + g.getName(); final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) - reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.CIRCLE_START, null); + reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.CIRCLE_START, null); return quark.getData(); } @@ -109,13 +109,13 @@ public Entity getEnd() { final String idShort = "*end*"; final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) - reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.CIRCLE_END, null); + reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.CIRCLE_END, null); return quark.getData(); } final String idShort = "*end*" + p.getName(); final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) - reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.CIRCLE_END, null); + reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.CIRCLE_END, null); return quark.getData(); } @@ -125,13 +125,13 @@ public Entity getHistorical() { final String idShort = "*historical*"; final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) - reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.PSEUDO_STATE, null); + reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.PSEUDO_STATE, null); return quark.getData(); } final String idShort = "*historical*" + g.getName(); final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) - reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.PSEUDO_STATE, null); + reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.PSEUDO_STATE, null); return quark.getData(); } @@ -143,7 +143,7 @@ public Entity getHistorical(String idShort) { final Quark ident = quarkInContext(true, tmp); final Entity result; if (ident.getData() == null) - result = reallyCreateLeaf(ident, Display.getWithNewlines(""), LeafType.PSEUDO_STATE, null); + result = reallyCreateLeaf(ident, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.PSEUDO_STATE, null); else result = ident.getData(); endGroup(); @@ -156,14 +156,14 @@ public Entity getDeepHistory() { final String idShort = "*deephistory*"; final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) - reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.DEEP_HISTORY, null); + reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.DEEP_HISTORY, null); return quark.getData(); } final String idShort = "*deephistory*" + g.getName(); final Quark quark = quarkInContext(true, cleanId(idShort)); if (quark.getData() == null) - reallyCreateLeaf(quark, Display.getWithNewlines(""), LeafType.DEEP_HISTORY, null); + reallyCreateLeaf(quark, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.DEEP_HISTORY, null); return quark.getData(); } @@ -177,7 +177,7 @@ public Entity getDeepHistory(String idShort) { final Quark ident = quarkInContext(true, cleanId(tmp)); final Entity result; if (ident.getData() == null) - result = reallyCreateLeaf(ident, Display.getWithNewlines(""), LeafType.DEEP_HISTORY, null); + result = reallyCreateLeaf(ident, Display.getWithNewlines(legacyReplaceBackslashNByNewline(), ""), LeafType.DEEP_HISTORY, null); else result = ident.getData(); endGroup(); diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackage2.java b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackage2.java index 1f75ece83cd..562ee3445db 100644 --- a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackage2.java +++ b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackage2.java @@ -121,7 +121,7 @@ protected CommandExecutionResult executeArg(StateDiagram diagram, LineLocation l if (display == null) display = quark.getName(); - diagram.gotoGroup(quark, Display.getWithNewlines(display), GroupType.PACKAGE, USymbols.FRAME); + diagram.gotoGroup(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display), GroupType.PACKAGE, USymbols.FRAME); final Entity p = diagram.getCurrentGroup(); final String stereotype = arg.get("STEREOTYPE", 0); if (stereotype != null) diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java index 60c4a7d79e4..c06a2764d2e 100644 --- a/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java +++ b/src/net/sourceforge/plantuml/statediagram/command/CommandCreatePackageState.java @@ -125,10 +125,10 @@ protected CommandExecutionResult executeArg(StateDiagram diagram, LineLocation l final String display = getNotNull(arg, "DISPLAY1", "DISPLAY2"); - diagram.gotoGroup(quark, Display.getWithNewlines(display == null ? quark.getName() : display), GroupType.STATE); + diagram.gotoGroup(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display == null ? quark.getName() : display), GroupType.STATE); final Entity p = diagram.getCurrentGroup(); if (display != null) - p.setDisplay(Display.getWithNewlines(display)); + p.setDisplay(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display)); final String stereotype = arg.get("STEREOTYPE", 0); if (stereotype != null) diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java b/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java index 8aa4a4ec4db..b999912bead 100644 --- a/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java +++ b/src/net/sourceforge/plantuml/statediagram/command/CommandCreateState.java @@ -134,7 +134,7 @@ protected CommandExecutionResult executeArg(StateDiagram diagram, LineLocation l Entity ent = quark.getData(); if (ent == null) - ent = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(display), type, null); + ent = diagram.reallyCreateLeaf(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display), type, null); else diagram.setLastEntity(ent); @@ -142,7 +142,7 @@ protected CommandExecutionResult executeArg(StateDiagram diagram, LineLocation l if (currentPass == ParserPass.ONE) { - ent.setDisplay(Display.getWithNewlines(display)); + ent.setDisplay(Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), display)); if (stereotype != null) ent.setStereotype(Stereotype.build(stereotype)); diff --git a/src/net/sourceforge/plantuml/statediagram/command/CommandLinkStateCommon.java b/src/net/sourceforge/plantuml/statediagram/command/CommandLinkStateCommon.java index 171cdf29c51..01038475fdf 100644 --- a/src/net/sourceforge/plantuml/statediagram/command/CommandLinkStateCommon.java +++ b/src/net/sourceforge/plantuml/statediagram/command/CommandLinkStateCommon.java @@ -120,7 +120,7 @@ protected CommandExecutionResult executeArg(StateDiagram diagram, LineLocation l final LinkType linkType = new LinkType(circleEnd ? LinkDecor.ARROW_AND_CIRCLE : LinkDecor.ARROW, crossStart ? LinkDecor.CIRCLE_CROSS : LinkDecor.NONE); - final Display label = Display.getWithNewlines(arg.get("LABEL", 0)); + final Display label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("LABEL", 0)); final LinkArg linkArg = LinkArg.build(label, lenght, diagram.getSkinParam().classAttributeIconSize() > 0); Link link = new Link(diagram, diagram.getSkinParam().getCurrentStyleBuilder(), cl1, cl2, linkType, linkArg); @@ -189,7 +189,7 @@ private Entity getEntity(StateDiagram diagram, final String code) { if (quark.getData() != null) return quark.getData(); - return diagram.reallyCreateLeaf(quark, Display.getWithNewlines(quark.getName()), LeafType.STATE, null); + return diagram.reallyCreateLeaf(quark, Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), quark.getName()), LeafType.STATE, null); } private String removeEquals(String code) { diff --git a/src/net/sourceforge/plantuml/style/ISkinSimple.java b/src/net/sourceforge/plantuml/style/ISkinSimple.java index 2c3c0a77426..3332e8da14e 100644 --- a/src/net/sourceforge/plantuml/style/ISkinSimple.java +++ b/src/net/sourceforge/plantuml/style/ISkinSimple.java @@ -69,4 +69,6 @@ public SheetBuilder sheet(FontConfiguration fontConfiguration, HorizontalAlignme public SheetBuilder sheet(FontConfiguration fontConfiguration, HorizontalAlignment horizontalAlignment, CreoleMode creoleMode, FontConfiguration stereo); + public boolean legacyReplaceBackslashNByNewline(); + } \ No newline at end of file diff --git a/src/net/sourceforge/plantuml/svek/Kal.java b/src/net/sourceforge/plantuml/svek/Kal.java index 4139cf95531..78484cc3796 100644 --- a/src/net/sourceforge/plantuml/svek/Kal.java +++ b/src/net/sourceforge/plantuml/svek/Kal.java @@ -98,7 +98,7 @@ public Kal(SvekEdge SvekEdge, String text, ISkinParam skinParam, Entity entity, final FontConfiguration font = style.getFontConfiguration(skinParam.getIHtmlColorSet()); - this.textBlock = Display.getWithNewlines(text).create7(font, HorizontalAlignment.LEFT, skinParam, + this.textBlock = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), text).create7(font, HorizontalAlignment.LEFT, skinParam, CreoleMode.SIMPLE_LINE); this.dim = this.textBlock.calculateDimension(stringBounder).delta(4, 2); diff --git a/src/net/sourceforge/plantuml/svek/SvekEdge.java b/src/net/sourceforge/plantuml/svek/SvekEdge.java index f7ddfa11e28..070170e4bee 100644 --- a/src/net/sourceforge/plantuml/svek/SvekEdge.java +++ b/src/net/sourceforge/plantuml/svek/SvekEdge.java @@ -316,13 +316,13 @@ else if (note.getPosition() == Position.TOP) if (link.getQuantifier1() == null) startTailText = null; else - startTailText = Display.getWithNewlines(link.getQuantifier1()).create(cardinalityFont, + startTailText = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), link.getQuantifier1()).create(cardinalityFont, HorizontalAlignment.CENTER, skinParam); if (link.getQuantifier2() == null) endHeadText = null; else - endHeadText = Display.getWithNewlines(link.getQuantifier2()).create(cardinalityFont, + endHeadText = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), link.getQuantifier2()).create(cardinalityFont, HorizontalAlignment.CENTER, skinParam); if (link.getType().getMiddleDecor() == LinkMiddleDecor.NONE) diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageArcCircle.java b/src/net/sourceforge/plantuml/svek/image/EntityImageArcCircle.java index b82591d6424..f2a88f1d0b2 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageArcCircle.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageArcCircle.java @@ -70,7 +70,7 @@ public EntityImageArcCircle(Entity entity) { if (stereotype == null || stereotype.getLabel(Guillemet.DOUBLE_COMPARATOR) == null) { this.stereo = null; } else { - this.stereo = Display.getWithNewlines(stereotype.getLabel(getSkinParam().guillemet())).create( + this.stereo = Display.getWithNewlines(getSkinParam().legacyReplaceBackslashNByNewline(), stereotype.getLabel(getSkinParam().guillemet())).create( FontConfiguration.create(getSkinParam(), FontParam.COMPONENT_STEREOTYPE, stereotype), HorizontalAlignment.CENTER, getSkinParam()); } diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader.java b/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader.java index a0d65eca242..78c27513603 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageClassHeader.java @@ -133,7 +133,7 @@ public EntityImageClassHeader(Entity entity, PortionShower portionShower) { .with(entity.getStereostyles()) // .getMergedStyle(getSkinParam().getCurrentStyleBuilder()); - genericBlock = Display.getWithNewlines(generic).create( + genericBlock = Display.getWithNewlines(getSkinParam().legacyReplaceBackslashNByNewline(), generic).create( FontConfiguration.create(getSkinParam(), FontParam.CLASS_STEREOTYPE, stereotype), HorizontalAlignment.CENTER, getSkinParam()); genericBlock = TextBlockUtils.withMargin(genericBlock, 1, 1); diff --git a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java index 0fdee32ccf0..ee24d3871c8 100644 --- a/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java +++ b/src/net/sourceforge/plantuml/svek/image/EntityImageDescription.java @@ -171,7 +171,7 @@ else if (symbol == USymbols.INTERFACE) ctx = new Fashion(backcolor, forecolor).withStroke(stroke).withShadow(deltaShadow).withCorner(roundCorner, diagonalCorner); - final Display codeDisplay = Display.getWithNewlines(entity.getName()); + final Display codeDisplay = Display.getWithNewlines(getSkinParam().legacyReplaceBackslashNByNewline(), entity.getName()); if ((entity.getDisplay().equalsLike(codeDisplay) && symbol.getSName() == SName.package_) || entity.getDisplay().isWhite()) desc = TextBlockUtils.empty(style.value(PName.MinimumWidth).asDouble(), 0); diff --git a/src/net/sourceforge/plantuml/text/StringLocated.java b/src/net/sourceforge/plantuml/text/StringLocated.java index 2f546fd10b9..fc4a8f7db7d 100644 --- a/src/net/sourceforge/plantuml/text/StringLocated.java +++ b/src/net/sourceforge/plantuml/text/StringLocated.java @@ -41,6 +41,7 @@ import net.sourceforge.plantuml.StringUtils; import net.sourceforge.plantuml.jaws.Jaws; +import net.sourceforge.plantuml.jaws.JawsFlags; import net.sourceforge.plantuml.utils.LineLocation; final public class StringLocated { @@ -66,19 +67,18 @@ final public class StringLocated { //} public List expandsJaws() { + if (JawsFlags.PARSE_NEW_MULTILINE_TRIPLE_EXCLAMATION_MARKS) { + final int x = s.indexOf("!!!"); + if (x == -1) + return Arrays.asList(this); + final String s1 = s.substring(0, x); + final String s2 = s.substring(x + 3); + return Arrays.asList(new StringLocated(s1, location, preprocessorError).jawsHideBackslash(), + new StringLocated(s2, location, preprocessorError).jawsHideBackslash()); + } return Arrays.asList(this); } - public List expandsJaws2() { - final int x = s.indexOf("!!!"); - if (x == -1) - return Arrays.asList(this); - final String s1 = s.substring(0, x); - final String s2 = s.substring(x + 3); - return Arrays.asList(new StringLocated(s1, location, preprocessorError).jawsHideBackslash(), - new StringLocated(s2, location, preprocessorError).jawsHideBackslash()); - } - public StringLocated jawsHideBackslash() { return new StringLocated(s.replace('\\', Jaws.BLOCK_E1_REAL_BACKSLASH), location, preprocessorError); } diff --git a/src/net/sourceforge/plantuml/timingdiagram/Player.java b/src/net/sourceforge/plantuml/timingdiagram/Player.java index 79d574c3b33..a7eb2000582 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/Player.java +++ b/src/net/sourceforge/plantuml/timingdiagram/Player.java @@ -71,7 +71,7 @@ public Player(String title, ISkinParam skinParam, TimingRuler ruler, boolean com this.skinParam = skinParam; this.compact = compact; this.ruler = ruler; - this.title = Display.getWithNewlines(title); + this.title = Display.getWithNewlines(false, title); } public boolean isCompact() { diff --git a/src/net/sourceforge/plantuml/timingdiagram/PlayerAnalog.java b/src/net/sourceforge/plantuml/timingdiagram/PlayerAnalog.java index d0a48d4da91..9e66b5565c6 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/PlayerAnalog.java +++ b/src/net/sourceforge/plantuml/timingdiagram/PlayerAnalog.java @@ -246,7 +246,7 @@ private void drawScaleLabel(UGraphic ug, double value, double fullAvailableWidth } private TextBlock getTextBlock(double value) { - final Display display = Display.getWithNewlines("" + value); + final Display display = Display.getWithNewlines(false, "" + value); return display.create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam); } diff --git a/src/net/sourceforge/plantuml/timingdiagram/PlayerBinary.java b/src/net/sourceforge/plantuml/timingdiagram/PlayerBinary.java index 94e967fd90b..d71701b5e64 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/PlayerBinary.java +++ b/src/net/sourceforge/plantuml/timingdiagram/PlayerBinary.java @@ -236,7 +236,7 @@ final protected FontConfiguration getCommentFontConfiguration() { } private TextBlock getTextBlock(String value) { - final Display display = Display.getWithNewlines(value); + final Display display = Display.getWithNewlines(false, value); return display.create(getCommentFontConfiguration(), HorizontalAlignment.LEFT, skinParam); } diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimeConstraint.java b/src/net/sourceforge/plantuml/timingdiagram/TimeConstraint.java index 7ecadd3db93..1d1fe9071e9 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/TimeConstraint.java +++ b/src/net/sourceforge/plantuml/timingdiagram/TimeConstraint.java @@ -74,7 +74,7 @@ public TimeConstraint(double marginx, TimeTick tick1, TimeTick tick2, String lab this.marginx = marginx; this.tick1 = Objects.requireNonNull(tick1); this.tick2 = Objects.requireNonNull(tick2); - this.label = Display.getWithNewlines(label); + this.label = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), label); this.skinParam = skinParam; this.styleBuilder = skinParam.getCurrentStyleBuilder(); this.config = config; diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimeMessage.java b/src/net/sourceforge/plantuml/timingdiagram/TimeMessage.java index ba80f766bfb..0fac7781cc7 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/TimeMessage.java +++ b/src/net/sourceforge/plantuml/timingdiagram/TimeMessage.java @@ -62,7 +62,7 @@ public TimeMessage(TickInPlayer tickInPlayer1, TickInPlayer tickInPlayer2, Strin this.styleBuilder = skinParam.getCurrentStyleBuilder(); this.tickInPlayer1 = tickInPlayer1; this.tickInPlayer2 = tickInPlayer2; - this.label = Display.getWithNewlines(label); + this.label = Display.getWithNewlines(false, label); this.setSpecificColor(getColor()); this.type = new LinkType(LinkDecor.NONE, LinkDecor.NONE); } diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java b/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java index df570275747..4b99a332d8a 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java +++ b/src/net/sourceforge/plantuml/timingdiagram/TimingRuler.java @@ -194,7 +194,7 @@ private TextBlock getTimeTextBlock(long time) { } private TextBlock getTimeTextBlock(String string) { - final Display display = Display.getWithNewlines(string); + final Display display = Display.getWithNewlines(false, string); final FontConfiguration fontConfiguration = FontConfiguration.create(skinParam, getStyleTimeline()); return display.create(fontConfiguration, HorizontalAlignment.LEFT, skinParam); } diff --git a/src/net/sourceforge/plantuml/timingdiagram/command/CommandHighlight.java b/src/net/sourceforge/plantuml/timingdiagram/command/CommandHighlight.java index a510604bdc1..3bca17f3fb1 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/command/CommandHighlight.java +++ b/src/net/sourceforge/plantuml/timingdiagram/command/CommandHighlight.java @@ -89,7 +89,7 @@ final protected CommandExecutionResult executeArg(TimingDiagram diagram, LineLoc throws NoSuchColorException { final TimeTick tickFrom = TimeTickBuilder.parseTimeTick("FROM", arg, diagram); final TimeTick tickTo = TimeTickBuilder.parseTimeTick("TO", arg, diagram); - final Display display = Display.getWithNewlines(arg.get("CAPTION", 0)); + final Display display = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("CAPTION", 0)); final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); return diagram.highlight(tickFrom, tickTo, display, colors); } diff --git a/src/net/sourceforge/plantuml/timingdiagram/command/CommandNote.java b/src/net/sourceforge/plantuml/timingdiagram/command/CommandNote.java index 3d985de1cd1..95840cc0e77 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/command/CommandNote.java +++ b/src/net/sourceforge/plantuml/timingdiagram/command/CommandNote.java @@ -88,7 +88,7 @@ final protected CommandExecutionResult executeArg(TimingDiagram diagram, LineLoc if (player == null) return CommandExecutionResult.error("Unkown \"" + code + "\""); - final Display note = Display.getWithNewlines(arg.get("NOTE", 0)); + final Display note = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), arg.get("NOTE", 0)); final TimeTick now = diagram.getNow(); final String stereotypeString = arg.get("STEREO", 0); diff --git a/src/net/sourceforge/plantuml/timingdiagram/graphic/Histogram.java b/src/net/sourceforge/plantuml/timingdiagram/graphic/Histogram.java index f0c5955ffba..0af3d600d4a 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/graphic/Histogram.java +++ b/src/net/sourceforge/plantuml/timingdiagram/graphic/Histogram.java @@ -411,7 +411,7 @@ private double stepHeight() { } private TextBlock getTextBlock(String value) { - final Display display = Display.getWithNewlines(value); + final Display display = Display.getWithNewlines(false, value); return display.create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam); } diff --git a/src/net/sourceforge/plantuml/timingdiagram/graphic/Ribbon.java b/src/net/sourceforge/plantuml/timingdiagram/graphic/Ribbon.java index dddd20cfd0a..dcb33a52d49 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/graphic/Ribbon.java +++ b/src/net/sourceforge/plantuml/timingdiagram/graphic/Ribbon.java @@ -117,7 +117,7 @@ private FontConfiguration getFontConfiguration() { } private TextBlock createTextBlock(String value) { - final Display display = Display.getWithNewlines(value); + final Display display = Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), value); return display.create(getFontConfiguration(), HorizontalAlignment.LEFT, skinParam); } diff --git a/src/net/sourceforge/plantuml/wbs/WBSDiagram.java b/src/net/sourceforge/plantuml/wbs/WBSDiagram.java index fec7cd62c5e..44e516e2713 100644 --- a/src/net/sourceforge/plantuml/wbs/WBSDiagram.java +++ b/src/net/sourceforge/plantuml/wbs/WBSDiagram.java @@ -141,7 +141,7 @@ public CommandExecutionResult addIdea(String code, HColor backColor, int level, label = m.group(1); stereotype = m.group(2); } - final Display display = Display.getWithNewlines(label); + final Display display = Display.getWithNewlines(legacyReplaceBackslashNByNewline(), label); return addIdea(code, backColor, level, display, Stereotype.build(stereotype), direction, shape); } diff --git a/src/net/sourceforge/plantuml/wire/CommandWLink.java b/src/net/sourceforge/plantuml/wire/CommandWLink.java index de1e3dc448e..a2f398ed2c1 100644 --- a/src/net/sourceforge/plantuml/wire/CommandWLink.java +++ b/src/net/sourceforge/plantuml/wire/CommandWLink.java @@ -106,7 +106,7 @@ protected CommandExecutionResult executeArg(WireDiagram diagram, LineLocation lo label = Display.NULL; } else { final String message = arg.get("MESSAGE", 0); - label = Display.getWithNewlines(message); + label = Display.getWithNewlines(diagram.legacyReplaceBackslashNByNewline(), message); } if (orientation == WOrientation.VERTICAL) diff --git a/src/net/sourceforge/plantuml/wire/WBlock.java b/src/net/sourceforge/plantuml/wire/WBlock.java index dbc1b57e015..1d9ddec5834 100644 --- a/src/net/sourceforge/plantuml/wire/WBlock.java +++ b/src/net/sourceforge/plantuml/wire/WBlock.java @@ -185,7 +185,7 @@ public CommandExecutionResult wmove(int level, double x, double y) { public CommandExecutionResult print(StringBounder stringBounder, ISkinParam skinParam, int level, String text) { if (level == 0) { - final WPrint print = new WPrint(skinParam, getNextPosition(), null, Display.getWithNewlines(text)); + final WPrint print = new WPrint(skinParam, getNextPosition(), null, Display.getWithNewlines(skinParam.legacyReplaceBackslashNByNewline(), text)); this.prints.add(print); this.cursor = this.cursor.compose(UTranslate.dy(print.getHeight(stringBounder))); diff --git a/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java b/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java index 3c6d26a5941..9dae2ae27a1 100644 --- a/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java +++ b/src/net/sourceforge/plantuml/yaml/YamlDiagramFactory.java @@ -95,7 +95,7 @@ public Diagram createSystem(UmlSource source, Map skinMap) { } final String title = styleExtractor.getTitle(); if (title != null) - result.setTitle(DisplayPositioned.single(Display.getWithNewlines(title), HorizontalAlignment.CENTER, + result.setTitle(DisplayPositioned.single(Display.getWithNewlines(result.legacyReplaceBackslashNByNewline(), title), HorizontalAlignment.CENTER, VerticalAlignment.CENTER)); } return result; diff --git a/test/net/sourceforge/plantuml/SkinParamTest.java b/test/net/sourceforge/plantuml/SkinParamTest.java index dd8952cb258..291a266949b 100644 --- a/test/net/sourceforge/plantuml/SkinParamTest.java +++ b/test/net/sourceforge/plantuml/SkinParamTest.java @@ -21,6 +21,7 @@ import net.sourceforge.plantuml.skin.LineParam; import net.sourceforge.plantuml.skin.Padder; import net.sourceforge.plantuml.skin.PaddingParam; +import net.sourceforge.plantuml.skin.Pragma; import net.sourceforge.plantuml.skin.SkinParam; import net.sourceforge.plantuml.skin.SplitParam; import net.sourceforge.plantuml.skin.UmlDiagramType; @@ -44,7 +45,7 @@ class SkinParamTest { @EnumSource(UmlDiagramType.class) public void testDefaultValues(UmlDiagramType umlDiagramType) { - final SkinParam skinParam = SkinParam.create(umlDiagramType); + final SkinParam skinParam = SkinParam.create(umlDiagramType, new Pragma()); final Stereotype fooStereotype = Stereotype.build("<>"); assertThat(skinParam.actorStyle()).isEqualTo(ActorStyle.STICKMAN); @@ -443,7 +444,7 @@ public void test_tabSize() { private SkinParam createSkinParam(String... keyValuePairs) { // Using SEQUENCE here is an arbitrary decision that should not affect test // outcome - final SkinParam skinParam = SkinParam.create(UmlDiagramType.SEQUENCE); + final SkinParam skinParam = SkinParam.create(UmlDiagramType.SEQUENCE, new Pragma()); for (int i = 0; i < keyValuePairs.length; i += 2) { skinParam.setParam(StringUtils.goLowerCase(keyValuePairs[i]), keyValuePairs[i + 1]); }