1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-16 18:25:11 +00:00

fix: improve note syntax in sequence diagrams

https://forum.plantuml.net/17587/notes-linked-to-messages-in-sequence-diagrams
This commit is contained in:
Arnaud Roques 2023-03-14 18:50:51 +01:00
parent 4e0af3328c
commit 8f074cfbdf
4 changed files with 22 additions and 9 deletions

View File

@ -10,6 +10,7 @@ package ext.plantuml.com.ctreber.aclib.gui;
public class MOBoolean extends MonitoredObject public class MOBoolean extends MonitoredObject
{ {
// ::remove folder when __CORE__ // ::remove folder when __CORE__
// ::remove folder when __MIT__
private boolean fBoolean; private boolean fBoolean;
public MOBoolean() public MOBoolean()

View File

@ -71,10 +71,12 @@ public final class FactorySequenceNoteAcrossCommand implements SingleMultiFactor
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STYLE", "(note|hnote|rnote)"), // new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO", "(\\<\\<.*\\>\\>)?"), // new RegexLeaf("STEREO1", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("ACROSS", "(accross|across)"), // new RegexLeaf("ACROSS", "(accross|across)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO2", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), //
color().getRegex(), // color().getRegex(), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
UrlBuilder.OPTIONAL, // UrlBuilder.OPTIONAL, //
@ -88,10 +90,12 @@ public final class FactorySequenceNoteAcrossCommand implements SingleMultiFactor
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STYLE", "(note|hnote|rnote)"), // new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO", "(\\<\\<.*\\>\\>)?"), // new RegexLeaf("STEREO1", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("ACROSS", "(accross|across)"), // new RegexLeaf("ACROSS", "(accross|across)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO2", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), //
color().getRegex(), // color().getRegex(), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
UrlBuilder.OPTIONAL, // UrlBuilder.OPTIONAL, //
@ -157,7 +161,7 @@ public final class FactorySequenceNoteAcrossCommand implements SingleMultiFactor
final Note note = new Note((Participant) null, (Participant) null, display, final Note note = new Note((Participant) null, (Participant) null, display,
diagram.getSkinParam().getCurrentStyleBuilder()); diagram.getSkinParam().getCurrentStyleBuilder());
Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet());
final String stereotypeString = line0.get("STEREO", 0); final String stereotypeString = line0.getLazzy("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = Stereotype.build(stereotypeString); final Stereotype stereotype = Stereotype.build(stereotypeString);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground, colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground,

View File

@ -75,12 +75,14 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STYLE", "(note|hnote|rnote)"), // new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO", "(\\<\\<.*\\>\\>)?"), // new RegexLeaf("STEREO1", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("POSITION", "(right|left|over)"), // new RegexLeaf("POSITION", "(right|left|over)"), //
RegexLeaf.spaceOneOrMore(), // RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("PARTICIPANT", "(?:of[%s]+)?([%pLN_.@]+|[%g][^%g]+[%g])"), // new RegexLeaf("PARTICIPANT", "(?:of[%s]+)?([%pLN_.@]+|[%g][^%g]+[%g])"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO2", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), //
color().getRegex(), // color().getRegex(), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
UrlBuilder.OPTIONAL, // UrlBuilder.OPTIONAL, //
@ -94,12 +96,14 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STYLE", "(note|hnote|rnote)"), // new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO", "(\\<\\<.*\\>\\>)?"), // new RegexLeaf("STEREO1", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("POSITION", "(right|left|over)"), // new RegexLeaf("POSITION", "(right|left|over)"), //
RegexLeaf.spaceOneOrMore(), // RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("PARTICIPANT", "(?:of[%s])?([%pLN_.@]+|[%g][^%g]+[%g])"), // new RegexLeaf("PARTICIPANT", "(?:of[%s])?([%pLN_.@]+|[%g][^%g]+[%g])"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO2", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), //
color().getRegex(), // color().getRegex(), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
UrlBuilder.OPTIONAL, // UrlBuilder.OPTIONAL, //
@ -157,7 +161,7 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
final Display display = diagram.manageVariable(strings.toDisplay()); final Display display = diagram.manageVariable(strings.toDisplay());
final Note note = new Note(p, position, display, diagram.getSkinParam().getCurrentStyleBuilder()); final Note note = new Note(p, position, display, diagram.getSkinParam().getCurrentStyleBuilder());
Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet()); Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
final String stereotypeString = arg.get("STEREO", 0); final String stereotypeString = arg.getLazzy("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = Stereotype.build(stereotypeString); final Stereotype stereotype = Stereotype.build(stereotypeString);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground, colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground,

View File

@ -75,10 +75,12 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STYLE", "(note|hnote|rnote)"), // new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO", "(\\<\\<.*\\>\\>)?"), // new RegexLeaf("STEREO1", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceOneOrMore(), // RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("POSITION", "(right|left|bottom|top)"), // new RegexLeaf("POSITION", "(right|left|bottom|top)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO2", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), //
ColorParser.exp1(), // ColorParser.exp1(), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
UrlBuilder.OPTIONAL, // UrlBuilder.OPTIONAL, //
@ -90,10 +92,12 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STYLE", "(note|hnote|rnote)"), // new RegexLeaf("STYLE", "(note|hnote|rnote)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO", "(\\<\\<.*\\>\\>)?"), // new RegexLeaf("STEREO1", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceOneOrMore(), // RegexLeaf.spaceOneOrMore(), //
new RegexLeaf("POSITION", "(right|left|bottom|top)"), // new RegexLeaf("POSITION", "(right|left|bottom|top)"), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("STEREO2", "(\\<\\<.*\\>\\>)?"), //
RegexLeaf.spaceZeroOrMore(), //
ColorParser.exp1(), // ColorParser.exp1(), //
RegexLeaf.spaceZeroOrMore(), // RegexLeaf.spaceZeroOrMore(), //
UrlBuilder.OPTIONAL, // UrlBuilder.OPTIONAL, //
@ -152,7 +156,7 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
Colors colors = Colors.empty().add(ColorType.BACK, Colors colors = Colors.empty().add(ColorType.BACK,
backcolor0 == null ? null : HColorSet.instance().getColor(backcolor0)); backcolor0 == null ? null : HColorSet.instance().getColor(backcolor0));
final Note note = new Note(display, position, style, diagram.getSkinParam().getCurrentStyleBuilder()); final Note note = new Note(display, position, style, diagram.getSkinParam().getCurrentStyleBuilder());
final String stereotypeString = line0.get("STEREO", 0); final String stereotypeString = line0.getLazzy("STEREO", 0);
if (stereotypeString != null) { if (stereotypeString != null) {
final Stereotype stereotype = Stereotype.build(stereotypeString); final Stereotype stereotype = Stereotype.build(stereotypeString);
colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground, colors = colors.applyStereotypeForNote(stereotype, diagram.getSkinParam(), ColorParam.noteBackground,