1 | package org.expeditee.io;
|
---|
2 |
|
---|
3 | import java.io.IOException;
|
---|
4 |
|
---|
5 | import org.expeditee.actions.Misc;
|
---|
6 | import org.expeditee.agents.DefaultAgent;
|
---|
7 | import org.expeditee.gui.Frame;
|
---|
8 | import org.expeditee.gui.FrameGraphics;
|
---|
9 | import org.expeditee.gui.FrameIO;
|
---|
10 | import org.expeditee.items.Item;
|
---|
11 |
|
---|
12 | public 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
|
---|