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


Java AppContext.get方法代码示例

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


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

示例1: getKeymapTable

import sun.awt.AppContext; //导入方法依赖的package包/类
private static HashMap<String,Keymap> getKeymapTable() {
    synchronized (KEYMAP_TABLE) {
        AppContext appContext = AppContext.getAppContext();
        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:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:JTextComponent.java

示例2: getPresentationManager

import sun.awt.AppContext; //导入方法依赖的package包/类
/**
 * Returns the Presentation Manager for the current thread group, using the ThreadGroup-specific
 * AppContext to hold it. Creates and records one if needed.
 */
public static PresentationManager getPresentationManager()
{
    SecurityManager sm = System.getSecurityManager();
    if (sm != null && AppContext.getAppContexts().size() > 0) {
        AppContext ac = AppContext.getAppContext();
        if (ac != null) {
            synchronized (pmLock) {
                PresentationManager pm =
                    (PresentationManager) ac.get(PresentationManager.class);
                if (pm == null) {
                    pm = setupPresentationManager();
                    ac.put(PresentationManager.class, pm);
                }
                return pm;
            }
        }
    }

    // No security manager or AppContext
    return Holder.defaultPresentationManager;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:ORB.java

示例3: getCreatedFonts

import sun.awt.AppContext; //导入方法依赖的package包/类
public Font[] getCreatedFonts() {

        Hashtable<String,Font2D> nameTable;
        if (fontsAreRegistered) {
            nameTable = createdByFullName;
        } else if (fontsAreRegisteredPerAppContext) {
            AppContext appContext = AppContext.getAppContext();
            nameTable =
                (Hashtable<String,Font2D>)appContext.get(regFullNameKey);
        } else {
            return null;
        }

        Locale l = getSystemStartupLocale();
        synchronized (nameTable) {
            Font[] fonts = new Font[nameTable.size()];
            int i=0;
            for (Font2D font2D : nameTable.values()) {
                fonts[i++] = new Font(font2D.getFontName(l), Font.PLAIN, 1);
            }
            return fonts;
        }
    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:24,代码来源:SunFontManager.java

示例4: scheduleDisplayChanges

import sun.awt.AppContext; //导入方法依赖的package包/类
private static void scheduleDisplayChanges() {
    // To avoid threading problems, we notify each RepaintManager
    // on the thread it was created on.
    for (AppContext context : AppContext.getAppContexts()) {
        synchronized(context) {
            if (!context.isDisposed()) {
                EventQueue eventQueue = (EventQueue)context.get(
                    AppContext.EVENT_QUEUE_KEY);
                if (eventQueue != null) {
                    eventQueue.postEvent(new InvocationEvent(
                        Toolkit.getDefaultToolkit(),
                        new DisplayChangedRunnable()));
                }
            }
        }
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:RepaintManager.java

示例5: createUI

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

示例6: getDefaultFlavorMap

import sun.awt.AppContext; //导入方法依赖的package包/类
/**
 * Returns the default FlavorMap for this thread's ClassLoader.
 */
public static FlavorMap getDefaultFlavorMap() {
    AppContext context = AppContext.getAppContext();
    FlavorMap fm = (FlavorMap) context.get(FLAVOR_MAP_KEY);
    if (fm == null) {
        fm = new SystemFlavorMap();
        context.put(FLAVOR_MAP_KEY, fm);
    }
    return fm;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:13,代码来源:SystemFlavorMap.java

示例7: createUI

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

示例8: getCreatedFontFamilyNames

import sun.awt.AppContext; //导入方法依赖的package包/类
public TreeMap<String, String> getCreatedFontFamilyNames() {

        Hashtable<String,FontFamily> familyTable;
        if (fontsAreRegistered) {
            familyTable = createdByFamilyName;
        } else if (fontsAreRegisteredPerAppContext) {
            AppContext appContext = AppContext.getAppContext();
            @SuppressWarnings("unchecked")
            Hashtable<String,FontFamily> tmp =
                (Hashtable<String,FontFamily>)appContext.get(regFamilyKey);
            familyTable = tmp;
        } else {
            return null;
        }

        Locale l = getSystemStartupLocale();
        synchronized (familyTable) {
            TreeMap<String, String> map = new TreeMap<String, String>();
            for (FontFamily f : familyTable.values()) {
                Font2D font2D = f.getFont(Font.PLAIN);
                if (font2D == null) {
                    font2D = f.getClosestStyle(Font.PLAIN);
                }
                String name = font2D.getFamilyName(l);
                map.put(name.toLowerCase(l), name);
            }
            return map;
        }
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:30,代码来源:SunFontManager.java

示例9: 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

示例10: createUI

import sun.awt.AppContext; //导入方法依赖的package包/类
/**
 * Returns an instance of {@code BasicRadioButtonUI}.
 *
 * @param b a component
 * @return an instance of {@code BasicRadioButtonUI}
 */
public static ComponentUI createUI(JComponent b) {
    AppContext appContext = AppContext.getAppContext();
    BasicRadioButtonUI radioButtonUI =
            (BasicRadioButtonUI) appContext.get(BASIC_RADIO_BUTTON_UI_KEY);
    if (radioButtonUI == null) {
        radioButtonUI = new BasicRadioButtonUI();
        appContext.put(BASIC_RADIO_BUTTON_UI_KEY, radioButtonUI);
    }
    return radioButtonUI;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:17,代码来源:BasicRadioButtonUI.java

示例11: createUI

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

示例12: getAnimationController

import sun.awt.AppContext; //导入方法依赖的package包/类
private static synchronized AnimationController getAnimationController() {
    AppContext appContext = AppContext.getAppContext();
    Object obj = appContext.get(ANIMATION_CONTROLLER_KEY);
    if (obj == null) {
        obj = new AnimationController();
        appContext.put(ANIMATION_CONTROLLER_KEY, obj);
    }
    return (AnimationController) obj;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:10,代码来源:AnimationController.java

示例13: createUI

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

示例14: 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:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:MotifCheckBoxUI.java

示例15: createUI

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


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