当前位置: 首页>>代码示例>>Java>>正文


Java HeadlessToolkit类代码示例

本文整理汇总了Java中sun.awt.HeadlessToolkit的典型用法代码示例。如果您正苦于以下问题:Java HeadlessToolkit类的具体用法?Java HeadlessToolkit怎么用?Java HeadlessToolkit使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


HeadlessToolkit类属于sun.awt包,在下文中一共展示了HeadlessToolkit类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setDesktopProperty

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:28,代码来源:Toolkit.java

示例2: notifyAWTEventListeners

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:Toolkit.java

示例3: setDesktopProperty

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:31,代码来源:Toolkit.java

示例4: setDesktopProperty

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:24,代码来源:Toolkit.java

示例5: notifyAWTEventListeners

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
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);
       }
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:17,代码来源:Toolkit.java

示例6: addNotify

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:TrayIcon.java

示例7: addNotify

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
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);
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:SystemTray.java

示例8: getDesktopProperty

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:48,代码来源:Toolkit.java

示例9: createPropertyChangeSupport

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
private static PropertyChangeSupport createPropertyChangeSupport(Toolkit toolkit) {
    if (toolkit instanceof SunToolkit || toolkit instanceof HeadlessToolkit) {
        return new DesktopPropertyChangeSupport(toolkit);
    } else {
        return new PropertyChangeSupport(toolkit);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:Toolkit.java

示例10: getFontPath

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
@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";
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:CFontManager.java

示例11: get

import sun.awt.HeadlessToolkit; //导入依赖的package包/类
public static IkvmToolkit get()
{
	Toolkit tk = Toolkit.getDefaultToolkit();
	if (tk instanceof HeadlessToolkit)
	{
		tk = ((HeadlessToolkit)tk).getUnderlyingToolkit();
	}
	return (IkvmToolkit)tk;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:IkvmToolkit.java


注:本文中的sun.awt.HeadlessToolkit类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。