Changeset 5322 in josm for trunk/src/org
- Timestamp:
- 2012-07-11T19:00:17+02:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java
r5266 r5322 755 755 } 756 756 757 @SuppressWarnings("unchecked") 757 758 protected Component createLayout(Component data, boolean scroll, Collection<SideButton> buttons) { 758 if(scroll) { 759 return createLayout(data, scroll, new Collection[]{buttons}); 760 } 761 762 protected Component createLayout(Component data, boolean scroll, Collection<SideButton>... buttons) { 763 if (scroll) { 759 764 data = new JScrollPane(data); 760 765 } 761 766 add(data, BorderLayout.CENTER); 762 if(buttons != null && buttons.size() != 0) { 763 buttonsPanel = new JPanel(Main.pref.getBoolean("dialog.align.left", false) 764 ? new FlowLayout(FlowLayout.LEFT) : new GridLayout(1,buttons.size())); 765 for(SideButton button : buttons) { 766 buttonsPanel.add(button); 767 javax.swing.Action action = button.getAction(); 768 if (action != null) { 769 buttonActions.add(action); 770 } else { 771 System.err.println("Button " + button + " doesn't have action defined"); 772 new Exception().printStackTrace(); 767 if (buttons != null && buttons.length > 0 && !buttons[0].isEmpty()) { 768 buttonsPanel = new JPanel(new GridLayout(buttons.length, 1)); 769 for (Collection<SideButton> buttonRow : buttons) { 770 final JPanel buttonRowPanel = new JPanel(Main.pref.getBoolean("dialog.align.left", false) 771 ? new FlowLayout(FlowLayout.LEFT) : new GridLayout(1, buttonRow.size())); 772 buttonsPanel.add(buttonRowPanel); 773 for (SideButton button : buttonRow) { 774 buttonRowPanel.add(button); 775 javax.swing.Action action = button.getAction(); 776 if (action != null) { 777 buttonActions.add(action); 778 } else { 779 System.err.println("Button " + button + " doesn't have action defined"); 780 new Exception().printStackTrace(); 781 } 773 782 } 774 783 } 775 784 add(buttonsPanel, BorderLayout.SOUTH); 776 if (Main.pref.getBoolean("dialog.dynamic.buttons", true)) {785 if (Main.pref.getBoolean("dialog.dynamic.buttons", true)) { 777 786 Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.MOUSE_MOTION_EVENT_MASK); 778 787 buttonsPanel.setVisible(buttonHiding == ButtonHiddingType.ALWAYS_SHOWN || !isDocked); 779 788 } 780 } else if (buttonsHide != null) {789 } else if (buttonsHide != null) { 781 790 buttonsHide.setVisible(false); 782 791 }
Note:
See TracChangeset
for help on using the changeset viewer.