Package org.gephi.utils.longtask.api

Examples of org.gephi.utils.longtask.api.LongTaskExecutor$RunningLongTask


    public LayoutModelImpl() {
        listeners = new ArrayList<PropertyChangeListener>();
        savedProperties = new HashMap<LayoutPropertyKey, Object>();

        executor = new LongTaskExecutor(true, "layout", 5);
        executor.setLongTaskListener(new LongTaskListener() {

            public void taskFinished(LongTask task) {
                setRunning(false);
            }
View Full Code Here


                NotifyDescriptor.Message msg = new NotifyDescriptor.Message(message, NotifyDescriptor.WARNING_MESSAGE);
                DialogDisplayer.getDefault().notify(msg);
                //Logger.getLogger("").log(Level.WARNING, "", t.getCause());
            }
        };
        executor = new LongTaskExecutor(true, "Importer", 10);
    }
View Full Code Here

public class DesktopGeneratorController implements GeneratorController {

    private LongTaskExecutor executor;

    public DesktopGeneratorController() {
        executor = new LongTaskExecutor(true, "Generator");
    }
View Full Code Here

            s.setup(pStatistics);
        }
        model.setRunning(pStatistics, true);

        if (pStatistics instanceof LongTask) {
            LongTaskExecutor executor = new LongTaskExecutor(true, builder.getName(), 10);
//            executor.addLongTaskListener(this);
            if (listener != null) {
                executor.setLongTaskListener(listener);
            }
            executor.execute((LongTask) pStatistics, new Runnable() {

                public void run() {
                    pStatistics.execute(graphModel, attributeModel);
                    model.setRunning(pStatistics, false);
                    for (StatisticsUI s : uis) {
View Full Code Here

    public static void tearDownClass() throws Exception {
    }

    @Test
    public void testExecutor() {
        final LongTaskExecutor longTaskExecutor = new LongTaskExecutor(true);
        LongTaskListener longTaskListener = new LongTaskListener() {

            final int limit = 100;
            int count;

            public void taskFinished(LongTask task) {
                System.out.println("Finished" + (++count));
                if (count == limit) {
                    return;
                }
                LongTaskTest l = new LongTaskTest();
                longTaskExecutor.execute(l, l);
            }
        };
        longTaskExecutor.setLongTaskListener(longTaskListener);
        LongTaskTest longTaskTest = new LongTaskTest();
        longTaskExecutor.execute(longTaskTest, longTaskTest);
        try {
            Thread.sleep(3000);
        } catch (InterruptedException ex) {
            Exceptions.printStackTrace(ex);
        }
View Full Code Here

    private LongTaskExecutor executor;
    private LongTaskErrorHandler errorHandler;

    public ClusteringControllerImpl() {
        executor = new LongTaskExecutor(true, "Clusterer", 10);
        errorHandler = new LongTaskErrorHandler() {

            public void fatalError(Throwable t) {
                Logger.getLogger("").log(Level.SEVERE, "", t.getCause() != null ? t.getCause() : t);
            }
View Full Code Here

                NotifyDescriptor.Message msg = new NotifyDescriptor.Message(message, NotifyDescriptor.WARNING_MESSAGE);
                DialogDisplayer.getDefault().notify(msg);
                //Logger.getLogger("").log(Level.WARNING, "", t.getCause());
            }
        };
        executor = new LongTaskExecutor(true, "Exporter", 10);
    }
View Full Code Here

    public ProjectControllerUIImpl() {

        controller = Lookup.getDefault().lookup(ProjectController.class);

        //Project IO executor
        longTaskExecutor = new LongTaskExecutor(true, "Project IO");
        longTaskExecutor.setDefaultErrorHandler(new LongTaskErrorHandler() {

            public void fatalError(Throwable t) {
                unlockProjectActions();
                String txt = NbBundle.getMessage(ProjectControllerUIImpl.class, "ProjectControllerUI.error.open");
View Full Code Here

        if (result == NotifyDescriptor.OK_OPTION) {
            //This line will write the file path from the panel to the exporter's <code>setPath()<code> method.
            settingPanel.unsetup(true);

            //Create a new executor and execute
            LongTaskExecutor executor = new LongTaskExecutor(true, "SQLite Exporter");
            executor.setDefaultErrorHandler(errorHandler);
            executor.execute(exporter, new Runnable() {

                @Override
                public void run() {
                    //Get the current workspace and set it to the exporter
                    Workspace currentWorkspace = Lookup.getDefault().lookup(ProjectController.class).getCurrentWorkspace();
View Full Code Here

@Messages("CTL_UsingProgressAndCancelAction=Test progress and cancel")
public final class UsingProgressAndCancelAction implements ActionListener {

    @Override
    public void actionPerformed(ActionEvent e) {
        LongTaskExecutor executor = new LongTaskExecutor(true);
        LongTaskExample longTaskExample = new LongTaskExample();
        executor.execute(longTaskExample, longTaskExample, "Task...", null);
    }
View Full Code Here

TOP

Related Classes of org.gephi.utils.longtask.api.LongTaskExecutor$RunningLongTask

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.