Changeset 67 for trunk/src/org/expeditee/io/ExpWriter.java
- Timestamp:
- 05/19/08 12:03:18 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/io/ExpWriter.java
r58 r67 1 1 package org.expeditee.io; 2 2 3 import java.awt.Rectangle;4 3 import java.io.File; 5 4 import java.io.FileWriter; … … 7 6 import java.lang.reflect.Method; 8 7 import java.util.Iterator; 9 import java.util.LinkedHashMap;10 8 import java.util.LinkedList; 11 9 import java.util.List; … … 17 15 import org.expeditee.items.Line; 18 16 import org.expeditee.items.Picture; 19 import org.expeditee.items.Text;20 17 import org.expeditee.items.WidgetCorner; 21 18 import org.expeditee.items.WidgetEdge; … … 34 31 private StringBuilder _stringWriter = null; 35 32 36 // keep track of methods that are put on the same line37 private static LinkedHashMap<String, Method> _ItemTags = null;38 39 private static LinkedHashMap<String, Method> _FrameTags = null;40 41 33 private static final char TERMINATOR = 'Z'; 42 34 43 35 public ExpWriter() { 44 if (_ItemTags != null && _FrameTags != null) 45 return; 46 47 _ItemTags = new LinkedHashMap<String, Method>(); 48 _FrameTags = new LinkedHashMap<String, Method>(); 49 50 Class[] param = {}; 51 52 try { 53 _FrameTags.put("V", Frame.class.getMethod("getVersion", param)); 54 _FrameTags.put("p", Frame.class.getMethod("getProtection", param)); 55 _FrameTags.put("U", Frame.class.getMethod("getOwner", param)); 56 _FrameTags.put("D", Frame.class.getMethod("getDateCreated", param)); 57 _FrameTags.put("M", Frame.class.getMethod("getLastModifyUser", 58 param)); 59 _FrameTags.put("d", Frame.class.getMethod("getLastModifyDate", 60 param)); 61 _FrameTags.put("F", Frame.class.getMethod("getFrozenDate", param)); 62 63 _FrameTags.put("O", Frame.class.getMethod("getForegroundColor", 64 param)); 65 _FrameTags.put("B", Frame.class.getMethod("getBackgroundColor", 66 param)); 67 68 _ItemTags.put("S", Item.class.getMethod("getTypeAndID", param)); 69 _ItemTags.put("s", Item.class.getMethod("getDateCreated", param)); 70 _ItemTags.put("d", Item.class.getMethod("getColor", param)); 71 _ItemTags.put("G", Item.class 72 .getMethod("getBackgroundColor", param)); 73 _ItemTags.put("P", Item.class.getMethod("getPosition", param)); 74 _ItemTags.put("F", Item.class.getMethod("getLink", param)); 75 _ItemTags.put("X", Item.class.getMethod("getAction", param)); 76 _ItemTags.put("x", Item.class.getMethod("getActionMark", param)); 77 _ItemTags.put("U", Item.class.getMethod("getActionCursorEnter", 78 param)); 79 _ItemTags.put("V", Item.class.getMethod("getActionCursorLeave", 80 param)); 81 _ItemTags.put("W", Item.class.getMethod("getActionEnterFrame", 82 param)); 83 _ItemTags.put("Y", Item.class.getMethod("getActionLeaveFrame", 84 param)); 85 _ItemTags.put("D", Item.class.getMethod("getData", param)); 86 _ItemTags.put("u", Item.class.getMethod("getHighlight", param)); 87 _ItemTags.put("e", Item.class.getMethod("getFillColor", param)); 88 _ItemTags.put("i", Item.class.getMethod("getFillPattern", param)); 89 _ItemTags.put("o", Item.class.getMethod("getOwner", param)); 90 _ItemTags.put("n", Item.class.getMethod("getLinkMark", param)); 91 _ItemTags.put("q", Item.class.getMethod("getLinkFrameset", param)); 92 _ItemTags.put("y", Item.class.getMethod("getLinkTemplate", param)); 93 _ItemTags.put("g", Item.class.getMethod("getLinePattern", param)); 94 95 _ItemTags.put("j", Item.class.getMethod("getArrow", param)); 96 97 _ItemTags.put("f", Text.class.getMethod("getFont", param)); 98 _ItemTags.put("t", Text.class.getMethod("getSpacing", param)); 99 _ItemTags.put("T", Text.class.getMethod("getText", param)); 100 101 _ItemTags.put("a", Text.class.getMethod("getWordSpacing", param)); 102 _ItemTags.put("b", Text.class.getMethod("getLetterSpacing", param)); 103 _ItemTags 104 .put("m", Text.class.getMethod("getInitialSpacing", param)); 105 _ItemTags.put("w", Text.class.getMethod("getWidth", param)); 106 _ItemTags.put("k", Text.class.getMethod("getJustification", param)); 107 108 _ItemTags.put("h", Item.class.getMethod("getThickness", param)); 109 _ItemTags.put("l", Item.class.getMethod("getLineIDs", param)); 110 _ItemTags.put("c", Item.class.getMethod("getConstraintIDs", param)); 111 112 } catch (Exception e) { 113 e.printStackTrace(); 114 } 36 super(); 115 37 } 116 38 … … 128 50 } else 129 51 _writer = new ProxyWriter(new FileWriter(_filename)); 52 53 try { 54 _ItemTags.put("S", Item.class.getMethod("getTypeAndID", new Class[] {})); 55 } catch (Exception e) { 56 57 } 130 58 } 131 59 … … 225 153 // Dont save the item if it is off the screen 226 154 if (item.offScreen()) { 227 System.out.println("item offscreen!");155 //System.out.println("item offscreen!"); 228 156 return; 229 157 }
Note:
See TracChangeset
for help on using the changeset viewer.