java.awt.peer.TrayIconPeer Java Examples

The following examples show how to use java.awt.peer.TrayIconPeer. 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 jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #2
Source File: TrayIcon.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #3
Source File: TrayIcon.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #4
Source File: TrayIcon.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #5
Source File: TrayIcon.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #6
Source File: TrayIcon.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #7
Source File: TrayIcon.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #8
Source File: TrayIcon.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #9
Source File: TrayIcon.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #10
Source File: TrayIcon.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #11
Source File: TrayIcon.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
        if (popup != null) {
            popup.removeNotify();
        }
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #12
Source File: TrayIcon.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #13
Source File: TrayIcon.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #14
Source File: TrayIcon.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #15
Source File: TrayIcon.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
        if (popup != null) {
            popup.removeNotify();
        }
    }
    if (p != null) {
        p.dispose();
    }
}
 
Example #16
Source File: HeadlessToolkit.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public TrayIconPeer createTrayIcon(TrayIcon target)
  throws HeadlessException {
    throw new HeadlessException();
}
 
Example #17
Source File: SunToolkit.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public abstract TrayIconPeer createTrayIcon(TrayIcon target)
throws HeadlessException, AWTException;
 
Example #18
Source File: HToolkit.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public TrayIconPeer createTrayIcon(TrayIcon target)
  throws HeadlessException {
    throw new HeadlessException();
}
 
Example #19
Source File: SunToolkit.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public abstract TrayIconPeer createTrayIcon(TrayIcon target)
throws HeadlessException, AWTException;
 
Example #20
Source File: HeadlessToolkit.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public TrayIconPeer createTrayIcon(TrayIcon target)
  throws HeadlessException {
    throw new HeadlessException();
}
 
Example #21
Source File: TrayIcon.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Sets the tooltip string for this <code>TrayIcon</code>. The
 * tooltip is displayed automatically when the mouse hovers over
 * the icon.  Setting the tooltip to <code>null</code> removes any
 * tooltip text.
 *
 * When displayed, the tooltip string may be truncated on some platforms;
 * the number of characters that may be displayed is platform-dependent.
 *
 * @param tooltip the string for the tooltip; if the value is
 * <code>null</code> no tooltip is shown
 * @see #getToolTip
 */
public void setToolTip(String tooltip) {
    this.tooltip = tooltip;

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.setToolTip(tooltip);
    }
}
 
Example #22
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 #23
Source File: TrayIcon.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example #24
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 #25
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 #26
Source File: TrayIcon.java    From Java8CN with Apache License 2.0 3 votes vote down vote up
/**
 * Sets the tooltip string for this <code>TrayIcon</code>. The
 * tooltip is displayed automatically when the mouse hovers over
 * the icon.  Setting the tooltip to <code>null</code> removes any
 * tooltip text.
 *
 * When displayed, the tooltip string may be truncated on some platforms;
 * the number of characters that may be displayed is platform-dependent.
 *
 * @param tooltip the string for the tooltip; if the value is
 * <code>null</code> no tooltip is shown
 * @see #getToolTip
 */
public void setToolTip(String tooltip) {
    this.tooltip = tooltip;

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.setToolTip(tooltip);
    }
}
 
Example #27
Source File: TrayIcon.java    From Java8CN 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 #28
Source File: TrayIcon.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Displays a popup message near the tray icon.  The message will
 * disappear after a time or if the user clicks on it.  Clicking
 * on the message may trigger an {@code ActionEvent}.
 *
 * <p>Either the caption or the text may be <code>null</code>, but an
 * <code>NullPointerException</code> is thrown if both are
 * <code>null</code>.
 *
 * When displayed, the caption or text strings may be truncated on
 * some platforms; the number of characters that may be displayed is
 * platform-dependent.
 *
 * <p><strong>Note:</strong> Some platforms may not support
 * showing a message.
 *
 * @param caption the caption displayed above the text, usually in
 * bold; may be <code>null</code>
 * @param text the text displayed for the particular message; may be
 * <code>null</code>
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both <code>caption</code>
 * and <code>text</code> are <code>null</code>
 */
public void displayMessage(String caption, String text, MessageType messageType) {
    if (caption == null && text == null) {
        throw new NullPointerException("displaying the message with both caption and text being null");
    }

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.displayMessage(caption, text, messageType.name());
    }
}
 
Example #29
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 #30
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();
    }
}