diff --git a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java index ebb3afe6b..7685dfb09 100644 --- a/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java +++ b/src/net/sourceforge/plantuml/activitydiagram3/ActivityDiagram3.java @@ -226,15 +226,13 @@ public class ActivityDiagram3 extends UmlDiagram { final double dpiFactor = getDpiFactor(fileFormatOption, Dimension2DDouble.delta(dim, margins.getLeft() + margins.getRight(), 0)); - final HColor backcolor = skinParam.getBackgroundColor(false); - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - final ImageParameter imageParameter = new ImageParameter(this, getAnimation(), dpiFactor, metadata, - getWarningOrError(), backcolor); + final ImageParameter imageParameter = new ImageParameter(this, fileFormatOption, getAnimation(), dpiFactor, + getWarningOrError()); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } diff --git a/src/net/sourceforge/plantuml/board/BoardDiagram.java b/src/net/sourceforge/plantuml/board/BoardDiagram.java index 3e5852d99..30a1fec8e 100644 --- a/src/net/sourceforge/plantuml/board/BoardDiagram.java +++ b/src/net/sourceforge/plantuml/board/BoardDiagram.java @@ -55,10 +55,6 @@ import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.graphic.InnerStrategy; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; -import net.sourceforge.plantuml.style.PName; -import net.sourceforge.plantuml.style.SName; -import net.sourceforge.plantuml.style.Style; -import net.sourceforge.plantuml.style.StyleSignature; import net.sourceforge.plantuml.svek.TextBlockBackcolored; import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.ImageParameter; @@ -89,18 +85,9 @@ public class BoardDiagram extends UmlDiagram { final double dpiFactor = scale == null ? getScaleCoef(fileFormatOption) : scale.getScale(100, 100); final ISkinParam skinParam = getSkinParam(); - final Style style = StyleSignature.of(SName.root, SName.document, SName.mindmapDiagram) - .getMergedStyle(skinParam.getCurrentStyleBuilder()); - HColor backgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getIHtmlColorSet()); - if (backgroundColor == null) { - backgroundColor = HColorUtils.transparent(); - } - - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - - final ImageParameter imageParameter = new ImageParameter(this, skinParam.getColorMapper(), skinParam.handwritten(), - null, dpiFactor, metadata, "", backgroundColor); + final ImageParameter imageParameter = new ImageParameter(this, + fileFormatOption, null, dpiFactor, ""); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); @@ -110,7 +97,7 @@ public class BoardDiagram extends UmlDiagram { .addAdd(result); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } private TextBlockBackcolored getTextBlock() { diff --git a/src/net/sourceforge/plantuml/bpm/BpmDiagram.java b/src/net/sourceforge/plantuml/bpm/BpmDiagram.java index 7bd58e051..ae15796e5 100644 --- a/src/net/sourceforge/plantuml/bpm/BpmDiagram.java +++ b/src/net/sourceforge/plantuml/bpm/BpmDiagram.java @@ -42,7 +42,6 @@ import java.util.Deque; import java.util.List; import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.SkinParam; import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagramType; @@ -52,7 +51,6 @@ import net.sourceforge.plantuml.core.ImageData; import net.sourceforge.plantuml.graphic.UDrawable; import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.ImageParameter; -import net.sourceforge.plantuml.ugraphic.color.HColor; public class BpmDiagram extends UmlDiagram { @@ -84,16 +82,13 @@ public class BpmDiagram extends UmlDiagram { protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormatOption) throws IOException { final double dpiFactor = 1; - ISkinParam skinParam = getSkinParam(); - final HColor backcolor = skinParam.getBackgroundColor(false); - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - final ImageParameter imageParameter = new ImageParameter(this, getAnimation(), dpiFactor, metadata, - getWarningOrError(), backcolor); + final ImageParameter imageParameter = new ImageParameter(this, fileFormatOption, getAnimation(), dpiFactor, + getWarningOrError()); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); imageBuilder.setUDrawable(getUDrawable()); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } private UDrawable getUDrawable() { diff --git a/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java b/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java index 965abb1ba..d1988133b 100644 --- a/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java +++ b/src/net/sourceforge/plantuml/classdiagram/ClassDiagram.java @@ -39,7 +39,6 @@ import java.io.IOException; import java.io.OutputStream; import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.UmlDiagramType; import net.sourceforge.plantuml.core.ImageData; @@ -59,7 +58,6 @@ import net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram; import net.sourceforge.plantuml.svek.image.EntityImageClass; import net.sourceforge.plantuml.ugraphic.ImageBuilder; import net.sourceforge.plantuml.ugraphic.ImageParameter; -import net.sourceforge.plantuml.ugraphic.color.HColor; public class ClassDiagram extends AbstractClassOrObjectDiagram { @@ -200,12 +198,10 @@ public class ClassDiagram extends AbstractClassOrObjectDiagram { final RowLayout rawLayout = getRawLayout(i); fullLayout.addRowLayout(rawLayout); } - ISkinParam skinParam = getSkinParam(); - final HColor backcolor = skinParam.getBackgroundColor(false); - final ImageParameter imageParameter = new ImageParameter(this, null, 1.0, null, null, backcolor); + final ImageParameter imageParameter = new ImageParameter(this, fileFormatOption, null, 1.0, null); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); imageBuilder.setUDrawable(fullLayout); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } private RowLayout getRawLayout(int raw) { diff --git a/src/net/sourceforge/plantuml/jsondiagram/JsonDiagram.java b/src/net/sourceforge/plantuml/jsondiagram/JsonDiagram.java index 9e19b59ee..caf7a9b83 100644 --- a/src/net/sourceforge/plantuml/jsondiagram/JsonDiagram.java +++ b/src/net/sourceforge/plantuml/jsondiagram/JsonDiagram.java @@ -63,7 +63,6 @@ import net.sourceforge.plantuml.ugraphic.ImageParameter; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.color.HColor; public class JsonDiagram extends TitledDiagram { @@ -96,16 +95,15 @@ public class JsonDiagram extends TitledDiagram { final double dpiFactor = scale == null ? 1 : scale.getScale(100, 100); final ISkinParam skinParam = getSkinParam(); - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - final ImageParameter imageParameter = new ImageParameter(this, new ColorMapperIdentity(), false, null, dpiFactor, - metadata, "", null); + final ImageParameter imageParameter = new ImageParameter(this, fileFormatOption, null, dpiFactor, + ""); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); TextBlock result = getTextBlock(); result = new AnnotatedWorker(this, skinParam, fileFormatOption.getDefaultStringBounder(getSkinParam())) .addAdd(result); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, 0, os); + return imageBuilder.writeImageTOBEMOVED(0, os); } private void drawInternal(UGraphic ug) { diff --git a/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java b/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java index c2bcfd4ea..2d0acbce1 100644 --- a/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java +++ b/src/net/sourceforge/plantuml/mindmap/MindMapDiagram.java @@ -56,7 +56,6 @@ import net.sourceforge.plantuml.graphic.InnerStrategy; import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.graphic.TextBlock; import net.sourceforge.plantuml.style.NoStyleAvailableException; -import net.sourceforge.plantuml.style.PName; import net.sourceforge.plantuml.style.SName; import net.sourceforge.plantuml.style.Style; import net.sourceforge.plantuml.style.StyleBuilder; @@ -68,7 +67,6 @@ import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; import net.sourceforge.plantuml.ugraphic.color.HColor; -import net.sourceforge.plantuml.ugraphic.color.HColorUtils; public class MindMapDiagram extends UmlDiagram { @@ -99,15 +97,8 @@ public class MindMapDiagram extends UmlDiagram { final Style style = StyleSignature.of(SName.root, SName.document, SName.mindmapDiagram) .getMergedStyle(skinParam.getCurrentStyleBuilder()); - HColor backgroundColor = style.value(PName.BackGroundColor).asColor(skinParam.getIHtmlColorSet()); - if (backgroundColor == null) { - backgroundColor = HColorUtils.transparent(); - } - - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - - final ImageParameter imageParameter = new ImageParameter(this, skinParam.getColorMapper(), skinParam.handwritten(), - null, dpiFactor, metadata, "", backgroundColor); + final ImageParameter imageParameter = new ImageParameter(this, + fileFormatOption, null, dpiFactor, ""); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); @@ -117,7 +108,7 @@ public class MindMapDiagram extends UmlDiagram { .addAdd(result); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } private TextBlockBackcolored getTextBlock() { diff --git a/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java b/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java index 9c1e51c4c..191fa45e4 100644 --- a/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java +++ b/src/net/sourceforge/plantuml/nwdiag/NwDiagram.java @@ -74,7 +74,6 @@ import net.sourceforge.plantuml.ugraphic.UEmpty; import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; -import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; @@ -222,15 +221,15 @@ public class NwDiagram extends UmlDiagram { final double dpiFactor = scale == null ? 1 : scale.getScale(100, 100); final ISkinParam skinParam = getSkinParam(); - final ImageParameter imageParameter = new ImageParameter(this, new ColorMapperIdentity(), false, null, dpiFactor, "", - "", null); + final ImageParameter imageParameter = new ImageParameter(this, fileFormatOption, null, dpiFactor, + ""); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); TextBlock result = getTextBlock(); result = new AnnotatedWorker(this, skinParam, fileFormatOption.getDefaultStringBounder(getSkinParam())) .addAdd(result); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, 0, os); + return imageBuilder.writeImageTOBEMOVED(0, os); } private TextBlockBackcolored getTextBlock() { diff --git a/src/net/sourceforge/plantuml/project/GanttDiagram.java b/src/net/sourceforge/plantuml/project/GanttDiagram.java index e719dee7d..cc7eda970 100644 --- a/src/net/sourceforge/plantuml/project/GanttDiagram.java +++ b/src/net/sourceforge/plantuml/project/GanttDiagram.java @@ -99,7 +99,6 @@ import net.sourceforge.plantuml.ugraphic.ImageParameter; import net.sourceforge.plantuml.ugraphic.MinMax; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; -import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorSet; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; @@ -171,8 +170,8 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit throws IOException { final Scale scale = getScale(); final double dpiFactor = scale == null ? 1 : scale.getScale(100, 100); - final ImageParameter imageParameter = new ImageParameter(this, new ColorMapperIdentity(), false, null, dpiFactor, - getMetadata(), "", null); + final ImageParameter imageParameter = new ImageParameter(this, fileFormatOption, null, dpiFactor, + ""); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); final StringBounder stringBounder = fileFormatOption.getDefaultStringBounder(getSkinParam()); @@ -180,7 +179,7 @@ public class GanttDiagram extends TitledDiagram implements ToTaskDraw, WithSprit result = new AnnotatedWorker(this, getSkinParam(), stringBounder).addAdd(result); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed, os); + return imageBuilder.writeImageTOBEMOVED(seed, os); } public void setPrintScale(PrintScale printScale) { diff --git a/src/net/sourceforge/plantuml/salt/PSystemSalt.java b/src/net/sourceforge/plantuml/salt/PSystemSalt.java index 4aa99d7fc..a5fe27994 100644 --- a/src/net/sourceforge/plantuml/salt/PSystemSalt.java +++ b/src/net/sourceforge/plantuml/salt/PSystemSalt.java @@ -127,11 +127,8 @@ public class PSystemSalt extends TitledDiagram implements WithSprite { final Scale scale = getScale(); final double dpiFactor = scale == null ? getScaleCoef(fileFormatOption) : scale.getScale(100, 100); final ISkinParam skinParam = getSkinParam(); - HColor backcolor = skinParam.getBackgroundColor(false); - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - - final ImageParameter imageParameter = new ImageParameter(this, skinParam.getColorMapper(), - skinParam.handwritten(), null, dpiFactor, metadata, "", backcolor); + final ImageParameter imageParameter = new ImageParameter(this, + fileFormatOption, null, dpiFactor, ""); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); @@ -140,7 +137,7 @@ public class PSystemSalt extends TitledDiagram implements WithSprite { result = new AnnotatedWorker(this, skinParam, stringBounder).addAdd(result); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } catch (Exception e) { e.printStackTrace(); UmlDiagram.exportDiagramError(os, e, fileFormatOption, seed, getMetadata(), "none", diff --git a/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java b/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java index f277b6d0b..7d7367df8 100644 --- a/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java +++ b/src/net/sourceforge/plantuml/sdot/CucaDiagramFileMakerSmetana.java @@ -443,11 +443,8 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker { // } final double scale = 1; - ISkinParam skinParam = diagram.getSkinParam(); - final HColor backcolor = skinParam.getBackgroundColor(false); - final String metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null; - final ImageParameter imageParameter = new ImageParameter(diagram, diagram.getAnimation(), scale, metadata, - null, backcolor); + final ImageParameter imageParameter = new ImageParameter(diagram, fileFormatOption, diagram.getAnimation(), scale, + null); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); @@ -460,7 +457,7 @@ public class CucaDiagramFileMakerSmetana implements CucaDiagramFileMaker { // imageBuilder.setUDrawable(new Drawing(new YMirror(dim.getHeight()))); imageBuilder.setUDrawable(annotatedWorker.addAdd(new Drawing(new YMirror(dim.getHeight()), dim))); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, diagram.seed(), os); + return imageBuilder.writeImageTOBEMOVED(diagram.seed(), os); } catch (Throwable e) { SmetanaDebug.printMe(); UmlDiagram.exportDiagramError(os, e, fileFormatOption, diagram.seed(), diagram.getMetadata(), diff --git a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java index 4d3d8960d..287822a4d 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java +++ b/src/net/sourceforge/plantuml/sequencediagram/graphic/SequenceDiagramFileMakerPuma2.java @@ -194,13 +194,9 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker { // System.err.println("dpiFactor=" + dpiFactor); // System.err.println("scale=" + scale); - final String metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null; - - ISkinParam skinParam = diagram.getSkinParam(); - final HColor backcolor = skinParam.getBackgroundColor(false); final double factor = oneOf(scale, dpiFactor); - final ImageParameter imageParameter = new ImageParameter(diagram, diagram.getAnimation(), factor, metadata, - null, backcolor); + final ImageParameter imageParameter = new ImageParameter(diagram, fileFormatOption, diagram.getAnimation(), factor, + null); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); imageBuilder.setUDrawable(new UDrawable() { @@ -237,7 +233,7 @@ public class SequenceDiagramFileMakerPuma2 implements FileMaker { } }); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, diagram.seed(), os); + return imageBuilder.writeImageTOBEMOVED(diagram.seed(), os); } private void drawFooter(SequenceDiagramArea area, UGraphic ug, int page) { diff --git a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java index dd6f48cb8..90632e2fa 100644 --- a/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java +++ b/src/net/sourceforge/plantuml/sequencediagram/teoz/SequenceDiagramFileMakerTeoz.java @@ -149,18 +149,15 @@ public class SequenceDiagramFileMakerTeoz implements FileMaker { final double dpiFactor = diagram.getDpiFactor(fileFormatOption, dimTotal); final double scale = 1; - final String metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null; - ISkinParam skinParam = diagram.getSkinParam(); - final HColor backcolor = skinParam.getBackgroundColor(false); final double factor = oneOf(scale, dpiFactor); - final ImageParameter imageParameter = new ImageParameter(diagram, diagram.getAnimation(), factor, metadata, - null, backcolor); + final ImageParameter imageParameter = new ImageParameter(diagram, fileFormatOption, diagram.getAnimation(), factor, + null); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); imageBuilder.setUDrawable(new Foo(index)); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, diagram.seed(), os); + return imageBuilder.writeImageTOBEMOVED(diagram.seed(), os); } diff --git a/src/net/sourceforge/plantuml/sprite/ListSpriteDiagram.java b/src/net/sourceforge/plantuml/sprite/ListSpriteDiagram.java index 50fff6f64..dada84086 100644 --- a/src/net/sourceforge/plantuml/sprite/ListSpriteDiagram.java +++ b/src/net/sourceforge/plantuml/sprite/ListSpriteDiagram.java @@ -41,7 +41,6 @@ import java.io.OutputStream; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagramType; @@ -59,7 +58,6 @@ import net.sourceforge.plantuml.ugraphic.ImageParameter; import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; -import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; public class ListSpriteDiagram extends UmlDiagram { @@ -78,15 +76,12 @@ public class ListSpriteDiagram extends UmlDiagram { final TextBlock result = getTable(); final double dpiFactor = 1; - ISkinParam skinParam = getSkinParam(); - final HColor backcolor = skinParam.getBackgroundColor(false); - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - final ImageParameter imageParameter = new ImageParameter(this, getAnimation(), dpiFactor, metadata, - getWarningOrError(), backcolor); + final ImageParameter imageParameter = new ImageParameter(this, fileFormatOption, getAnimation(), dpiFactor, + getWarningOrError()); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } private TextBlock getTable() { diff --git a/src/net/sourceforge/plantuml/sprite/StdlibDiagram.java b/src/net/sourceforge/plantuml/sprite/StdlibDiagram.java index 984109427..9cd26aafa 100644 --- a/src/net/sourceforge/plantuml/sprite/StdlibDiagram.java +++ b/src/net/sourceforge/plantuml/sprite/StdlibDiagram.java @@ -42,7 +42,6 @@ import java.util.List; import net.sourceforge.plantuml.Dimension2DDouble; import net.sourceforge.plantuml.FileFormatOption; -import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.ISkinSimple; import net.sourceforge.plantuml.UmlDiagram; import net.sourceforge.plantuml.UmlDiagramType; @@ -65,7 +64,6 @@ import net.sourceforge.plantuml.ugraphic.ImageParameter; import net.sourceforge.plantuml.ugraphic.UFont; import net.sourceforge.plantuml.ugraphic.UGraphic; import net.sourceforge.plantuml.ugraphic.UTranslate; -import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; import net.sourceforge.plantuml.ugraphic.color.NoSuchColorException; @@ -89,15 +87,12 @@ public class StdlibDiagram extends UmlDiagram { final TextBlock result = getTable(); final double dpiFactor = 1; - ISkinParam skinParam = getSkinParam(); - final HColor backcolor = skinParam.getBackgroundColor(false); - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - final ImageParameter imageParameter = new ImageParameter(this, getAnimation(), dpiFactor, metadata, - getWarningOrError(), backcolor); + final ImageParameter imageParameter = new ImageParameter(this, fileFormatOption, getAnimation(), dpiFactor, + getWarningOrError()); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } private TextBlock getTable() { diff --git a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java index b0c4e208f..2592843bd 100644 --- a/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java +++ b/src/net/sourceforge/plantuml/svek/CucaDiagramFileMakerSvek.java @@ -124,12 +124,12 @@ public final class CucaDiagramFileMakerSvek implements CucaDiagramFileMaker { final HColor backcolor = result.getBackcolor(); final String metadata = fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null; - final ImageParameter imageParameter = new ImageParameter(diagram, diagram.getAnimation(), scale, metadata, + final ImageParameter imageParameter = new ImageParameter(diagram, fileFormatOption, diagram.getAnimation(), scale, metadata, warningOrError, backcolor); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); imageBuilder.setUDrawable(result); - final ImageData imageData = imageBuilder.writeImageTOBEMOVED(fileFormatOption, diagram.seed(), os); + final ImageData imageData = imageBuilder.writeImageTOBEMOVED(diagram.seed(), os); if (isGraphvizCrash) { ((ImageDataAbstract) imageData).setStatus(503); } diff --git a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java index 3d80996fa..f57d5a3fb 100644 --- a/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java +++ b/src/net/sourceforge/plantuml/timingdiagram/TimingDiagram.java @@ -100,11 +100,8 @@ public class TimingDiagram extends UmlDiagram implements Clocks { protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormatOption) throws IOException { final double dpiFactor = 1; - ISkinParam skinParam1 = getSkinParam(); - final HColor backcolor = skinParam1.getBackgroundColor(false); - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - final ImageParameter imageParameter = new ImageParameter(this, getAnimation(), dpiFactor, metadata, - getWarningOrError(), backcolor); + final ImageParameter imageParameter = new ImageParameter(this, fileFormatOption, getAnimation(), dpiFactor, + getWarningOrError()); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); TextBlock result = getTextBlock(); @@ -113,7 +110,7 @@ public class TimingDiagram extends UmlDiagram implements Clocks { .addAdd(result); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } private TextBlockBackcolored getTextBlock() { diff --git a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java index 26587344a..8db972a9c 100644 --- a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java +++ b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java @@ -118,6 +118,10 @@ public class ImageBuilder { this.udrawable = udrawable; } + public ImageData writeImageTOBEMOVED(long seed, OutputStream os) throws IOException { + return writeImageTOBEMOVED(param.getFileFormatOption(), seed, os); + } + public ImageData writeImageTOBEMOVED(FileFormatOption fileFormatOption, long seed, OutputStream os) throws IOException { final FileFormat fileFormat = fileFormatOption.getFileFormat(); diff --git a/src/net/sourceforge/plantuml/ugraphic/ImageParameter.java b/src/net/sourceforge/plantuml/ugraphic/ImageParameter.java index 0234075fc..67ea1ea56 100644 --- a/src/net/sourceforge/plantuml/ugraphic/ImageParameter.java +++ b/src/net/sourceforge/plantuml/ugraphic/ImageParameter.java @@ -37,6 +37,7 @@ package net.sourceforge.plantuml.ugraphic; import net.sourceforge.plantuml.ColorParam; import net.sourceforge.plantuml.CornerParam; +import net.sourceforge.plantuml.FileFormatOption; import net.sourceforge.plantuml.ISkinParam; import net.sourceforge.plantuml.LineParam; import net.sourceforge.plantuml.SvgCharSizeHack; @@ -70,6 +71,7 @@ public class ImageParameter { private final UStroke borderStroke; private final HColor borderColor; private final double borderCorner; + private final FileFormatOption fileFormatOption; public ImageParameter(ColorMapper colorMapper, boolean useHandwritten, Animation animation, double dpiFactor, String metadata, String warningOrError, ClockwiseTopRightBottomLeft margins, HColor backcolor) { @@ -88,16 +90,25 @@ public class ImageParameter { this.borderStroke = null; this.svgCharSizeHack = SvgCharSizeHack.NO_HACK; this.lengthAdjust = LengthAdjust.defaultValue(); + this.fileFormatOption = null; } - public ImageParameter(TitledDiagram diagram, ColorMapper colorMapper, boolean useHandwritten, Animation animation, double dpiFactor, - String metadata, String warningOrError, HColor backcolor) { - this(colorMapper, useHandwritten, animation, dpiFactor, metadata, warningOrError, calculateDiagramMargin(diagram), backcolor); + public ImageParameter(TitledDiagram diagram, FileFormatOption fileFormatOption, Animation animation, double dpiFactor, String warningOrError) { + this( + diagram, + fileFormatOption, + animation, + dpiFactor, + fileFormatOption.isWithMetadata() ? diagram.getMetadata() : null, + warningOrError, + diagram.getSkinParam().getBackgroundColor(false) + ); } - public ImageParameter(TitledDiagram diagram, Animation animation, double dpiFactor, String metadata, + public ImageParameter(TitledDiagram diagram, FileFormatOption fileFormatOption, Animation animation, double dpiFactor, String metadata, String warningOrError, HColor backcolor) { final ISkinParam skinParam = diagram.getSkinParam(); + this.fileFormatOption = fileFormatOption; this.colorMapper = skinParam.getColorMapper(); this.useHandwritten = skinParam.handwritten(); this.animation = animation; @@ -179,6 +190,10 @@ public class ImageParameter { return lengthAdjust; } + public FileFormatOption getFileFormatOption() { + return fileFormatOption; + } + private static ClockwiseTopRightBottomLeft calculateDiagramMargin(TitledDiagram diagram) { if (UseStyle.useBetaStyle()) { final Style style = StyleSignature.of(SName.root, SName.document).getMergedStyle(diagram.getSkinParam().getCurrentStyleBuilder()); diff --git a/src/net/sourceforge/plantuml/wbs/WBSDiagram.java b/src/net/sourceforge/plantuml/wbs/WBSDiagram.java index 37917fec2..995733aa1 100644 --- a/src/net/sourceforge/plantuml/wbs/WBSDiagram.java +++ b/src/net/sourceforge/plantuml/wbs/WBSDiagram.java @@ -83,10 +83,8 @@ public class WBSDiagram extends UmlDiagram { final double dpiFactor = scale == null ? getScaleCoef(fileFormatOption) : scale.getScale(100, 100); final ISkinParam skinParam = getSkinParam(); - HColor backcolor = skinParam.getBackgroundColor(false); - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - final ImageParameter imageParameter = new ImageParameter(this, skinParam.getColorMapper(), skinParam.handwritten(), - null, dpiFactor, metadata, "", backcolor); + final ImageParameter imageParameter = new ImageParameter(this, + fileFormatOption, null, dpiFactor, ""); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); TextBlock result = getTextBlock(); @@ -95,7 +93,7 @@ public class WBSDiagram extends UmlDiagram { .addAdd(result); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } private TextBlockBackcolored getTextBlock() { diff --git a/src/net/sourceforge/plantuml/wire/WireDiagram.java b/src/net/sourceforge/plantuml/wire/WireDiagram.java index c400ae5fb..8b76112cc 100644 --- a/src/net/sourceforge/plantuml/wire/WireDiagram.java +++ b/src/net/sourceforge/plantuml/wire/WireDiagram.java @@ -87,10 +87,8 @@ public class WireDiagram extends UmlDiagram { final double dpiFactor = scale == null ? getScaleCoef(fileFormatOption) : scale.getScale(100, 100); final ISkinParam skinParam = getSkinParam(); - HColor backcolor = skinParam.getBackgroundColor(false); - final String metadata = fileFormatOption.isWithMetadata() ? getMetadata() : null; - final ImageParameter imageParameter = new ImageParameter(this, skinParam.getColorMapper(), skinParam.handwritten(), - null, dpiFactor, metadata, "", backcolor); + final ImageParameter imageParameter = new ImageParameter(this, + fileFormatOption, null, dpiFactor, ""); final ImageBuilder imageBuilder = ImageBuilder.build(imageParameter); TextBlock result = getTextBlock(); @@ -99,7 +97,7 @@ public class WireDiagram extends UmlDiagram { .addAdd(result); imageBuilder.setUDrawable(result); - return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os); + return imageBuilder.writeImageTOBEMOVED(seed(), os); } private TextBlockBackcolored getTextBlock() {