Changeset 103
- Timestamp:
- 06/13/08 18:00:25 (16 years ago)
- Location:
- trunk/src/org/expeditee
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Actions.java
r102 r103 74 74 // Must be a forward slash for loading resources 75 75 String path = pckgname.replace('.', '/'); 76 // System.out.println("Get classes: " + path);76 // System.out.println("Get classes: " + path); 77 77 try { 78 78 ClassLoader cld = Thread.currentThread().getContextClassLoader(); … … 105 105 + ") does not appear to be a valid package"); 106 106 } 107 // System.out.println("Path:" + directory.getPath());107 // System.out.println("Path:" + directory.getPath()); 108 108 int splitPoint = directory.getPath().indexOf('!'); 109 109 if (splitPoint > 0) { … … 118 118 jarName = jarName.replace("%20", " "); 119 119 } 120 // System.out.println("JarName:" + jarName);120 // System.out.println("JarName:" + jarName); 121 121 JarFile jarFile = new JarFile(jarName); 122 122 … … 138 138 } 139 139 jarFile.close(); 140 // System.out.println("Loaded " + classCount + " classes from "141 // 140 // System.out.println("Loaded " + classCount + " classes from " 141 // + pckgname); 142 142 143 143 } catch (Exception e) { … … 291 291 */ 292 292 public static void PerformAction(Frame source, Item launcher, String command) { 293 if (!command.equalsIgnoreCase("Restore")) 294 FrameIO.SaveFrame(source, false); 293 // if (!command.equalsIgnoreCase("Restore")) 294 // FrameIO.SaveFrame(source, false); 295 // TODO make restore UNDO the changes made by the last action 295 296 296 297 // separate method name and parameter names … … 381 382 name = name.toLowerCase(); 382 383 // save the current frame (if necesssary) 383 FrameUtils.LeavingFrame(source); 384 // TODO make this nicer... ie. make Format an action rather than an 385 // agent and save frames only before running agents 386 if (!name.equalsIgnoreCase("format") && !name.equalsIgnoreCase("sort")) { 387 FrameUtils.LeavingFrame(source); 388 } 384 389 385 390 try { -
trunk/src/org/expeditee/agents/DisplayComet.java
r98 r103 26 26 protected Frame process(Frame frame) { 27 27 Collection<String> seen = new HashSet<String>(); 28 29 DisplayIO.addToBack(frame); 30 28 31 // Goto the end of the comet 29 32 Item old = null; 30 33 Frame oldFrame = frame; 31 34 while (oldFrame != null) { 35 if(_stop) 36 return null; 32 37 seen.add(oldFrame.getName().toLowerCase()); 33 38 _frameList.push(oldFrame); … … 46 51 // Back out one frame at a time 47 52 while (!_frameList.empty()) { 53 if(_stop) 54 return null; 48 55 DisplayIO.setCurrentFrame(_frameList.pop()); 49 56 _frameCount++; -
trunk/src/org/expeditee/gui/DisplayIO.java
r97 r103 58 58 * The title to display in the Title bar. 59 59 */ 60 public static final String TITLE = "Exp1 0Jun2008A";60 public static final String TITLE = "Exp13Jun2008A"; 61 61 62 62 private DisplayIO() { -
trunk/src/org/expeditee/gui/FrameUtils.java
r102 r103 579 579 if (!item.isAnnotation()) 580 580 continue; 581 582 String attribute = AttributeUtils.getAttribute(item.getText()); 583 if(attribute == null || attribute.length() < 3) 581 582 String attributeFullCase = AttributeUtils.getAttribute(item 583 .getText()); 584 // TODO Change the line below so that it does not complain for built 585 // in attributes 586 if (attributeFullCase == null || attributeFullCase.length() < 4) 584 587 continue; 585 attribute = attribute.substring(1).toLowerCase();586 588 String attribute = attributeFullCase.substring(1).toLowerCase(); 589 587 590 if (attribute.equals("homeframe")) { 588 591 String first = getLink(item, UserSettings.FirstFrame); … … 593 596 // warn the user 594 597 else { 595 // FrameGraphics.WarningMessage("Home frame: " + first596 // 598 // FrameGraphics.WarningMessage("Home frame: " + first 599 // + " is not a valid frame."); 597 600 UserSettings.FirstFrame = profile.getName(); 598 601 } … … 627 630 } else if (attribute.equals("logging")) { 628 631 UserSettings.Logging = getBoolean(item, UserSettings.Logging); 629 } else if (attribute.equals( 630 "itemtemplate")) { 632 } else if (attribute.equals("itemtemplate")) { 631 633 UserSettings.ItemTemplate = ((Text) item).getTemplateForm(); 632 } else if (attribute.equals( 633 "annotationtemplate")) { 634 } else if (attribute.equals("annotationtemplate")) { 634 635 UserSettings.AnnotationTemplate = ((Text) item) 635 636 .getTemplateForm(); 636 } else if (attribute.equals( 637 "statstemplate")) { 637 } else if (attribute.equals("statstemplate")) { 638 638 UserSettings.StatTemplate = ((Text) item).getTemplateForm(); 639 } else if (attribute.equals( 640 "commenttemplate")) { 639 } else if (attribute.equals("commenttemplate")) { 641 640 UserSettings.CodeCommentTemplate = ((Text) item) 642 641 .getTemplateForm(); 643 } else if (attribute.equals( 644 "linetemplate")) { 642 } else if (attribute.equals("linetemplate")) { 645 643 UserSettings.LineTemplate = ((Text) item).getTemplateForm(); 646 644 } else if (attribute.equals("framesetdir")) { 647 645 String dir = getDir(item, null); 648 if (dir != null) {646 if (dir != null) { 649 647 UserSettings.FrameDirs.add(dir); 650 648 } … … 668 666 UserSettings.FrameDirs.addAll(getDirs(item)); 669 667 } else { 670 FrameGraphics.WarningMessage("[" + item.getText() + "]" + " is not a profile frame tag"); 668 FrameGraphics.WarningMessage(attributeFullCase 669 + " is not a profile frame tag"); 671 670 } 672 671 } … … 761 760 else 762 761 return name + File.separator; 763 } else{762 } else { 764 763 FrameGraphics.ErrorMessage("Directory not found: " + name); 765 764 } 766 }else{ 767 FrameGraphics.WarningMessage("Missing value for profile attribute" + name); 765 } else { 766 FrameGraphics.WarningMessage("Missing value for profile attribute" 767 + name); 768 768 } 769 769 return alt; … … 870 870 i.Permission = permissionLevel; 871 871 if (i instanceof Text && i.isAnnotation()) { 872 if (ItemUtils.startsWithTag(i, 873 ItemUtils.TAG_POINTTYPE)) { 872 if (ItemUtils.startsWithTag(i, ItemUtils.TAG_POINTTYPE)) { 874 873 Text txt = (Text) i; 875 874 String line = txt.getFirstLine(); … … 896 895 else if (ItemUtils.startsWithTag(i, ItemUtils.TAG_VECTOR) 897 896 && i.getLink() != null) { 897 // TODO It is possible to get into an infinate loop if a 898 // frame contains an @ao which leads to a frame with an 899 // @v which points back to the frame with the @ao 900 898 901 Frame vector = FrameIO.LoadFrame(i.getAbsoluteLink()); 899 902 if (vector != null) { … … 913 916 else if (ItemUtils.startsWithTag(i, ItemUtils.TAG_OVERLAY) 914 917 && i.getLink() != null) { 918 if (i.getAbsoluteLink().equalsIgnoreCase( 919 toParse.getName())) { 920 // This frame contains an active overlay which 921 // points to itself 922 FrameGraphics.ErrorMessage(toParse.getName() 923 + " contains an @o which links to itself"); 924 continue; 925 } 926 915 927 Frame overlay = FrameIO.LoadFrame(i.getAbsoluteLink()); 916 928 // Parse(overlay); … … 924 936 && i.getLink() != null) { 925 937 String link = i.getAbsoluteLink(); 938 if (link.equalsIgnoreCase(toParse.getName())) { 939 // This frame contains an active overlay which 940 // points to itself 941 FrameGraphics.ErrorMessage(toParse.getName() 942 + " contains an @ao which links to itself"); 943 continue; 944 } 926 945 Frame overlay = FrameIO.LoadFrame(link); 927 946 // Parse(overlay); … … 975 994 } 976 995 } 977 // TODO decide exactly what to do here!!996 // TODO decide exactly what to do here!! 978 997 toParse.addAnnotation((Text) i); 979 998 } … … 1418 1437 for (File helpFrameset : helpFramesets) { 1419 1438 String framesetName = helpFrameset.getName(); 1420 if (!FrameIO.isValidFramesetName(framesetName))1439 if (!FrameIO.isValidFramesetName(framesetName)) 1421 1440 continue; 1422 1441 Frame indexFrame = FrameIO.LoadFrame(framesetName + '1'); -
trunk/src/org/expeditee/stats/CometStats.java
r90 r103 56 56 57 57 StringBuffer sb = new StringBuffer(); 58 sb.append(SessionStats.getDate()); 58 59 sb.append("CometName: ").append(_name).append('\n'); 59 sb.append(" Edits: ").append(_sessions).append('\n');60 sb.append("Versions: ").append(_sessions).append('\n'); 60 61 sb.append(" Current | Average | Total").append('\n'); 61 62 Time averageActive = new Time((long) (0.5 + active.getTime() -
trunk/src/org/expeditee/stats/SessionStats.java
r90 r103 89 89 90 90 public static String getCurrentStats() { 91 StringBuffer stats = get SessionDateTime();91 StringBuffer stats = getLength(); 92 92 93 93 long elapsedTime = (new Date()).getTime() - _StartTime.getTime(); … … 107 107 108 108 private static String getTimeElapsed() { 109 SimpleDateFormat formatter = new SimpleDateFormat("HH:mm");110 109 Date currentTime = new Date(); 111 110 long elapsedTime = currentTime.getTime() - _StartTime.getTime(); 112 String time = formatter.format(_StartTime); 113 time += "-->" + formatter.format(currentTime); 114 time += " = " + (int) (elapsedTime / MILLISECONDS_PER_MINUTE); // (new 111 String time = "" + (int) ((double)elapsedTime / MILLISECONDS_PER_MINUTE + 0.5); // (new 115 112 // SimpleDateFormat("m").format(elapsedTime)); 116 113 … … 260 257 if (_StatsEnabled) { 261 258 _AccessedFrames++; 262 _FrameEvents.clear();263 _FrameAccessTime = new Date();264 _FrameAccessDarkTime = (Time) _DarkTime.clone();265 259 } 266 260 } … … 269 263 FrameEdited(frameName); 270 264 _SavedFrames++; 265 266 _FrameEvents.clear(); 267 _FrameAccessTime = new Date(); 268 _FrameAccessDarkTime = (Time) _DarkTime.clone(); 271 269 } 272 270 … … 350 348 351 349 private static void FrameEdited(String name) { 352 _FramesEdited.append(Logger.EasyDateFormat("ddMMMyyyy -HHmm:ss"))350 _FramesEdited.append(Logger.EasyDateFormat("ddMMMyyyy:HHmm:ss")) 353 351 .append("[").append(name).append("]\n"); 354 352 } … … 402 400 403 401 public static String getItemStats() { 404 StringBuffer stats = get SessionDateTime();402 StringBuffer stats = getLength(); 405 403 int max = 0; 406 404 for (int i = 0; i < STAT_TYPES; i++) { … … 436 434 437 435 public static String getEventStats() { 438 StringBuffer stats = get SessionDateTime();436 StringBuffer stats = getLength(); 439 437 int max = getMax(_EventTimes); 440 438 int maxWidthEvents = ("" + max).length(); … … 485 483 * @return 486 484 */ 487 private static StringBuffer getSessionDateTime() { 485 public static StringBuffer getLength() { 486 StringBuffer stats = getDate(); 487 stats.append("SessionTime: ").append(getTimeElapsed()).append("\n"); 488 return stats; 489 } 490 491 public static StringBuffer getDate() { 488 492 StringBuffer stats = new StringBuffer("Date: "); 489 stats.append(Logger.EasyDateFormat("ddMMMyyyy")).append("\n"); 490 stats.append("SessionTime: ").append(getTimeElapsed()).append("\n"); 493 stats.append(Logger.EasyDateFormat("ddMMMyyyy:HHmm")).append("\n"); 491 494 return stats; 492 495 } -
trunk/src/org/expeditee/stats/TreeStats.java
r102 r103 68 68 69 69 StringBuffer sb = new StringBuffer(); 70 sb.append(SessionStats.getDate()); 70 71 sb.append("TopFrame: ").append(_name).append('\n'); 71 72 sb.append("Frames: ").append(_treeFrames).append('\n'); 72 73 sb.append("Versions: ").append(_treeSessions).append('\n'); 73 sb.append(" FrameAve |VersionAve| Total").append('\n');74 sb.append(" VersionAve| FrameAve | Total").append('\n'); 74 75 Time averageActive = new Time((long) (0.5 + active.getTime() 75 76 / (1.0 * _treeFrames)));
Note:
See TracChangeset
for help on using the changeset viewer.