Changeset 8510 in josm for trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
- Timestamp:
- 2015-06-20T23:42:21+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/ExtendedDialog.java
r8461 r8510 107 107 108 108 // For easy access when inherited 109 protected transient Insets contentInsets = new Insets(10, 5,0,5);109 protected transient Insets contentInsets = new Insets(10, 5, 0, 5); 110 110 protected List<JButton> buttons = new ArrayList<>(); 111 111 … … 174 174 public ExtendedDialog setButtonIcons(String[] buttonIcons) { 175 175 bIcons = new Icon[buttonIcons.length]; 176 for (int i =0; i<buttonIcons.length; ++i) {176 for (int i = 0; i < buttonIcons.length; ++i) { 177 177 bIcons[i] = ImageProvider.get(buttonIcons[i]); 178 178 } … … 320 320 JPanel buttonsPanel = new JPanel(new GridBagLayout()); 321 321 322 for (int i =0; i < bTexts.length; i++) {322 for (int i = 0; i < bTexts.length; i++) { 323 323 final int final_i = i; 324 324 Action action = new AbstractAction(bTexts[i]) { 325 @Override public void actionPerformed(ActionEvent evt) { 325 @Override 326 public void actionPerformed(ActionEvent evt) { 326 327 buttonAction(final_i, evt); 327 328 } … … 332 333 defaultButton = button; 333 334 } 334 if (bIcons != null && bIcons[i] != null) {335 if (bIcons != null && bIcons[i] != null) { 335 336 button.setIcon(bIcons[i]); 336 337 } … … 339 340 } 340 341 341 buttonsPanel.add(button, GBC.std().insets(2, 2,2,2));342 buttonsPanel.add(button, GBC.std().insets(2, 2, 2, 2)); 342 343 buttons.add(button); 343 344 } 344 345 if (showHelpButton) { 345 buttonsPanel.add(new JButton(new HelpAction()), GBC.std().insets(2, 2,2,2));346 HelpUtil.setHelpContext(getRootPane(), helpTopic);346 buttonsPanel.add(new JButton(new HelpAction()), GBC.std().insets(2, 2, 2, 2)); 347 HelpUtil.setHelpContext(getRootPane(), helpTopic); 347 348 } 348 349 … … 358 359 if (icon != null) { 359 360 JLabel iconLbl = new JLabel(icon); 360 gc.insets = new Insets(10, 10,10,10);361 gc.insets = new Insets(10, 10, 10, 10); 361 362 gc.anchor = GridBagConstraints.NORTH; 362 363 gc.weighty = 1.0; … … 382 383 gc.gridy = y++; 383 384 gc.anchor = GridBagConstraints.LINE_START; 384 gc.insets = new Insets(5, contentInsets.left,5,contentInsets.right);385 gc.insets = new Insets(5, contentInsets.left, 5, contentInsets.right); 385 386 cp.add(togglePanel, gc); 386 387 } … … 388 389 gc.gridy = y++; 389 390 gc.anchor = GridBagConstraints.CENTER; 390 gc.insets = new Insets(5, 5,5,5);391 gc.insets = new Insets(5, 5, 5, 5); 391 392 cp.add(buttonsPanel, gc); 392 393 if (placeContentInScrollPane) { … … 406 407 boolean limitedInHeight = d.height > x.height; 407 408 408 if (x.width > 0 && d.width > x.width) {409 if (x.width > 0 && d.width > x.width) { 409 410 d.width = x.width; 410 411 } 411 if (x.height > 0 && d.height > x.height) {412 if (x.height > 0 && d.height > x.height) { 412 413 d.height = x.height; 413 414 } 414 415 415 416 // We have a vertical scrollbar and enough space to prevent a horizontal one 416 if (!limitedInWidth && limitedInHeight) {417 if (!limitedInWidth && limitedInHeight) { 417 418 d.width += new JScrollBar().getPreferredSize().width; 418 419 } … … 493 494 // Ensure all required variables are available 494 495 if (!rememberSizePref.isEmpty() && defaultWindowGeometry != null) { 495 if (visible) {496 if (visible) { 496 497 initWindowGeometry().applySafe(this); 497 498 } else if (isShowing()) { // should fix #6438, #6981, #8295
Note:
See TracChangeset
for help on using the changeset viewer.