下面列出了java.awt.peer.TrayIconPeer#updateImage ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
/**
* Sets the image for this <code>TrayIcon</code>. The previous
* tray icon image is discarded without calling the {@link
* java.awt.Image#flush} method — you will need to call it
* manually.
*
* <p> If the image represents an animated image, it will be
* animated automatically.
*
* <p> See the {@link #setImageAutoSize(boolean)} property for
* details on the size of the displayed image.
*
* <p> Calling this method with the same image that is currently
* being used has no effect.
*
* @throws NullPointerException if <code>image</code> is <code>null</code>
* @param image the non-null <code>Image</code> to be used
* @see #getImage
* @see Image
* @see SystemTray#add(TrayIcon)
* @see TrayIcon#TrayIcon(Image, String)
*/
public void setImage(Image image) {
if (image == null) {
throw new NullPointerException("setting null Image");
}
this.image = image;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to <code>false</code>.
*
* <p> If auto-size is <code>false</code>, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is <code>true</code>, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize <code>true</code> to auto-size the image,
* <code>false</code> otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the image for this <code>TrayIcon</code>. The previous
* tray icon image is discarded without calling the {@link
* java.awt.Image#flush} method — you will need to call it
* manually.
*
* <p> If the image represents an animated image, it will be
* animated automatically.
*
* <p> See the {@link #setImageAutoSize(boolean)} property for
* details on the size of the displayed image.
*
* <p> Calling this method with the same image that is currently
* being used has no effect.
*
* @throws NullPointerException if <code>image</code> is <code>null</code>
* @param image the non-null <code>Image</code> to be used
* @see #getImage
* @see Image
* @see SystemTray#add(TrayIcon)
* @see TrayIcon#TrayIcon(Image, String)
*/
public void setImage(Image image) {
if (image == null) {
throw new NullPointerException("setting null Image");
}
this.image = image;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to <code>false</code>.
*
* <p> If auto-size is <code>false</code>, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is <code>true</code>, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize <code>true</code> to auto-size the image,
* <code>false</code> otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to <code>false</code>.
*
* <p> If auto-size is <code>false</code>, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is <code>true</code>, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize <code>true</code> to auto-size the image,
* <code>false</code> otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the image for this <code>TrayIcon</code>. The previous
* tray icon image is discarded without calling the {@link
* java.awt.Image#flush} method — you will need to call it
* manually.
*
* <p> If the image represents an animated image, it will be
* animated automatically.
*
* <p> See the {@link #setImageAutoSize(boolean)} property for
* details on the size of the displayed image.
*
* <p> Calling this method with the same image that is currently
* being used has no effect.
*
* @throws NullPointerException if <code>image</code> is <code>null</code>
* @param image the non-null <code>Image</code> to be used
* @see #getImage
* @see Image
* @see SystemTray#add(TrayIcon)
* @see TrayIcon#TrayIcon(Image, String)
*/
public void setImage(Image image) {
if (image == null) {
throw new NullPointerException("setting null Image");
}
this.image = image;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the image for this <code>TrayIcon</code>. The previous
* tray icon image is discarded without calling the {@link
* java.awt.Image#flush} method — you will need to call it
* manually.
*
* <p> If the image represents an animated image, it will be
* animated automatically.
*
* <p> See the {@link #setImageAutoSize(boolean)} property for
* details on the size of the displayed image.
*
* <p> Calling this method with the same image that is currently
* being used has no effect.
*
* @throws NullPointerException if <code>image</code> is <code>null</code>
* @param image the non-null <code>Image</code> to be used
* @see #getImage
* @see Image
* @see SystemTray#add(TrayIcon)
* @see TrayIcon#TrayIcon(Image, String)
*/
public void setImage(Image image) {
if (image == null) {
throw new NullPointerException("setting null Image");
}
this.image = image;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to <code>false</code>.
*
* <p> If auto-size is <code>false</code>, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is <code>true</code>, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize <code>true</code> to auto-size the image,
* <code>false</code> otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the image for this <code>TrayIcon</code>. The previous
* tray icon image is discarded without calling the {@link
* java.awt.Image#flush} method — you will need to call it
* manually.
*
* <p> If the image represents an animated image, it will be
* animated automatically.
*
* <p> See the {@link #setImageAutoSize(boolean)} property for
* details on the size of the displayed image.
*
* <p> Calling this method with the same image that is currently
* being used has no effect.
*
* @throws NullPointerException if <code>image</code> is <code>null</code>
* @param image the non-null <code>Image</code> to be used
* @see #getImage
* @see Image
* @see SystemTray#add(TrayIcon)
* @see TrayIcon#TrayIcon(Image, String)
*/
public void setImage(Image image) {
if (image == null) {
throw new NullPointerException("setting null Image");
}
this.image = image;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the image for this <code>TrayIcon</code>. The previous
* tray icon image is discarded without calling the {@link
* java.awt.Image#flush} method — you will need to call it
* manually.
*
* <p> If the image represents an animated image, it will be
* animated automatically.
*
* <p> See the {@link #setImageAutoSize(boolean)} property for
* details on the size of the displayed image.
*
* <p> Calling this method with the same image that is currently
* being used has no effect.
*
* @throws NullPointerException if <code>image</code> is <code>null</code>
* @param image the non-null <code>Image</code> to be used
* @see #getImage
* @see Image
* @see SystemTray#add(TrayIcon)
* @see TrayIcon#TrayIcon(Image, String)
*/
public void setImage(Image image) {
if (image == null) {
throw new NullPointerException("setting null Image");
}
this.image = image;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to <code>false</code>.
*
* <p> If auto-size is <code>false</code>, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is <code>true</code>, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize <code>true</code> to auto-size the image,
* <code>false</code> otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to <code>false</code>.
*
* <p> If auto-size is <code>false</code>, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is <code>true</code>, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize <code>true</code> to auto-size the image,
* <code>false</code> otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the image for this <code>TrayIcon</code>. The previous
* tray icon image is discarded without calling the {@link
* java.awt.Image#flush} method — you will need to call it
* manually.
*
* <p> If the image represents an animated image, it will be
* animated automatically.
*
* <p> See the {@link #setImageAutoSize(boolean)} property for
* details on the size of the displayed image.
*
* <p> Calling this method with the same image that is currently
* being used has no effect.
*
* @throws NullPointerException if <code>image</code> is <code>null</code>
* @param image the non-null <code>Image</code> to be used
* @see #getImage
* @see Image
* @see SystemTray#add(TrayIcon)
* @see TrayIcon#TrayIcon(Image, String)
*/
public void setImage(Image image) {
if (image == null) {
throw new NullPointerException("setting null Image");
}
this.image = image;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to <code>false</code>.
*
* <p> If auto-size is <code>false</code>, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is <code>true</code>, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize <code>true</code> to auto-size the image,
* <code>false</code> otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to <code>false</code>.
*
* <p> If auto-size is <code>false</code>, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is <code>true</code>, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize <code>true</code> to auto-size the image,
* <code>false</code> otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to {@code false}.
*
* <p> If auto-size is {@code false}, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is {@code true}, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize {@code true} to auto-size the image,
* {@code false} otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the image for this <code>TrayIcon</code>. The previous
* tray icon image is discarded without calling the {@link
* java.awt.Image#flush} method — you will need to call it
* manually.
*
* <p> If the image represents an animated image, it will be
* animated automatically.
*
* <p> See the {@link #setImageAutoSize(boolean)} property for
* details on the size of the displayed image.
*
* <p> Calling this method with the same image that is currently
* being used has no effect.
*
* @throws NullPointerException if <code>image</code> is <code>null</code>
* @param image the non-null <code>Image</code> to be used
* @see #getImage
* @see Image
* @see SystemTray#add(TrayIcon)
* @see TrayIcon#TrayIcon(Image, String)
*/
public void setImage(Image image) {
if (image == null) {
throw new NullPointerException("setting null Image");
}
this.image = image;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to {@code false}.
*
* <p> If auto-size is {@code false}, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is {@code true}, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize {@code true} to auto-size the image,
* {@code false} otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the image for this <code>TrayIcon</code>. The previous
* tray icon image is discarded without calling the {@link
* java.awt.Image#flush} method — you will need to call it
* manually.
*
* <p> If the image represents an animated image, it will be
* animated automatically.
*
* <p> See the {@link #setImageAutoSize(boolean)} property for
* details on the size of the displayed image.
*
* <p> Calling this method with the same image that is currently
* being used has no effect.
*
* @throws NullPointerException if <code>image</code> is <code>null</code>
* @param image the non-null <code>Image</code> to be used
* @see #getImage
* @see Image
* @see SystemTray#add(TrayIcon)
* @see TrayIcon#TrayIcon(Image, String)
*/
public void setImage(Image image) {
if (image == null) {
throw new NullPointerException("setting null Image");
}
this.image = image;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}
/**
* Sets the auto-size property. Auto-size determines whether the
* tray image is automatically sized to fit the space allocated
* for the image on the tray. By default, the auto-size property
* is set to <code>false</code>.
*
* <p> If auto-size is <code>false</code>, and the image size
* doesn't match the tray icon space, the image is painted as-is
* inside that space — if larger than the allocated space, it will
* be cropped.
*
* <p> If auto-size is <code>true</code>, the image is stretched or shrunk to
* fit the tray icon space.
*
* @param autosize <code>true</code> to auto-size the image,
* <code>false</code> otherwise
* @see #isImageAutoSize
*/
public void setImageAutoSize(boolean autosize) {
this.autosize = autosize;
TrayIconPeer peer = this.peer;
if (peer != null) {
peer.updateImage();
}
}