From 9791fc3f66681ee3d59110806fb3244594c2ef5c Mon Sep 17 00:00:00 2001 From: matthew16550 Date: Mon, 20 Sep 2021 16:56:14 +1000 Subject: [PATCH] Rename UGraphic2.writeImageTOBEMOVED() -> UGraphic.writeToStream() & remove UGraphic2 interface. --- .../plantuml/braille/UGraphicBraille.java | 10 ++--- .../plantuml/graphic/UGraphicDelegator.java | 9 +++- .../plantuml/sudoku/GraphicsSudoku.java | 4 +- .../plantuml/ugraphic/FontChecker.java | 4 +- .../plantuml/ugraphic/ImageBuilder.java | 19 ++++---- .../plantuml/ugraphic/UGraphic.java | 4 ++ .../plantuml/ugraphic/UGraphic2.java | 44 ------------------- .../plantuml/ugraphic/UGraphicNo.java | 10 ++++- .../plantuml/ugraphic/UGraphicNull.java | 5 ++- .../ugraphic/debug/UGraphicDebug.java | 6 +-- .../plantuml/ugraphic/eps/UGraphicEps.java | 6 +-- .../plantuml/ugraphic/g2d/UGraphicG2d.java | 6 +-- .../ugraphic/html5/UGraphicHtml5.java | 6 +-- .../plantuml/ugraphic/svg/UGraphicSvg.java | 10 ++--- .../plantuml/ugraphic/tikz/UGraphicTikz.java | 10 ++--- .../plantuml/ugraphic/txt/UGraphicTxt.java | 6 +-- .../plantuml/ugraphic/visio/UGraphicVdx.java | 10 ++--- 17 files changed, 66 insertions(+), 103 deletions(-) delete mode 100644 src/net/sourceforge/plantuml/ugraphic/UGraphic2.java diff --git a/src/net/sourceforge/plantuml/braille/UGraphicBraille.java b/src/net/sourceforge/plantuml/braille/UGraphicBraille.java index 5461f910f..7b7ab56fc 100644 --- a/src/net/sourceforge/plantuml/braille/UGraphicBraille.java +++ b/src/net/sourceforge/plantuml/braille/UGraphicBraille.java @@ -34,6 +34,8 @@ */ package net.sourceforge.plantuml.braille; +import static net.sourceforge.plantuml.ugraphic.ImageBuilder.plainPngBuilder; + import java.io.IOException; import java.io.OutputStream; @@ -45,7 +47,6 @@ import net.sourceforge.plantuml.ugraphic.AbstractUGraphic; import net.sourceforge.plantuml.ugraphic.ClipContainer; import net.sourceforge.plantuml.ugraphic.UCenteredCharacter; import net.sourceforge.plantuml.ugraphic.UEllipse; -import net.sourceforge.plantuml.ugraphic.UGraphic2; import net.sourceforge.plantuml.ugraphic.UImage; import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.UPath; @@ -55,10 +56,8 @@ import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.HColor; -import static net.sourceforge.plantuml.ugraphic.ImageBuilder.plainPngBuilder; - // https://www.branah.com/braille-translator -public class UGraphicBraille extends AbstractUGraphic implements ClipContainer, UGraphic2 { +public class UGraphicBraille extends AbstractUGraphic implements ClipContainer { public static final int QUANTA = 4; private final BrailleGrid grid; @@ -121,7 +120,8 @@ public class UGraphicBraille extends AbstractUGraphic implements Cl return FileFormat.BRAILLE_PNG.getDefaultStringBounder(); } - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException { + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { plainPngBuilder(new BrailleDrawer(getGraphicObject())) .metadata(metadata) .write(os); diff --git a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java index 3d3d4a5c3..3403c9971 100644 --- a/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java +++ b/src/net/sourceforge/plantuml/graphic/UGraphicDelegator.java @@ -43,6 +43,9 @@ import net.sourceforge.plantuml.ugraphic.UShape; import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.HColor; +import java.io.IOException; +import java.io.OutputStream; + public abstract class UGraphicDelegator implements UGraphic { final private UGraphic ug; @@ -105,4 +108,8 @@ public abstract class UGraphicDelegator implements UGraphic { return ug.getDefaultBackground(); } -} \ No newline at end of file + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { + ug.writeToStream(os, metadata, dpi); + } +} diff --git a/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java b/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java index 580e75a93..6b4d9961e 100644 --- a/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java +++ b/src/net/sourceforge/plantuml/sudoku/GraphicsSudoku.java @@ -93,7 +93,7 @@ public class GraphicsSudoku { new ColorMapperIdentity(), false, 1.0, null, null, 0, "none", SvgCharSizeHack.NO_HACK, LengthAdjust.defaultValue()); drawInternal(ug); - ug.createXml(os, null); + ug.writeToStream(os, null, -1); // dpi param is not used return ImageDataSimple.ok(); } @@ -101,7 +101,7 @@ public class GraphicsSudoku { final UGraphicTikz ug = new UGraphicTikz(HColorUtils.WHITE, new ColorMapperIdentity(), 1, fileFormat == FileFormat.LATEX, TikzFontDistortion.getDefault()); drawInternal(ug); - ug.createTikz(os); + ug.writeToStream(os, null, -1); // dpi param is not used return ImageDataSimple.ok(); } diff --git a/src/net/sourceforge/plantuml/ugraphic/FontChecker.java b/src/net/sourceforge/plantuml/ugraphic/FontChecker.java index 3c38fa092..6f5afe759 100644 --- a/src/net/sourceforge/plantuml/ugraphic/FontChecker.java +++ b/src/net/sourceforge/plantuml/ugraphic/FontChecker.java @@ -175,8 +175,8 @@ public class FontChecker { public void drawU(UGraphic ug) { ug = ug.apply(HColorUtils.BLACK); ug.draw(new URectangle(dim - 1, dim - 1)); - if (ug instanceof UGraphic2) { - ug = (UGraphic2) ug.apply(new UTranslate(dim / 3, 2 * dim / 3)); + if (!(ug instanceof LimitFinder)) { + ug = ug.apply(new UTranslate(dim / 3, 2 * dim / 3)); final UText text = new UText("" + c, FontConfiguration.blackBlueTrue(font)); ug.draw(text); } diff --git a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java index b5489d75d..9a983e645 100644 --- a/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java +++ b/src/net/sourceforge/plantuml/ugraphic/ImageBuilder.java @@ -273,16 +273,15 @@ public class ImageBuilder { final Scale scale = titledDiagram == null ? null : titledDiagram.getScale(); final double scaleFactor = (scale == null ? 1 : scale.getScale(dim.getWidth(), dim.getHeight())) * getDpi() / 96.0; - final UGraphic2 ug = createUGraphic(fileFormatOption, dim, animationArg, dx, dy, scaleFactor); - UGraphic ug2 = ug; + UGraphic ug = createUGraphic(fileFormatOption, dim, animationArg, dx, dy, scaleFactor); maybeDrawBorder(ug, dim); if (randomPixel) { - drawRandomPoint(ug2); + drawRandomPoint(ug); } - ug2 = handwritten(ug2.apply(new UTranslate(margin.getLeft(), margin.getTop()))); - udrawable.drawU(ug2); - ug2.flushUg(); - ug.writeImageTOBEMOVED(os, metadata, 96); + ug = handwritten(ug.apply(new UTranslate(margin.getLeft(), margin.getTop()))); + udrawable.drawU(ug); + ug.flushUg(); + ug.writeToStream(os, metadata, 96); os.flush(); if (ug instanceof UGraphicG2d) { @@ -403,7 +402,7 @@ public class ImageBuilder { return ImageIO.read(baos.toByteArray()); } - private UGraphic2 createUGraphic(FileFormatOption option, final Dimension2D dim, Animation animationArg, double dx, + private UGraphic createUGraphic(FileFormatOption option, final Dimension2D dim, Animation animationArg, double dx, double dy, double scaleFactor) { switch (option.getFileFormat()) { case PNG: @@ -435,7 +434,7 @@ public class ImageBuilder { } } - private UGraphic2 createUGraphicSVG(double scaleFactor, Dimension2D dim) { + private UGraphic createUGraphicSVG(double scaleFactor, Dimension2D dim) { final String hoverPathColorRGB = getHoverPathColorRGB(); final LengthAdjust lengthAdjust = skinParam == null ? LengthAdjust.defaultValue() : skinParam.getlengthAdjust(); final String preserveAspectRatio = getPreserveAspectRatio(); @@ -448,7 +447,7 @@ public class ImageBuilder { } - private UGraphic2 createUGraphicPNG(double scaleFactor, final Dimension2D dim, Animation affineTransforms, + private UGraphic createUGraphicPNG(double scaleFactor, final Dimension2D dim, Animation affineTransforms, double dx, double dy, String watermark) { Color backColor = getDefaultBackColor(); diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphic.java b/src/net/sourceforge/plantuml/ugraphic/UGraphic.java index bc9665667..06193fed9 100644 --- a/src/net/sourceforge/plantuml/ugraphic/UGraphic.java +++ b/src/net/sourceforge/plantuml/ugraphic/UGraphic.java @@ -40,6 +40,9 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.HColor; +import java.io.IOException; +import java.io.OutputStream; + public interface UGraphic { public StringBounder getStringBounder(); @@ -66,4 +69,5 @@ public interface UGraphic { public HColor getDefaultBackground(); + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException; } diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphic2.java b/src/net/sourceforge/plantuml/ugraphic/UGraphic2.java deleted file mode 100644 index dd8b5710c..000000000 --- a/src/net/sourceforge/plantuml/ugraphic/UGraphic2.java +++ /dev/null @@ -1,44 +0,0 @@ -/* ======================================================================== - * PlantUML : a free UML diagram generator - * ======================================================================== - * - * (C) Copyright 2009-2020, Arnaud Roques - * - * Project Info: http://plantuml.com - * - * If you like this project or if you find it useful, you can support us at: - * - * http://plantuml.com/patreon (only 1$ per month!) - * http://plantuml.com/paypal - * - * This file is part of PlantUML. - * - * PlantUML is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * PlantUML distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public - * License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, - * USA. - * - * - * Original Author: Arnaud Roques - * - * - */ -package net.sourceforge.plantuml.ugraphic; - -import java.io.IOException; -import java.io.OutputStream; - -public interface UGraphic2 extends UGraphic { - - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException; -} diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicNo.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicNo.java index 0e73cd02d..32da15c41 100644 --- a/src/net/sourceforge/plantuml/ugraphic/UGraphicNo.java +++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicNo.java @@ -41,6 +41,9 @@ import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; +import java.io.IOException; +import java.io.OutputStream; + public abstract class UGraphicNo implements UGraphic { private final StringBounder stringBounder; @@ -104,7 +107,12 @@ public abstract class UGraphicNo implements UGraphic { public boolean matchesProperty(String propertyName) { return false; } - + + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { + throw new UnsupportedOperationException(); + } + // // Internal things // diff --git a/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java b/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java index 5a9d80999..4ebb71051 100644 --- a/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java +++ b/src/net/sourceforge/plantuml/ugraphic/UGraphicNull.java @@ -44,7 +44,7 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; -public class UGraphicNull extends AbstractUGraphic implements EnsureVisible, UGraphic2 { +public class UGraphicNull extends AbstractUGraphic implements EnsureVisible { @Override protected AbstractCommonUGraphic copyUGraphic() { @@ -63,7 +63,8 @@ public class UGraphicNull extends AbstractUGraphic implements EnsureVisi return FileFormat.PNG.getDefaultStringBounder(); } - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException { + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { } public void ensureVisible(double x, double y) { diff --git a/src/net/sourceforge/plantuml/ugraphic/debug/UGraphicDebug.java b/src/net/sourceforge/plantuml/ugraphic/debug/UGraphicDebug.java index bd95be05a..1630f4c70 100644 --- a/src/net/sourceforge/plantuml/ugraphic/debug/UGraphicDebug.java +++ b/src/net/sourceforge/plantuml/ugraphic/debug/UGraphicDebug.java @@ -55,7 +55,6 @@ import net.sourceforge.plantuml.ugraphic.UCenteredCharacter; import net.sourceforge.plantuml.ugraphic.UComment; import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UEmpty; -import net.sourceforge.plantuml.ugraphic.UGraphic2; import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.UPath; import net.sourceforge.plantuml.ugraphic.UPolygon; @@ -70,7 +69,7 @@ import net.sourceforge.plantuml.ugraphic.color.HColorMiddle; import net.sourceforge.plantuml.ugraphic.color.HColorSimple; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; -public class UGraphicDebug extends AbstractCommonUGraphic implements ClipContainer, UGraphic2 { +public class UGraphicDebug extends AbstractCommonUGraphic implements ClipContainer { private final List output; private final double scaleFactor; @@ -280,7 +279,8 @@ public class UGraphicDebug extends AbstractCommonUGraphic implements ClipContain return color.getClass().getSimpleName() + " " + new Date(); } - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException { + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { print(os, "DPI: " + dpi); print(os, "dimension: " + pointd(dim.getWidth(), dim.getHeight())); print(os, "scaleFactor: " + String.format(Locale.US, "%.4f", scaleFactor)); diff --git a/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java b/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java index f9c88b6bd..011b7206f 100644 --- a/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java +++ b/src/net/sourceforge/plantuml/ugraphic/eps/UGraphicEps.java @@ -49,7 +49,6 @@ import net.sourceforge.plantuml.ugraphic.AbstractUGraphic; import net.sourceforge.plantuml.ugraphic.ClipContainer; import net.sourceforge.plantuml.ugraphic.UCenteredCharacter; import net.sourceforge.plantuml.ugraphic.UEllipse; -import net.sourceforge.plantuml.ugraphic.UGraphic2; import net.sourceforge.plantuml.ugraphic.UImage; import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.UPath; @@ -59,7 +58,7 @@ import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.HColor; -public class UGraphicEps extends AbstractUGraphic implements ClipContainer, UGraphic2 { +public class UGraphicEps extends AbstractUGraphic implements ClipContainer { private final StringBounder stringBounder; @@ -135,7 +134,8 @@ public class UGraphicEps extends AbstractUGraphic implements ClipCo getGraphicObject().closeLink(); } - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException { + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { os.write(getEPSCode().getBytes()); } diff --git a/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java b/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java index c7174df16..ae940f500 100644 --- a/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java +++ b/src/net/sourceforge/plantuml/ugraphic/g2d/UGraphicG2d.java @@ -64,7 +64,6 @@ import net.sourceforge.plantuml.ugraphic.UChange; import net.sourceforge.plantuml.ugraphic.UClip; import net.sourceforge.plantuml.ugraphic.UEllipse; import net.sourceforge.plantuml.ugraphic.UGraphic; -import net.sourceforge.plantuml.ugraphic.UGraphic2; import net.sourceforge.plantuml.ugraphic.UImage; import net.sourceforge.plantuml.ugraphic.UImageSvg; import net.sourceforge.plantuml.ugraphic.ULine; @@ -76,7 +75,7 @@ import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.HColor; -public class UGraphicG2d extends AbstractUGraphic implements EnsureVisible, UGraphic2 { +public class UGraphicG2d extends AbstractUGraphic implements EnsureVisible { private BufferedImage bufferedImage; @@ -214,7 +213,8 @@ public class UGraphicG2d extends AbstractUGraphic implements EnsureV return getGraphicObject(); } - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException { + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { final BufferedImage im = getBufferedImage(); PngIO.write(im, os, metadata, dpi); } diff --git a/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java b/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java index 5ef77829e..059edd4e2 100644 --- a/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java +++ b/src/net/sourceforge/plantuml/ugraphic/html5/UGraphicHtml5.java @@ -42,7 +42,6 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.ugraphic.AbstractCommonUGraphic; import net.sourceforge.plantuml.ugraphic.AbstractUGraphic; import net.sourceforge.plantuml.ugraphic.ClipContainer; -import net.sourceforge.plantuml.ugraphic.UGraphic2; import net.sourceforge.plantuml.ugraphic.ULine; import net.sourceforge.plantuml.ugraphic.UPolygon; import net.sourceforge.plantuml.ugraphic.URectangle; @@ -50,7 +49,7 @@ import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.HColor; -public class UGraphicHtml5 extends AbstractUGraphic implements ClipContainer, UGraphic2 { +public class UGraphicHtml5 extends AbstractUGraphic implements ClipContainer { private final StringBounder stringBounder; @@ -86,7 +85,8 @@ public class UGraphicHtml5 extends AbstractUGraphic implements Clip return getGraphicObject().generateHtmlCode(); } - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException { + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { os.write(generateHtmlCode().getBytes()); } diff --git a/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java b/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java index a65aff8ef..3a14fed26 100644 --- a/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java +++ b/src/net/sourceforge/plantuml/ugraphic/svg/UGraphicSvg.java @@ -54,7 +54,6 @@ import net.sourceforge.plantuml.ugraphic.ClipContainer; import net.sourceforge.plantuml.ugraphic.UCenteredCharacter; import net.sourceforge.plantuml.ugraphic.UComment; import net.sourceforge.plantuml.ugraphic.UEllipse; -import net.sourceforge.plantuml.ugraphic.UGraphic2; import net.sourceforge.plantuml.ugraphic.UGroupType; import net.sourceforge.plantuml.ugraphic.UImage; import net.sourceforge.plantuml.ugraphic.UImageSvg; @@ -68,7 +67,7 @@ import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.HColor; import net.sourceforge.plantuml.ugraphic.color.HColorGradient; -public class UGraphicSvg extends AbstractUGraphic implements ClipContainer, UGraphic2 { +public class UGraphicSvg extends AbstractUGraphic implements ClipContainer { private final StringBounder stringBounder; private final boolean textAsPath2; @@ -153,7 +152,8 @@ public class UGraphicSvg extends AbstractUGraphic implements ClipCo return stringBounder; } - public void createXml(OutputStream os, String metadata) throws IOException { + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { try { if (metadata != null) { getGraphicObject().addComment(metadata); @@ -184,10 +184,6 @@ public class UGraphicSvg extends AbstractUGraphic implements ClipCo getGraphicObject().closeLink(); } - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException { - createXml(os, metadata); - } - @Override protected void drawComment(UComment comment) { getGraphicObject().addComment(comment.getComment()); diff --git a/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java b/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java index cc1a34f68..df2d10e3f 100644 --- a/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java +++ b/src/net/sourceforge/plantuml/ugraphic/tikz/UGraphicTikz.java @@ -49,7 +49,6 @@ import net.sourceforge.plantuml.ugraphic.AbstractUGraphic; import net.sourceforge.plantuml.ugraphic.ClipContainer; import net.sourceforge.plantuml.ugraphic.UCenteredCharacter; import net.sourceforge.plantuml.ugraphic.UEllipse; -import net.sourceforge.plantuml.ugraphic.UGraphic2; import net.sourceforge.plantuml.ugraphic.UImage; import net.sourceforge.plantuml.ugraphic.UImageSvg; import net.sourceforge.plantuml.ugraphic.ULine; @@ -60,7 +59,7 @@ import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.HColor; -public class UGraphicTikz extends AbstractUGraphic implements ClipContainer, UGraphic2 { +public class UGraphicTikz extends AbstractUGraphic implements ClipContainer { private final StringBounder stringBounder; private final TikzFontDistortion tikzFontDistortion; @@ -119,11 +118,8 @@ public class UGraphicTikz extends AbstractUGraphic implements Clip getGraphicObject().closeLink(); } - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException { - createTikz(os); - } - - public void createTikz(OutputStream os) throws IOException { + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { getGraphicObject().createData(os); } diff --git a/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java b/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java index 4badcdf8a..c9d407ba6 100644 --- a/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java +++ b/src/net/sourceforge/plantuml/ugraphic/txt/UGraphicTxt.java @@ -51,14 +51,13 @@ import net.sourceforge.plantuml.graphic.StringBounder; import net.sourceforge.plantuml.security.SecurityUtils; import net.sourceforge.plantuml.ugraphic.AbstractCommonUGraphic; import net.sourceforge.plantuml.ugraphic.ClipContainer; -import net.sourceforge.plantuml.ugraphic.UGraphic2; import net.sourceforge.plantuml.ugraphic.UImage; import net.sourceforge.plantuml.ugraphic.UShape; import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.color.ColorMapperIdentity; import net.sourceforge.plantuml.ugraphic.color.HColorUtils; -public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer, UGraphic2 { +public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer { private final UmlCharArea charArea; @@ -116,7 +115,8 @@ public class UGraphicTxt extends AbstractCommonUGraphic implements ClipContainer return new Dimension2DDouble(0, 0); } - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException { + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { final PrintStream ps = SecurityUtils.createPrintStream(os, true, UTF_8); getCharArea().print(ps); } diff --git a/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java b/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java index 5b17bd882..27dfafa2f 100644 --- a/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java +++ b/src/net/sourceforge/plantuml/ugraphic/visio/UGraphicVdx.java @@ -46,7 +46,6 @@ import net.sourceforge.plantuml.ugraphic.AbstractUGraphic; import net.sourceforge.plantuml.ugraphic.ClipContainer; import net.sourceforge.plantuml.ugraphic.UCenteredCharacter; import net.sourceforge.plantuml.ugraphic.UEllipse; -import net.sourceforge.plantuml.ugraphic.UGraphic2; import net.sourceforge.plantuml.ugraphic.UImage; import net.sourceforge.plantuml.ugraphic.UImageSvg; import net.sourceforge.plantuml.ugraphic.ULine; @@ -57,7 +56,7 @@ import net.sourceforge.plantuml.ugraphic.UText; import net.sourceforge.plantuml.ugraphic.color.ColorMapper; import net.sourceforge.plantuml.ugraphic.color.HColor; -public class UGraphicVdx extends AbstractUGraphic implements ClipContainer, UGraphic2 { +public class UGraphicVdx extends AbstractUGraphic implements ClipContainer { private final StringBounder stringBounder; @@ -106,11 +105,8 @@ public class UGraphicVdx extends AbstractUGraphic implements Clip return stringBounder; } - public void writeImageTOBEMOVED(OutputStream os, String metadata, int dpi) throws IOException { - createVsd(os); - } - - public void createVsd(OutputStream os) throws IOException { + @Override + public void writeToStream(OutputStream os, String metadata, int dpi) throws IOException { getGraphicObject().createVsd(os); }