Esempio n. 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();
   }
 }
Esempio n. 2
0
 static {
   caretTimer = new Timer(500, new CaretBlinker());
   caretTimer.setInitialDelay(500);
   caretTimer.start();
 }
Esempio n. 3
-62
 private void createRepaintTimer() {
   if (myRepaintTimer != null) {
     myRepaintTimer.stop();
   }
   myRepaintTimer = new Timer(1000 / myMaxFPS, new WeakRedrawTimer(this));
   myRepaintTimer.start();
 }