Examples of ProgressMonitor


Examples of org.geoserver.importer.job.ProgressMonitor

    /**
     * Runs any initial checks against the data preparing for import.
     */
    public final void prepare() throws IOException {
        prepare(new ProgressMonitor());
    }
View Full Code Here

Examples of org.mindswap.pellet.utils.progress.ProgressMonitor

  // This tests ticket 148
  // Canceling realization with REALIZE_BY_INDIVIDUAL=false throws an NPE
  public void testRealizeByIndividualsNPE() throws Exception {
    PelletOptions.REALIZE_INDIVIDUAL_AT_A_TIME = false;

    ProgressMonitor monitor = new TimedProgressMonitor( 1 );

    Reasoner pellet = new Reasoner( OWL.manager );
    KnowledgeBase kb = pellet.getKB();

    OWLOntology ont = loadOntology( base + "food.owl" );
View Full Code Here

Examples of org.openstreetmap.josm.gui.progress.ProgressMonitor

    private void download(Collection<Bounds> bboxes, Class<?> klass) {
        for (Bounds bbox : bboxes) {
            AbstractDownloadTask task = getDownloadTask(klass);
           
            ProgressMonitor monitor = null;
            if (Main.pref.getBoolean("plugin.continuos_download.quiet_download", false)) {
                monitor = NullProgressMonitor.INSTANCE;
            }

            Future<?> future = task.download(false, bbox, monitor);
View Full Code Here

Examples of org.pocui.core.actions.progress.ProgressMonitor

        buttonFinish.addActionListener(buttonFinishActionListener = new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                try {
                    final ProgressMonitorDialog lvProgressMonitorDialog = new ProgressMonitorDialog();
                    final ProgressMonitor lvProgressMonitor = new ProgressMonitor();
                    lvProgressMonitor.addDialog(lvProgressMonitorDialog);

                    // Get and initialize the finish-action.
                    AbsAction<S, VoidSelection> lvFinishAction = getActionConfiguration().getPerformFinishAction();
                    lvFinishAction.setInSelection(getMask().getSelection());
                    final ActionWorker<VoidSelection> lvWorker = new ActionWorker<VoidSelection>(lvFinishAction, lvProgressMonitor);

                    //Listen for thread to finish, to be able to remove listener:
                    lvWorker.addPropertyChangeListener(new PropertyChangeListener() {

                        public void propertyChange(PropertyChangeEvent pvEvt) {
                            if (ActionWorker.StateValue.DONE.equals(pvEvt.getNewValue())) {
                                //Removing Listener(Dialog) from Monitor, if Action finished:
                                lvProgressMonitor.removeDialog(lvProgressMonitorDialog);
                                lvWorker.removePropertyChangeListener(this);

                                if (lvProgressMonitor.isCanceled()) {
                                    handlePerformFinishActionException(lvProgressMonitor.getCancelThrowable());
                                }

                                closeDialog();
                            }
                        }
View Full Code Here

Examples of org.springframework.richclient.progress.ProgressMonitor

        if (ret != JOptionPane.OK_OPTION)
            return;

        ApplicationWindow aw = getApplicationWindow();
        final StatusBar bar = aw.getStatusBar();
        ProgressMonitor pm = bar.getProgressMonitor();

        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle(tr.get(ID + ".fileDialog"));
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int res = fc.showOpenDialog(aw.getControl());
        if (res != JFileChooser.APPROVE_OPTION) {
            bar.setMessage(tr.get(ID + ".noFileSelected"));
            return;
        }

        file = fc.getSelectedFile();
        if (!file.isDirectory()) {
            int resultOP = JOptionPane.showConfirmDialog(null, tr.get(ID + ".confirmation.message"),
                    tr.get(ID + ".confirmation.title"), JOptionPane.OK_CANCEL_OPTION);
            if (resultOP != JOptionPane.OK_OPTION) {
                return;
            }
        }
        pm.taskStarted(tr.get(ID + ".startTask"), 100);
        MySwingWorker sw = new MySwingWorker(ID) {

            @Override
            protected void myconstruct() throws Exception {
                bar.getProgressMonitor().worked(10);
View Full Code Here

Examples of org.springframework.richclient.progress.ProgressMonitor

     */
    private ApplicationContext loadRootApplicationContext(String[] configLocations, MessageSource messageSource) {
        final ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(configLocations, false);

        if (splashScreen instanceof MonitoringSplashScreen) {
            final ProgressMonitor tracker = ((MonitoringSplashScreen) splashScreen).getProgressMonitor();

            applicationContext.addBeanFactoryPostProcessor(
                    new ProgressMonitoringBeanFactoryPostProcessor(tracker, messageSource));

        }
View Full Code Here

Examples of org.springframework.richclient.progress.ProgressMonitor

        checkIfDataIsAlreadyAvailable();
        closeAllViews();

        ApplicationWindow aw = getApplicationWindow();
        final StatusBar bar = aw.getStatusBar();
        final ProgressMonitor pm = bar.getProgressMonitor();

        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle(tr.get(ID + ".fileDialog"));
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int res = fc.showOpenDialog(aw.getControl());
        if (res != JFileChooser.APPROVE_OPTION) {
            bar.setMessage(tr.get(ID + ".noFileSelected"));
            return;
        }
        file = fc.getSelectedFile();
        if (!file.isDirectory()) {
            int resultOP = JOptionPane.showConfirmDialog(null, tr.get(ID + ".confirmation.message"),
                    tr.get(ID + ".confirmation.title"), JOptionPane.OK_CANCEL_OPTION);
            if (resultOP != JOptionPane.OK_OPTION) {
                return;
            }
        }
        pm.taskStarted(tr.get(ID + ".startTask"), 100);

        MySwingWorker sw = new MySwingWorker(ID) {

            @Override
            protected void myconstruct() throws Exception {
View Full Code Here

Examples of org.springframework.richclient.progress.ProgressMonitor

        MySwingWorker sw = new MySwingWorker(ID) {

            @Override
            protected void myconstruct() throws Exception {
                StatusBar bar = getApplicationWindow().getStatusBar();
                ProgressMonitor pm = bar.getProgressMonitor();

                int resultDownload = JOptionPane.showConfirmDialog(null, tr.get(ID + ".downloadQuestion"),
                        tr.get(ID + ".downloadQuestion"), JOptionPane.YES_NO_OPTION);
                if (resultDownload == JOptionPane.YES_OPTION) {
                    String str = "http://peat_hal.users.sourceforge.net/sessions_catalog.j1";
                    bar.setMessage(tr.get("downloadFrom", str));
                    istream = new UrlResource(str).getInputStream();
                    pm.worked(5);
                    bar.setMessage("");
                }

                pm.taskStarted(tr.get(ID + ".startTask"), -1);
                pm.worked(10);

                ImportJavaOne importer = new ImportJavaOne();
                ImportJavaOne.overwriteSettings(settings);
                FastMap<String, Person> persons = new FastMap<String, Person>();
                // TODO update progres:
                Collection<JavaOneInterval> coll = importer.parse(istream);
                double tmp = 80.0 / (coll.size() + 1);
                int counter = 0;
                Dao<Event> eDao = dataPool.getDao(Event.class);
                for (JavaOneInterval ev : coll) {
                    pm.worked(10 + (int) (counter * tmp));
                    counter++;
                    Event event = eDao.create();
                    if (ev.getStart() >= 0 && ev.getDuration() > 0) {
                        IntervalInt si = settings.toInterval(ev.getStartDateTime(), ev.getEndDateTime());
                        if (si != null)
                            event.setInterval(si.getStart(), si.getDuration());
                    }
                    event.setName(ev.getId());
                    event.setDescription(ev.getDescription());
                    if (ev.getSpeakers() != null) {
                        for (String str : ev.getSpeakers().split(";")) {
                            str = str.trim();
                            Person p = persons.get(str);
                            if (p == null) {
                                p = new Person();
                                p.setName(str);
                                persons.put(str, p);
                            }
                            p.addEvent(event, Role.TEACHER, true);
                        }
                    }
                    eDao.attach(event);
                }
                pm.worked(90);
                dataPool.getDao(Person.class).attachAll(persons.values());
                pm.worked(100);
            }

            @Override
            protected void done() {
                openAllViews();
View Full Code Here

Examples of org.springframework.richclient.progress.ProgressMonitor

        checkIfDataIsAlreadyAvailable();
        closeAllViews();

        ApplicationWindow aw = getApplicationWindow();
        final StatusBar bar = aw.getStatusBar();
        final ProgressMonitor pm = bar.getProgressMonitor();

        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle(tr.get(ID + ".fileDialog"));
        fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int res = fc.showOpenDialog(aw.getControl());
        if (res != JFileChooser.APPROVE_OPTION) {
            bar.setMessage(tr.get(ID + ".noFileSelected"));
            return;
        }
        file = fc.getSelectedFile();
        if (!file.isDirectory()) {
            int resultOP = JOptionPane.showConfirmDialog(null, tr.get(ID + ".confirmation.message"),
                    tr.get(ID + ".confirmation.title"), JOptionPane.OK_CANCEL_OPTION);
            if (resultOP != JOptionPane.OK_OPTION) {
                return;
            }
        }
        pm.taskStarted(tr.get(ID + ".startTask"), 100);
        MySwingWorker sw = new MySwingWorker(ID) {

            @Override
            protected void myconstruct() throws Exception {
                bar.getProgressMonitor().worked(10);
View Full Code Here

Examples of org.springframework.richclient.progress.ProgressMonitor

     */
    @Override
    protected void doOnce() {
        ApplicationWindow aw = getApplicationWindow();
        final StatusBar bar = aw.getStatusBar();
        ProgressMonitor pm = bar.getProgressMonitor();

        JFileChooser fc = new JFileChooser();
        fc.setDialogTitle(tr.get(ID + ".fileDialog"));
        int res = fc.showSaveDialog(aw.getControl());
        if (res != JFileChooser.APPROVE_OPTION) {
            bar.setMessage(tr.get(ID + ".noFileSelected"));
            return;
        }
        final File f = fc.getSelectedFile();

        pm.taskStarted(tr.get(ID + ".startTask"), -1);

        MySwingWorker sw = new MySwingWorker(ID) {

            @Override
            protected void myconstruct() throws Exception {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.