~ubuntu-branches/ubuntu/utopic/sweethome3d/utopic

« back to all changes in this revision

Viewing changes to src/com/eteks/sweethome3d/swing/PrintPreviewPanel.java

  • Committer: Package Import Robot
  • Author(s): Gabriele Giacone
  • Date: 2013-03-22 23:35:34 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20130322233534-k9g9mz1vch0dfy4y
Tags: 4.0+dfsg-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
import javax.swing.BorderFactory;
34
34
import javax.swing.Box;
35
35
import javax.swing.InputMap;
 
36
import javax.swing.JButton;
36
37
import javax.swing.JComponent;
37
38
import javax.swing.JDialog;
38
39
import javax.swing.JLabel;
159
160
      };
160
161
    this.toolBar.setFloatable(false);
161
162
    ActionMap actions = getActionMap();    
162
 
    this.toolBar.add(actions.get(ActionType.SHOW_PREVIOUS_PAGE));
163
 
    this.toolBar.add(actions.get(ActionType.SHOW_NEXT_PAGE));
 
163
    if (OperatingSystem.isMacOSXLeopardOrSuperior() && OperatingSystem.isJavaVersionGreaterOrEqual("1.7")) {
 
164
      // Add buttons with higher insets to ensure the top and bottom of segmented buttons are correctly drawn
 
165
      class HigherInsetsButton extends JButton {
 
166
        public HigherInsetsButton(Action action) {
 
167
          super(action);
 
168
        }
 
169
 
 
170
        @Override
 
171
        public Insets getInsets() {
 
172
          Insets insets = super.getInsets();
 
173
          insets.top += 3;
 
174
          insets.bottom += 3;
 
175
          return insets;
 
176
        }
 
177
      }
 
178
      toolBar.add(new HigherInsetsButton(actions.get(ActionType.SHOW_PREVIOUS_PAGE)));
 
179
      toolBar.add(new HigherInsetsButton(actions.get(ActionType.SHOW_NEXT_PAGE)));
 
180
    } else {
 
181
      this.toolBar.add(actions.get(ActionType.SHOW_PREVIOUS_PAGE));
 
182
      this.toolBar.add(actions.get(ActionType.SHOW_NEXT_PAGE));
 
183
    }
164
184
    updateToolBarButtonsStyle(this.toolBar);
165
185
    
166
186
    this.toolBar.add(Box.createHorizontalStrut(20));