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

The following examples show how to use sun.swing.SwingUtilities2#isLocalDisplay() . 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 jdk1.8-source-analysis 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();
    Object aaTextInfo =
        SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
    defaults.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
    updateUI();
}
 
Example 2
Source File: GTKLookAndFeel.java    From openjdk-8 with GNU General Public License v2.0 5 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");
    }

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

    /*
     * Check if system AA font settings should be used.
     * Sun's JDS (for Linux and Solaris) ships with high quality CJK
     * fonts and specifies via fontconfig that these be rendered in
     * B&W to take advantage of the embedded bitmaps.
     * If is a Sun CJK locale or remote display, indicate by the condition
     * variable that in this case the L&F recommends ignoring desktop
     * settings. On other Unixes (eg Linux) this doesn't apply.
     * REMIND 1: The isSunCJK test is really just a place holder
     * until we can properly query fontconfig and use the properties
     * set for specific fonts.
     * REMIND 2: See comment on isLocalDisplay() definition regarding
     * XRender.
     */
    gtkAAFontSettingsCond = !isSunCJK && SwingUtilities2.isLocalDisplay();
    aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(gtkAAFontSettingsCond);
}
 
Example 3
Source File: MetalLookAndFeel.java    From jdk8u-dev-jdk 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();
    Object aaTextInfo =
        SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
    defaults.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
    updateUI();
}
 
Example 4
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 5
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 6
Source File: MetalLookAndFeel.java    From jdk8u-jdk 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();
    Object aaTextInfo =
        SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
    defaults.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
    updateUI();
}
 
Example 7
Source File: GTKLookAndFeel.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 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");
    }

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

    /*
     * Check if system AA font settings should be used.
     * Sun's JDS (for Linux and Solaris) ships with high quality CJK
     * fonts and specifies via fontconfig that these be rendered in
     * B&W to take advantage of the embedded bitmaps.
     * If is a Sun CJK locale or remote display, indicate by the condition
     * variable that in this case the L&F recommends ignoring desktop
     * settings. On other Unixes (eg Linux) this doesn't apply.
     * REMIND 1: The isSunCJK test is really just a place holder
     * until we can properly query fontconfig and use the properties
     * set for specific fonts.
     * REMIND 2: See comment on isLocalDisplay() definition regarding
     * XRender.
     */
    gtkAAFontSettingsCond = !isSunCJK && SwingUtilities2.isLocalDisplay();
    aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(gtkAAFontSettingsCond);
}
 
Example 8
Source File: MetalLookAndFeel.java    From openjdk-jdk8u 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();
    Object aaTextInfo =
        SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
    defaults.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
    updateUI();
}
 
Example 9
Source File: MetalLookAndFeel.java    From JDKSourceCode1.8 with MIT License 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();
    Object aaTextInfo =
        SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
    defaults.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
    updateUI();
}
 
Example 10
Source File: GTKLookAndFeel.java    From JDKSourceCode1.8 with MIT License 5 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");
    }

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

    /*
     * Check if system AA font settings should be used.
     * Sun's JDS (for Linux and Solaris) ships with high quality CJK
     * fonts and specifies via fontconfig that these be rendered in
     * B&W to take advantage of the embedded bitmaps.
     * If is a Sun CJK locale or remote display, indicate by the condition
     * variable that in this case the L&F recommends ignoring desktop
     * settings. On other Unixes (eg Linux) this doesn't apply.
     * REMIND 1: The isSunCJK test is really just a place holder
     * until we can properly query fontconfig and use the properties
     * set for specific fonts.
     * REMIND 2: See comment on isLocalDisplay() definition regarding
     * XRender.
     */
    gtkAAFontSettingsCond = !isSunCJK && SwingUtilities2.isLocalDisplay();
    aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(gtkAAFontSettingsCond);
}
 
Example 11
Source File: MetalLookAndFeel.java    From jdk8u_jdk 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();
    Object aaTextInfo =
        SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
    defaults.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
    updateUI();
}
 
Example 12
Source File: GTKLookAndFeel.java    From jdk8u60 with GNU General Public License v2.0 5 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");
    }

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

    /*
     * Check if system AA font settings should be used.
     * Sun's JDS (for Linux and Solaris) ships with high quality CJK
     * fonts and specifies via fontconfig that these be rendered in
     * B&W to take advantage of the embedded bitmaps.
     * If is a Sun CJK locale or remote display, indicate by the condition
     * variable that in this case the L&F recommends ignoring desktop
     * settings. On other Unixes (eg Linux) this doesn't apply.
     * REMIND 1: The isSunCJK test is really just a place holder
     * until we can properly query fontconfig and use the properties
     * set for specific fonts.
     * REMIND 2: See comment on isLocalDisplay() definition regarding
     * XRender.
     */
    gtkAAFontSettingsCond = !isSunCJK && SwingUtilities2.isLocalDisplay();
    aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(gtkAAFontSettingsCond);
}
 
Example 13
Source File: MetalLookAndFeel.java    From openjdk-8 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();
    Object aaTextInfo =
        SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
    defaults.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
    updateUI();
}
 
Example 14
Source File: MetalLookAndFeel.java    From dragonwell8_jdk 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();
    Object aaTextInfo =
        SwingUtilities2.AATextInfo.getAATextInfo(lafCond);
    defaults.put(SwingUtilities2.AA_TEXT_PROPERTY_KEY, aaTextInfo);
    updateUI();
}
 
Example 15
Source File: GTKLookAndFeel.java    From hottub with GNU General Public License v2.0 5 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");
    }

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

    /*
     * Check if system AA font settings should be used.
     * Sun's JDS (for Linux and Solaris) ships with high quality CJK
     * fonts and specifies via fontconfig that these be rendered in
     * B&W to take advantage of the embedded bitmaps.
     * If is a Sun CJK locale or remote display, indicate by the condition
     * variable that in this case the L&F recommends ignoring desktop
     * settings. On other Unixes (eg Linux) this doesn't apply.
     * REMIND 1: The isSunCJK test is really just a place holder
     * until we can properly query fontconfig and use the properties
     * set for specific fonts.
     * REMIND 2: See comment on isLocalDisplay() definition regarding
     * XRender.
     */
    gtkAAFontSettingsCond = !isSunCJK && SwingUtilities2.isLocalDisplay();
    aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(gtkAAFontSettingsCond);
}
 
Example 16
Source File: GTKLookAndFeel.java    From openjdk-jdk8u 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.
     * Sun's JDS (for Linux and Solaris) ships with high quality CJK
     * fonts and specifies via fontconfig that these be rendered in
     * B&W to take advantage of the embedded bitmaps.
     * If is a Sun CJK locale or remote display, indicate by the condition
     * variable that in this case the L&F recommends ignoring desktop
     * settings. On other Unixes (eg Linux) this doesn't apply.
     * REMIND 1: The isSunCJK test is really just a place holder
     * until we can properly query fontconfig and use the properties
     * set for specific fonts.
     * REMIND 2: See comment on isLocalDisplay() definition regarding
     * XRender.
     */
    gtkAAFontSettingsCond = !isSunCJK && SwingUtilities2.isLocalDisplay();
    aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(gtkAAFontSettingsCond);
}
 
Example 17
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 18
Source File: GTKLookAndFeel.java    From jdk8u_jdk 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.
     * Sun's JDS (for Linux and Solaris) ships with high quality CJK
     * fonts and specifies via fontconfig that these be rendered in
     * B&W to take advantage of the embedded bitmaps.
     * If is a Sun CJK locale or remote display, indicate by the condition
     * variable that in this case the L&F recommends ignoring desktop
     * settings. On other Unixes (eg Linux) this doesn't apply.
     * REMIND 1: The isSunCJK test is really just a place holder
     * until we can properly query fontconfig and use the properties
     * set for specific fonts.
     * REMIND 2: See comment on isLocalDisplay() definition regarding
     * XRender.
     */
    gtkAAFontSettingsCond = !isSunCJK && SwingUtilities2.isLocalDisplay();
    aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(gtkAAFontSettingsCond);
}
 
Example 19
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 20
Source File: GTKLookAndFeel.java    From dragonwell8_jdk 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.
     * Sun's JDS (for Linux and Solaris) ships with high quality CJK
     * fonts and specifies via fontconfig that these be rendered in
     * B&W to take advantage of the embedded bitmaps.
     * If is a Sun CJK locale or remote display, indicate by the condition
     * variable that in this case the L&F recommends ignoring desktop
     * settings. On other Unixes (eg Linux) this doesn't apply.
     * REMIND 1: The isSunCJK test is really just a place holder
     * until we can properly query fontconfig and use the properties
     * set for specific fonts.
     * REMIND 2: See comment on isLocalDisplay() definition regarding
     * XRender.
     */
    gtkAAFontSettingsCond = !isSunCJK && SwingUtilities2.isLocalDisplay();
    aaTextInfo = SwingUtilities2.AATextInfo.getAATextInfo(gtkAAFontSettingsCond);
}