Package com.lightcrafts.platform

Examples of com.lightcrafts.platform.ProgressDialog


        Logger logger = Logger.getLogger("com.lightcrafts.image.metadata");
        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),
                    true,
                    ImageDatumComparator.CaptureTime,
                    getProgressIndicator()
                );
            }
        };
        dialog.showProgress(frame, thread, "Scanning...", 0, 1, false);
        Throwable thrown = dialog.getThrown();
        if (thrown != null) {
            throw new RuntimeException("Error initializing ImageList", thrown);
        }
        return Images;
    }
View Full Code Here


        //
        // Activation of a licence key takes several seconds, so we show the
        // user an indeterminate progress dialog and check to see if the
        // ActivateThread threw an exception.
        //
        final ProgressDialog pd = Platform.getPlatform().getProgressDialog();
        final ActivateThread at = new ActivateThread( pd, key, true );
        pd.showProgress(
            null, at, LOCALE.get( "ActivatingSerialNumberMessage" ), false
        );
        final Throwable t = pd.getThrown();
        if ( t != null )
            if ( t instanceof RuntimeException )
                throw (RuntimeException)t;
            else
                throw new RuntimeException( t );
View Full Code Here

        //
        // Deactivation of a licence key takes several seconds, so we show the
        // user an indeterminate progress dialog and check to see if the
        // ActivateThread threw an exception.
        //
        final ProgressDialog pd = Platform.getPlatform().getProgressDialog();
        final ActivateThread at = new ActivateThread( pd, key, false );
        pd.showProgress(
            null, at, LOCALE.get( "DeactivatingSerialNumberMessage" ), false
        );
        final Throwable t = pd.getThrown();
        if ( t != null )
            if ( t instanceof RuntimeException )
                throw (RuntimeException)t;
            else
                throw new RuntimeException( t );
View Full Code Here

        final Engine engine,
        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;
View Full Code Here

        //
        // Finally, put up a ProgressDialog and check to see if there is an
        // update available.
        //
        final ProgressDialog progress =
            Platform.getPlatform().getProgressDialog();
        final SynchronousCheckThread checkThread =
            new SynchronousCheckThread( progress );
        progress.showProgress(
            null, checkThread, LOCALE.get( "CheckingForUpdateMessage" ), false
        );
        final Throwable t = progress.getThrown();
        if ( t != null ) {
            final AlertDialog alert = Platform.getPlatform().getAlertDialog();
            alert.showAlert(
                null,
                LOCALE.get( "CheckingForUpdateProblem" ),
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,
                    FileCacheFactory.get(directory),
                    useCache,
                    ImageDatumComparator.CaptureTime,
                    getProgressIndicator()
                );
            }
            public void cancel() {
                ImageList.cancel();
            }
        };
        FileSystemView view = Platform.getPlatform().getFileSystemView();
        String dirName = view.getSystemDisplayName(directory);
        dialog.showProgress(
            this, thread, LOCALE.get("ScanningMessage", dirName), 0, 1, true
        );
        Throwable t = dialog.getThrown();
        if (t != null) {
            throw new RuntimeException(LOCALE.get("ScanningError"), t);
        }
        if (images.getAllImageData().isEmpty()) {
            // Enqueue this, because the layout may be getting initialized
View Full Code Here

TOP

Related Classes of com.lightcrafts.platform.ProgressDialog

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.