< prev index next >

src/java.desktop/share/classes/sun/awt/SunToolkit.java

Print this page




 696         AWTAccessor.getComponentAccessor().setBackgroundEraseDisabled(component, true);
 697     }
 698 
 699     /**
 700      * Returns the value of "sun.awt.noerasebackground" property. Default
 701      * value is {@code false}.
 702      */
 703     public static boolean getSunAwtNoerasebackground() {
 704         return AccessController.doPrivileged(new GetBooleanAction("sun.awt.noerasebackground"));
 705     }
 706 
 707     /**
 708      * Returns the value of "sun.awt.erasebackgroundonresize" property. Default
 709      * value is {@code false}.
 710      */
 711     public static boolean getSunAwtErasebackgroundonresize() {
 712         return AccessController.doPrivileged(new GetBooleanAction("sun.awt.erasebackgroundonresize"));
 713     }
 714 
 715 

 716     static final SoftCache imgCache = new SoftCache();
 717 
 718     static Image getImageFromHash(Toolkit tk, URL url) {
 719         checkPermissions(url);
 720         synchronized (imgCache) {
 721             Image img = (Image)imgCache.get(url);
 722             if (img == null) {
 723                 try {
 724                     img = tk.createImage(new URLImageSource(url));
 725                     imgCache.put(url, img);
 726                 } catch (Exception e) {
 727                 }
 728             }
 729             return img;
 730         }
 731     }
 732 
 733     static Image getImageFromHash(Toolkit tk,
 734                                                String filename) {
 735         checkPermissions(filename);




 696         AWTAccessor.getComponentAccessor().setBackgroundEraseDisabled(component, true);
 697     }
 698 
 699     /**
 700      * Returns the value of "sun.awt.noerasebackground" property. Default
 701      * value is {@code false}.
 702      */
 703     public static boolean getSunAwtNoerasebackground() {
 704         return AccessController.doPrivileged(new GetBooleanAction("sun.awt.noerasebackground"));
 705     }
 706 
 707     /**
 708      * Returns the value of "sun.awt.erasebackgroundonresize" property. Default
 709      * value is {@code false}.
 710      */
 711     public static boolean getSunAwtErasebackgroundonresize() {
 712         return AccessController.doPrivileged(new GetBooleanAction("sun.awt.erasebackgroundonresize"));
 713     }
 714 
 715 
 716     @SuppressWarnings("deprecation")
 717     static final SoftCache imgCache = new SoftCache();
 718 
 719     static Image getImageFromHash(Toolkit tk, URL url) {
 720         checkPermissions(url);
 721         synchronized (imgCache) {
 722             Image img = (Image)imgCache.get(url);
 723             if (img == null) {
 724                 try {
 725                     img = tk.createImage(new URLImageSource(url));
 726                     imgCache.put(url, img);
 727                 } catch (Exception e) {
 728                 }
 729             }
 730             return img;
 731         }
 732     }
 733 
 734     static Image getImageFromHash(Toolkit tk,
 735                                                String filename) {
 736         checkPermissions(filename);


< prev index next >