1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 10:59:01 +00:00
This commit is contained in:
Arnaud Roques 2022-04-07 18:53:33 +02:00
parent 29cd7dce0c
commit d8c80f4110
3 changed files with 23 additions and 19 deletions

View File

@ -70,14 +70,15 @@ public class FontConfiguration {
return getFont().toStringDebug() + " " + styles.toString(); return getFont().toStringDebug() + " " + styles.toString();
} }
public static FontConfiguration create(UFont font, HColor color, HColor hyperlinkColor, boolean useUnderlineForHyperlink) { public static FontConfiguration create(UFont font, HColor color, HColor hyperlinkColor,
boolean useUnderlineForHyperlink) {
return create(font, color, hyperlinkColor, useUnderlineForHyperlink, 8); return create(font, color, hyperlinkColor, useUnderlineForHyperlink, 8);
} }
public static FontConfiguration create(UFont font, HColor color, HColor hyperlinkColor, boolean useUnderlineForHyperlink, public static FontConfiguration create(UFont font, HColor color, HColor hyperlinkColor,
int tabSize) { boolean useUnderlineForHyperlink, int tabSize) {
return new FontConfiguration(getStyles(font), font, color, font, color, null, FontPosition.NORMAL, new SvgAttributes(), false, return new FontConfiguration(getStyles(font), font, color, font, color, null, FontPosition.NORMAL,
hyperlinkColor, useUnderlineForHyperlink, tabSize); new SvgAttributes(), false, hyperlinkColor, useUnderlineForHyperlink, tabSize);
} }
public static FontConfiguration blackBlueTrue(UFont font) { public static FontConfiguration blackBlueTrue(UFont font) {
@ -91,10 +92,12 @@ public class FontConfiguration {
} }
public static FontConfiguration create(ISkinParam skinParam, Style style) { public static FontConfiguration create(ISkinParam skinParam, Style style) {
// User getStyle().getFontConfiguration(skinParam.getIHtmlColorSet()) instead ? final HColor hyperlinkColor = style.value(PName.HyperLinkColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
final boolean useUnderlineForHyperlink = skinParam.useUnderlineForHyperlink();
return create(style.getUFont(), return create(style.getUFont(),
style.value(PName.FontColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()), style.value(PName.FontColor).asColor(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet()),
skinParam.getHyperlinkColor(), skinParam.useUnderlineForHyperlink(), skinParam.getTabSize()); hyperlinkColor, useUnderlineForHyperlink, skinParam.getTabSize());
} }
// --- // ---

View File

@ -625,6 +625,14 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
if (opale) if (opale)
return; return;
if (link.isInvis())
return;
if (dotPath == null) {
Log.info("DotPath is null for " + this);
return;
}
ug.draw(link.commentForSvg()); ug.draw(link.commentForSvg());
final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class); final Map<UGroupType, String> typeIDent = new EnumMap<>(UGroupType.class);
typeIDent.put(UGroupType.CLASS, typeIDent.put(UGroupType.CLASS,
@ -648,9 +656,6 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
x += dx; x += dx;
y += dy; y += dy;
if (link.isInvis())
return;
if (this.link.getColors() != null) { if (this.link.getColors() != null) {
final HColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE); final HColor newColor = this.link.getColors().getColor(ColorType.ARROW, ColorType.LINE);
if (newColor != null) if (newColor != null)
@ -669,10 +674,6 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
ug = ug.apply(stroke); ug = ug.apply(stroke);
// double moveEndY = 0; // double moveEndY = 0;
if (dotPath == null) {
Log.info("DotPath is null for " + this);
return;
}
DotPath todraw = dotPath; DotPath todraw = dotPath;
if (link.getEntity2().isGroup() && link.getEntity2().getUSymbol() instanceof USymbolFolder) { if (link.getEntity2().isGroup() && link.getEntity2().getUSymbol() instanceof USymbolFolder) {
final Cluster endCluster = bibliotekon.getCluster((IGroup) link.getEntity2()); final Cluster endCluster = bibliotekon.getCluster((IGroup) link.getEntity2());
@ -738,7 +739,7 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
final Set<Point2D> bez = dotPath.sample(); final Set<Point2D> bez = dotPath.sample();
Point2D minPt = null; Point2D minPt = null;
double minDist = Double.MAX_VALUE; double minDist = Double.MAX_VALUE;
for (Point2D pt : square) { for (Point2D pt : square)
for (Point2D pt2 : bez) { for (Point2D pt2 : bez) {
final double distance = pt2.distance(pt); final double distance = pt2.distance(pt);
if (minPt == null || distance < minDist) { if (minPt == null || distance < minDist) {
@ -746,7 +747,7 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
minDist = distance; minDist = distance;
} }
} }
}
link.getLinkConstraint().setPosition(link, minPt); link.getLinkConstraint().setPosition(link, minPt);
link.getLinkConstraint().drawMe(ug, skinParam); link.getLinkConstraint().drawMe(ug, skinParam);
} }
@ -769,9 +770,9 @@ public class SvekLine implements Moveable, Hideable, GuideLine {
private String uniq(final Set<String> ids, final String comment) { private String uniq(final Set<String> ids, final String comment) {
boolean changed = ids.add(comment); boolean changed = ids.add(comment);
if (changed) { if (changed)
return comment; return comment;
}
int i = 1; int i = 1;
while (true) { while (true) {
final String candidate = comment + "-" + i; final String candidate = comment + "-" + i;

View File

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