Changeset 27359 in osm for applications/editors


Ignore:
Timestamp:
2011-12-30T19:05:08+01:00 (13 years ago)
Author:
stoecker
Message:

use createLayout() for toggle dialog

Location:
applications/editors/josm/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewDialog.java

    r26174 r27359  
    1313import java.io.FileInputStream;
    1414import java.io.IOException;
     15import java.util.Arrays;
    1516import java.util.Collections;
    1617import java.util.HashSet;
     
    2223import java.util.Set;
    2324
    24 import javax.swing.JButton;
     25import javax.swing.AbstractAction;
    2526import javax.swing.JComboBox;
    2627import javax.swing.JLabel;
     
    2829
    2930import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
     31import org.openstreetmap.josm.gui.SideButton;
    3032import org.openstreetmap.josm.plugins.graphview.core.access.AccessRulesetReader;
    3133import org.openstreetmap.josm.plugins.graphview.core.visualisation.ColorScheme;
     
    152154        }
    153155
    154         this.add(BorderLayout.CENTER, selectionPanel);
    155 
    156 
    157         JPanel buttonPanel = new JPanel();
    158         JButton showLayerButton = new JButton(tr("Create/update graph"));
    159         showLayerButton.addActionListener(new ActionListener() {
    160             public void actionPerformed(ActionEvent e) {
    161                 plugin.createGraphViewLayer();
    162             }
    163         });
    164         buttonPanel.add(showLayerButton);
    165 
    166         this.add(BorderLayout.SOUTH, buttonPanel);
     156        createLayout(selectionPanel, true, Arrays.asList(new SideButton[] {
     157            new SideButton(new AbstractAction(tr("Create/update graph")) {
     158                public void actionPerformed(ActionEvent e) {
     159                    plugin.createGraphViewLayer();
     160                }
     161            })
     162        }));
    167163
    168164        updateSelections();
    169165        this.preferences.addObserver(this);
    170 
    171166    }
    172167
  • applications/editors/josm/plugins/licensechange/src/org/openstreetmap/josm/plugins/licensechange/LicenseChangeDialog.java

    r26373 r27359  
    1414import java.io.IOException;
    1515import java.lang.reflect.InvocationTargetException;
     16import java.util.Arrays;
    1617import java.util.ArrayList;
    1718import java.util.Collection;
     
    2425import javax.swing.JMenuItem;
    2526import javax.swing.JOptionPane;
    26 import javax.swing.JPanel;
    2727import javax.swing.JPopupMenu;
    2828import javax.swing.JScrollPane;
     
    9393        tree.addTreeSelectionListener(new SelectionWatch());
    9494
    95         add(new JScrollPane(tree), BorderLayout.CENTER);
    96 
    97         JPanel buttonPanel = new JPanel(new GridLayout(1, 3));
    98 
    9995        selectButton = new SideButton(marktr("Select"), "select", "LicenseChange",
    10096                tr("Set the selected elements on the map to the selected items in the list above."), this);
    10197        selectButton.setEnabled(false);
    102         buttonPanel.add(selectButton);
    103         buttonPanel.add(new SideButton(plugin.checkAction), "refresh");
    104         add(buttonPanel, BorderLayout.SOUTH);
    105 
     98
     99        createLayout(tree, true, Arrays.asList(new SideButton[] {
     100            selectButton, new SideButton(plugin.checkAction)
     101        }));
    106102    }
    107103
Note: See TracChangeset for help on using the changeset viewer.