1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 02:49:06 +00:00
Arnaud Roques 2023-01-10 18:48:14 +01:00
parent a5d39f6dda
commit cc840383e3
6 changed files with 60 additions and 21 deletions

View File

@ -53,6 +53,8 @@ import net.sourceforge.plantuml.cucadiagram.GroupType;
import net.sourceforge.plantuml.cucadiagram.Ident;
import net.sourceforge.plantuml.cucadiagram.NamespaceStrategy;
import net.sourceforge.plantuml.cucadiagram.Stereotype;
import net.sourceforge.plantuml.graphic.USymbol;
import net.sourceforge.plantuml.graphic.USymbols;
import net.sourceforge.plantuml.graphic.color.ColorParser;
import net.sourceforge.plantuml.graphic.color.ColorType;
import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException;
@ -112,8 +114,15 @@ public class CommandNamespace extends SingleLineCommand2<ClassDiagram> {
return status;
final IEntity p = diagram.getCurrentGroup();
final String stereotype = arg.get("STEREOTYPE", 0);
if (stereotype != null)
p.setStereotype(Stereotype.build(stereotype));
if (stereotype != null) {
final USymbol usymbol = USymbols.fromString(stereotype, diagram.getSkinParam().actorStyle(),
diagram.getSkinParam().componentStyle(), diagram.getSkinParam().packageStyle());
if (usymbol == null)
p.setStereotype(Stereotype.build(stereotype));
else
p.setUSymbol(usymbol);
}
final String urlString = arg.get("URL", 0);
if (urlString != null) {

View File

@ -250,6 +250,9 @@ public class StyleParser {
ins.jump();
} else if (current == '@') {
result.add(new StyleToken(StyleTokenType.AROBASE_MEDIA, readArobaseMedia(ins)));
} else if (current == '\"') {
final String s = readQuotedString(ins);
result.add(new StyleToken(StyleTokenType.STRING, s));
} else {
final String s = readString(ins);
if (s.startsWith("<"))
@ -298,6 +301,21 @@ public class StyleParser {
return result.toString();
}
private static String readQuotedString(CharInspector ins) {
final StringBuilder result = new StringBuilder();
if (ins.peek(0) != '\"')
throw new IllegalStateException();
ins.jump();
while (ins.peek(0) != 0 && ins.peek(0) != '\"') {
char ch = ins.peek(0);
ins.jump();
result.append(ch);
}
if (ins.peek(0) == '\"')
ins.jump();
return result.toString();
}
private static String readString(CharInspector ins) {
final StringBuilder result = new StringBuilder();
while (ins.peek(0) != 0) {

View File

@ -42,10 +42,16 @@ import net.sourceforge.plantuml.svek.Side;
public class ExtremityFactoryCircleCrowfoot extends AbstractExtremityFactory implements ExtremityFactory {
@Override
public UDrawable createUDrawable(XPoint2D p0, double angle, Side side) {
angle -= Math.PI / 2;
return new ExtremityCircleCrowfoot(p0, angle);
}
@Override
public UDrawable createUDrawable(XPoint2D p0, XPoint2D p1, XPoint2D p2, Side side) {
final double ortho = atan2(p0, p2);
return new ExtremityCircleCrowfoot(p1, ortho);
}
}

View File

@ -42,6 +42,12 @@ import net.sourceforge.plantuml.svek.Side;
public class ExtremityFactoryCircleLine extends AbstractExtremityFactory implements ExtremityFactory {
@Override
public UDrawable createUDrawable(XPoint2D p0, double angle, Side side) {
angle -= Math.PI / 2;
return new ExtremityCircleLine(p0, angle);
}
@Override
public UDrawable createUDrawable(XPoint2D p0, XPoint2D p1, XPoint2D p2, Side side) {
final double ortho = atan2(p0, p2);

View File

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

View File

@ -127,7 +127,7 @@ skinparam useBetaStyle false
''
'' Global Default Values
''
skinparam defaultFontName IBM Plex Sans, Noto Sans, Verdana
skinparam defaultFontName "IBM Plex Sans, Noto Sans, Verdana"
skinparam defaultFontSize 12
'skinparam dpi 125
skinparam shadowing false
@ -531,20 +531,20 @@ skinparam useBetaStyle true
boardDiagram {
node {
$primary_scheme ()
$primary_scheme()
BackGroundColor $PRIMARY
LineColor $PRIMARY_DARK
FontName IBM Plex Sans, Noto Sans, Verdana
FontName "IBM Plex Sans, Noto Sans, Verdana"
'FontColor
FontSize 12
'FontStyle bold
RoundCorner 0
'LineThickness 2
'LineStyle 10;5
'LineStyle 10-5
separator {
LineThickness $LINE_THICKNESS
LineColor $PRIMARY_DARK
'LineStyle 1;5
'LineStyle 1-5
}
}
}
@ -586,7 +586,7 @@ ganttDiagram {
FontStyle bold
'BackGroundColor GreenYellow
LineColor $PRIMARY_DARK
'LineStyle 8.0;13.0
'LineStyle 8.0-13.0
'LineThickness 3.0
}
@ -599,7 +599,7 @@ ganttDiagram {
}
separator {
BackgroundColor $PRIMARY
`LineStyle 8.0;3.0
'LineStyle 8.0-3.0
LineColor $PRIMARY
LineThickness 1.0
FontSize 12
@ -616,27 +616,27 @@ ganttDiagram {
jsonDiagram {
node {
$primary_scheme ()
$primary_scheme()
BackGroundColor $PRIMARY
LineColor $PRIMARY_DARK
FontName IBM Plex Sans, Noto Sans, Verdana
FontName "IBM Plex Sans, Noto Sans, Verdana"
'FontColor
FontSize 12
'FontStyle bold
RoundCorner 0
'LineThickness 2
'LineStyle 10;5
'LineStyle 10-5
separator {
LineThickness $LINE_THICKNESS
LineColor $PRIMARY_DARK
'LineStyle 1;5
'LineStyle 1-5
}
}
arrow {
BackGroundColor $PRIMARY_DARK
LineColor $PRIMARY_DARK
LineThickness $LINE_THICKNESS
LineStyle 3;6
LineStyle 3-6
}
highlight {
BackGroundColor $PRIMARY_DARK
@ -739,27 +739,27 @@ wireDiagram {
yamlDiagram {
node {
$primary_scheme ()
$primary_scheme()
BackGroundColor $PRIMARY
LineColor $PRIMARY_DARK
FontName IBM Plex Sans, Noto Sans, Verdana
FontName "IBM Plex Sans, Noto Sans, Verdana"
'FontColor
FontSize 12
'FontStyle bold
RoundCorner 0
'LineThickness 2
'LineStyle 10;5
'LineStyle 10-5
separator {
LineThickness $LINE_THICKNESS
LineColor $PRIMARY_DARK
'LineStyle 1;5
'LineStyle 1-5
}
}
arrow {
BackGroundColor $PRIMARY_DARK
LineColor $PRIMARY_DARK
LineThickness $LINE_THICKNESS
LineStyle 3;6
LineStyle 3-6
}
highlight {
BackGroundColor $PRIMARY_DARK