public boolean drawToBufImage(
      Graphics g, ToolkitImage img, AffineTransform xform, ImageObserver iw) {
    Graphics2D g2 = (Graphics2D) g;

    if (src != null) {
      src.checkSecurity(null, false);
    }
    if ((availinfo & ImageObserver.ERROR) != 0) {
      if (iw != null) {
        iw.imageUpdate(image, ImageObserver.ERROR | ImageObserver.ABORT, -1, -1, -1, -1);
      }
      return false;
    }
    boolean done = ((availinfo & ImageObserver.ALLBITS) != 0);
    boolean abort = ((availinfo & ImageObserver.ABORT) != 0);

    if (!done && !abort) {
      addWatcher(iw);
      startProduction();
      // Some producers deliver image data synchronously
      done = ((availinfo & ImageObserver.ALLBITS) != 0);
    }

    if (done || (0 != (availinfo & ImageObserver.FRAMEBITS))) {
      g2.drawImage(bimage, xform, null);
    }

    return done;
  }
Esempio n. 2
0
 protected static boolean imageReady(ToolkitImage sunimg, ImageObserver observer) {
   if (sunimg.hasError()) {
     if (observer != null) {
       observer.imageUpdate(sunimg, ImageObserver.ERROR | ImageObserver.ABORT, -1, -1, -1, -1);
     }
     return false;
   }
   return true;
 }
 /*     */ private synchronized void addWatcher(
     ImageObserver paramImageObserver, boolean paramBoolean)
       /*     */ {
   /* 211 */ if ((this.availinfo & 0x40) != 0) {
     /* 212 */ if (paramImageObserver != null) {
       /* 213 */ paramImageObserver.imageUpdate(this, 192, -1, -1, -1, -1);
       /*     */ }
     /*     */
     /* 216 */ return;
     /*     */ }
   /* 218 */ ImageRepresentation localImageRepresentation = getImageRep();
   /* 219 */ localImageRepresentation.addWatcher(paramImageObserver);
   /* 220 */ if (paramBoolean) /* 221 */ localImageRepresentation.startProduction();
   /*     */ }
 public boolean prepare(ImageObserver iw) {
   if (src != null) {
     src.checkSecurity(null, false);
   }
   if ((availinfo & ImageObserver.ERROR) != 0) {
     if (iw != null) {
       iw.imageUpdate(image, ImageObserver.ERROR | ImageObserver.ABORT, -1, -1, -1, -1);
     }
     return false;
   }
   boolean done = ((availinfo & ImageObserver.ALLBITS) != 0);
   if (!done) {
     addWatcher(iw);
     startProduction();
     // Some producers deliver image data synchronously
     done = ((availinfo & ImageObserver.ALLBITS) != 0);
   }
   return done;
 }
  public boolean drawToBufImage(
      Graphics g,
      ToolkitImage img,
      int dx1,
      int dy1,
      int dx2,
      int dy2,
      int sx1,
      int sy1,
      int sx2,
      int sy2,
      Color bg,
      ImageObserver iw) {

    if (src != null) {
      src.checkSecurity(null, false);
    }
    if ((availinfo & ImageObserver.ERROR) != 0) {
      if (iw != null) {
        iw.imageUpdate(image, ImageObserver.ERROR | ImageObserver.ABORT, -1, -1, -1, -1);
      }
      return false;
    }
    boolean done = ((availinfo & ImageObserver.ALLBITS) != 0);
    boolean abort = ((availinfo & ImageObserver.ABORT) != 0);

    if (!done && !abort) {
      addWatcher(iw);
      startProduction();
      // Some producers deliver image data synchronously
      done = ((availinfo & ImageObserver.ALLBITS) != 0);
    }

    if (done || (0 != (availinfo & ImageObserver.FRAMEBITS))) {
      g.drawImage(bimage, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, bg, null);
    }

    return done;
  }
Esempio n. 6
0
 // returns null iff error or abort
 public Dimension getImageSize() throws InterruptedException {
   synchronized (m_observer) {
     while (!resultKnown()) m_observer.wait();
     return m_isImcomplete ? null : new Dimension(m_size);
   }
 }
Esempio n. 7
0
 // PROPERTY CHANGE LISTENER
 public void propertyChange(PropertyChangeEvent evt) {
   for (ImageObserver observer : observerList) {
     observer.imageUpdate(null, ImageObserver.ALLBITS, 0, 0, 0, 0);
   }
 }