1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-23 11:29:06 +00:00

Merge pull request #512 from matthew16550/ffo-3

Remove redundant FileFormatOption.affineTransform field
This commit is contained in:
arnaudroques 2021-03-29 09:20:52 +02:00 committed by GitHub
commit 8fce18246c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,7 +50,6 @@ import net.sourceforge.plantuml.graphic.StringBounder;
public final class FileFormatOption implements Serializable { public final class FileFormatOption implements Serializable {
private final FileFormat fileFormat; private final FileFormat fileFormat;
private final AffineTransform affineTransform;
private boolean withMetadata; private boolean withMetadata;
private final boolean useRedForError; private final boolean useRedForError;
private final String svgLinkTarget; private final String svgLinkTarget;
@ -65,21 +64,20 @@ public final class FileFormatOption implements Serializable {
} }
public FileFormatOption(FileFormat fileFormat) { public FileFormatOption(FileFormat fileFormat) {
this(fileFormat, null, true, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, null); this(fileFormat, true, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, null);
} }
public FileFormatOption(FileFormat fileFormat, boolean withMetadata) { public FileFormatOption(FileFormat fileFormat, boolean withMetadata) {
this(fileFormat, null, withMetadata, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null, this(fileFormat, withMetadata, false, null, false, null, TikzFontDistortion.getDefault(), 1.0, null,
null); null);
} }
private FileFormatOption(FileFormat fileFormat, AffineTransform at, boolean withMetadata, boolean useRedForError, private FileFormatOption(FileFormat fileFormat, boolean withMetadata, boolean useRedForError,
String svgLinkTarget, boolean debugsvek, String hoverColor, TikzFontDistortion tikzFontDistortion, String svgLinkTarget, boolean debugsvek, String hoverColor, TikzFontDistortion tikzFontDistortion,
double scale, String preserveAspectRatio, String watermark) { double scale, String preserveAspectRatio, String watermark) {
this.hoverColor = hoverColor; this.hoverColor = hoverColor;
this.watermark = watermark; this.watermark = watermark;
this.fileFormat = fileFormat; this.fileFormat = fileFormat;
this.affineTransform = at;
this.withMetadata = withMetadata; this.withMetadata = withMetadata;
this.useRedForError = useRedForError; this.useRedForError = useRedForError;
this.svgLinkTarget = svgLinkTarget; this.svgLinkTarget = svgLinkTarget;
@ -109,51 +107,52 @@ public final class FileFormatOption implements Serializable {
} }
public FileFormatOption withUseRedForError() { public FileFormatOption withUseRedForError() {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek, return new FileFormatOption(fileFormat, withMetadata, true, svgLinkTarget, debugsvek,
hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark); hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark);
} }
public FileFormatOption withTikzFontDistortion(TikzFontDistortion tikzFontDistortion) { public FileFormatOption withTikzFontDistortion(TikzFontDistortion tikzFontDistortion) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, true, svgLinkTarget, debugsvek, return new FileFormatOption(fileFormat, withMetadata, true, svgLinkTarget, debugsvek,
hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark); hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark);
} }
public FileFormatOption withSvgLinkTarget(String svgLinkTarget) { public FileFormatOption withSvgLinkTarget(String svgLinkTarget) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget, debugsvek, return new FileFormatOption(fileFormat, withMetadata, useRedForError, svgLinkTarget, debugsvek,
hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark); hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark);
} }
public FileFormatOption withPreserveAspectRatio(String preserveAspectRatio) { public FileFormatOption withPreserveAspectRatio(String preserveAspectRatio) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget, debugsvek, return new FileFormatOption(fileFormat, withMetadata, useRedForError, svgLinkTarget, debugsvek,
hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark); hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark);
} }
public FileFormatOption withHoverColor(String hoverColor) { public FileFormatOption withHoverColor(String hoverColor) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget, debugsvek, return new FileFormatOption(fileFormat, withMetadata, useRedForError, svgLinkTarget, debugsvek,
hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark); hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark);
} }
public FileFormatOption withScale(double scale) { public FileFormatOption withScale(double scale) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget, debugsvek, return new FileFormatOption(fileFormat, withMetadata, useRedForError, svgLinkTarget, debugsvek,
hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark); hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark);
} }
public FileFormatOption withWartermark(String watermark) { public FileFormatOption withWartermark(String watermark) {
return new FileFormatOption(fileFormat, affineTransform, withMetadata, useRedForError, svgLinkTarget, debugsvek, return new FileFormatOption(fileFormat, withMetadata, useRedForError, svgLinkTarget, debugsvek,
hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark); hoverColor, tikzFontDistortion, scale, preserveAspectRatio, watermark);
} }
@Override @Override
public String toString() { public String toString() {
return fileFormat.toString() + " " + affineTransform; return fileFormat.toString();
} }
public final FileFormat getFileFormat() { public final FileFormat getFileFormat() {
return fileFormat; return fileFormat;
} }
@Deprecated
public AffineTransform getAffineTransform() { public AffineTransform getAffineTransform() {
return affineTransform; return null;
} }
public final boolean isUseRedForError() { public final boolean isUseRedForError() {