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

Last change on this file since 289 was 121, checked in by bjn8, 16 years ago

Added invalidation for graphics... biiiig commit. LOts of effeciency improvements - now can animate

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.FrameIO;
9import org.expeditee.gui.MessageBay;
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 MessageBay.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.