Improve hyperlink color management

This commit is contained in:
Arnaud Roques 2021-11-10 22:15:26 +01:00
parent 1fbe080683
commit 9ee6179c3a
3 changed files with 19 additions and 11 deletions

View File

@ -103,9 +103,9 @@ public class FontConfiguration {
return useUnderlineForHyperlink;
}
public final HColor getHyperlinkColor() {
return hyperlinkColor;
}
// public final HColor getHyperlinkColor() {
// return hyperlinkColor;
// }
// ---
@ -170,8 +170,11 @@ public class FontConfiguration {
fontPosition, svgAttributes, true, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}
public FontConfiguration changeColor(HColor htmlColor) {
return new FontConfiguration(styles, motherFont, motherColor, currentFont, htmlColor, extendedColor,
public FontConfiguration changeColor(HColor newHtmlColor) {
if (hyperlink)
return new FontConfiguration(styles, motherFont, motherColor, currentFont, currentColor, extendedColor,
fontPosition, svgAttributes, hyperlink, newHtmlColor, useUnderlineForHyperlink, tabSize);
return new FontConfiguration(styles, motherFont, motherColor, currentFont, newHtmlColor, extendedColor,
fontPosition, svgAttributes, hyperlink, hyperlinkColor, useUnderlineForHyperlink, tabSize);
}

View File

@ -106,6 +106,8 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
final Rose rose = new Rose();
final FontConfiguration fontConfiguration;
final HorizontalAlignment horizontalAlignment;
if (UseStyle.useBetaStyle()) {
final Style style = getDefaultStyleDefinition(umlDiagramType.getStyleName())
.getMergedStyle(skinParam.getCurrentStyleBuilder());
@ -118,6 +120,9 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
this.borderColor = style.value(PName.LineColor).asColor(skinParam.getThemeStyle(),
skinParam.getIHtmlColorSet());
this.shadowing = style.value(PName.Shadowing).asDouble();
fontConfiguration = style.getFontConfiguration(skinParam.getThemeStyle(), skinParam.getIHtmlColorSet());
horizontalAlignment = style.getHorizontalAlignment();
} else {
this.shadowing = skinParam.shadowing(getEntity().getStereotype()) ? 4 : 0;
if (entity.getColors(getSkinParam()).getColor(ColorType.BACK) == null) {
@ -126,16 +131,16 @@ public class EntityImageNote extends AbstractEntityImage implements Stencil {
this.noteBackgroundColor = entity.getColors(getSkinParam()).getColor(ColorType.BACK);
}
this.borderColor = SkinParamUtils.getColor(getSkinParam(), null, ColorParam.noteBorder);
fontConfiguration = new FontConfiguration(getSkinParam(), FontParam.NOTE, null);
horizontalAlignment = skinParam.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false, null);
}
if (strings.size() == 1 && strings.get(0).length() == 0) {
textBlock = new TextBlockEmpty();
} else {
final FontConfiguration fc = new FontConfiguration(getSkinParam(), FontParam.NOTE, null);
final HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null,
false, null);
textBlock = BodyFactory.create3(strings, FontParam.NOTE, getSkinParam(), align, fc,
getSkinParam().wrapWidth());
textBlock = BodyFactory.create3(strings, FontParam.NOTE, getSkinParam(), horizontalAlignment,
fontConfiguration, getSkinParam().wrapWidth());
}
}

View File

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