Package javax.swing

Examples of javax.swing.Timer$Task


     *                 Periood in milliseconds that base timer should fire.
     */
    public SourcedTimer(TimeSource src, int granularity) {
  source = src;
  event = new SourcedTimerEvent(this, 0);
  baseTimer = new Timer(granularity, this);
  baseTimer.setInitialDelay(0);
    }
View Full Code Here


  * Real work is done by <code>converToEventList</code>
  */
    private void initEventList(TrackList tracks) {
  nextEvent = 0;
  if (timer == null) {
      timer = new Timer(0, this);
      timer.setRepeats(false);
  }
  convertToEventList(tracks);
    }
View Full Code Here

       
        //
        // Kick off a timer to free up the volatile image if there have been no recent updates
        // (e.g. the player is paused)
        //
        resourceTimer = new Timer(250, resourceReaper);
       
        //
        // Don't use a layout manager - the output component will positioned within this
        // component according to the aspect ratio and scaling mode
        //
View Full Code Here

   * Add component to its parent. Start the timer for auto-update.
   */
  public void addNotify()
  {
    super.addNotify();
    _timer = new Timer(1000, this);
    _timer.start();
  }
View Full Code Here

        int retries = pDownload.getRetryCounter();
        if (retries <= RETRY_LIMIT) {
            pDownload.setState(DownloadService.RETRYING);
//            mLog.info("Retry timer activated, retries=" + retries);
            Timer t = new Timer((int) CALMDOWN_PERIOD, new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        pDownload
                                .setRetryCounter(pDownload.getRetryCounter() + 1);
//                        mLog.info("Retrying"
//                                + pDownload.getAttachment());
//                        DownloadLogic.getInstance().download(pDownload);

                    } catch (Exception e1) {
//                        mLog.info("Retry failed"
//                                + pDownload.getAttachment());
                    }
                }
            });
            t.setInitialDelay((int) CALMDOWN_PERIOD);
            t.setRepeats(false);
            t.start();

        } else {
//            mLog.info("No more retries allowed for"
//                    + pDownload.getAttachment());
//            pDownload.setState(DownloadLogic.ERROR);
View Full Code Here

    private void updatePreview(final BibtexEntry toShow, final boolean changedPreview, int repeats) {
        if (workingOnPreview) {
            if (repeats > 0)
                return; // We've already waited once. Give up on this selection.
            Timer t = new Timer(50, new ActionListener() {
                public void actionPerformed(ActionEvent actionEvent) {
                    updatePreview(toShow, changedPreview, 1);
                }
            });
            t.setRepeats(false);
            t.start();
            return;
        }
        EventList<BibtexEntry> list = table.getSelected();
        // Check if the entry to preview is still selected:
        if ((list.size() != 1) || (list.get(0) != toShow)) {
View Full Code Here

     *
     * @param callPanel the <tt>CallPanel</tt> to close
     */
    public void closeWait(CallPanel callPanel)
    {
        Timer timer
            = new Timer(5000, new CloseCallListener(callPanel));

        timer.setRepeats(false);
        timer.start();
    }
View Full Code Here

        super(new BorderLayout());

        this.call = call;
        this.callWindow = callWindow;

        this.callDurationTimer = new Timer(1000, new CallTimerListener());
        this.callDurationTimer.setRepeats(true);

        // The call duration parameter is not known yet.
        this.setCallTitle(null);
View Full Code Here

        CallPeer callPeer = evt.getSourceCallPeer();

        callPeer.removeCallPeerConferenceListener(this);

        Timer timer = new Timer(5000,
            new RemovePeerPanelListener(callPeer));

        timer.setRepeats(false);
        timer.start();

        // The call is finished when that last peer is removed.
        if (call.getCallPeerCount() == 0)
        {
            this.stopCallTimer();
View Full Code Here

            this.progressBar.setValue(progress);

            if(progressBar.getPercentComplete() == 1.0)
            {
                // Wait 1 sec and remove the progress bar from the main panel.
                Timer progressBarTimer = new Timer(1 * 1000, null);

                progressBarTimer.setRepeats(false);
                progressBarTimer.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e)
                    {
                        mainPanel.remove(progressBar);
                        mainPanel.add(readyLabel, BorderLayout.SOUTH);
                        mainPanel.revalidate();
                        mainPanel.repaint();
                        progressBar.setValue(0);
                    }
                });
                progressBarTimer.start();
            }

            lastProgress = progress;
        }
    }
View Full Code Here

TOP

Related Classes of javax.swing.Timer$Task

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.