1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 02:49:06 +00:00
Arnaud Roques 2022-12-16 19:37:14 +01:00
parent 5deec17711
commit 4044c73d06
9 changed files with 24 additions and 23 deletions

View File

@ -49,7 +49,7 @@ public enum ComponentStyle {
case UML2:
return USymbols.COMPONENT2;
case RECTANGLE:
return USymbols.RECTANGLE;
return USymbols.COMPONENT_RECTANGLE;
}
throw new AssertionError();
}

View File

@ -94,49 +94,44 @@ public class UrlBuilder {
public Url getUrl(String s) {
Matcher2 m;
m = QUOTED.matcher(s);
if (matchesOrFind(m)) {
if (matchesOrFind(m))
return new Url(withTopUrl(m.group(1)), m.group(2), m.group(3));
}
m = ONLY_TOOLTIP.matcher(s);
if (matchesOrFind(m)) {
if (matchesOrFind(m))
return new Url("", m.group(1), null);
}
m = ONLY_TOOLTIP_AND_LABEL.matcher(s);
if (matchesOrFind(m)) {
if (matchesOrFind(m))
return new Url("", m.group(1), m.group(2));
}
m = LINK_TOOLTIP_NOLABEL.matcher(s);
if (matchesOrFind(m)) {
if (matchesOrFind(m))
return new Url(withTopUrl(m.group(1)), m.group(2), null);
}
m = LINK_WITH_OPTIONAL_TOOLTIP_WITH_OPTIONAL_LABEL.matcher(s);
if (matchesOrFind(m)) {
if (matchesOrFind(m))
return new Url(withTopUrl(m.group(1)), m.group(2), m.group(3));
}
return null;
}
private boolean matchesOrFind(Matcher2 m) {
if (mode == UrlMode.STRICT) {
if (mode == UrlMode.STRICT)
return m.matches();
} else if (mode == UrlMode.ANYWHERE) {
else if (mode == UrlMode.ANYWHERE)
return m.find();
} else {
else
throw new IllegalStateException();
}
}
private String withTopUrl(String url) {
if (url.startsWith("http:") == false && url.startsWith("https:") == false && url.startsWith("file:") == false
&& topurl != null) {
&& topurl != null)
return topurl + url;
}
return url;
}

View File

@ -68,7 +68,8 @@ public class CommandUrl extends SingleLineCommand2<AbstractEntityDiagram> {
RegexLeaf.spaceOneOrMore(), //
new RegexOptional(new RegexLeaf("is")), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")"), RegexLeaf.end()); //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")"), //
RegexLeaf.end()); //
}
@Override

View File

@ -82,7 +82,8 @@ public final class FactorySequenceNoteCommand implements SingleMultiFactoryComma
RegexLeaf.spaceZeroOrMore(), //
color().getRegex(), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), RegexLeaf.end());
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
RegexLeaf.end());
}
private IRegex getRegexConcatSingleLine() {

View File

@ -81,7 +81,8 @@ public final class FactorySequenceNoteOnArrowCommand implements SingleMultiFacto
RegexLeaf.spaceZeroOrMore(), //
ColorParser.exp1(), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), RegexLeaf.end());
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
RegexLeaf.end());
}
private IRegex getRegexConcatSingleLine() {

View File

@ -87,7 +87,8 @@ public final class FactorySequenceNoteOverSeveralCommand implements SingleMultiF
RegexLeaf.spaceZeroOrMore(), //
color().getRegex(), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), RegexLeaf.end() //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
RegexLeaf.end() //
);
}

View File

@ -83,6 +83,7 @@ public abstract class USymbols {
public final static USymbol USECASE = null;
public final static USymbol COMPONENT1 = record("COMPONENT1", new USymbolComponent1());
public final static USymbol COMPONENT2 = record("COMPONENT2", new USymbolComponent2());
public final static USymbol COMPONENT_RECTANGLE = record("COMPONENT_RECTANGLE", new USymbolRectangle(SName.component));
public final static USymbol BOUNDARY = record("BOUNDARY", new USymbolBoundary());
public final static USymbol ENTITY_DOMAIN = record("ENTITY_DOMAIN", new USymbolEntityDomain());
public final static USymbol CONTROL = record("CONTROL", new USymbolControl());

View File

@ -65,7 +65,8 @@ public class CommandUrl extends SingleLineCommand2<SequenceDiagram> {
RegexLeaf.spaceOneOrMore(), //
new RegexOptional(new RegexLeaf("is")), //
RegexLeaf.spaceZeroOrMore(), //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")"), RegexLeaf.end()); //
new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")"), //
RegexLeaf.end()); //
}
@Override

View File

@ -81,7 +81,7 @@ public class Version {
}
public static int beta() {
final int beta = 5;
final int beta = 6;
return beta;
}