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

Print this page




1666      */
1667     public boolean shouldUpdateStyleOnAncestorChanged() {
1668         return true;
1669     }
1670 
1671     /**
1672      * {@inheritDoc}
1673      */
1674     public LayoutStyle getLayoutStyle() {
1675         return GnomeLayoutStyle.INSTANCE;
1676     }
1677 
1678 
1679     /**
1680      * Gnome layout style.  From:
1681      * http://developer.gnome.org/projects/gup/hig/2.0/design-window.html#window-layout-spacing
1682      * You'll notice this doesn't do the radiobutton/checkbox border
1683      * adjustments that windows/metal do.  This is because gtk doesn't
1684      * provide margins/insets for checkbox/radiobuttons.
1685      */

1686     private static class GnomeLayoutStyle extends DefaultLayoutStyle {
1687         private static GnomeLayoutStyle INSTANCE = new GnomeLayoutStyle();
1688 
1689         @Override
1690         public int getPreferredGap(JComponent component1,
1691                 JComponent component2, ComponentPlacement type, int position,
1692                 Container parent) {
1693             // Checks args
1694             super.getPreferredGap(component1, component2, type, position,
1695                                   parent);
1696 
1697             switch(type) {
1698             case INDENT:
1699                 if (position == SwingConstants.EAST ||
1700                         position == SwingConstants.WEST) {
1701                     // Indent group members 12 pixels to denote hierarchy and
1702                     // association.
1703                     return 12;
1704                 }
1705                 // Fall through to related




1666      */
1667     public boolean shouldUpdateStyleOnAncestorChanged() {
1668         return true;
1669     }
1670 
1671     /**
1672      * {@inheritDoc}
1673      */
1674     public LayoutStyle getLayoutStyle() {
1675         return GnomeLayoutStyle.INSTANCE;
1676     }
1677 
1678 
1679     /**
1680      * Gnome layout style.  From:
1681      * http://developer.gnome.org/projects/gup/hig/2.0/design-window.html#window-layout-spacing
1682      * You'll notice this doesn't do the radiobutton/checkbox border
1683      * adjustments that windows/metal do.  This is because gtk doesn't
1684      * provide margins/insets for checkbox/radiobuttons.
1685      */
1686     @SuppressWarnings("fallthrough")
1687     private static class GnomeLayoutStyle extends DefaultLayoutStyle {
1688         private static GnomeLayoutStyle INSTANCE = new GnomeLayoutStyle();
1689 
1690         @Override
1691         public int getPreferredGap(JComponent component1,
1692                 JComponent component2, ComponentPlacement type, int position,
1693                 Container parent) {
1694             // Checks args
1695             super.getPreferredGap(component1, component2, type, position,
1696                                   parent);
1697 
1698             switch(type) {
1699             case INDENT:
1700                 if (position == SwingConstants.EAST ||
1701                         position == SwingConstants.WEST) {
1702                     // Indent group members 12 pixels to denote hierarchy and
1703                     // association.
1704                     return 12;
1705                 }
1706                 // Fall through to related