Search in sources :

Example 16 with AppContext

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;
}
Also used : AppContext(sun.awt.AppContext) List(java.util.List) ArrayList(java.util.ArrayList)

Example 17 with AppContext

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;
}
Also used : AppContext(sun.awt.AppContext) Map(java.util.Map) HashMap(java.util.HashMap)

Example 18 with AppContext

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;
    }
}
Also used : HashMap(java.util.HashMap) AppContext(sun.awt.AppContext)

Example 19 with AppContext

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;
    }
}
Also used : AppContext(sun.awt.AppContext)

Example 20 with AppContext

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;
}
Also used : AppContext(sun.awt.AppContext)

Aggregations

AppContext (sun.awt.AppContext)74 HashMap (java.util.HashMap)3 Hashtable (java.util.Hashtable)3 Locale (java.util.Locale)3 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 EventListenerAggregate (sun.awt.EventListenerAggregate)3 FlavorListener (java.awt.datatransfer.FlavorListener)2 WeakReference (java.lang.ref.WeakReference)2 Map (java.util.Map)2 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)2 LookAndFeel (javax.swing.LookAndFeel)2 MetalLookAndFeel (javax.swing.plaf.metal.MetalLookAndFeel)2 MetalTheme (javax.swing.plaf.metal.MetalTheme)2 ValueNamePair (org.compiere.util.ValueNamePair)2 PeerEvent (sun.awt.PeerEvent)2 AccumulativeRunnable (sun.swing.AccumulativeRunnable)2 Container (java.awt.Container)1 EventQueue (java.awt.EventQueue)1 Font (java.awt.Font)1 Rectangle (java.awt.Rectangle)1