Java Code Examples for java.awt.peer.TrayIconPeer#updateImage()

The following examples show how to use java.awt.peer.TrayIconPeer#updateImage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TrayIcon.java    From Java8CN with Apache License 2.0 3 votes vote down vote up
/**
 * 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 &#151; 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();
    }
}
 
Example 2
Source File: TrayIcon.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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 &#151; 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();
    }
}
 
Example 3
Source File: TrayIcon.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the image for this <code>TrayIcon</code>.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#151; 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();
    }
}
 
Example 4
Source File: TrayIcon.java    From openjdk-jdk9 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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 &#8212; 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();
    }
}
 
Example 5
Source File: TrayIcon.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the image for this <code>TrayIcon</code>.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#151; 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();
    }
}
 
Example 6
Source File: TrayIcon.java    From Bytecoder with Apache License 2.0 3 votes vote down vote up
/**
 * 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 &#8212; 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();
    }
}
 
Example 7
Source File: TrayIcon.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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 &#151; 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();
    }
}
 
Example 8
Source File: TrayIcon.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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 &#151; 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();
    }
}
 
Example 9
Source File: TrayIcon.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the image for this <code>TrayIcon</code>.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#151; 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();
    }
}
 
Example 10
Source File: TrayIcon.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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 &#151; 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();
    }
}
 
Example 11
Source File: TrayIcon.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * Sets the image for this <code>TrayIcon</code>.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#151; 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();
    }
}
 
Example 12
Source File: TrayIcon.java    From jdk8u-dev-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the image for this <code>TrayIcon</code>.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#151; 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();
    }
}
 
Example 13
Source File: TrayIcon.java    From JDKSourceCode1.8 with MIT License 3 votes vote down vote up
/**
 * Sets the image for this <code>TrayIcon</code>.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#151; 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();
    }
}
 
Example 14
Source File: TrayIcon.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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 &#151; 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();
    }
}
 
Example 15
Source File: TrayIcon.java    From jdk8u60 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the image for this <code>TrayIcon</code>.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#151; 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();
    }
}
 
Example 16
Source File: TrayIcon.java    From jdk-1.7-annotated with Apache License 2.0 3 votes vote down vote up
/**
 * Sets the image for this <code>TrayIcon</code>.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#151; 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();
    }
}
 
Example 17
Source File: TrayIcon.java    From jdk-1.7-annotated with Apache License 2.0 3 votes vote down vote up
/**
 * 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 &#151; 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();
    }
}
 
Example 18
Source File: TrayIcon.java    From jdk8u-dev-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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 &#151; 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();
    }
}
 
Example 19
Source File: TrayIcon.java    From dragonwell8_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the image for this <code>TrayIcon</code>.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#151; 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();
    }
}
 
Example 20
Source File: TrayIcon.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * 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 &#151; 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();
    }
}