本文整理汇总了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);
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}