View | Details | Raw Unified | Return to bug 262804 | Differences between
and this patch

Collapse All | Expand All

(-)openide.util.ui/src/org/openide/util/ImageUtilities.java (-6 / +14 lines)
 Lines 195-204    Link Here 
195
        if( image == null ) {
195
        if( image == null ) {
196
            return null;
196
            return null;
197
        }
197
        }
198
        RGBImageFilter imageFilter = getImageIconFilter();
199
        if( null != imageFilter ) {
200
            image = Toolkit.getDefaultToolkit().createImage( new FilteredImageSource( image.getSource(), imageFilter ) );
201
        }
202
        return ( ImageIcon ) image2Icon( image );
198
        return ( ImageIcon ) image2Icon( image );
203
    }
199
    }
204
    
200
    
 Lines 601-606    Link Here 
601
                }
597
                }
602
                name = new String(name).intern(); // NOPMD
598
                name = new String(name).intern(); // NOPMD
603
                result = ToolTipImage.createNew("", result, url);
599
                result = ToolTipImage.createNew("", result, url);
600
                result = applyIconFilter(result);
604
                cache.put(name, new ActiveRef<String>(result, cache, name));
601
                cache.put(name, new ActiveRef<String>(result, cache, name));
605
                return result;
602
                return result;
606
            } else { // no icon found
603
            } else { // no icon found
 Lines 648-659    Link Here 
648
            } catch (InterruptedException e) {
645
            } catch (InterruptedException e) {
649
                System.out.println("INTERRUPTED while loading Image");
646
                System.out.println("INTERRUPTED while loading Image");
650
            }
647
            }
651
648
//            HELP ME: It does not work with artificial images, which have been inverted by an ImageFilter
652
            assert (tracker.statusID(id, false) == MediaTracker.COMPLETE) : "Image loaded";
649
//            assert (tracker.statusID(id, false) == MediaTracker.COMPLETE) : "Expected 'Image loaded', but was " + tracker.statusID(id, false);
653
            tracker.removeImage(image, id);
650
            tracker.removeImage(image, id);
654
        }
651
        }
655
    }
652
    }
656
    
653
    
654
    private static Image applyIconFilter(Image image) {
655
        if (image == null) {
656
            return null;
657
        }
658
        RGBImageFilter imageFilter = getImageIconFilter();
659
        if (null != imageFilter) {
660
            return Toolkit.getDefaultToolkit().createImage(new FilteredImageSource(image.getSource(), imageFilter));
661
        }
662
        return image;
663
    }
664
    
657
    private static final Image doMergeImages(Image image1, Image image2, int x, int y) {
665
    private static final Image doMergeImages(Image image1, Image image2, int x, int y) {
658
        ensureLoaded(image1);
666
        ensureLoaded(image1);
659
        ensureLoaded(image2);
667
        ensureLoaded(image2);

Return to bug 262804
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo