< prev index next >

src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java

Print this page




  68      * Solaris, or Linux with Sun JDS in a CJK Locale.
  69      * Used to determine if Sun's high quality CJK fonts are present.
  70      */
  71     private static boolean isSunCJK;
  72 
  73     /*
  74      * Used to override if system (desktop) text anti-aliasing settings should
  75      * be used. The reasons for this are are is that currently its "off"
  76      * for CJK locales which is not likely to be a good universal answer, and
  77      * also its off for remote display. So this provides an unsupported
  78      * way to explicitly request that it be "on".
  79      */
  80     private static boolean gtkAAFontSettingsCond;
  81 
  82     /**
  83      * Font to use in places where there is no widget.
  84      */
  85     private Font fallbackFont;
  86 
  87     /**
  88      * If true, GTKLookAndFeel is inside the <code>initialize</code>
  89      * method.
  90      */
  91     private boolean inInitialize;
  92 
  93     /**
  94      * If true, PropertyChangeListeners have been installed for the
  95      * Toolkit.
  96      */
  97     private boolean pclInstalled;
  98 
  99     /**
 100      * StyleFactory needs to be created only the first time.
 101      */
 102     private GTKStyleFactory styleFactory;
 103 
 104     /**
 105      * Cached theme name. Used by GTKGraphicsUtils
 106      */
 107     private static String gtkThemeName = "Default";
 108 


1654             try {
1655                 w = Integer.parseInt(width);
1656                 h = Integer.parseInt(height);
1657             } catch (NumberFormatException nfe) {
1658                 return false;
1659             }
1660 
1661             if (w > 0 && h > 0) {
1662                 int type = GTKStyle.GTKStockIconInfo.getIconType(size);
1663                 GTKStyle.GTKStockIconInfo.setIconSize(type, w, h);
1664             } else {
1665                 System.err.println("Invalid size in gtk-icon-sizes: " + w + "," + h);
1666             }
1667         }
1668 
1669         return true;
1670     }
1671 
1672     /**
1673      * Returns whether or not the UIs should update their
1674      * <code>SynthStyles</code> from the <code>SynthStyleFactory</code>
1675      * when the ancestor of the Component changes.
1676      *
1677      * @return whether or not the UIs should update their
1678      * <code>SynthStyles</code> from the <code>SynthStyleFactory</code>
1679      * when the ancestor changed.
1680      */
1681     public boolean shouldUpdateStyleOnAncestorChanged() {
1682         return true;
1683     }
1684 
1685     /**
1686      * {@inheritDoc}
1687      */
1688     public LayoutStyle getLayoutStyle() {
1689         return GnomeLayoutStyle.INSTANCE;
1690     }
1691 
1692 
1693     /**
1694      * Gnome layout style.  From:
1695      * http://developer.gnome.org/projects/gup/hig/2.0/design-window.html#window-layout-spacing
1696      * You'll notice this doesn't do the radiobutton/checkbox border
1697      * adjustments that windows/metal do.  This is because gtk doesn't
1698      * provide margins/insets for checkbox/radiobuttons.




  68      * Solaris, or Linux with Sun JDS in a CJK Locale.
  69      * Used to determine if Sun's high quality CJK fonts are present.
  70      */
  71     private static boolean isSunCJK;
  72 
  73     /*
  74      * Used to override if system (desktop) text anti-aliasing settings should
  75      * be used. The reasons for this are are is that currently its "off"
  76      * for CJK locales which is not likely to be a good universal answer, and
  77      * also its off for remote display. So this provides an unsupported
  78      * way to explicitly request that it be "on".
  79      */
  80     private static boolean gtkAAFontSettingsCond;
  81 
  82     /**
  83      * Font to use in places where there is no widget.
  84      */
  85     private Font fallbackFont;
  86 
  87     /**
  88      * If true, GTKLookAndFeel is inside the {@code initialize}
  89      * method.
  90      */
  91     private boolean inInitialize;
  92 
  93     /**
  94      * If true, PropertyChangeListeners have been installed for the
  95      * Toolkit.
  96      */
  97     private boolean pclInstalled;
  98 
  99     /**
 100      * StyleFactory needs to be created only the first time.
 101      */
 102     private GTKStyleFactory styleFactory;
 103 
 104     /**
 105      * Cached theme name. Used by GTKGraphicsUtils
 106      */
 107     private static String gtkThemeName = "Default";
 108 


1654             try {
1655                 w = Integer.parseInt(width);
1656                 h = Integer.parseInt(height);
1657             } catch (NumberFormatException nfe) {
1658                 return false;
1659             }
1660 
1661             if (w > 0 && h > 0) {
1662                 int type = GTKStyle.GTKStockIconInfo.getIconType(size);
1663                 GTKStyle.GTKStockIconInfo.setIconSize(type, w, h);
1664             } else {
1665                 System.err.println("Invalid size in gtk-icon-sizes: " + w + "," + h);
1666             }
1667         }
1668 
1669         return true;
1670     }
1671 
1672     /**
1673      * Returns whether or not the UIs should update their
1674      * {@code SynthStyles} from the {@code SynthStyleFactory}
1675      * when the ancestor of the Component changes.
1676      *
1677      * @return whether or not the UIs should update their
1678      * {@code SynthStyles} from the {@code SynthStyleFactory}
1679      * when the ancestor changed.
1680      */
1681     public boolean shouldUpdateStyleOnAncestorChanged() {
1682         return true;
1683     }
1684 
1685     /**
1686      * {@inheritDoc}
1687      */
1688     public LayoutStyle getLayoutStyle() {
1689         return GnomeLayoutStyle.INSTANCE;
1690     }
1691 
1692 
1693     /**
1694      * Gnome layout style.  From:
1695      * http://developer.gnome.org/projects/gup/hig/2.0/design-window.html#window-layout-spacing
1696      * You'll notice this doesn't do the radiobutton/checkbox border
1697      * adjustments that windows/metal do.  This is because gtk doesn't
1698      * provide margins/insets for checkbox/radiobuttons.


< prev index next >