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

Last change on this file since 80 was 80, checked in by ra33, 16 years ago

Added some more unit tests
Did a bunch of refactoring
AND added a few new features... @b @v were the most significant

File size: 1.2 KB
Line 
1package org.expeditee.io;
2
3import java.io.IOException;
4
5import org.expeditee.actions.Misc;
6import org.expeditee.agents.DefaultAgent;
7import org.expeditee.gui.Frame;
8import org.expeditee.gui.FrameGraphics;
9import org.expeditee.gui.FrameIO;
10import org.expeditee.items.Item;
11
12public class PNGWriter extends AbstractHTMLWriter {
13 @Override
14 protected void writeStartFrame(Frame starting) throws IOException {
15 if (_filename.equalsIgnoreCase(DefaultAgent.CLIPBOARD))
16 return;
17
18 indent();
19 String filesFolder = getFilesFolder();
20 String imageDirectory = FrameIO.EXPORTS_DIR + filesFolder;
21 String fileName = Misc.ImageFrame(starting, "PNG", imageDirectory);
22 if (fileName != null) {
23 String imageRelativeFullPath = filesFolder + fileName;
24 _writer.write("<p><img src = '" + imageRelativeFullPath
25 + "' border=1></p>");
26 _writer.write(ItemWriter.NEW_LINE);
27 } else {
28 FrameGraphics.ErrorMessage("Could not create image for "
29 + starting.getName());
30 }
31 }
32
33 @Override
34 protected void writeItem(Item item) {
35 }
36}
37
38// Get the inheritance right
39// Make sure the outline is output correctly and to the correct file
40// Output all the images into a correctly named folder xxx_files
41// Add the image links to the HTML file
42// Without annotations- option to do it with
Note: See TracBrowser for help on using the repository browser.