source: trunk/src/org/expeditee/io/PNGWriter.java@ 1513

Last change on this file since 1513 was 1274, checked in by bln4, 5 years ago

Consistency of FrameIO path names

File size: 2.0 KB
Line 
1/**
2 * PNGWriter.java
3 * Copyright (C) 2010 New Zealand Digital Library, http://expeditee.org
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19package org.expeditee.io;
20
21import java.io.IOException;
22
23import org.expeditee.actions.Misc;
24import org.expeditee.agents.DefaultAgent;
25import org.expeditee.gui.Frame;
26import org.expeditee.gui.FrameIO;
27import org.expeditee.gui.MessageBay;
28import org.expeditee.items.Item;
29
30public class PNGWriter extends AbstractHTMLWriter {
31 @Override
32 protected void writeStartFrame(Frame starting) throws IOException {
33 if (_filename.equalsIgnoreCase(DefaultAgent.CLIPBOARD))
34 return;
35
36 indent();
37 String filesFolder = getFilesFolder();
38 String imageDirectory = FrameIO.EXPORTS_PATH + filesFolder;
39 String fileName = Misc.ImageFrame(starting, "PNG", imageDirectory);
40 if (fileName != null) {
41 String imageRelativeFullPath = filesFolder + fileName;
42 _writer.write("<p><img src = '" + imageRelativeFullPath
43 + "' border=1></p>");
44 _writer.write(ItemWriter.NEW_LINE);
45 } else {
46 MessageBay.errorMessage("Could not create image for "
47 + starting.getName());
48 }
49 }
50
51 @Override
52 protected void writeItem(Item item) {
53 }
54}
55
56// Get the inheritance right
57// Make sure the outline is output correctly and to the correct file
58// Output all the images into a correctly named folder xxx_files
59// Add the image links to the HTML file
60// Without annotations- option to do it with
Note: See TracBrowser for help on using the repository browser.