/[classpath]/classpath/gnu/java/awt/peer/gtk/GtkImage.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/peer/gtk/GtkImage.java

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

revision 1.9 by fitzsim, Mon Dec 1 17:23:16 2003 UTC revision 1.10 by fitzsim, Tue Dec 2 19:42:10 2003 UTC
# Line 60  public class GtkImage extends Image impl Line 60  public class GtkImage extends Image impl
60    Vector propertyObservers = new Vector ();    Vector propertyObservers = new Vector ();
61    
62    ImageProducer source;    ImageProducer source;
63      ImageObserver observer;
64    Graphics g;    Graphics g;
65    
66    /* Variables in which we stored cached data, if possible.    /* Variables in which we stored cached data, if possible.
# Line 79  public class GtkImage extends Image impl Line 80  public class GtkImage extends Image impl
80      source = producer;      source = producer;
81      this.g = g;      this.g = g;
82    
83      source.addConsumer (this);      if (source != null)
84          source.addConsumer (this);
85    }    }
86      
87      public void setObserver (ImageObserver observer)
88      {
89        this.observer = observer;
90      }
91    
92    public synchronized int    public synchronized int
93    getWidth (ImageObserver observer)    getWidth (ImageObserver observer)
94    {    {
# Line 135  public class GtkImage extends Image impl Line 142  public class GtkImage extends Image impl
142      pixelCache = null;      pixelCache = null;
143      model = null;      model = null;
144    
145      source.removeConsumer (this);      if (source != null)
146      source.addConsumer (this);        {
147            source.removeConsumer (this);
148            source.addConsumer (this);
149          }
150    }    }
151    
152    public boolean    public boolean
# Line 168  public class GtkImage extends Image impl Line 178  public class GtkImage extends Image impl
178          if (io != null)          if (io != null)
179            io.imageUpdate (this, ImageObserver.HEIGHT, -1, -1, width, height);            io.imageUpdate (this, ImageObserver.HEIGHT, -1, -1, width, height);
180        }        }
181    
182        if (observer != null)
183          observer.imageUpdate (this,
184                                (ImageObserver.WIDTH
185                                 | ImageObserver.HEIGHT),
186                                -1, -1, width, height);
187    }    }
188    
189    public synchronized void    public synchronized void
# Line 203  public class GtkImage extends Image impl Line 219  public class GtkImage extends Image impl
219    {    {
220      setPixels (x, y, width, height, cm, convertPixels (pixels), offset,      setPixels (x, y, width, height, cm, convertPixels (pixels), offset,
221                 scansize);                 scansize);
222    
223        if (observer != null)
224          observer.imageUpdate (this,
225                                ImageObserver.SOMEBITS,
226                                x, y, width, height);
227    }    }
228    
229    public synchronized void    public synchronized void
# Line 244  public class GtkImage extends Image impl Line 265  public class GtkImage extends Image impl
265      if (status == ImageConsumer.SINGLEFRAMEDONE)      if (status == ImageConsumer.SINGLEFRAMEDONE)
266        isCacheable = false;        isCacheable = false;
267    
268      source.removeConsumer (this);      if (observer != null)
269          {
270            if (status == ImageConsumer.IMAGEERROR)
271              observer.imageUpdate (null,
272                                    ImageObserver.ERROR,
273                                    -1, -1, -1, -1);
274            else
275              observer.imageUpdate (null,
276                                    ImageObserver.ALLBITS,
277                                    -1, -1, -1, -1);
278          }
279    
280        if (source != null)
281          source.removeConsumer (this);
282    }    }
283    
284    public synchronized void    public synchronized void
# Line 257  public class GtkImage extends Image impl Line 291  public class GtkImage extends Image impl
291        }        }
292      else      else
293        {        {
294          source.startProduction (painter);          if (source != null)
295          source.removeConsumer (painter);            {
296                source.startProduction (painter);
297                source.removeConsumer (painter);
298              }
299        }        }
300    }    }
301    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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