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


Java AppContext.put方法代码示例

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


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

示例1: useAlternateFontforJALocales

import sun.awt.AppContext; //导入方法依赖的package包/类
public synchronized void useAlternateFontforJALocales() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger()
            .info("Entered useAlternateFontforJALocales().");
    }
    if (!FontUtilities.isWindows) {
        return;
    }

    if (!maybeMultiAppContext()) {
        gAltJAFont = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        appContext.put(altJAFontKey, altJAFontKey);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:SunFontManager.java

示例2: getKeymapTable

import sun.awt.AppContext; //导入方法依赖的package包/类
private static HashMap<String,Keymap> getKeymapTable() {
    synchronized (KEYMAP_TABLE) {
        AppContext appContext = AppContext.getAppContext();
        @SuppressWarnings("unchecked")
        HashMap<String,Keymap> keymapTable =
            (HashMap<String,Keymap>)appContext.get(KEYMAP_TABLE);
        if (keymapTable == null) {
            keymapTable = new HashMap<String,Keymap>(17);
            appContext.put(KEYMAP_TABLE, keymapTable);
            //initialize default keymap
            Keymap binding = addKeymap(DEFAULT_KEYMAP, null);
            binding.setDefaultAction(new
                                     DefaultEditorKit.DefaultKeyTypedAction());
        }
        return keymapTable;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:18,代码来源:JTextComponent.java

示例3: getDoSubmit

import sun.awt.AppContext; //导入方法依赖的package包/类
private static AccumulativeRunnable<Runnable> getDoSubmit() {
    synchronized (DO_SUBMIT_KEY) {
        final AppContext appContext = AppContext.getAppContext();
        Object doSubmit = appContext.get(DO_SUBMIT_KEY);
        if (doSubmit == null) {
            doSubmit = new DoSubmitAccumulativeRunnable();
            appContext.put(DO_SUBMIT_KEY, doSubmit);
        }
        @SuppressWarnings("unchecked")
        AccumulativeRunnable<Runnable> tmp = (AccumulativeRunnable<Runnable>) doSubmit;
        return tmp;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:SwingWorker.java

示例4: defaultManager

import sun.awt.AppContext; //导入方法依赖的package包/类
/**
 * Returns the default menu selection manager.
 *
 * @return a MenuSelectionManager object
 */
public static MenuSelectionManager defaultManager() {
    synchronized (MENU_SELECTION_MANAGER_KEY) {
        AppContext context = AppContext.getAppContext();
        MenuSelectionManager msm = (MenuSelectionManager)context.get(
                                             MENU_SELECTION_MANAGER_KEY);
        if (msm == null) {
            msm = new MenuSelectionManager();
            context.put(MENU_SELECTION_MANAGER_KEY, msm);

            // installing additional listener if found in the AppContext
            Object o = context.get(SwingUtilities2.MENU_SELECTION_MANAGER_LISTENER_KEY);
            if (o != null && o instanceof ChangeListener) {
                msm.addChangeListener((ChangeListener) o);
            }
        }

        return msm;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:MenuSelectionManager.java

示例5: preferProportionalFonts

import sun.awt.AppContext; //导入方法依赖的package包/类
public synchronized void preferProportionalFonts() {
    if (FontUtilities.isLogging()) {
        FontUtilities.getLogger()
            .info("Entered preferProportionalFonts().");
    }
    /* If no proportional fonts are configured, there's no need
     * to take any action.
     */
    if (!FontConfiguration.hasMonoToPropMap()) {
        return;
    }

    if (!maybeMultiAppContext()) {
        if (gPropPref == true) {
            return;
        }
        gPropPref = true;
        createCompositeFonts(fontNameCache, gLocalePref, gPropPref);
        _usingAlternateComposites = true;
    } else {
        AppContext appContext = AppContext.getAppContext();
        if (appContext.get(proportionalFontKey) == proportionalFontKey) {
            return;
        }
        appContext.put(proportionalFontKey, proportionalFontKey);
        boolean acLocalePref =
            appContext.get(localeFontKey) == localeFontKey;
        ConcurrentHashMap<String, Font2D>
            altNameCache = new ConcurrentHashMap<String, Font2D> ();
        /* If there is an existing hashtable, we can drop it. */
        appContext.put(CompositeFont.class, altNameCache);
        _usingPerAppContextComposites = true;
        createCompositeFonts(altNameCache, acLocalePref, true);
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:36,代码来源:SunFontManager.java

示例6: createUI

import sun.awt.AppContext; //导入方法依赖的package包/类
public static ComponentUI createUI(JComponent b) {
    AppContext appContext = AppContext.getAppContext();
    BasicToggleButtonUI toggleButtonUI =
            (BasicToggleButtonUI) appContext.get(BASIC_TOGGLE_BUTTON_UI_KEY);
    if (toggleButtonUI == null) {
        toggleButtonUI = new BasicToggleButtonUI();
        appContext.put(BASIC_TOGGLE_BUTTON_UI_KEY, toggleButtonUI);
    }
    return toggleButtonUI;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:BasicToggleButtonUI.java

示例7: getCurrentKeyboardFocusManager

import sun.awt.AppContext; //导入方法依赖的package包/类
synchronized static KeyboardFocusManager
    getCurrentKeyboardFocusManager(AppContext appcontext)
{
    KeyboardFocusManager manager = (KeyboardFocusManager)
        appcontext.get(KeyboardFocusManager.class);
    if (manager == null) {
        manager = new DefaultKeyboardFocusManager();
        appcontext.put(KeyboardFocusManager.class, manager);
    }
    return manager;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:KeyboardFocusManager.java

示例8: getCacheInfo

import sun.awt.AppContext; //导入方法依赖的package包/类
/**
 * Returns the <code>CacheInfo</code> object associated with this
 * <code>ThreadGroup</code>.
 */
private static synchronized CacheInfo getCacheInfo() {
    AppContext context = AppContext.getAppContext();
    CacheInfo info = (CacheInfo)context.get(CacheInfo.class);
    if (info == null) {
        info = new CacheInfo();
        context.put(CacheInfo.class, info);
    }
    return info;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:ImageIO.java

示例9: currentManager

import sun.awt.AppContext; //导入方法依赖的package包/类
/**
 * Returns the RepaintManager for the specified AppContext.  If
 * a RepaintManager has not been created for the specified
 * AppContext this will return null.
 */
static RepaintManager currentManager(AppContext appContext) {
    RepaintManager rm = (RepaintManager)appContext.get(repaintManagerKey);
    if (rm == null) {
        rm = new RepaintManager(BUFFER_STRATEGY_TYPE);
        appContext.put(repaintManagerKey, rm);
    }
    return rm;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:14,代码来源:RepaintManager.java

示例10: getFetcherInfo

import sun.awt.AppContext; //导入方法依赖的package包/类
static FetcherInfo getFetcherInfo() {
    AppContext appContext = AppContext.getAppContext();
    synchronized(appContext) {
        FetcherInfo info = (FetcherInfo)appContext.get(FETCHER_INFO_KEY);
        if (info == null) {
            info = new FetcherInfo();
            appContext.put(FETCHER_INFO_KEY, info);
        }
        return info;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:12,代码来源:ImageFetcher.java

示例11: createUI

import sun.awt.AppContext; //导入方法依赖的package包/类
public static ComponentUI createUI(JComponent c) {
    AppContext appContext = AppContext.getAppContext();
    MotifRadioButtonUI motifRadioButtonUI =
            (MotifRadioButtonUI) appContext.get(MOTIF_RADIO_BUTTON_UI_KEY);
    if (motifRadioButtonUI == null) {
        motifRadioButtonUI = new MotifRadioButtonUI();
        appContext.put(MOTIF_RADIO_BUTTON_UI_KEY, motifRadioButtonUI);
    }
    return motifRadioButtonUI;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:MotifRadioButtonUI.java

示例12: createUI

import sun.awt.AppContext; //导入方法依赖的package包/类
public static ComponentUI createUI(JComponent c) {
    AppContext appContext = AppContext.getAppContext();
    WindowsCheckBoxUI windowsCheckBoxUI =
            (WindowsCheckBoxUI) appContext.get(WINDOWS_CHECK_BOX_UI_KEY);
    if (windowsCheckBoxUI == null) {
        windowsCheckBoxUI = new WindowsCheckBoxUI();
        appContext.put(WINDOWS_CHECK_BOX_UI_KEY, windowsCheckBoxUI);
    }
    return windowsCheckBoxUI;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:WindowsCheckBoxUI.java

示例13: createUI

import sun.awt.AppContext; //导入方法依赖的package包/类
public static ComponentUI createUI(JComponent c) {
    AppContext appContext = AppContext.getAppContext();
    MotifCheckBoxUI motifCheckBoxUI =
            (MotifCheckBoxUI) appContext.get(MOTIF_CHECK_BOX_UI_KEY);
    if (motifCheckBoxUI == null) {
        motifCheckBoxUI = new MotifCheckBoxUI();
        appContext.put(MOTIF_CHECK_BOX_UI_KEY, motifCheckBoxUI);
    }
    return motifCheckBoxUI;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:MotifCheckBoxUI.java

示例14: createUI

import sun.awt.AppContext; //导入方法依赖的package包/类
/**
 * Returns an instance of {@code MetalLabelUI}.
 *
 * @param c a component
 * @return an instance of {@code MetalLabelUI}
 */
public static ComponentUI createUI(JComponent c) {
    if (System.getSecurityManager() != null) {
        AppContext appContext = AppContext.getAppContext();
        MetalLabelUI safeMetalLabelUI =
                (MetalLabelUI) appContext.get(METAL_LABEL_UI_KEY);
        if (safeMetalLabelUI == null) {
            safeMetalLabelUI = new MetalLabelUI();
            appContext.put(METAL_LABEL_UI_KEY, safeMetalLabelUI);
        }
        return safeMetalLabelUI;
    }
    return metalLabelUI;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:MetalLabelUI.java

示例15: getDefaultQueue

import sun.awt.AppContext; //导入方法依赖的package包/类
/**
 * Fetch the default layout queue.
 */
public static LayoutQueue getDefaultQueue() {
    AppContext ac = AppContext.getAppContext();
    synchronized (DEFAULT_QUEUE) {
        LayoutQueue defaultQueue = (LayoutQueue) ac.get(DEFAULT_QUEUE);
        if (defaultQueue == null) {
            defaultQueue = new LayoutQueue();
            ac.put(DEFAULT_QUEUE, defaultQueue);
        }
        return defaultQueue;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:LayoutQueue.java


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