private static void checkNoBlocksRemain() {
   // Check that the blocks system has been cleaned out.
   assertFalse(Block.getAllBlocks().iterator().hasNext());
   Workspace workspace = Workspace.getInstance();
   assertFalse(workspace.getRenderableBlocks().iterator().hasNext());
   assertFalse(workspace.getBlocks().iterator().hasNext());
 }
Exemplo n.º 2
0
 public static void showRuntimeComplaint(RenderableBlock rb, String complaint) {
   Complaint balloon = rb.getComplaint();
   balloon.getBlockNoteLabel().setActive(true);
   if (!rb.isVisible()) {
     rb.getTopmost().setCollapsed(false);
   }
   balloon.setText("Error: " + complaint + "\n");
   balloon.getBlockNoteLabel().setActive(true);
   balloon.getBlockNoteLabel().setBackground(ERROR_COLOR);
   complaintRect = rb.getBounds().union(balloon.getBounds());
   balloon.reformBlockNote();
   // TODO(user) scrollToShowRectangle doesn't seem to work properly at the Swing level
   Workspace.getInstance().getBlockCanvas().scrollToShowRectangle(complaintRect);
 }
Exemplo n.º 3
0
 /* Called from yacodeblocks.WorkSpaceController at the end of compilation.
  *
  * @return number of errors
  */
 public static int showCompiletimeComplaints() {
   // TODO(user) scrollToShowRectangle doesn't seem to work properly at the Swing level
   Workspace.getInstance().getBlockCanvas().scrollToShowRectangle(complaintRect);
   return compileErrors.size();
 }