Package java.awt.image

Examples of java.awt.image.ImageObserver


            flags |= ImageObserver.SOMEBITS;
        }

        synchronized (this.observers) {
            for (Iterator<ImageObserver> i = this.observers.iterator(); i.hasNext();) {
                ImageObserver observer = i.next();

                boolean result = observer.imageUpdate(bi, flags,
                        startx, starty,
                        width, height);

                // if result is false, the observer no longer wants to
                // be notified of changes
View Full Code Here


        return bufferedImage;
    }

    private void waitForImage(BufferedImage bufferedImage) {
        final ImageLoadStatus imageLoadStatus = new ImageLoadStatus();
        bufferedImage.getHeight(new ImageObserver() {
            public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
                if (infoflags == ALLBITS) {
                    imageLoadStatus.heightDone = true;
                    return true;
                }
                return false;
            }
        });
        bufferedImage.getWidth(new ImageObserver() {
            public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
                if (infoflags == ALLBITS) {
                    imageLoadStatus.widthDone = true;
                    return true;
                }
View Full Code Here

   
    int[] position = Utils.parseXY(childNode.getAttribute("position"));
    position = screen.findPosition(position);
    int[] size = Utils.parseSize(childNode.getAttribute("size"));
//    elements.add(new SkinBox(position[0], position[1], size[0], size[1], childNode));
    ImageObserver observer = null;
    g.drawImage(image, position[0], position[1], size[0], size[1], observer );
  }
View Full Code Here

        public boolean isWatcher(ImageObserver iw) {
            return (myref.get() == iw || next.isWatcher(iw));
        }

        public Link removeWatcher(ImageObserver iw) {
            ImageObserver myiw = myref.get();
            if (myiw == null) {
                // Remove me from the chain, but continue recursion.
                return next.removeWatcher(iw);
            }
            // At this point myiw is not null so we know this test will
View Full Code Here

        public boolean newInfo(Image img, int info,
                               int x, int y, int w, int h)
        {
            // Note tail recursion because items are added LIFO.
            boolean ret = next.newInfo(img, info, x, y, w, h);
            ImageObserver myiw = myref.get();
            if (myiw == null) {
                // My referent is null so we must prune in a second pass.
                ret = true;
            } else if (myiw.imageUpdate(img, info, x, y, w, h) == false) {
                // My referent has lost interest so clear it and ask
                // for a pruning pass to remove it later.
                myref.clear();
                ret = true;
            }
View Full Code Here

            imageState |= state;
            if((imageState & (ImageObserver.ALLBITS)) != 0 ) {
                done = true;
            }
        }
        ImageObserver observer = null;

        for (Iterator<ImageObserver> i = observers.iterator(); i.hasNext();) {
            try {
                observer = i.next();
            } catch (ConcurrentModificationException e) {
                i = observers.iterator();
                continue;
            }
            observer.imageUpdate(this, imageState, x, y, width, height);
        }

    }
View Full Code Here

            imageState |= state;
            if((imageState & (ImageObserver.ALLBITS)) != 0 ) {
                done = true;
            }
        }
        ImageObserver observer = null;

        for (Iterator<ImageObserver> i = observers.iterator(); i.hasNext();) {
            try {
                observer = i.next();
            } catch (ConcurrentModificationException e) {
                i = observers.iterator();
                continue;
            }
            observer.imageUpdate(this, imageState, x, y, width, height);
        }

    }
View Full Code Here

        return bufferedImage;
    }

    private void waitForImage(BufferedImage bufferedImage) {
        final ImageLoadStatus imageLoadStatus = new ImageLoadStatus();
        bufferedImage.getHeight(new ImageObserver() {
            @Override
            public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
                if (infoflags == ALLBITS) {
                    imageLoadStatus.heightDone = true;
                    return true;
                }
                return false;
            }
        });
        bufferedImage.getWidth(new ImageObserver() {
            @Override
            public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height) {
                if (infoflags == ALLBITS) {
                    imageLoadStatus.widthDone = true;
                    return true;
View Full Code Here

        super(imageReaderSpi);
    }

    @Override
    public int getHeight(final int i) throws IOException {
        return getImage(i).getHeight(new ImageObserver() {
            public boolean imageUpdate(final Image img, final int infoflags,
                            final int x, final int y, final int width,
                            final int height) {
                return (infoflags & HEIGHT) == 0;
            }
View Full Code Here

        });
    }

    @Override
    public int getWidth(final int i) throws IOException {
        return getImage(i).getWidth(new ImageObserver() {
            public boolean imageUpdate(final Image img, final int infoflags,
                            final int x, final int y, final int width,
                            final int height) {
                return (infoflags & WIDTH) == 0;
            }
View Full Code Here

TOP

Related Classes of java.awt.image.ImageObserver

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.