1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-06-26 11:52:36 +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
{
// ::remove folder when __CORE__
// ::remove folder when __MIT__
private boolean fBoolean;
public MOBoolean()

View File

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

View File

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

View File

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