< prev index next >

src/java.desktop/windows/classes/sun/awt/windows/WTrayIconPeer.java

Print this page




 163                 }
 164             }
 165         }
 166 
 167         if (raster instanceof IntegerComponentRaster) {
 168             ficW = ((IntegerComponentRaster)raster).getScanlineStride();
 169         }
 170         setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
 171                       andMask, ficW, raster.getWidth(), raster.getHeight());
 172     }
 173 
 174     void postEvent(AWTEvent event) {
 175         WToolkit.postEvent(WToolkit.targetToAppContext(target), event);
 176     }
 177 
 178     native void create();
 179     synchronized native void _dispose();
 180 
 181     /*
 182      * Updates/adds the icon in/to the system tray.
 183      * @param doUpdate if <code>true</code>, updates the icon,
 184      * otherwise, adds the icon
 185      */
 186     native void updateNativeIcon(boolean doUpdate);
 187 
 188     native void setNativeIcon(int[] rData, byte[] andMask, int nScanStride,
 189                               int width, int height);
 190 
 191     native void _displayMessage(String caption, String text, String messageType);
 192 
 193     class IconObserver implements ImageObserver {
 194         @Override
 195         public boolean imageUpdate(Image image, int flags, int x, int y, int width, int height) {
 196             if (image != ((TrayIcon)target).getImage() || // if the image has been changed
 197                 isDisposed())
 198             {
 199                 return false;
 200             }
 201             if ((flags & (ImageObserver.FRAMEBITS | ImageObserver.ALLBITS |
 202                           ImageObserver.WIDTH | ImageObserver.HEIGHT)) != 0)
 203             {


 163                 }
 164             }
 165         }
 166 
 167         if (raster instanceof IntegerComponentRaster) {
 168             ficW = ((IntegerComponentRaster)raster).getScanlineStride();
 169         }
 170         setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
 171                       andMask, ficW, raster.getWidth(), raster.getHeight());
 172     }
 173 
 174     void postEvent(AWTEvent event) {
 175         WToolkit.postEvent(WToolkit.targetToAppContext(target), event);
 176     }
 177 
 178     native void create();
 179     synchronized native void _dispose();
 180 
 181     /*
 182      * Updates/adds the icon in/to the system tray.
 183      * @param doUpdate if {@code true}, updates the icon,
 184      * otherwise, adds the icon
 185      */
 186     native void updateNativeIcon(boolean doUpdate);
 187 
 188     native void setNativeIcon(int[] rData, byte[] andMask, int nScanStride,
 189                               int width, int height);
 190 
 191     native void _displayMessage(String caption, String text, String messageType);
 192 
 193     class IconObserver implements ImageObserver {
 194         @Override
 195         public boolean imageUpdate(Image image, int flags, int x, int y, int width, int height) {
 196             if (image != ((TrayIcon)target).getImage() || // if the image has been changed
 197                 isDisposed())
 198             {
 199                 return false;
 200             }
 201             if ((flags & (ImageObserver.FRAMEBITS | ImageObserver.ALLBITS |
 202                           ImageObserver.WIDTH | ImageObserver.HEIGHT)) != 0)
 203             {
< prev index next >