Changeset 90 for trunk/src/org/expeditee/actions
- Timestamp:
- 06/06/08 12:42:25 (16 years ago)
- Location:
- trunk/src/org/expeditee/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Misc.java
r87 r90 11 11 import java.io.IOException; 12 12 import java.lang.reflect.Method; 13 import java.sql.Time;14 13 import java.util.ArrayList; 15 14 import java.util.List; … … 23 22 import org.expeditee.gui.FrameMouseActions; 24 23 import org.expeditee.gui.TimeKeeper; 25 import org.expeditee.io.Logger;26 24 import org.expeditee.items.Item; 27 25 import org.expeditee.items.Text; 26 import org.expeditee.stats.CometStats; 28 27 import org.expeditee.stats.SessionStats; 29 28 import org.expeditee.stats.StatsLogger; 29 import org.expeditee.stats.TreeStats; 30 30 31 31 /** … … 56 56 public static void Restore() { 57 57 FrameIO.Reload(); 58 // FrameGraphics.DisplayMessage("Restoration complete.");58 // FrameGraphics.DisplayMessage("Restoration complete."); 59 59 } 60 60 … … 232 232 */ 233 233 public static void GetCometStats(Frame frame) { 234 FrameGraphics.DisplayMessage("Extracting comet stats..."); 235 236 StringBuffer sb = new StringBuffer(); 237 Time active = frame.getCometActiveTime(true); 238 Time dark = frame.getCometDarkTime(true); 239 Time total = new Time(active.getTime() + dark.getTime()); 240 int length = frame.getCometLength(); 241 sb.append("CometName: ").append(frame.getName()).append('\n'); 242 sb.append("Length: ").append(length).append('\n'); 243 sb.append(" Current Average Total").append('\n'); 244 Time averageActive = new Time((long) (0.5 + active.getTime() 245 / (1.0 * length))); 246 Time averageDark = new Time((long) (0.5 + dark.getTime() 247 / (1.0 * length))); 248 Time averageTotal = new Time((long) (0.5 + total.getTime() 249 / (1.0 * length))); 250 Time currentActive = SessionStats.getFrameActiveTime(); 251 Time currentDark = SessionStats.getFrameDarkTime(); 252 Time currentTotal = SessionStats.getFrameTotalTime(); 253 254 sb.append("ActiveTime: ").append(Logger.EasyTimeFormat(currentActive)).append( 255 ' ').append(Logger.EasyTimeFormat(averageActive)).append( 256 ' ').append(Logger.EasyTimeFormat(active)).append('\n'); 257 sb.append(" DarkTime: ").append(Logger.EasyTimeFormat(currentDark)).append( 258 ' ').append(Logger.EasyTimeFormat(averageDark)).append( 259 ' ').append(Logger.EasyTimeFormat(dark)).append('\n'); 260 sb.append(" TotalTime: ").append(Logger.EasyTimeFormat(currentTotal)).append( 261 ' ').append(Logger.EasyTimeFormat(averageTotal)).append( 262 ' ').append(Logger.EasyTimeFormat(total)); 263 CreateTextItem(sb.toString()); 264 265 FrameGraphics.OverwriteMessage("Comet stats complete"); 234 TimeKeeper timer = new TimeKeeper(); 235 FrameGraphics.DisplayMessage("Computing comet stats..."); 236 237 CometStats cometStats = new CometStats(frame, true); 238 CreateTextItem(cometStats.toString()); 239 FrameGraphics.OverwriteMessage("Comet stats time: " 240 + timer.getElapsedStringSeconds()); 241 } 242 243 public static void GetTreeStats(Frame frame) { 244 TimeKeeper timer = new TimeKeeper(); 245 FrameGraphics.DisplayMessage("Computing tree stats..."); 246 247 TreeStats treeStats = new TreeStats(frame, true); 248 CreateTextItem(treeStats.toString()); 249 FrameGraphics.OverwriteMessage("Tree stats time: " 250 + timer.getElapsedStringSeconds()); 266 251 } 267 252 -
trunk/src/org/expeditee/actions/Simple.java
r88 r90 239 239 // if the throws exception annotation is on the frame then 240 240 // it passes only if an exception is thrown 241 if (title.getParentOrCurrentFrame().hasAnnotation("ThrowsException")) { 241 if (title.getParentOrCurrentFrame().hasAnnotation( 242 "ThrowsException")) { 242 243 errorMessage = "Expected exception " + title.toString(); 243 244 passed = false; … … 245 246 } catch (Exception e) { 246 247 _programsRunning--; 247 if (!title.getParentOrCurrentFrame().hasAnnotation("ThrowsException")) { 248 if (!title.getParentOrCurrentFrame().hasAnnotation( 249 "ThrowsException")) { 248 250 errorMessage = e.getMessage(); 249 251 passed = false; … … 390 392 391 393 if (_step) { 392 DisplayIO.setCurrentFrame(child); 394 if (child != DisplayIO.getCurrentFrame()) { 395 DisplayIO.setCurrentFrame(child); 396 } 393 397 DisplayIO.addToBack(child); 394 398 } … … 437 441 if (lastItemStatus != Status.TrueIf 438 442 && lastItemStatus != Status.FalseIf) { 443 if (_step) { 444 DisplayIO.removeFromBack(); 445 } 439 446 return lastItemStatus; 440 447 } … … 456 463 457 464 if (_step) { 465 DisplayIO.removeFromBack(); 458 466 DisplayIO.setCurrentFrame(current.getParent()); 459 DisplayIO.removeFromBack();460 467 } 461 468 … … 525 532 ArrayList<String> tokens = new ArrayList<String>(); 526 533 527 // At the moment annotation items are ignored by the interpreter528 //// Check special annotation tags for programs529 //if (statement.length() > 0 && statement.charAt(0) == '@') {530 //statement = statement.toLowerCase();531 //// Flags the next unit test as being required to throw an exception532 //if (statement.equals("@throwsexception")) {533 //code.getParentOrCurrentFrame().setThrowsException(true);534 //}535 //return null;536 //}534 // At the moment annotation items are ignored by the interpreter 535 // // Check special annotation tags for programs 536 // if (statement.length() > 0 && statement.charAt(0) == '@') { 537 // statement = statement.toLowerCase(); 538 // // Flags the next unit test as being required to throw an exception 539 // if (statement.equals("@throwsexception")) { 540 // code.getParentOrCurrentFrame().setThrowsException(true); 541 // } 542 // return null; 543 // } 537 544 538 545 for (int i = 0; i < statement.length(); i++) {
Note:
See TracChangeset
for help on using the changeset viewer.