Exemplo n.º 1
0
 @Override
 protected void deleteWidgets(List<WidgetWrapper> hitList) {
   boolean needsRecompile = false;
   for (int i = 0; i < hitList.size(); i++) {
     WidgetWrapper w = hitList.get(i);
     removeWidget(w);
     if (w.widget() instanceof org.nlogo.window.JobWidget) {
       // this ensures that the right thing happens if we delete
       // a button or monitor that doesn't compile; we need to remove it
       // from the errors tab - ST 12/17/04
       org.nlogo.window.JobWidget jobWidget = (org.nlogo.window.JobWidget) w.widget();
       jobWidget.innerSource("");
       new org.nlogo.window.Events.CompileMoreSourceEvent(jobWidget).raise(this);
     }
     if (w.widget() instanceof org.nlogo.window.InterfaceGlobalWidget) {
       needsRecompile = true;
     }
   }
   setForegroundWrapper();
   revalidate();
   repaint(); // you wouldn't think this'd be necessary, but without it
   // the widget didn't visually disappear - ST 6/23/03
   if (needsRecompile) {
     new org.nlogo.window.Events.CompileAllEvent().raise(this);
   }
   loseFocusIfAppropriate();
 }
Exemplo n.º 2
0
 private void resetWidgetProcedures() {
   for (JobOwner owner : widgets) {
     if (owner instanceof JobWidget) {
       ((JobWidget) owner).procedure(null);
     }
   }
 }