Example usage for com.google.gwt.user.client Timer schedule

List of usage examples for com.google.gwt.user.client Timer schedule

Introduction

In this page you can find the example usage for com.google.gwt.user.client Timer schedule.

Prototype

public synchronized void schedule(int delayMs) 

Source Link

Document

Schedules a timer to elapse in the future.

Usage

From source file:gwt.material.design.demo.client.application.components.loader.LoaderView.java

License:Apache License

@UiHandler("btnShowNavBarProgress")
void onShowNavBarProgress(ClickEvent e) {
    navBar.showProgress(ProgressType.INDETERMINATE);
    Timer t = new Timer() {
        @Override/*  w  w  w  .  ja  v  a 2  s.  c o  m*/
        public void run() {
            navBar.hideProgress();
        }
    };
    t.schedule(3000);
}

From source file:gwt.material.design.demo.client.application.components.loader.LoaderView.java

License:Apache License

@UiHandler("collapseItemOne")
void onShowCollapseProgress(ClickEvent e) {
    collapseItemOne.showProgress(ProgressType.INDETERMINATE);
    Timer t = new Timer() {
        @Override/*from   w ww .  ja  v  a 2s  .  c om*/
        public void run() {
            collapseItemOne.hideProgress();
        }
    };
    t.schedule(3000);
}

From source file:gwt.material.design.demo.client.application.components.loader.LoaderView.java

License:Apache License

@UiHandler("collapseItemTwo")
void onShowCollapseTwoProgress(ClickEvent e) {
    collapseItemTwo.showProgress(ProgressType.INDETERMINATE);
    Timer t = new Timer() {
        @Override// w  w w  . j  a  v a 2 s .c o m
        public void run() {
            collapseItemTwo.hideProgress();
        }
    };
    t.schedule(3000);
}

From source file:gwt.material.design.demo.client.application.components.loader.LoaderView.java

License:Apache License

@UiHandler("collapseItemThree")
void onShowCollapseThreeProgress(ClickEvent e) {
    collapseItemThree.showProgress(ProgressType.INDETERMINATE);
    Timer t = new Timer() {
        @Override/*from   ww w  . j  a  va 2 s .c o  m*/
        public void run() {
            collapseItemThree.hideProgress();
        }
    };
    t.schedule(3000);
}

From source file:gwt.material.design.demo.client.application.components.loader.LoaderView.java

License:Apache License

@UiHandler("acList")
void onKeyUp(KeyUpEvent e) {
    acList.showProgress(ProgressType.INDETERMINATE);
    Timer t = new Timer() {
        @Override/*from  w ww  . j av  a2 s .  c om*/
        public void run() {
            acList.hideProgress();
        }
    };
    t.schedule(1000);
}

From source file:gwt.material.design.demo.client.application.showcase.ShowcaseView.java

License:Apache License

@UiHandler("btnSplashScreen")
void onSplashscreen(ClickEvent e) {
    splash.show();//from  w  w  w  . j a v a 2 s.  co  m
    Timer t = new Timer() {
        @Override
        public void run() {
            splash.hide();
        }
    };
    t.schedule(3000);
}

From source file:gwt.material.design.demo.client.ui.charts.MaterialColoredLineChart.java

License:Apache License

private void initialize() {
    ChartLoader chartLoader = new ChartLoader(ChartPackage.CORECHART);
    chartLoader.loadApi(new Runnable() {

        @Override// w w  w.j  a v a 2 s. co m
        public void run() {
            // Create and attach the chart
            chart = new LineChart();
            cardContent.add(chart);
            draw();
            Timer timer = new Timer() {
                public void run() {
                    draw2();
                }
            };
            timer.schedule(2000);
        }
    });
}

From source file:gwtcog.examples.client.neural.neat.boxes.VisualizeBoxesMain.java

License:Apache License

private void beginTraining() {

    if (pop == null) {
        btnTraining.setEnabled(false);/*w  w w.  j a  v  a  2  s  . c  o m*/
        resetTraining();
    }

    // update the GUI
    btnTraining.setText("Stop Training");
    btnExample.setEnabled(false);
    trainingUnderway = true;

    requestStop = false;

    //Start the main loop
    Timer t = new Timer() {
        @Override
        public void run() {
            train();
        }
    };
    t.schedule(100);
}

From source file:hu.akarnokd.reactive4java.util.DefaultGwtScheduler.java

License:Apache License

@Override
public Closeable schedule(final Runnable run) {
    final Timer timer = new Timer() {
        @Override/*  w  w  w. ja v a  2s  . c o  m*/
        public void run() {
            run.run();
        }
    };
    timer.schedule(1);
    return new Closeable() {
        @Override
        public void close() throws IOException {
            timer.cancel();
        }
    };
}

From source file:hu.akarnokd.reactive4java.util.DefaultGwtScheduler.java

License:Apache License

@Override
public Closeable schedule(final Runnable run, long delay) {
    final Timer timer = new Timer() {
        @Override//from   www . ja v a  2 s  .com
        public void run() {
            run.run();
        }
    };
    timer.schedule((int) (delay / 1000000L));
    return new Closeable() {
        @Override
        public void close() throws IOException {
            timer.cancel();
        }
    };
}