Package java.awt

Examples of java.awt.MediaTracker.waitForID()


        // Use MediaTracker to wait for new image to be created
        try {
            MediaTracker tracker = new MediaTracker(this);
            tracker.addImage(newImage, 0);
            tracker.waitForID(0);
        } catch (InterruptedException e) {
            DialogUtil.error(e);
        }

        // Encode the painted image as a GIF, sending to output stream
View Full Code Here


          e.printStackTrace();
        }
    MediaTracker mt = new MediaTracker(this);
    mt.addImage(splashImage, 0);
    try {
      mt.waitForID(0);
    } catch (InterruptedException ie) {
    }
    int imgWidth = splashImage.getWidth(this);
    int imgHeight = splashImage.getHeight(this);
    setSize(imgWidth, imgHeight);
View Full Code Here

    // Load the image
    MediaTracker mt = new MediaTracker(this);
    mt.addImage(image,0);
    try {
      mt.waitForID(0);
    } catch(InterruptedException ie){
    }
       
    // Center the window on the screen
    int imgWidth = image.getWidth(this);
View Full Code Here

    this.tileHeight = tileHeight;

    MediaTracker mediaTracker = new MediaTracker( new Container() );
    mediaTracker.addImage( img, 0 );
    try {
      mediaTracker.waitForID( 0 );
    } catch( InterruptedException e1 ) { /* ignore */ }
  }
 
  /**
   *  Queries the tile width
View Full Code Here

    MediaTracker mediaTracker = new MediaTracker( _screens.get(0) );
    mediaTracker.addImage(transCursorImage, 0);
    try
    {
      mediaTracker.waitForID(0);
    }
    catch (InterruptedException ie)
    {
      System.err.println(ie);
      System.exit(1);
View Full Code Here

    // Load the image
    MediaTracker mt = new MediaTracker(this);
    mt.addImage(image,0);
    try {
      mt.waitForID(0);
    } catch(InterruptedException ie){
    }
       
    // Center the window on the screen
    int imgWidth = image.getWidth(this);
View Full Code Here

                                                   Image image) {
        /* Determine image width and height using MediaTracker. */
        MediaTracker tracker = new MediaTracker(new Canvas());
        tracker.addImage(image, 0);
        try {
            tracker.waitForID(0);
        } catch (InterruptedException e) {
            e.printStackTrace();
            throw new RuntimeException(JaiI18N.getString("AWTImageOpImage0"));
        }
  if (tracker.isErrorID(0)) {  // not standard file format
View Full Code Here

    Toolkit toolkit = Toolkit.getDefaultToolkit();
    Image image = toolkit.getImage(screen.getSkin().findPixmap(pixmap));
    MediaTracker mediaTracker = new MediaTracker(this);
    mediaTracker.addImage(image, 0);
    try  {
      mediaTracker.waitForID(0);
    } catch (InterruptedException ie) {
      System.err.println(ie);
      System.exit(1);
    }
   
View Full Code Here

                String filename = ((File)input).getAbsolutePath();
                do {
                    try {
                        Image img = tk.createImage(filename);
                        mt.addImage(img, 0);
                        mt.waitForID(0, 0);
                        mt.removeImage(img, 0);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } while (--numReps >= 0);
View Full Code Here

            case INPUT_URL:
                do {
                    try {
                        Image img = tk.createImage((URL)input);
                        mt.addImage(img, 0);
                        mt.waitForID(0, 0);
                        mt.removeImage(img, 0);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } while (--numReps >= 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.