src/macosx/classes/com/apple/laf/AquaIcon.java

Print this page




 278         //static IconUIResource getNoteIconUIResource() { return noteIcon.get(); }
 279 
 280         private static final SystemIconSingleton caut = new SystemIconSingleton("caut");
 281         static SystemIcon getCautionIcon() { return caut.get(); }
 282 
 283         private static final SystemIconSingleton stop = new SystemIconSingleton("stop");
 284         static SystemIcon getStopIcon() { return stop.get(); }
 285 
 286         final String selector;
 287 
 288         public SystemIcon(final String iconSelector, final int width, final int height) {
 289             super(width, height);
 290             selector = iconSelector;
 291         }
 292 
 293         public SystemIcon(final String iconSelector) {
 294             this(iconSelector, 16, 16);
 295         }
 296 
 297         Image createImage() {
 298             int w = getIconWidth();
 299             int h = getIconHeight();
 300             return new AquaImageFactory.MultiResolutionIconImage(
 301                     AquaUtils.getCImageCreator().createSystemImageFromSelector(
 302                             selector, w, h),
 303                     AquaUtils.getCImageCreator().createSystemImageFromSelector(
 304                             selector, 2 * w, 2 * h)
 305             );
 306         }
 307     }
 308 }


 278         //static IconUIResource getNoteIconUIResource() { return noteIcon.get(); }
 279 
 280         private static final SystemIconSingleton caut = new SystemIconSingleton("caut");
 281         static SystemIcon getCautionIcon() { return caut.get(); }
 282 
 283         private static final SystemIconSingleton stop = new SystemIconSingleton("stop");
 284         static SystemIcon getStopIcon() { return stop.get(); }
 285 
 286         final String selector;
 287 
 288         public SystemIcon(final String iconSelector, final int width, final int height) {
 289             super(width, height);
 290             selector = iconSelector;
 291         }
 292 
 293         public SystemIcon(final String iconSelector) {
 294             this(iconSelector, 16, 16);
 295         }
 296 
 297         Image createImage() {
 298             return AquaUtils.getCImageCreator().createSystemImageFromSelector(
 299                     selector, getIconWidth(), getIconHeight());






 300         }
 301     }
 302 }