Changeset 309
- Timestamp:
- 09/16/08 18:09:56 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Misc.java
r294 r309 2 2 3 3 import java.awt.Color; 4 import java.awt.Desktop; 4 5 import java.awt.Image; 5 6 import java.awt.image.BufferedImage; … … 16 17 import javax.imageio.ImageIO; 17 18 19 import org.expeditee.gui.Browser; 18 20 import org.expeditee.gui.DisplayIO; 19 21 import org.expeditee.gui.Frame; … … 872 874 Reminders.stop(); 873 875 } 876 877 public static void print(String file){ 878 try { 879 if (Browser._theBrowser.isVersion6()) { 880 if (Desktop.isDesktopSupported()) { 881 Desktop.getDesktop().print(new File(file)); 882 } 883 } 884 } catch (Exception e) { 885 MessageBay.errorMessage("Printing error: " + e.getMessage()); 886 } 887 } 874 888 } -
trunk/src/org/expeditee/gui/Browser.java
r298 r309 56 56 // A flag which is set once the application is exiting. 57 57 private boolean _isExiting = false; 58 59 private boolean _version6 = false; 60 61 public boolean isVersion6() { 62 return _version6; 63 } 58 64 59 65 private static boolean _initComplete = false; … … 187 193 if (version.startsWith("1.6")) { 188 194 // Set the drag and drop handler 195 _version6 = true; 189 196 setTransferHandler(FrameDNDTransferHandler.getInstance()); 190 197 } else { -
trunk/src/org/expeditee/gui/DisplayIO.java
r306 r309 69 69 * The title to display in the Title bar. 70 70 */ 71 public static final String TITLE = "Exp1 5Sep2008A";71 public static final String TITLE = "Exp16Sep2008A"; 72 72 73 73 private DisplayIO() { … … 730 730 if (_VisitedFrames[opposite].size() == 0) { 731 731 FrameIO.SuspendCache(); 732 setCurrentFrame(FrameIO.LoadFrame(UserSettings. FirstFrame), true);732 setCurrentFrame(FrameIO.LoadFrame(UserSettings.HomeFrame), true); 733 733 FrameIO.ResumeCache(); 734 734 } else { -
trunk/src/org/expeditee/gui/FrameUtils.java
r307 r309 34 34 import org.expeditee.network.FrameShare; 35 35 import org.expeditee.stats.SessionStats; 36 import org.jfree.util.ArrayUtilities;37 36 38 37 public class FrameUtils { … … 447 446 448 447 public static void DisplayHomeFrame() { 449 DisplayFrame(UserSettings. FirstFrame);448 DisplayFrame(UserSettings.HomeFrame); 450 449 } 451 450 … … 565 564 566 565 if (attribute.equals("homeframe")) { 567 String first = getLink(item, UserSettings. FirstFrame);566 String first = getLink(item, UserSettings.HomeFrame); 568 567 // do not use non-existant frames as the first frame 569 568 if (FrameIO.isValidFrameName(first)) { 570 UserSettings. FirstFrame = first;569 UserSettings.HomeFrame = first; 571 570 } 572 571 // warn the user … … 574 573 // MessageBay.warningMessage("Home frame: " + first 575 574 // + " is not a valid frame."); 576 UserSettings. FirstFrame = profile.getName();575 UserSettings.HomeFrame = profile.getName(); 577 576 } 578 577 } else if (attribute.equals("menuframe")) … … 638 637 } else if (attribute.equals("framesetdirs")) { 639 638 UserSettings.FrameDirs.addAll(getDirs(item)); 639 } else if (attribute.equals("imagedirs")) { 640 UserSettings.ImageDirs.addAll(getDirs(item)); 640 641 } else if (attribute.equals("style")) { 641 642 UserSettings.Style = getStyle(item.getChild()); … … 644 645 } 645 646 } 647 646 648 return errors; 647 649 } … … 649 651 private static List<Text> getStyle(Frame child) { 650 652 List<Text> style = new ArrayList<Text>(8); 651 for (int i = 0; i < 10; i++){653 for (int i = 0; i < 10; i++) { 652 654 style.add(null); 653 655 } … … 666 668 667 669 public static void loadFirstFrame(Frame profile) { 668 if (UserSettings. FirstFrame == null)669 UserSettings. FirstFrame = profile.getName();670 if (UserSettings.HomeFrame == null) 671 UserSettings.HomeFrame = profile.getName(); 670 672 // else { 671 Frame firstFrame = FrameIO.LoadFrame(UserSettings. FirstFrame);673 Frame firstFrame = FrameIO.LoadFrame(UserSettings.HomeFrame); 672 674 if (firstFrame == null) { 673 675 MessageBay.warningMessage("Home frame not found: " 674 + UserSettings. FirstFrame);675 UserSettings. FirstFrame = profile.getName();676 + UserSettings.HomeFrame); 677 UserSettings.HomeFrame = profile.getName(); 676 678 DisplayIO.setCurrentFrame(profile, true); 677 679 } else { -
trunk/src/org/expeditee/gui/UserSettings.java
r298 r309 16 16 public abstract class UserSettings { 17 17 18 public static List<Text> Style ;18 public static List<Text> Style = new LinkedList<Text>();; 19 19 20 20 public static int Gravity = 3; … … 38 38 public static String MenuFrame = null; 39 39 40 public static String FirstFrame = null;40 public static String HomeFrame = null; 41 41 42 42 public static List<String> FrameDirs = new LinkedList<String>(); -
trunk/src/org/expeditee/io/AbstractHTMLWriter.java
r306 r309 52 52 return; 53 53 54 writer.write(styleName + " { font-size: " + Math.round(style.getSize()) 55 + "px"); 54 Font font = style.getPaintFont(); 55 if (font == null) 56 return; 56 57 57 Font font = style.getPaintFont(); 58 if(font == null) 59 return; 58 writer.write(styleName + " { font-family: " 59 + Conversion.getCssFontFamily(font.getFamily())); 60 61 //writer.write("; font-size: " + Math.round(style.getSize()) + "px"); 60 62 61 writer.write("; font-family: " + Conversion.getCssFontFamily(font.getFamily()));62 63 if (font.isBold()) { 63 64 writer.write("; font-weight: bold"); … … 79 80 writer.write("; color: " + Conversion.getCssColor(c)); 80 81 } 81 82 82 83 c = style.getBorderColor(); 83 84 if (c != null) { … … 85 86 writer.write("; outline-style: solid"); 86 87 } 87 88 88 89 writer.write("}" + ItemWriter.NEW_LINE); 89 90 -
trunk/src/org/expeditee/io/DefaultFrameWriter.java
r306 r309 1 1 package org.expeditee.io; 2 2 3 import java.awt.Desktop; 3 4 import java.io.File; 4 5 import java.io.FileWriter; … … 11 12 12 13 import org.expeditee.agents.WriteTree; 14 import org.expeditee.gui.Browser; 13 15 import org.expeditee.gui.Frame; 14 16 import org.expeditee.gui.FrameIO; … … 126 128 return writeFrame(toWrite, null); 127 129 } 128 130 129 131 public String writeFrame(Frame toWrite, Writer writer) throws IOException { 130 132 try { … … 167 169 protected void writeEndFrame(Frame ending) throws IOException { 168 170 } 169 171 170 172 protected final void initialise(Frame start) throws IOException { 171 173 initialise(start, null); 172 174 } 173 175 174 176 protected void initialise(Frame start, Writer writer) throws IOException { 175 177 if (_filename == null) 176 _filename = FrameIO.EXPORTS_DIR 177 + getFileName(start) + _format; 178 179 if(writer != null){ 178 _filename = FrameIO.EXPORTS_DIR + getFileName(start) + _format; 179 180 if (writer != null) { 180 181 _writer = new ProxyWriter(writer); 181 182 _output = writer.toString(); 182 } else if (_filename.equalsIgnoreCase(WriteTree.CLIPBOARD)) {183 } else if (_filename.equalsIgnoreCase(WriteTree.CLIPBOARD)) { 183 184 _writer = new ProxyWriter(true); 184 185 _output = WriteTree.CLIPBOARD; … … 223 224 _writer.close(); 224 225 } 225 226 try { 227 if (Browser._theBrowser.isVersion6()) { 228 if (Desktop.isDesktopSupported()) { 229 Desktop.getDesktop().open(new File(_output)); 230 } 231 } 232 } catch (Exception e) { 233 e.printStackTrace(); 234 } 226 235 return " exported to " + _output; 227 236 } -
trunk/src/org/expeditee/io/PDFWriter.java
r306 r309 33 33 34 34 public PDFWriter() { 35 assert(UserSettings.Style != null); 35 36 if (UserSettings.Style.size() > 0) { 36 37 Text text = UserSettings.Style.get(0);
Note:
See TracChangeset
for help on using the changeset viewer.