jdk/src/share/classes/sun/awt/image/ImageWatched.java
changeset 12388 5a31b31ab09b
parent 5506 202f599c92aa
equal deleted inserted replaced
12171:ab7bb1fd211f 12388:5a31b31ab09b
     1 /*
     1 /*
     2  * Copyright (c) 1995, 2003, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   141 
   141 
   142     public synchronized void addWatcher(ImageObserver iw) {
   142     public synchronized void addWatcher(ImageObserver iw) {
   143         if (iw != null && !isWatcher(iw)) {
   143         if (iw != null && !isWatcher(iw)) {
   144             watcherList = new WeakLink(iw, watcherList);
   144             watcherList = new WeakLink(iw, watcherList);
   145         }
   145         }
       
   146         watcherList = watcherList.removeWatcher(null);
   146     }
   147     }
   147 
   148 
   148     public synchronized boolean isWatcher(ImageObserver iw) {
   149     public synchronized boolean isWatcher(ImageObserver iw) {
   149         return watcherList.isWatcher(iw);
   150         return watcherList.isWatcher(iw);
   150     }
   151     }