use of sun.awt.AppContext in project jdk8u_jdk by JetBrains.
the class BumpBuffer method createBuffer.
private static BumpBuffer createBuffer(GraphicsConfiguration gc, Color topColor, Color shadowColor, Color backColor) {
AppContext context = AppContext.getAppContext();
List<BumpBuffer> buffers = (List<BumpBuffer>) context.get(METAL_BUMPS);
if (buffers == null) {
buffers = new ArrayList<BumpBuffer>();
context.put(METAL_BUMPS, buffers);
}
for (BumpBuffer buffer : buffers) {
if (buffer.hasSameConfiguration(gc, topColor, shadowColor, backColor)) {
return buffer;
}
}
BumpBuffer buffer = new BumpBuffer(gc, topColor, shadowColor, backColor);
buffers.add(buffer);
return buffer;
}
use of sun.awt.AppContext in project jdk8u_jdk by JetBrains.
the class Region method getLowerCaseNameMap.
private static Map<Region, String> getLowerCaseNameMap() {
AppContext context = AppContext.getAppContext();
Map<Region, String> map = (Map<Region, String>) context.get(LOWER_CASE_NAME_MAP_KEY);
if (map == null) {
map = new HashMap<Region, String>();
context.put(LOWER_CASE_NAME_MAP_KEY, map);
}
return map;
}
use of sun.awt.AppContext in project jdk8u_jdk by JetBrains.
the class JTextComponent method getKeymapTable.
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;
}
}
use of sun.awt.AppContext in project jdk8u_jdk by JetBrains.
the class LayoutQueue method getDefaultQueue.
/**
* 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;
}
}
use of sun.awt.AppContext in project jdk8u_jdk by JetBrains.
the class HTMLEditorKit method getStyleSheet.
/**
* Get the set of styles currently being used to render the
* HTML elements. By default the resource specified by
* DEFAULT_CSS gets loaded, and is shared by all HTMLEditorKit
* instances.
*/
public StyleSheet getStyleSheet() {
AppContext appContext = AppContext.getAppContext();
StyleSheet defaultStyles = (StyleSheet) appContext.get(DEFAULT_STYLES_KEY);
if (defaultStyles == null) {
defaultStyles = new StyleSheet();
appContext.put(DEFAULT_STYLES_KEY, defaultStyles);
try {
InputStream is = HTMLEditorKit.getResourceAsStream(DEFAULT_CSS);
Reader r = new BufferedReader(new InputStreamReader(is, "ISO-8859-1"));
defaultStyles.loadRules(r, null);
r.close();
} catch (Throwable e) {
// on error we simply have no styles... the html
// will look mighty wrong but still function.
}
}
return defaultStyles;
}
Aggregations