/** * Returns the initial delay value. * * @return an integer representing the initial delay value, * in milliseconds * @see #setInitialDelay */ public int getInitialDelay() { return enterTimer.getInitialDelay(); }
/** * Returns the initial delay value. * * @return an integer representing the initial delay value, in milliseconds * @see #setInitialDelay(int) */ public int getInitialDelay() { return initialDelayTimer.getInitialDelay(); }
/** * Returns the dismissal delay value. * * @return an integer representing the dismissal delay value, in * milliseconds * @see #setDismissDelay(int) */ public int getDismissDelay() { return dismissTimer.getInitialDelay(); }
public void scheduleActivatedNodes (Node[] nodes) { synchronized (this) { this.nodes = nodes; if (timer == null) { // start timer with INIT_DELAY timer = new Timer (INIT_DELAY, this); timer.setCoalesce (true); timer.setRepeats (false); } if (timer.isRunning ()) { // if timer is running then double init delay if (timer.getInitialDelay () < MAX_DELAY) timer.setInitialDelay (timer.getInitialDelay () * 2); firstChange = false; } else { // the first change is set immediatelly setActivatedNodes (nodes); firstChange = true; } // make sure timer is running timer.restart(); } }
public void scheduleActivatedNodes (Node[] nodes) { synchronized (this) { this.nodes = nodes; if (timer == null) { // start timer with INIT_DELAY timer = new Timer (INIT_DELAY, this); timer.setCoalesce (true); timer.setRepeats (false); } if (timer.isRunning ()) { // if timer is running then double init delay if (timer.getInitialDelay () < MAX_DELAY) timer.setInitialDelay (timer.getInitialDelay () * 2); firstChange = false; } else { // the first change is set immediatelly setActivatedNodes (nodes); firstChange = true; } // make sure timer is running timer.restart(); } }
void postEvent(final ProgressEvent event, boolean shortenPeriod) { synchronized (this) { eventQueue.add(event); if (!dispatchRunning) { timerStart = System.currentTimeMillis(); int delay = timer.getInitialDelay(); // period of timer is longer than required by the handle -> shorten it. if (shortenPeriod && timer.getInitialDelay() > event.getSource().getInitialDelay()) { delay = event.getSource().getInitialDelay(); } dispatchRunning = true; resetTimer(delay, true); } else if (shortenPeriod) { // time remaining is longer than required by the handle's initial delay. // restart with shorter time. if (System.currentTimeMillis() - timerStart > event.getSource().getInitialDelay()) { resetTimer(event.getSource().getInitialDelay(), true); } } } }
if(timer.getInitialDelay() >= initialDelay) { timer.setInitialDelay(initialDelay);