예제 #1
0
 @Override
 public void actionPerformed(ActionEvent e) {
   TerminalPanel terminalPanel = ref.get();
   if (terminalPanel != null) {
     terminalPanel.myCursor.changeStateIfNeeded();
     if (terminalPanel.needScrollUpdate.getAndSet(false)) {
       terminalPanel.updateScrolling();
     }
     if (terminalPanel.needRepaint.getAndSet(false)) {
       try {
         terminalPanel.doRepaint();
       } catch (Exception ex) {
         LOG.error("Error while terminal panel redraw", ex);
       }
     }
   } else { // terminalPanel was garbage collected
     Timer timer = (Timer) e.getSource();
     timer.removeActionListener(this);
     timer.stop();
   }
 }
예제 #2
-62
 private void createRepaintTimer() {
   if (myRepaintTimer != null) {
     myRepaintTimer.stop();
   }
   myRepaintTimer = new Timer(1000 / myMaxFPS, new WeakRedrawTimer(this));
   myRepaintTimer.start();
 }