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