mirror of
https://github.com/octoleo/plantuml.git
synced 2024-11-25 14:27:33 +00:00
Infer svgLinkTarget instead of storing it in ImageBuilder.
This commit is contained in:
parent
f1b5a4c827
commit
7863aae1af
@ -121,7 +121,6 @@ public class ImageBuilder {
|
|||||||
private long seed = 42;
|
private long seed = 42;
|
||||||
private ISkinParam skinParam;
|
private ISkinParam skinParam;
|
||||||
private int status = 0;
|
private int status = 0;
|
||||||
private String svgLinkTarget;
|
|
||||||
private TitledDiagram titledDiagram;
|
private TitledDiagram titledDiagram;
|
||||||
private boolean randomPixel;
|
private boolean randomPixel;
|
||||||
private String warningOrError;
|
private String warningOrError;
|
||||||
@ -204,6 +203,16 @@ public class ImageBuilder {
|
|||||||
return skinParam == null ? SvgCharSizeHack.NO_HACK : skinParam;
|
return skinParam == null ? SvgCharSizeHack.NO_HACK : skinParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getSvgLinkTarget() {
|
||||||
|
if (fileFormatOption.getSvgLinkTarget() != null) {
|
||||||
|
return fileFormatOption.getSvgLinkTarget();
|
||||||
|
} else if (skinParam != null) {
|
||||||
|
return skinParam.getSvgLinkTarget();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public ImageBuilder warningOrError(String warningOrError) {
|
public ImageBuilder warningOrError(String warningOrError) {
|
||||||
this.warningOrError = warningOrError;
|
this.warningOrError = warningOrError;
|
||||||
return this;
|
return this;
|
||||||
@ -218,8 +227,6 @@ public class ImageBuilder {
|
|||||||
margin = calculateMargin(diagram);
|
margin = calculateMargin(diagram);
|
||||||
metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null;
|
metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null;
|
||||||
seed = diagram.seed();
|
seed = diagram.seed();
|
||||||
svgLinkTarget = (fileFormatOption.getSvgLinkTarget() != null)
|
|
||||||
? fileFormatOption.getSvgLinkTarget() : skinParam.getSvgLinkTarget();
|
|
||||||
titledDiagram = diagram;
|
titledDiagram = diagram;
|
||||||
warningOrError = diagram.getWarningOrError();
|
warningOrError = diagram.getWarningOrError();
|
||||||
return this;
|
return this;
|
||||||
@ -420,7 +427,7 @@ public class ImageBuilder {
|
|||||||
case ATXT:
|
case ATXT:
|
||||||
return new UGraphicTxt();
|
return new UGraphicTxt();
|
||||||
case DEBUG:
|
case DEBUG:
|
||||||
return new UGraphicDebug(scaleFactor, dim, svgLinkTarget, getHoverPathColorRGB(), seed, getPreserveAspectRatio());
|
return new UGraphicDebug(scaleFactor, dim, getSvgLinkTarget(), getHoverPathColorRGB(), seed, getPreserveAspectRatio());
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedOperationException(option.getFileFormat().toString());
|
throw new UnsupportedOperationException(option.getFileFormat().toString());
|
||||||
}
|
}
|
||||||
@ -432,6 +439,7 @@ public class ImageBuilder {
|
|||||||
final String preserveAspectRatio = getPreserveAspectRatio();
|
final String preserveAspectRatio = getPreserveAspectRatio();
|
||||||
final SvgCharSizeHack svgCharSizeHack = getSvgCharSizeHack();
|
final SvgCharSizeHack svgCharSizeHack = getSvgCharSizeHack();
|
||||||
final boolean svgDimensionStyle = skinParam == null || skinParam.svgDimensionStyle();
|
final boolean svgDimensionStyle = skinParam == null || skinParam.svgDimensionStyle();
|
||||||
|
final String svgLinkTarget = getSvgLinkTarget();
|
||||||
HColor backColor = HColorUtils.WHITE; // TODO simplify backcolor some more in a future PR
|
HColor backColor = HColorUtils.WHITE; // TODO simplify backcolor some more in a future PR
|
||||||
if (this.backcolor instanceof HColorSimple) {
|
if (this.backcolor instanceof HColorSimple) {
|
||||||
backColor = this.backcolor;
|
backColor = this.backcolor;
|
||||||
|
Loading…
Reference in New Issue
Block a user