Examples of waitForID()


Examples of java.awt.MediaTracker.waitForID()

            MediaTracker tracker = new MediaTracker(comp);

            // Fully load image before continuing
            tracker.addImage(base, 0);
            do {
                try { tracker.waitForID(0); } catch (InterruptedException e) { continue; }
            } while (false);
            tracker.removeImage(base);

            final int w = base.getWidth(null), h = base.getHeight(null);
            BufferedImage tmp = new BufferedImage(w*2, h*2, BufferedImage.TYPE_INT_ARGB);
View Full Code Here

Examples of java.awt.MediaTracker.waitForID()

                tgr.drawImage(base, null, null);
            }

            tracker.addImage(tmp, 1);
            do {
                try { tracker.waitForID(1); } catch (InterruptedException e) { continue; }
            } while (false);
            tracker.removeImage(tmp);

            // TODO: Make this configurable.
            // Cut outer pixel border? This removes the distinct tile border present in most tiles.
View Full Code Here

Examples of java.awt.MediaTracker.waitForID()

        if (scaled == null) {
            MediaTracker tracker = new MediaTracker(this);
            if ((base.getWidth(null) == -1) || (base.getHeight(null) == -1)) {
                tracker.addImage(base, 0);
                try {
                    tracker.waitForID(0);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                tracker.removeImage(base);
            }
View Full Code Here

Examples of java.awt.MediaTracker.waitForID()

            scaled = scale(base, width, height);
            tracker.addImage(scaled, 1);
            // Wait for image to load
            try {
                tracker.waitForID(1);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            tracker.removeImage(scaled);
View Full Code Here

Examples of java.awt.MediaTracker.waitForID()

        // wait for splash image to load completely
        MediaTracker tracker = new MediaTracker(frame);
        tracker.addImage(imgSplash, 0);
        try {
            tracker.waitForID(0);
        } catch (InterruptedException e) {

        }
        // make splash image panel
        BufferedPanel panTitle = new BufferedPanel();
View Full Code Here

Examples of java.awt.MediaTracker.waitForID()

            Image image = frame.getToolkit().getImage(
                    "data/images/misc/megamek-splash2.gif"); //$NON-NLS-1$
            MediaTracker tracker = new MediaTracker(frame);
            tracker.addImage(image, 0);
            try {
                tracker.waitForID(0);
                imgTitleImage = image;
            } catch (InterruptedException exp) {
                exp.printStackTrace();
            }
        } // End load-imgTitleImage
View Full Code Here

Examples of java.awt.MediaTracker.waitForID()

            Image image = frame.getToolkit().getImage(
                    "data/images/misc/megamek-splash2.gif"); //$NON-NLS-1$
            MediaTracker tracker = new MediaTracker(frame);
            tracker.addImage(image, 0);
            try {
                tracker.waitForID(0);
                imgTitleImage = image;
            } catch (InterruptedException exp) {
                exp.printStackTrace();
            }
        } // End load-imgTitleImage
View Full Code Here

Examples of java.awt.MediaTracker.waitForID()

        Image preview = entityImage.loadPreviewImage();

        MediaTracker loadTracker = new MediaTracker(comp);
        loadTracker.addImage(preview, 0);
        try {
            loadTracker.waitForID(0);
        } catch (InterruptedException e) {

        }
        return preview;
    }
View Full Code Here

Examples of java.awt.MediaTracker.waitForID()

    public static boolean setImage(Image im, JComponent c) {
        boolean b = true;
        MediaTracker mt = new MediaTracker(c);
        mt.addImage(im, 0);
        try {
            mt.waitForID(0);
        } catch (InterruptedException e) {
            System.out.println("Error while image loading."); //$NON-NLS-1$
            b = false;
        }
        if (mt.isErrorID(0)) {
View Full Code Here

Examples of java.awt.MediaTracker.waitForID()

    public static boolean setImage(Image im, Component c) {
        boolean b = true;
        MediaTracker mt = new MediaTracker(c);
        mt.addImage(im, 0);
        try {
            mt.waitForID(0);
        } catch (InterruptedException e) {
            System.out.println("Error while image loading."); //$NON-NLS-1$
            b = false;
        }
        if (mt.isErrorID(0)) {
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.