Package com.lightcrafts.utils.thread

Examples of com.lightcrafts.utils.thread.ProgressThread


        Handler handler = new TerseLoggingHandler(System.out);
        logger.addHandler(handler);
        logger.setUseParentHandlers(false);

        ProgressDialog dialog = Platform.getPlatform().getProgressDialog();
        ProgressThread thread = new ProgressThread(dialog) {
            public void run() {
                Images = new ImageList(
                    directory,
                    100,
                    FileCacheFactory.get(directory),
View Full Code Here


        final JFrame frame = new JFrame( "TestProgress" );
        frame.setBounds( 100, 100, 500, 300 );
        frame.setVisible( true );

        final MacOSXProgressDialog dialog = new MacOSXProgressDialog();
        final ProgressThread t = new TestThread( dialog );

        dialog.showProgress( frame, t, "Working...", 0, 20, true );
        System.exit( 0 );
    }
View Full Code Here

        boolean doPrint = printer.printDialog();

        if (doPrint) {
            ProgressDialog dialog = Platform.getPlatform().getProgressDialog();
            ProgressThread thread = new ProgressThread(dialog) {
                public void run() {
                    try {
                        engine.print(this, format, settings);
                    }
                    catch (PrinterException e) {
View Full Code Here

        final ImageExportOptions options,
        final String title,
        final Frame parent
    ) throws IOException {
        ProgressDialog dialog = Platform.getPlatform().getProgressDialog();
        ProgressThread thread = new ProgressThread(dialog) {
            public void run() {
                try {
                    // Write the file:
                    export(engine, options, this);
                }
                catch (IOException e) {
                    // This exception should be unpacked in the error handling
                    // below, following dialog.showProgress().
                    throw new RuntimeException(e);
                }
            }
        };
        dialog.showProgress(parent, thread, title, 0, 10, true);

        // Unpack any Throwable, in case it hides a checked exception:
        Throwable error = dialog.getThrown();
        if (error != null) {
            if ( error instanceof IOException )
                throw (IOException) error;
            if ( error instanceof RuntimeException )
                throw (RuntimeException) error;
            throw new RuntimeException( error );
        }
        if (thread.isCanceled()) {
            return false;
        }
        return true;
    }
View Full Code Here

    // Initialize the ImageList data for the browser from the given directory
    // under a ProgressDialog.
    private void initImages(final File directory, final boolean useCache) {
        ProgressDialog dialog = Platform.getPlatform().getProgressDialog();
        ProgressThread thread = new ProgressThread(dialog) {
            public void run() {
                DocumentDatabase.addDocumentDirectory(directory);
                images = new ImageList(
                    directory,
                    100,
View Full Code Here

        final JFrame frame = new JFrame( "TestProgress" );
        frame.setBounds( 100, 100, 500, 300 );
        frame.setVisible( true );

        final DefaultProgressDialog dialog = new DefaultProgressDialog();
        final ProgressThread t = new TestThread( dialog );

        dialog.showProgress( frame, t, "Working...", 0, 20, true );
        System.exit( 0 );
    }
View Full Code Here

        final File file,
        final ComboFrame frame,
        final DocumentInitializerListener listener
    ) {
        synchronized(Monitor) {
            Cancellable = new ProgressThread(DummyIndicator) {
                public void run() {
                    try {
                        frame.showWait(LOCALE.get("LoadMessage"));
                        notifyListenerStart(listener);
                        Document doc = Application.createDocument(
View Full Code Here

TOP

Related Classes of com.lightcrafts.utils.thread.ProgressThread

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.