Esempio n. 1
0
 /** This stops the layout if it's running, if it's not running it does nothing... */
 public void stop() {
   if (runner.isAlive()) {
     try {
       active = false;
       if (idleing) {
         runner.interrupt();
       }
       System.out.println(
           "Thread "
               + Thread.currentThread().getName()
               + " Ordering thread layout thread to stop.");
       runner.join();
       initThread();
     } catch (InterruptedException ex) {
       System.err.println("Layout Thread failed to stop");
       Logger.getLogger(WeightedElasticLayout.class.getName()).log(Level.SEVERE, null, ex);
     }
   }
 }
Esempio n. 2
0
 /**
  * Helper for events. Signals the graph it needs to restart calculating forces as the model has
  * changed. Mark graph as 'dirty' If layout thread is sleeping, wake it up.
  */
 private void markLayoutDirty() {
   stable = false;
   if (idleing) {
     runner.interrupt();
   }
 }