Java 类sun.awt.HeadlessToolkit 实例源码

项目:OpenJSharp    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:OpenJSharp    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:jdk8u-jdk    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:jdk8u-jdk    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:openjdk-jdk10    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 *
 * @param  name the property name
 * @param  newValue the new property value
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:openjdk-jdk10    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:openjdk9    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 *
 * @param  name the property name
 * @param  newValue the new property value
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:openjdk9    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:Java8CN    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:Java8CN    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:jdk8u_jdk    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:jdk8u_jdk    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:lookaside_java-1.8.0-openjdk    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:VarJ    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed. 
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
}
项目:VarJ    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
       // This is a workaround for headless toolkits.  It would be
       // better to override this method but it is declared package private.
       // "this instanceof" syntax defeats polymorphism.
       // --mm, 03/03/00
       if (this instanceof HeadlessToolkit) {
           ((HeadlessToolkit)this).getUnderlyingToolkit()
               .notifyAWTEventListeners(theEvent);
           return;
       }

AWTEventListener eventListener = this.eventListener;
       if (eventListener != null) {
    eventListener.eventDispatched(theEvent);
       }
   }
项目:jdk-1.7-annotated    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:jdk-1.7-annotated    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:infobip-open-jdk-8    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:infobip-open-jdk-8    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:jdk8u-dev-jdk    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:jdk8u-dev-jdk    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:jdk7-jdk    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:jdk7-jdk    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:openjdk-source-code-learn    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:openjdk-source-code-learn    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:OLD-OpenJDK8    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:OLD-OpenJDK8    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:openjdk-jdk7u-jdk    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:openjdk-jdk7u-jdk    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:openjdk-icedtea7    文件:Toolkit.java   
/**
 * Sets the named desktop property to the specified value and fires a
 * property change event to notify any listeners that the value has changed.
 */
protected final void setDesktopProperty(String name, Object newValue) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .setDesktopProperty(name, newValue);
        return;
    }
    Object oldValue;

    synchronized (this) {
        oldValue = desktopProperties.get(name);
        desktopProperties.put(name, newValue);
    }

    // Don't fire change event if old and new values are null.
    // It helps to avoid recursive resending of WM_THEMECHANGED
    if (oldValue != null || newValue != null) {
        desktopPropsSupport.firePropertyChange(name, oldValue, newValue);
    }
}
项目:openjdk-icedtea7    文件:Toolkit.java   
void notifyAWTEventListeners(AWTEvent theEvent) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared package private.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        ((HeadlessToolkit)this).getUnderlyingToolkit()
            .notifyAWTEventListeners(theEvent);
        return;
    }

    AWTEventListener eventListener = this.eventListener;
    if (eventListener != null) {
        eventListener.eventDispatched(theEvent);
    }
}
项目:OpenJSharp    文件:TrayIcon.java   
void addNotify()
  throws AWTException
{
    synchronized (this) {
        if (peer == null) {
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            if (toolkit instanceof SunToolkit) {
                peer = ((SunToolkit)Toolkit.getDefaultToolkit()).createTrayIcon(this);
            } else if (toolkit instanceof HeadlessToolkit) {
                peer = ((HeadlessToolkit)Toolkit.getDefaultToolkit()).createTrayIcon(this);
            }
        }
    }
    peer.setToolTip(tooltip);
}
项目:OpenJSharp    文件:SystemTray.java   
synchronized void addNotify() {
    if (peer == null) {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        if (toolkit instanceof SunToolkit) {
            peer = ((SunToolkit)Toolkit.getDefaultToolkit()).createSystemTray(this);
        } else if (toolkit instanceof HeadlessToolkit) {
            peer = ((HeadlessToolkit)Toolkit.getDefaultToolkit()).createSystemTray(this);
        }
    }
}
项目:OpenJSharp    文件:Toolkit.java   
/**
 * Obtains a value for the specified desktop property.
 *
 * A desktop property is a uniquely named value for a resource that
 * is Toolkit global in nature. Usually it also is an abstract
 * representation for an underlying platform dependent desktop setting.
 * For more information on desktop properties supported by the AWT see
 * <a href="doc-files/DesktopProperties.html">AWT Desktop Properties</a>.
 */
public final synchronized Object getDesktopProperty(String propertyName) {
    // This is a workaround for headless toolkits.  It would be
    // better to override this method but it is declared final.
    // "this instanceof" syntax defeats polymorphism.
    // --mm, 03/03/00
    if (this instanceof HeadlessToolkit) {
        return ((HeadlessToolkit)this).getUnderlyingToolkit()
            .getDesktopProperty(propertyName);
    }

    if (desktopProperties.isEmpty()) {
        initializeDesktopProperties();
    }

    Object value;

    // This property should never be cached
    if (propertyName.equals("awt.dynamicLayoutSupported")) {
        return getDefaultToolkit().lazilyLoadDesktopProperty(propertyName);
    }

    value = desktopProperties.get(propertyName);

    if (value == null) {
        value = lazilyLoadDesktopProperty(propertyName);

        if (value != null) {
            setDesktopProperty(propertyName, value);
        }
    }

    /* for property "awt.font.desktophints" */
    if (value instanceof RenderingHints) {
        value = ((RenderingHints)value).clone();
    }

    return value;
}
项目:OpenJSharp    文件:Toolkit.java   
private static PropertyChangeSupport createPropertyChangeSupport(Toolkit toolkit) {
    if (toolkit instanceof SunToolkit || toolkit instanceof HeadlessToolkit) {
        return new DesktopPropertyChangeSupport(toolkit);
    } else {
        return new PropertyChangeSupport(toolkit);
    }
}
项目:OpenJSharp    文件:CFontManager.java   
@Override
public String getFontPath(boolean noType1Fonts) {
    // In the case of the Cocoa toolkit, since we go through NSFont, we don't need to register /Library/Fonts
    Toolkit tk = Toolkit.getDefaultToolkit();
    if (tk instanceof HeadlessToolkit) {
        tk = ((HeadlessToolkit)tk).getUnderlyingToolkit();
    }
    if (tk instanceof LWCToolkit) {
        return "";
    }

    // X11 case
    return "/Library/Fonts";
}
项目:OpenJSharp    文件:IkvmToolkit.java   
public static IkvmToolkit get()
{
    Toolkit tk = Toolkit.getDefaultToolkit();
    if (tk instanceof HeadlessToolkit)
    {
        tk = ((HeadlessToolkit)tk).getUnderlyingToolkit();
    }
    return (IkvmToolkit)tk;
}
项目:jdk8u-jdk    文件:TrayIcon.java   
void addNotify()
  throws AWTException
{
    synchronized (this) {
        if (peer == null) {
            Toolkit toolkit = Toolkit.getDefaultToolkit();
            if (toolkit instanceof SunToolkit) {
                peer = ((SunToolkit)Toolkit.getDefaultToolkit()).createTrayIcon(this);
            } else if (toolkit instanceof HeadlessToolkit) {
                peer = ((HeadlessToolkit)Toolkit.getDefaultToolkit()).createTrayIcon(this);
            }
        }
    }
    peer.setToolTip(tooltip);
}
项目:jdk8u-jdk    文件:SystemTray.java   
synchronized void addNotify() {
    if (peer == null) {
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        if (toolkit instanceof SunToolkit) {
            peer = ((SunToolkit)Toolkit.getDefaultToolkit()).createSystemTray(this);
        } else if (toolkit instanceof HeadlessToolkit) {
            peer = ((HeadlessToolkit)Toolkit.getDefaultToolkit()).createSystemTray(this);
        }
    }
}