- Timestamp:
- 04/17/19 11:30:18 (5 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/assets/resources-public/framesets/authentication/1.exp
r1311 r1321 1 V 7881 V 800 2 2 p 40 3 3 U authadmin 4 4 D 23Nov2018[12:31] 5 5 M authadmin 6 d 1 5Apr2019[15:11]6 d 17Apr2019[11:24] 7 7 B 100 100 39 100 8 8 Z … … 74 74 K 0 0 0 100 75 75 P 350 287 76 T bln476 T 77 77 x F 78 78 D txtUsername … … 88 88 h 1.0 89 89 p 44 90 =Username90 _ph Username 91 91 92 92 S T 1291 … … 111 111 h 1.0 112 112 p 44 113 =Password113 _ph Password 114 114 115 115 S T 1374 … … 181 181 Z 182 182 183 ActiveTime:13802283:07:22 184 DarkTime:-13797066:-21:-5 185 11:53:057 89 251 Md 186 11:53:179 89 252 Rd 187 11:53:568 89 252 Ru 188 11:53:633 89 252 Mu 183 ActiveTime:16394710:10:09 184 DarkTime:-16387934:-21:-21 185 24:22:328 83 242 kSHIFT 186 24:22:571 83 242 kT 187 24:22:746 94 242 kO 188 24:23:091 103 242 kG 189 24:23:241 112 242 kG 190 24:23:371 121 242 kL 191 24:23:492 126 242 kE 192 24:26:443 134 242 kBACKSPACE 193 24:26:587 126 242 kBACKSPACE 194 24:26:731 121 242 kBACKSPACE 195 24:26:834 112 242 kBACKSPACE 196 24:26:971 103 242 kBACKSPACE 197 24:27:098 94 242 kBACKSPACE -
trunk/src/org/expeditee/assets/resources-public/framesets/authentication/2.exp
r1311 r1321 1 V 25 01 V 254 2 2 p 40 3 3 U authadmin 4 4 D 07Dec2018[12:19] 5 5 M authadmin 6 d 1 5Apr2019[15:12]6 d 17Apr2019[11:24] 7 7 B 100 100 39 100 8 8 Z … … 103 103 h 1.0 104 104 p 44 105 =Username105 _ph Username 106 106 107 107 S T 111 … … 126 126 h 1.0 127 127 p 44 128 =Password128 _ph Password 129 129 130 130 S T 130 … … 149 149 h 1.0 150 150 p 44 151 =Password Again151 _ph Password Again 152 152 153 153 S T 672 … … 171 171 h 1.0 172 172 p 44 173 =Email Again173 _ph Email Again 174 174 175 175 S T 671 … … 193 193 h 1.0 194 194 p 44 195 =Email195 _ph Email 196 196 197 197 S T 190 … … 263 263 Z 264 264 265 ActiveTime:01:1 1:23265 ActiveTime:01:14:57 266 266 DarkTime:01:31:57 267 12:56:260 116 494 Md 268 12:56:379 116 498 Rd 269 12:56:562 115 501 Ru 270 12:56:601 115 501 Mu 271 12:57:073 157 494 kLEFT_ARROW 267 24:15:545 211 281 Ld 268 24:15:698 211 281 Rd 269 24:15:841 211 281 Ru 270 24:15:872 211 281 Lu 271 24:17:969 41 223 Md 272 24:18:132 41 223 Rd 273 24:18:649 41 223 Mu 274 24:18:657 41 223 Ru 275 24:21:195 41 223 kLEFT_ARROW -
trunk/src/org/expeditee/auth/Actions.java
r1320 r1321 392 392 String message = "Creating new user account..."; 393 393 int progress = 0; 394 int step = 20;394 int step = 16; 395 395 396 396 // Extract user details … … 519 519 Path destinationFile = destinationDirectory.resolve(AuthenticatorBrowser.CREDENTIALS_FRAME + ExpReader.EXTENTION); 520 520 FrameIO.migrateFrame(credentialsFrame, destinationFile); 521 522 MessageBay.displayMessage(message + "Creating Individual Space."); 521 522 try { 523 progressBar.UpdateMessage(message + "Creating Individual Space.", progress += step); 524 } catch (Exception e) { 525 e.printStackTrace(); 526 } 523 527 DisplayController.refreshBayArea(); 524 528 … … 543 547 544 548 try { 545 progressBar.UpdateMessage(message + "Done.", progress += step);549 progressBar.UpdateMessage(message + "Done.", 100); 546 550 } catch (Exception e) { 547 551 e.printStackTrace(); -
trunk/src/org/expeditee/auth/account/Authenticate.java
r1320 r1321 25 25 import org.expeditee.auth.Actions; 26 26 import org.expeditee.auth.AuthenticatorBrowser; 27 import org.expeditee.auth.Mail;28 27 import org.expeditee.auth.gui.MailBay; 29 28 import org.expeditee.auth.tags.AuthenticationTag; -
trunk/src/org/expeditee/io/DefaultFrameReader.java
r1296 r1321 46 46 47 47 protected static LinkedHashMap<Character, Method> _ItemTags = null; 48 // IMPORTANT: keys in _ItemTagsExt must start with underscore as their first character 49 protected static LinkedHashMap<String, Method> _ItemTagsExt = null; 48 50 49 51 protected static List<Character> _DelayedItemTags = null; … … 74 76 75 77 _ItemTags = new LinkedHashMap<Character, Method>(); 78 _ItemTagsExt = new LinkedHashMap<String, Method>(); 76 79 _FrameTags = new LinkedHashMap<Character, Method>(); 77 80 _DelayedItemTags = new LinkedList<Character>(); … … 161 164 _ItemTags.put('O', Text.class.getMethod("setMask", pIntO)); 162 165 163 _ItemTags.put('=', Text.class.getMethod("setPlaceholder", pString));164 165 166 // Lines and constraints are created differently 166 167 _ItemTags.put('L', Line.class.getMethod("setStartItem", pItem)); … … 173 174 _ItemTags.put('^', Item.class.getMethod("setMagnetizedItemTop", pInt)); 174 175 _DelayedItemTags.add('^'); 175 _ItemTags.put('_', Item.class.getMethod("setMagnetizedItemBottom", pInt)); 176 _DelayedItemTags.add('_'); 176 _ItemTags.put('/', Item.class.getMethod("setMagnetizedItemBottom", pInt)); 177 _DelayedItemTags.add('/'); 178 179 _ItemTagsExt.put("_ph", Text.class.getMethod("setPlaceholder", pString)); 177 180 } catch (Exception e) { 178 181 e.printStackTrace(); -
trunk/src/org/expeditee/io/DefaultFrameWriter.java
r1296 r1321 56 56 // keep track of methods that are put on the same line 57 57 protected static LinkedHashMap<Character, Method> _ItemTags = null; 58 // IMPORTANT: keys in _ItemTagsExt must start with underscore as their first character 59 protected static LinkedHashMap<String, Method> _ItemTagsExt = null; 58 60 59 61 protected static LinkedHashMap<Character, Method> _FrameTags = null; … … 65 67 66 68 _ItemTags = new LinkedHashMap<Character, Method>(); 69 _ItemTagsExt = new LinkedHashMap<String, Method>(); 67 70 _FrameTags = new LinkedHashMap<Character, Method>(); 68 71 … … 148 151 _ItemTags.put(']', Item.class.getMethod("getMagnetizedItemRight")); 149 152 _ItemTags.put('^', Item.class.getMethod("getMagnetizedItemTop")); 150 _ItemTags.put('_', Item.class.getMethod("getMagnetizedItemBottom")); 151 152 _ItemTags.put('=', Text.class.getMethod("getPlaceholder")); 153 _ItemTags.put('/', Item.class.getMethod("getMagnetizedItemBottom")); 154 155 //_ItemTags.put('=', Text.class.getMethod("getPlaceholder")); 156 _ItemTagsExt.put("_ph", Text.class.getMethod("getPlaceholder")); 153 157 } catch (Exception e) { 154 158 e.printStackTrace(); -
trunk/src/org/expeditee/io/ExpReader.java
r1242 r1321 74 74 // allow for all characters, we take advantage of how || is evaluated: 75 75 // if the check for Character.isLetter passes, then the more complex map lookup operation does not take place. 76 return s.length() >= 2 && (Character.isLetter(s.charAt(0)) || _ItemTags.keySet().contains(s.charAt(0))); 76 77 if (s.length() < 2) { 78 return false; 79 } 80 char charZero = s.charAt(0); 81 82 if (charZero == '_') { 83 // If the character at the start is a underscore then we are dealing with the extended collection and must extract a string. 84 // This requires that the line contains a space character to split on and that the resulting split has at least two parts. 85 String[] parts = s.split(" "); 86 if (parts.length < 2) { 87 return false; 88 } 89 boolean isStringTag = _ItemTagsExt.keySet().contains(parts[0]); 90 if (isStringTag) { 91 return true; 92 } 93 } else { 94 // If we are looking at a letter then we can save ourselves from the less efficient general character check. 95 boolean isLetter = Character.isLetter(charZero); 96 if (isLetter) { 97 return true; 98 } 99 100 // If we are not looking at a letter but we are looking at a character that is not _ then it must be in the existing collection to be valid 101 boolean isCharacterTag = _ItemTags.keySet().contains(charZero); 102 if (isCharacterTag) { 103 return true; 104 } 105 } 106 107 // If we have somehow found a entry which does not pass any of the above tests then the line is invalid. 108 return false; 77 109 } 78 110 … … 246 278 */ 247 279 protected void processBodyLine(Item item, String line) { 280 Method toRun = null; 281 248 282 // separate the tag from the value 249 Character tag = getTag(line); 250 String value = getValue(line); 251 252 Method toRun = _ItemTags.get(tag); 283 String tag = getTag(line).toString(); 284 String value = null; 285 if (tag.charAt(0) != '_') { 286 value = getValue(line); 287 toRun = _ItemTags.get(tag.charAt(0)); 288 } else { 289 tag = getTagExt(line); 290 value = getValueExt(line); 291 toRun = _ItemTagsExt.get(tag); 292 } 293 253 294 254 295 if (toRun == null) { … … 271 312 return line.charAt(0); 272 313 } 314 315 protected static String getTagExt(String line) { 316 assert(line.length() >= 2 && line.contains(" ")); 317 String[] parts = line.split(" "); 318 assert(parts.length >= 2); 319 return parts[0]; 320 } 273 321 274 322 protected static String getValue(String line) { … … 278 326 return ""; 279 327 } 328 } 329 330 protected static String getValueExt(String line) { 331 assert(line.length() >= 2 && line.contains(" ")); 332 return line.substring(line.indexOf(" ") + 1); 280 333 } 281 334 -
trunk/src/org/expeditee/io/ExpWriter.java
r1208 r1321 277 277 private void writeClass(Object toWrite) throws IOException { 278 278 Iterator<Character> it = _ItemTags.keySet().iterator(); 279 Iterator<String> itExt = _ItemTagsExt.keySet().iterator(); 279 280 Object[] param = {}; 280 281 … … 300 301 } 301 302 } 303 304 while (itExt.hasNext()) { 305 String tag = itExt.next(); 306 Method toRun = _ItemTagsExt.get(tag); 307 Class<?> declarer = toRun.getDeclaringClass(); 308 if (declarer.isAssignableFrom(toWrite.getClass())) { 309 try { 310 Object o = toRun.invoke(toWrite, param); 311 o = Conversion.ConvertToExpeditee(toRun, o); 312 if (o != null) { 313 if (o instanceof List) { 314 for (Object line : (List) o) { 315 writeLine(tag.toString(), line.toString()); 316 } 317 } else 318 writeLine(tag.toString(), o.toString()); 319 } 320 } catch (Exception e) { 321 e.printStackTrace(); 322 } 323 } 324 } 302 325 } 303 326
Note:
See TracChangeset
for help on using the changeset viewer.