diff --git a/tools.descartes.pavo.export.pdf/.classpath b/tools.descartes.pavo.export.pdf/.classpath deleted file mode 100644 index eca7bdba8f03f22510b7980a94dbfe10c16c0901..0000000000000000000000000000000000000000 --- a/tools.descartes.pavo.export.pdf/.classpath +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<classpath> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> - <classpathentry kind="src" path="src"/> - <classpathentry kind="output" path="bin"/> -</classpath> diff --git a/tools.descartes.pavo.export.pdf/.gitignore b/tools.descartes.pavo.export.pdf/.gitignore deleted file mode 100644 index ae3c1726048cd06b9a143e0376ed46dd9b9a8d53..0000000000000000000000000000000000000000 --- a/tools.descartes.pavo.export.pdf/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/bin/ diff --git a/tools.descartes.pavo.export.pdf/.project b/tools.descartes.pavo.export.pdf/.project deleted file mode 100644 index 349de8a6765e6e8b6db0e58a08c116ac170365a4..0000000000000000000000000000000000000000 --- a/tools.descartes.pavo.export.pdf/.project +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<projectDescription> - <name>tools.descartes.pavo.export.pdf</name> - <comment></comment> - <projects> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.ManifestBuilder</name> - <arguments> - </arguments> - </buildCommand> - <buildCommand> - <name>org.eclipse.pde.SchemaBuilder</name> - <arguments> - </arguments> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.pde.PluginNature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> diff --git a/tools.descartes.pavo.export.pdf/.settings/org.eclipse.jdt.core.prefs b/tools.descartes.pavo.export.pdf/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0c68a61dca867ceb49e79d2402935261ec3e3809..0000000000000000000000000000000000000000 --- a/tools.descartes.pavo.export.pdf/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/tools.descartes.pavo.export.pdf/META-INF/MANIFEST.MF b/tools.descartes.pavo.export.pdf/META-INF/MANIFEST.MF deleted file mode 100644 index da474803956e909ffd070d640b999354bf061d85..0000000000000000000000000000000000000000 --- a/tools.descartes.pavo.export.pdf/META-INF/MANIFEST.MF +++ /dev/null @@ -1,14 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: Extension -Bundle-SymbolicName: tools.descartes.pavo.export.pdf;singleton:=true -Bundle-Version: 1.0.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Import-Package: org.jfree.chart, - org.jfree.chart.axis;version="1.0.19", - org.jfree.chart.plot;version="1.0.19", - org.jfree.chart.title;version="1.0.19", - org.jfree.graphics2d.svg;version="3.2.0", - tools.descartes.dql.models.mapping.domain -Require-Bundle: tools.descartes.pavo, - com.itextpdf;bundle-version="5.5.10" diff --git a/tools.descartes.pavo.export.pdf/build.properties b/tools.descartes.pavo.export.pdf/build.properties deleted file mode 100644 index 98bec33aed6d7f36d1b3faa87ec4ef3da8ef5bcc..0000000000000000000000000000000000000000 --- a/tools.descartes.pavo.export.pdf/build.properties +++ /dev/null @@ -1,3 +0,0 @@ -output.. = bin/ -bin.includes = META-INF/,\ - plugin.xml diff --git a/tools.descartes.pavo.export.pdf/lib/itextpdf-5.5.10.jar b/tools.descartes.pavo.export.pdf/lib/itextpdf-5.5.10.jar deleted file mode 100644 index ec453c3e03a0a038efbb4e6dd1d7d27f05930580..0000000000000000000000000000000000000000 Binary files a/tools.descartes.pavo.export.pdf/lib/itextpdf-5.5.10.jar and /dev/null differ diff --git a/tools.descartes.pavo.export.pdf/plugin.xml b/tools.descartes.pavo.export.pdf/plugin.xml deleted file mode 100644 index dfa8c21a471b18d9c28307d7b9ed7ca6432fbc25..0000000000000000000000000000000000000000 --- a/tools.descartes.pavo.export.pdf/plugin.xml +++ /dev/null @@ -1,11 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?eclipse version="3.4"?> -<plugin> - <extension - point="tools.descartes.pavo.export"> - <client - class="tools.descartes.pavo.export.pdf.PDFExportController"> - </client> - </extension> - -</plugin> diff --git a/tools.descartes.pavo.export.pdf/readme.md b/tools.descartes.pavo.export.pdf/readme.md deleted file mode 100644 index 1910f6d7e100289bd8fab60df108d637bfbcd8c6..0000000000000000000000000000000000000000 --- a/tools.descartes.pavo.export.pdf/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# PDF Export for PAVO - -This is an extension for the PAVO library. It enables the export of the currently shown diagram as a *.pdf file. It uses the the library in package tools.descartes.pavo.export.pdf.lib \ No newline at end of file diff --git a/tools.descartes.pavo.export.pdf/src/tools/descartes/pavo/export/pdf/PDFExportController.java b/tools.descartes.pavo.export.pdf/src/tools/descartes/pavo/export/pdf/PDFExportController.java deleted file mode 100644 index 3aa17f139c1446d1e4a2ea6cc3a7fbc46d1adf30..0000000000000000000000000000000000000000 --- a/tools.descartes.pavo.export.pdf/src/tools/descartes/pavo/export/pdf/PDFExportController.java +++ /dev/null @@ -1,164 +0,0 @@ -/** - * ============================================== - * DQL : Descartes Query Language - * ============================================== - * - * (c) Copyright 2014-2016, by Juergen Walter, Fabian Gorsler, Fabian Brosig and other contributors. - * - * Project Info: http://descartes.tools/dql - * - * All rights reserved. This software is made available under the terms of the - * Eclipse Public License (EPL) v1.0 as published by the Eclipse Foundation - * http://www.eclipse.org/legal/epl-v10.html - * - * This software is 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 Eclipse Public License (EPL) - * for more details. - * - * You should have received a copy of the Eclipse Public License (EPL) - * along with this software; if not visit http://www.eclipse.org or write to - * Eclipse Foundation, Inc., 308 SW First Avenue, Suite 110, Portland, 97204 USA - * Email: license (at) eclipse.org - * - * [Java is a trademark or registered trademark of Sun Microsystems, Inc. - * in the United States and other countries.] - */ - -package tools.descartes.pavo.export.pdf; - -import java.awt.image.BufferedImage; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import org.jfree.chart.JFreeChart; - -import com.itextpdf.text.Document; -import com.itextpdf.text.DocumentException; -import com.itextpdf.text.Font; -import com.itextpdf.text.FontFactory; -import com.itextpdf.text.Image; -import com.itextpdf.text.Paragraph; -import com.itextpdf.text.Rectangle; -import com.itextpdf.text.pdf.BaseFont; -import com.itextpdf.text.pdf.PdfWriter; - -import tools.descartes.pavo.controller.IExportController; -import tools.descartes.pavo.result.ResultContainerPavo; -import tools.descartes.pavo.view.ExportDialogFrame; - -/** - * Export controller extension using the PAVO ExtensionPoint. The exported file - * is of type PDF with the width and height taken from the user interaction with - * the GUI Uses the IText library - * - * @see tools.descartes.pavo.export.pdf.itext - * @author Maximilian König <max.c.koenig@t-online.de> - * @since 2016 - */ - -public class PDFExportController implements IExportController { - String filename; - - @Override - public void export(File file, JFreeChart chart, ResultContainerPavo result) { - filename = this.updatePathToSuffix(file).getPath(); - try { - this.create(new FileOutputStream(this.updatePathToSuffix(file)), chart, ExportDialogFrame.widthStatic, - ExportDialogFrame.heightStatic); - } catch (DocumentException | IOException e) { - e.printStackTrace(); - } - - } - - @Override - public String getStringForCombo() { - return new String("PDF Export"); - } - - @Override - public String getIdentifier() { - return new String("PDF Export"); - } - - /** - * Creates PDf file. - * - * @param outputStream - * {@link OutputStream}. - * @throws DocumentException - * @throws IOException - */ - public void create(OutputStream outputStream, JFreeChart chart, int width, int height) - throws DocumentException, IOException { - Document document = null; - PdfWriter writer = null; - - try { - - BufferedImage bufferedImage = chart.createBufferedImage(width, height); - Rectangle pagesize = new Rectangle(bufferedImage.getWidth(), bufferedImage.getHeight() + 10); - - document = new Document(pagesize); - - writer = PdfWriter.getInstance(document, outputStream); - document.open(); - FontFactory.defaultEmbedding = true; - - BaseFont bf1 = BaseFont.createFont(chart.getXYPlot().getRangeAxis().getLabelFont().getName(), - BaseFont.WINANSI, true); - bf1.setSubset(true); - Font font1 = new Font(bf1, 1); - document.add(new Paragraph(" ", font1)); - // - BaseFont bf2 = BaseFont.createFont(chart.getXYPlot().getRangeAxis().getLabelFont().getName(), - BaseFont.WINANSI, true); - bf2.setSubset(true); - Font font2 = new Font(bf2, 1); - document.add(new Paragraph(" ", font2)); - - Image image = Image.getInstance(writer, bufferedImage, 1.0f); - image.setAbsolutePosition(0, 0); - document.add(image); - // release resources - document.close(); - document = null; - - writer.close(); - writer = null; - } catch (DocumentException de) { - throw de; - } catch (IOException ioe) { - throw ioe; - } finally { - // release resources - if (null != document) { - try { - document.close(); - } catch (Exception ex) { - } - } - - if (null != writer) { - try { - writer.close(); - } catch (Exception ex) { - } - } - } - } - - @Override - public File updatePathToSuffix(File file) { - String name = file.getPath(); - if (name.length() < 3 || !name.substring(name.length() - 3, name.length()).equals("pdf")) { - return new File(name + ".pdf"); - } else { - return file; - } - } - -} \ No newline at end of file diff --git a/tools.descartes.pavo.export.pdf/src/tools/descartes/pavo/export/pdf/readme.md b/tools.descartes.pavo.export.pdf/src/tools/descartes/pavo/export/pdf/readme.md deleted file mode 100644 index 1910f6d7e100289bd8fab60df108d637bfbcd8c6..0000000000000000000000000000000000000000 --- a/tools.descartes.pavo.export.pdf/src/tools/descartes/pavo/export/pdf/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# PDF Export for PAVO - -This is an extension for the PAVO library. It enables the export of the currently shown diagram as a *.pdf file. It uses the the library in package tools.descartes.pavo.export.pdf.lib \ No newline at end of file