Java Code Examples for sun.swing.SwingUtilities2#putAATextInfo()

The following examples show how to use sun.swing.SwingUtilities2#putAATextInfo() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MetalLookAndFeel.java    From Bytecoder with Apache License 2.0 5 votes vote down vote up
public void propertyChange(PropertyChangeEvent pce) {
    LookAndFeel laf = get();
    if (laf == null || laf != UIManager.getLookAndFeel()) {
        dispose();
        return;
    }
    UIDefaults defaults = UIManager.getLookAndFeelDefaults();
    boolean lafCond = SwingUtilities2.isLocalDisplay();
    SwingUtilities2.putAATextInfo(lafCond, defaults);
    updateUI();
}
 
Example 2
Source File: MetalLookAndFeel.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void propertyChange(PropertyChangeEvent pce) {
    LookAndFeel laf = get();
    if (laf == null || laf != UIManager.getLookAndFeel()) {
        dispose();
        return;
    }
    UIDefaults defaults = UIManager.getLookAndFeelDefaults();
    boolean lafCond = SwingUtilities2.isLocalDisplay();
    SwingUtilities2.putAATextInfo(lafCond, defaults);
    updateUI();
}
 
Example 3
Source File: GTKLookAndFeel.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public void initialize() {
    /*
     * We need to call loadGTK() to ensure that the native GTK
     * libraries are loaded.  It is very unlikely that this call will
     * fail (since we've already verified native GTK support in
     * isSupportedLookAndFeel()), but we can throw an error in the
     * failure situation just in case.
     */
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    if (toolkit instanceof UNIXToolkit &&
        !((UNIXToolkit)toolkit).loadGTK())
    {
        throw new InternalError("Unable to load native GTK libraries");
    }

    if (UNIXToolkit.getGtkVersion() == UNIXToolkit.GtkVersions.GTK2) {
        String version = AccessController.doPrivileged(
                new GetPropertyAction("jdk.gtk.version"));
        if (version != null) {
            IS_22 = version.equals("2.2");
        } else {
            IS_22 = true;
        }
    } else if (UNIXToolkit.getGtkVersion() ==
                            UNIXToolkit.GtkVersions.GTK3) {
        IS_3 = true;
    }

    super.initialize();
    inInitialize = true;
    loadStyles();
    inInitialize = false;

    /*
     * Check if system AA font settings should be used.
     * REMIND: See comment on isLocalDisplay() definition regarding
     * XRender.
     */
    gtkAAFontSettingsCond = SwingUtilities2.isLocalDisplay();
    aaTextInfo = new HashMap<>(2);
    SwingUtilities2.putAATextInfo(gtkAAFontSettingsCond, aaTextInfo);
}
 
Example 4
Source File: GTKLookAndFeel.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public void initialize() {
    /*
     * We need to call loadGTK() to ensure that the native GTK
     * libraries are loaded.  It is very unlikely that this call will
     * fail (since we've already verified native GTK support in
     * isSupportedLookAndFeel()), but we can throw an error in the
     * failure situation just in case.
     */
    Toolkit toolkit = Toolkit.getDefaultToolkit();
    if (toolkit instanceof UNIXToolkit &&
        !((UNIXToolkit)toolkit).loadGTK())
    {
        throw new InternalError("Unable to load native GTK libraries");
    }

    if (UNIXToolkit.getGtkVersion() == UNIXToolkit.GtkVersions.GTK2) {
        String version = AccessController.doPrivileged(
                new GetPropertyAction("jdk.gtk.version"));
        if (version != null) {
            IS_22 = version.equals("2.2");
        } else {
            IS_22 = true;
        }
    } else if (UNIXToolkit.getGtkVersion() ==
                            UNIXToolkit.GtkVersions.GTK3) {
        IS_3 = true;
    }

    super.initialize();
    inInitialize = true;
    loadStyles();
    inInitialize = false;

    /*
     * Check if system AA font settings should be used.
     * REMIND: See comment on isLocalDisplay() definition regarding
     * XRender.
     */
    gtkAAFontSettingsCond = SwingUtilities2.isLocalDisplay();
    aaTextInfo = new HashMap<>(2);
    SwingUtilities2.putAATextInfo(gtkAAFontSettingsCond, aaTextInfo);
}
 
Example 5
Source File: WindowsLookAndFeel.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected void updateUI() {
    UIDefaults defaults = UIManager.getLookAndFeelDefaults();
    SwingUtilities2.putAATextInfo(true, defaults);
    super.updateUI();
}