Java 类java.awt.peer.TrayIconPeer 实例源码

项目:VarJ    文件:TrayIcon.java   
void processMouseEvent(MouseEvent e) {
    MouseListener listener = mouseListener;

    TrayIconPeer peer = this.peer;
    if (e.isPopupTrigger() &&  peer != null) {
        peer.showPopupMenu(e.getPoint().x, e.getPoint().y);
    }

    if (listener != null) {
        int id = e.getID();
        switch(id) {
        case MouseEvent.MOUSE_PRESSED:
            listener.mousePressed(e);
            break;
        case MouseEvent.MOUSE_RELEASED:
            listener.mouseReleased(e);
            break;
        case MouseEvent.MOUSE_CLICKED:
            listener.mouseClicked(e);
            break;
        default:
            return;
        }
    }
}
项目:OpenJSharp    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:jdk8u-jdk    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:openjdk-jdk10    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
        if (popup != null) {
            popup.removeNotify();
        }
    }
    if (p != null) {
        p.dispose();
    }
}
项目:openjdk9    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:Java8CN    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:jdk8u_jdk    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:VarJ    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:jdk-1.7-annotated    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:infobip-open-jdk-8    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:jdk8u-dev-jdk    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:jdk7-jdk    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:openjdk-source-code-learn    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:OLD-OpenJDK8    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:openjdk-jdk7u-jdk    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:openjdk-icedtea7    文件:TrayIcon.java   
void removeNotify() {
    TrayIconPeer p = null;
    synchronized (this) {
        p = peer;
        peer = null;
    }
    if (p != null) {
        p.dispose();
    }
}
项目:openjdk-jdk10    文件:HeadlessToolkit.java   
public TrayIconPeer createTrayIcon(TrayIcon target)
  throws HeadlessException {
    throw new HeadlessException();
}
项目:openjdk-jdk10    文件:SunToolkit.java   
public abstract TrayIconPeer createTrayIcon(TrayIcon target)
throws HeadlessException, AWTException;
项目:openjdk-jdk10    文件:HToolkit.java   
@Override
public TrayIconPeer createTrayIcon(TrayIcon target)
  throws HeadlessException {
    throw new HeadlessException();
}
项目:openjdk9    文件:HeadlessToolkit.java   
public TrayIconPeer createTrayIcon(TrayIcon target)
  throws HeadlessException {
    throw new HeadlessException();
}
项目:openjdk9    文件:SunToolkit.java   
public abstract TrayIconPeer createTrayIcon(TrayIcon target)
throws HeadlessException, AWTException;
项目:openjdk9    文件:HToolkit.java   
@Override
public TrayIconPeer createTrayIcon(TrayIcon target)
  throws HeadlessException {
    throw new HeadlessException();
}
项目:OpenJSharp    文件:TrayIcon.java   
/**
 * 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();
    }
}
项目:OpenJSharp    文件:TrayIcon.java   
/**
 * 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);
    }
}
项目:OpenJSharp    文件:TrayIcon.java   
/**
 * 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();
    }
}
项目:OpenJSharp    文件:TrayIcon.java   
/**
 * 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());
    }
}
项目:jdk8u-jdk    文件:TrayIcon.java   
/**
 * 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();
    }
}
项目:jdk8u-jdk    文件:TrayIcon.java   
/**
 * 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);
    }
}
项目:jdk8u-jdk    文件:TrayIcon.java   
/**
 * 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();
    }
}
项目:jdk8u-jdk    文件:TrayIcon.java   
/**
 * 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());
    }
}
项目:openjdk-jdk10    文件:TrayIcon.java   
/**
 * Sets the image for this {@code TrayIcon}.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#8212; 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} is {@code null}
 * @param image the non-null {@code Image} 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();
    }
}
项目:openjdk-jdk10    文件:TrayIcon.java   
/**
 * Sets the tooltip string for this {@code TrayIcon}. The
 * tooltip is displayed automatically when the mouse hovers over
 * the icon.  Tooltip may be not visible on some platforms.
 * Setting the tooltip to {@code null} 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} no tooltip is shown
 * @see #getToolTip
 */
public void setToolTip(String tooltip) {
    this.tooltip = tooltip;

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.setToolTip(tooltip);
    }
}
项目:openjdk-jdk10    文件:TrayIcon.java   
/**
 * 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();
    }
}
项目:openjdk-jdk10    文件:TrayIcon.java   
/**
 * 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}, but an
 * {@code NullPointerException} is thrown if both are
 * {@code null}.
 *
 * 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}
 * @param text the text displayed for the particular message; may be
 * {@code null}
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both {@code caption}
 * and {@code text} are {@code null}
 */
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());
    }
}
项目:openjdk9    文件:TrayIcon.java   
/**
 * Sets the image for this {@code TrayIcon}.  The previous
 * tray icon image is discarded without calling the {@link
 * java.awt.Image#flush} method &#8212; 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} is {@code null}
 * @param image the non-null {@code Image} 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();
    }
}
项目:openjdk9    文件:TrayIcon.java   
/**
 * Sets the tooltip string for this {@code TrayIcon}. The
 * tooltip is displayed automatically when the mouse hovers over
 * the icon.  Setting the tooltip to {@code null} 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} no tooltip is shown
 * @see #getToolTip
 */
public void setToolTip(String tooltip) {
    this.tooltip = tooltip;

    TrayIconPeer peer = this.peer;
    if (peer != null) {
        peer.setToolTip(tooltip);
    }
}
项目:openjdk9    文件:TrayIcon.java   
/**
 * 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();
    }
}
项目:openjdk9    文件:TrayIcon.java   
/**
 * 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}, but an
 * {@code NullPointerException} is thrown if both are
 * {@code null}.
 *
 * 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}
 * @param text the text displayed for the particular message; may be
 * {@code null}
 * @param messageType an enum indicating the message type
 * @throws NullPointerException if both {@code caption}
 * and {@code text} are {@code null}
 */
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());
    }
}
项目:Java8CN    文件:TrayIcon.java   
/**
 * 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();
    }
}