/[classpath]/classpath/java/awt/image/PixelGrabber.java
ViewVC logotype

Diff of /classpath/java/awt/image/PixelGrabber.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by mark, Tue Jan 22 22:26:59 2002 UTC revision 1.5 by bryce, Fri Jan 25 04:41:11 2002 UTC
# Line 155  public class PixelGrabber implements Ima Line 155  public class PixelGrabber implements Ima
155       */       */
156      public boolean grabPixels() throws InterruptedException      public boolean grabPixels() throws InterruptedException
157      {      {
158          startGrabbing();        return grabPixels(0);
         while ( (status != ImageObserver.ALLBITS ) ||  
                 (status != ImageObserver.ERROR ) ||  
                 (status != ImageObserver.ABORT ) );  
   
         if( status == ImageObserver.ALLBITS )  
             return true;  
         else  
             return false;  
159      }      }
160    
161      /**      /**
# Line 176  public class PixelGrabber implements Ima Line 168  public class PixelGrabber implements Ima
168       */       */
169      public synchronized boolean grabPixels(long ms) throws InterruptedException      public synchronized boolean grabPixels(long ms) throws InterruptedException
170      {      {
         long start = System.currentTimeMillis();  
171          startGrabbing();          startGrabbing();
172          while ( (status != ImageObserver.ALLBITS ) ||          
173                  (status != ImageObserver.ERROR ) ||          if (ms < 0)
174                  (status != ImageObserver.ABORT ) )            return (status == ImageObserver.ALLBITS);
175              {          
176                  if( (System.currentTimeMillis() - start ) >= ms )          wait(ms);
177                      {          
178                          abortGrabbing();          if (status == ImageObserver.ALLBITS)
                         throw new InterruptedException();  
                     }  
             }  
   
         if( status == ImageObserver.ALLBITS )  
179              return true;              return true;
180          else          else
181              return false;              return false;
           
182      }      }
183    
184      /**      /**

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26