- Timestamp:
- 07/24/19 13:58:00 (5 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/encryption/io/EncryptedExpWriter.java
r1416 r1418 141 141 } 142 142 143 LinkedHashMap<Character,Method> itemTags = new LinkedHashMap<Character, Method>(getItem Tags());144 LinkedHashMap<String,Method> itemTagsExt = new LinkedHashMap<String, Method>(getItem TagsExt());143 LinkedHashMap<Character,Method> itemTags = new LinkedHashMap<Character, Method>(getItemCharTags()); 144 LinkedHashMap<String,Method> itemTagsExt = new LinkedHashMap<String, Method>(getItemStrTags()); 145 145 146 146 writeTag(toWrite, new Object[] {}, itemTags, 'S'); -
trunk/src/org/expeditee/io/DefaultFrameWriter.java
r1415 r1418 30 30 import java.util.HashSet; 31 31 import java.util.LinkedHashMap; 32 import java.util.Set; 32 33 33 34 import org.expeditee.agents.WriteTree; … … 167 168 168 169 // keep track of methods that are put on the same line 169 private static LinkedHashMap<Character, Method> _Item Tags = new LinkedHashMap<Character, Method>();170 private static LinkedHashMap<Character, Method> _ItemCharTags = new LinkedHashMap<Character, Method>(); 170 171 // IMPORTANT: keys in _ItemTagsExt must start with underscore as their first character 171 private static LinkedHashMap<String, Method> _ItemTagsExt = new LinkedHashMap<String, Method>(); 172 private static LinkedHashMap<String, Method> _ItemStrTags = new LinkedHashMap<String, Method>(); 173 174 private static LinkedHashMap<String, Method> _ItemTags = new LinkedHashMap<String, Method>(); 172 175 173 176 protected static LinkedHashMap<Character, Method> _FrameTags = new LinkedHashMap<Character, Method>(); … … 190 193 191 194 // Note: As of 26/11/18 there are no unused letter item tags. Use other characters. 192 _Item Tags.put(DefaultFrameWriter.TYPE_AND_ID, Item.class.getMethod("getTypeAndID"));193 _Item Tags.put(DefaultFrameWriter.DATE_CREATED, Item.class.getMethod("getDateCreated"));194 _Item Tags.put(DefaultFrameWriter.COLOR, Item.class.getMethod("getColor"));195 _Item Tags.put(DefaultFrameWriter.BACKGROUND_COLOR, Item.class.getMethod("getBackgroundColor"));196 _Item Tags.put(DefaultFrameWriter.BORDER_COLOR, Item.class.getMethod("getBorderColor"));197 198 _Item Tags.put(DefaultFrameWriter.POSITION, Item.class.getMethod("getPosition"));199 _Item Tags.put(DefaultFrameWriter.TEXT, Text.class.getMethod("getText"));200 _Item Tags.put(DefaultFrameWriter.LINK, Item.class.getMethod("getLink"));201 _Item Tags.put(DefaultFrameWriter.ACTION, Item.class.getMethod("getAction"));202 _Item Tags.put(DefaultFrameWriter.ACTION_MARK, Item.class.getMethod("getActionMark"));203 _Item Tags.put(DefaultFrameWriter.ACTION_CURSOR_ENTER, Item.class.getMethod("getActionCursorEnter"));204 _Item Tags.put(DefaultFrameWriter.ACTION_CURSOR_LEAVE, Item.class.getMethod("getActionCursorLeave"));205 _Item Tags.put(DefaultFrameWriter.ACTION_ENTER_FRAME, Item.class.getMethod("getActionEnterFrame"));206 _Item Tags.put(DefaultFrameWriter.ACTION_LEAVE_FRAME, Item.class.getMethod("getActionLeaveFrame"));207 _Item Tags.put(DefaultFrameWriter.DATA, Item.class.getMethod("getData"));208 _Item Tags.put(DefaultFrameWriter.HIGHLIGHT, Item.class.getMethod("getHighlight"));209 _Item Tags.put(DefaultFrameWriter.FILL_COLOR, Item.class.getMethod("getFillColor"));210 _Item Tags.put(DefaultFrameWriter.GRADIENT_COLOR, Item.class.getMethod("getGradientColor"));211 _Item Tags.put(DefaultFrameWriter.GRADIENT_ANGLE, Item.class.getMethod("getGradientAngle"));212 213 _Item Tags.put(DefaultFrameWriter.ANCHOR_LEFT, Item.class.getMethod("getAnchorLeft"));214 _Item Tags.put(DefaultFrameWriter.ANCHOR_RIGHT, Item.class.getMethod("getAnchorRight"));215 _Item Tags.put(DefaultFrameWriter.ANCHOR_TOP, Item.class.getMethod("getAnchorTop"));216 _Item Tags.put(DefaultFrameWriter.ANCHOR_BOTTOM, Item.class.getMethod("getAnchorBottom"));217 218 _Item Tags.put(DefaultFrameWriter.FILL_PATTERN, Item.class.getMethod("getFillPattern"));219 _Item Tags.put(DefaultFrameWriter.OWNER, Item.class.getMethod("getOwner"));220 _Item Tags.put(DefaultFrameWriter.LINK_MARK, Item.class.getMethod("getLinkMark"));221 _Item Tags.put(DefaultFrameWriter.LINK_FRAMESET, Item.class.getMethod("getLinkFrameset"));222 _Item Tags.put(DefaultFrameWriter.LINK_TEMPLATE, Item.class.getMethod("getLinkTemplate"));223 _Item Tags.put(DefaultFrameWriter.LINE_PATTERN, Item.class.getMethod("getLinePattern"));224 225 _Item Tags.put(DefaultFrameWriter.ARROW, Item.class.getMethod("getArrow"));226 227 _Item Tags.put(DefaultFrameWriter.DOT_TYPE, Item.class.getMethod("getDotType"));228 _Item Tags.put(DefaultFrameWriter.FILLED, Item.class.getMethod("getFilled"));229 230 _Item Tags.put(DefaultFrameWriter.FONT, Text.class.getMethod("getFont"));231 _Item Tags.put(DefaultFrameWriter.SPACING, Text.class.getMethod("getSpacing"));232 233 _Item Tags.put(DefaultFrameWriter.MASK, Text.class.getMethod("getMask"));195 _ItemCharTags.put(DefaultFrameWriter.TYPE_AND_ID, Item.class.getMethod("getTypeAndID")); 196 _ItemCharTags.put(DefaultFrameWriter.DATE_CREATED, Item.class.getMethod("getDateCreated")); 197 _ItemCharTags.put(DefaultFrameWriter.COLOR, Item.class.getMethod("getColor")); 198 _ItemCharTags.put(DefaultFrameWriter.BACKGROUND_COLOR, Item.class.getMethod("getBackgroundColor")); 199 _ItemCharTags.put(DefaultFrameWriter.BORDER_COLOR, Item.class.getMethod("getBorderColor")); 200 201 _ItemCharTags.put(DefaultFrameWriter.POSITION, Item.class.getMethod("getPosition")); 202 _ItemCharTags.put(DefaultFrameWriter.TEXT, Text.class.getMethod("getText")); 203 _ItemCharTags.put(DefaultFrameWriter.LINK, Item.class.getMethod("getLink")); 204 _ItemCharTags.put(DefaultFrameWriter.ACTION, Item.class.getMethod("getAction")); 205 _ItemCharTags.put(DefaultFrameWriter.ACTION_MARK, Item.class.getMethod("getActionMark")); 206 _ItemCharTags.put(DefaultFrameWriter.ACTION_CURSOR_ENTER, Item.class.getMethod("getActionCursorEnter")); 207 _ItemCharTags.put(DefaultFrameWriter.ACTION_CURSOR_LEAVE, Item.class.getMethod("getActionCursorLeave")); 208 _ItemCharTags.put(DefaultFrameWriter.ACTION_ENTER_FRAME, Item.class.getMethod("getActionEnterFrame")); 209 _ItemCharTags.put(DefaultFrameWriter.ACTION_LEAVE_FRAME, Item.class.getMethod("getActionLeaveFrame")); 210 _ItemCharTags.put(DefaultFrameWriter.DATA, Item.class.getMethod("getData")); 211 _ItemCharTags.put(DefaultFrameWriter.HIGHLIGHT, Item.class.getMethod("getHighlight")); 212 _ItemCharTags.put(DefaultFrameWriter.FILL_COLOR, Item.class.getMethod("getFillColor")); 213 _ItemCharTags.put(DefaultFrameWriter.GRADIENT_COLOR, Item.class.getMethod("getGradientColor")); 214 _ItemCharTags.put(DefaultFrameWriter.GRADIENT_ANGLE, Item.class.getMethod("getGradientAngle")); 215 216 _ItemCharTags.put(DefaultFrameWriter.ANCHOR_LEFT, Item.class.getMethod("getAnchorLeft")); 217 _ItemCharTags.put(DefaultFrameWriter.ANCHOR_RIGHT, Item.class.getMethod("getAnchorRight")); 218 _ItemCharTags.put(DefaultFrameWriter.ANCHOR_TOP, Item.class.getMethod("getAnchorTop")); 219 _ItemCharTags.put(DefaultFrameWriter.ANCHOR_BOTTOM, Item.class.getMethod("getAnchorBottom")); 220 221 _ItemCharTags.put(DefaultFrameWriter.FILL_PATTERN, Item.class.getMethod("getFillPattern")); 222 _ItemCharTags.put(DefaultFrameWriter.OWNER, Item.class.getMethod("getOwner")); 223 _ItemCharTags.put(DefaultFrameWriter.LINK_MARK, Item.class.getMethod("getLinkMark")); 224 _ItemCharTags.put(DefaultFrameWriter.LINK_FRAMESET, Item.class.getMethod("getLinkFrameset")); 225 _ItemCharTags.put(DefaultFrameWriter.LINK_TEMPLATE, Item.class.getMethod("getLinkTemplate")); 226 _ItemCharTags.put(DefaultFrameWriter.LINE_PATTERN, Item.class.getMethod("getLinePattern")); 227 228 _ItemCharTags.put(DefaultFrameWriter.ARROW, Item.class.getMethod("getArrow")); 229 230 _ItemCharTags.put(DefaultFrameWriter.DOT_TYPE, Item.class.getMethod("getDotType")); 231 _ItemCharTags.put(DefaultFrameWriter.FILLED, Item.class.getMethod("getFilled")); 232 233 _ItemCharTags.put(DefaultFrameWriter.FONT, Text.class.getMethod("getFont")); 234 _ItemCharTags.put(DefaultFrameWriter.SPACING, Text.class.getMethod("getSpacing")); 235 236 _ItemCharTags.put(DefaultFrameWriter.MASK, Text.class.getMethod("getMask")); 234 237 235 238 // TODO set a boolean flag to indicate that the text is a formula 236 239 // Store the formula in the text property NOT the answer 237 _Item Tags.put(DefaultFrameWriter.FORMULA, Item.class.getMethod("getFormula"));238 239 _Item Tags.put(DefaultFrameWriter.WORD_SPACING, Text.class.getMethod("getWordSpacing"));240 _Item Tags.put(DefaultFrameWriter.LETTER_SPACING, Text.class.getMethod("getLetterSpacing"));241 _Item Tags.put(DefaultFrameWriter.INITIAL_SPACING, Text.class.getMethod("getInitialSpacing"));242 _Item Tags.put(DefaultFrameWriter.WIDTH_TO_SAVE, Text.class.getMethod("getWidthToSave"));243 _Item Tags.put(DefaultFrameWriter.MIN_WIDTH_TO_SAVE, Text.class.getMethod("getMinWidthToSave"));244 _Item Tags.put(DefaultFrameWriter.JUSTIFICATION, Text.class.getMethod("getJustification"));245 _Item Tags.put(DefaultFrameWriter.AUTO_WRAP_TO_SAVE, Text.class.getMethod("getAutoWrapToSave"));246 247 _Item Tags.put(DefaultFrameWriter.THICKNESS, Item.class.getMethod("getThickness"));248 _Item Tags.put(DefaultFrameWriter.LINE_IDS, Item.class.getMethod("getLineIDs"));249 _Item Tags.put(DefaultFrameWriter.CONSTRAINT_IDS, Item.class.getMethod("getConstraintIDs"));250 251 _Item Tags.put(DefaultFrameWriter.TOOLTIP, Item.class.getMethod("getTooltip"));252 _Item Tags.put(DefaultFrameWriter.LINK_HISTORY, Item.class.getMethod("getLinkHistory"));253 254 _Item Tags.put(DefaultFrameWriter.PERMISSION, Item.class.getMethod("getPermission"));255 256 _Item Tags.put(DefaultFrameWriter.MAGNETIZED_ITEM_LEFT, Item.class.getMethod("getMagnetizedItemLeft"));257 _Item Tags.put(DefaultFrameWriter.MAGNETIZED_ITEM_RIGHT, Item.class.getMethod("getMagnetizedItemRight"));258 _Item Tags.put(DefaultFrameWriter.MAGNETIZED_ITEM_TOP, Item.class.getMethod("getMagnetizedItemTop"));259 _Item Tags.put(DefaultFrameWriter.MAGNETIZED_ITEM_BOTTOM, Item.class.getMethod("getMagnetizedItemBottom"));260 261 _Item TagsExt.put(DefaultFrameWriter.ENCRYPTION_LABEL_STR, Item.class.getMethod("getEncryptionLabel"));262 263 _Item TagsExt.put(DefaultFrameWriter.PLACEHOLDER_STR, Text.class.getMethod("getPlaceholder"));264 _Item TagsExt.put(DefaultFrameWriter.SINGLE_LINE_ONLY_STR, Text.class.getMethod("isSingleLineOnly"));265 _Item TagsExt.put(DefaultFrameWriter.TAB_INDEX_STR, Text.class.getMethod("getTabIndex"));266 _Item TagsExt.put(DefaultFrameWriter.ACCEPTS_ENTER, Item.class.getMethod("acceptsKeyboardEnter"));240 _ItemCharTags.put(DefaultFrameWriter.FORMULA, Item.class.getMethod("getFormula")); 241 242 _ItemCharTags.put(DefaultFrameWriter.WORD_SPACING, Text.class.getMethod("getWordSpacing")); 243 _ItemCharTags.put(DefaultFrameWriter.LETTER_SPACING, Text.class.getMethod("getLetterSpacing")); 244 _ItemCharTags.put(DefaultFrameWriter.INITIAL_SPACING, Text.class.getMethod("getInitialSpacing")); 245 _ItemCharTags.put(DefaultFrameWriter.WIDTH_TO_SAVE, Text.class.getMethod("getWidthToSave")); 246 _ItemCharTags.put(DefaultFrameWriter.MIN_WIDTH_TO_SAVE, Text.class.getMethod("getMinWidthToSave")); 247 _ItemCharTags.put(DefaultFrameWriter.JUSTIFICATION, Text.class.getMethod("getJustification")); 248 _ItemCharTags.put(DefaultFrameWriter.AUTO_WRAP_TO_SAVE, Text.class.getMethod("getAutoWrapToSave")); 249 250 _ItemCharTags.put(DefaultFrameWriter.THICKNESS, Item.class.getMethod("getThickness")); 251 _ItemCharTags.put(DefaultFrameWriter.LINE_IDS, Item.class.getMethod("getLineIDs")); 252 _ItemCharTags.put(DefaultFrameWriter.CONSTRAINT_IDS, Item.class.getMethod("getConstraintIDs")); 253 254 _ItemCharTags.put(DefaultFrameWriter.TOOLTIP, Item.class.getMethod("getTooltip")); 255 _ItemCharTags.put(DefaultFrameWriter.LINK_HISTORY, Item.class.getMethod("getLinkHistory")); 256 257 _ItemCharTags.put(DefaultFrameWriter.PERMISSION, Item.class.getMethod("getPermission")); 258 259 _ItemCharTags.put(DefaultFrameWriter.MAGNETIZED_ITEM_LEFT, Item.class.getMethod("getMagnetizedItemLeft")); 260 _ItemCharTags.put(DefaultFrameWriter.MAGNETIZED_ITEM_RIGHT, Item.class.getMethod("getMagnetizedItemRight")); 261 _ItemCharTags.put(DefaultFrameWriter.MAGNETIZED_ITEM_TOP, Item.class.getMethod("getMagnetizedItemTop")); 262 _ItemCharTags.put(DefaultFrameWriter.MAGNETIZED_ITEM_BOTTOM, Item.class.getMethod("getMagnetizedItemBottom")); 263 264 _ItemStrTags.put(DefaultFrameWriter.ENCRYPTION_LABEL_STR, Item.class.getMethod("getEncryptionLabel")); 265 266 _ItemStrTags.put(DefaultFrameWriter.PLACEHOLDER_STR, Text.class.getMethod("getPlaceholder")); 267 _ItemStrTags.put(DefaultFrameWriter.SINGLE_LINE_ONLY_STR, Text.class.getMethod("isSingleLineOnly")); 268 _ItemStrTags.put(DefaultFrameWriter.TAB_INDEX_STR, Text.class.getMethod("getTabIndex")); 269 _ItemStrTags.put(DefaultFrameWriter.ACCEPTS_ENTER, Item.class.getMethod("acceptsKeyboardEnter")); 267 270 } catch (Exception e) { 268 271 e.printStackTrace(); 269 272 } 273 274 Set<Character> keySet = _ItemCharTags.keySet(); 275 for (Character key: keySet) { 276 _ItemTags.put(key + "", _ItemCharTags.get(key)); 277 } 278 _ItemTags.putAll(_ItemStrTags); 270 279 } 271 280 … … 428 437 return "Not Supported"; 429 438 } 439 440 public static LinkedHashMap<String, Method> getItemTags() { 441 return _ItemTags; 442 } 430 443 431 444 /** 432 445 * @return the _ItemTags 433 446 */ 434 public static LinkedHashMap<Character, Method> getItem Tags() {435 return _Item Tags;447 public static LinkedHashMap<Character, Method> getItemCharTags() { 448 return _ItemCharTags; 436 449 } 437 450 … … 439 452 * @return the _ItemTagsExt 440 453 */ 441 public static LinkedHashMap<String, Method> getItem TagsExt() {442 return _Item TagsExt;454 public static LinkedHashMap<String, Method> getItemStrTags() { 455 return _ItemStrTags; 443 456 } 444 457 -
trunk/src/org/expeditee/io/ExpWriter.java
r1408 r1418 88 88 try { 89 89 _FrameTags.remove('A'); 90 getItem Tags().put('S', Item.class.getMethod("getTypeAndID",90 getItemCharTags().put('S', Item.class.getMethod("getTypeAndID", 91 91 new Class[] {})); 92 92 } catch (Exception e) { … … 306 306 307 307 protected void writeClass(Item toWrite) throws IOException { 308 writeTags(toWrite, new Object[] {}, getItem Tags());309 writeTags(toWrite, new Object[] {}, getItem TagsExt());308 writeTags(toWrite, new Object[] {}, getItemCharTags()); 309 writeTags(toWrite, new Object[] {}, getItemStrTags()); 310 310 } 311 311 -
trunk/src/org/expeditee/io/KMSWriter.java
r1408 r1418 81 81 try { 82 82 _FrameTags.put('A', Frame.class.getMethod("getName", new Class[] {})); 83 getItem Tags().put('S', Item.class.getMethod("getID", new Class[] {}));83 getItemCharTags().put('S', Item.class.getMethod("getID", new Class[] {})); 84 84 } catch (Exception e) { 85 85 … … 258 258 259 259 private void writeClass(Object toWrite) throws IOException { 260 Iterator<Character> it = getItem Tags().keySet().iterator();260 Iterator<Character> it = getItemCharTags().keySet().iterator(); 261 261 Object[] param = {}; 262 262 263 263 while (it.hasNext()) { 264 264 Character tag = it.next(); 265 Method toRun = getItem Tags().get(tag);265 Method toRun = getItemCharTags().get(tag); 266 266 Class<?> declarer = toRun.getDeclaringClass(); 267 267 if (declarer.isAssignableFrom(toWrite.getClass())) { -
trunk/src/org/expeditee/items/Item.java
r1417 r1418 334 334 { 335 335 EncryptionDetail unencryptedOnSave = new EncryptionDetail(EncryptionDetail.Type.UnencryptedOnSave); 336 for (Charactertag: DefaultFrameWriter.getItemTags().keySet()) {337 if (tag == 'T' || tag == 'S') {338 surrogatePropertyInheritanceDefault.put(tag + "", false);336 for (String tag: DefaultFrameWriter.getItemTags().keySet()) { 337 if (tag == "T" || tag == "S") { 338 surrogatePropertyInheritanceDefault.put(tag, false); 339 339 } else { 340 surrogatePropertyInheritanceDefault.put(tag + "", true); 341 } 342 primaryPropertyEncryptionDefault.put(tag + "", unencryptedOnSave); 343 } 344 345 for(String tag: DefaultFrameWriter.getItemTagsExt().keySet()) { 346 surrogatePropertyInheritanceDefault.put(tag, true); 340 surrogatePropertyInheritanceDefault.put(tag, true); 341 } 347 342 primaryPropertyEncryptionDefault.put(tag, unencryptedOnSave); 348 343 } … … 4129 4124 EncryptionDetail inheritanceCheckOnSave = new EncryptionDetail(EncryptionDetail.Type.InheritanceCheckOnSave); 4130 4125 4131 for (Character tag: DefaultFrameWriter.getItem Tags().keySet()) {4126 for (Character tag: DefaultFrameWriter.getItemCharTags().keySet()) { 4132 4127 if (tag == 'T') { 4133 4128 primaryPropertyEncryption.put(tag + "", reencryptOnSave.clone()); … … 4143 4138 } 4144 4139 4145 for (String tag: DefaultFrameWriter.getItem TagsExt().keySet()) {4140 for (String tag: DefaultFrameWriter.getItemStrTags().keySet()) { 4146 4141 primaryPropertyEncryption.put(tag, inheritanceCheckOnSave.clone()); 4147 4142 surrogate.surrogatePropertyInheritance.put(tag + "", true);
Note:
See TracChangeset
for help on using the changeset viewer.