Changeset 4363 in josm for trunk


Ignore:
Timestamp:
2011-08-27T23:57:30+02:00 (13 years ago)
Author:
stoecker
Message:

use createLayout() in all internal ToggleDialog's

Location:
trunk/src/org/openstreetmap/josm
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Bounds.java

    r4181 r4363  
    6363        String[] components = asString.split(separator);
    6464        if (components.length != 4)
    65             throw new IllegalArgumentException(MessageFormat.format("Exactly four doubles excpected in string, got {0}", components.length));
     65            throw new IllegalArgumentException(MessageFormat.format("Exactly four doubles excpected in string, got {0}: {1}", components.length, asString));
    6666        double[] values = new double[4];
    6767        for (int i=0; i<4; i++) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ChangesetDialog.java

    r4191 r4363  
    1212import java.awt.event.MouseAdapter;
    1313import java.awt.event.MouseEvent;
     14import java.util.Arrays;
    1415import java.util.Collection;
    1516import java.util.HashSet;
     
    175176    }
    176177
    177     protected JPanel buildButtonPanel() {
    178         JPanel tp = getButtonPanel(5);
    179 
    180         // -- select objects action
    181         selectObjectsAction = new SelectObjectsAction();
    182         tp.add(new SideButton(selectObjectsAction, false));
    183         cbInSelectionOnly.addItemListener(selectObjectsAction);
    184         lstInActiveDataLayer.getSelectionModel().addListSelectionListener(selectObjectsAction);
    185         lstInSelection.getSelectionModel().addListSelectionListener(selectObjectsAction);
    186 
    187         // -- read changesets action
    188         readChangesetAction = new ReadChangesetsAction();
    189         tp.add(new SideButton(readChangesetAction, false));
    190         cbInSelectionOnly.addItemListener(readChangesetAction);
    191         lstInActiveDataLayer.getSelectionModel().addListSelectionListener(readChangesetAction);
    192         lstInSelection.getSelectionModel().addListSelectionListener(readChangesetAction);
    193 
    194         // -- close changesets action
    195         closeChangesetAction = new CloseOpenChangesetsAction();
    196         tp.add(new SideButton(closeChangesetAction, false));
    197         cbInSelectionOnly.addItemListener(closeChangesetAction);
    198         lstInActiveDataLayer.getSelectionModel().addListSelectionListener(closeChangesetAction);
    199         lstInSelection.getSelectionModel().addListSelectionListener(closeChangesetAction);
    200 
    201         // -- show info action
    202         showChangesetInfoAction = new ShowChangesetInfoAction();
    203         tp.add(new SideButton(showChangesetInfoAction, false));
    204         cbInSelectionOnly.addItemListener(showChangesetInfoAction);
    205         lstInActiveDataLayer.getSelectionModel().addListSelectionListener(showChangesetInfoAction);
    206         lstInSelection.getSelectionModel().addListSelectionListener(showChangesetInfoAction);
    207 
    208         // -- launch changeset manager action
    209         launchChangesetManagerAction = new LaunchChangesetManagerAction();
    210         tp.add(new SideButton(launchChangesetManagerAction, false));
    211         cbInSelectionOnly.addItemListener(launchChangesetManagerAction);
    212         lstInActiveDataLayer.getSelectionModel().addListSelectionListener(launchChangesetManagerAction);
    213         lstInSelection.getSelectionModel().addListSelectionListener(launchChangesetManagerAction);
    214 
    215         return tp;
    216     }
    217 
    218178    protected void build() {
    219179        JPanel pnl = new JPanel(new BorderLayout());
    220180        pnl.add(buildFilterPanel(), BorderLayout.NORTH);
    221181        pnl.add(pnlList = buildListPanel(), BorderLayout.CENTER);
    222         pnl.add(buildButtonPanel(), BorderLayout.SOUTH);
    223         add(pnl, BorderLayout.CENTER);
    224182
    225183        cbInSelectionOnly.addItemListener(new FilterChangeHandler());
    226184
    227185        HelpUtil.setHelpContext(pnl, HelpUtil.ht("/Dialog/ChangesetListDialog"));
     186
     187        // -- select objects action
     188        selectObjectsAction = new SelectObjectsAction();
     189        cbInSelectionOnly.addItemListener(selectObjectsAction);
     190        lstInActiveDataLayer.getSelectionModel().addListSelectionListener(selectObjectsAction);
     191        lstInSelection.getSelectionModel().addListSelectionListener(selectObjectsAction);
     192
     193        // -- read changesets action
     194        readChangesetAction = new ReadChangesetsAction();
     195        cbInSelectionOnly.addItemListener(readChangesetAction);
     196        lstInActiveDataLayer.getSelectionModel().addListSelectionListener(readChangesetAction);
     197        lstInSelection.getSelectionModel().addListSelectionListener(readChangesetAction);
     198
     199        // -- close changesets action
     200        closeChangesetAction = new CloseOpenChangesetsAction();
     201        cbInSelectionOnly.addItemListener(closeChangesetAction);
     202        lstInActiveDataLayer.getSelectionModel().addListSelectionListener(closeChangesetAction);
     203        lstInSelection.getSelectionModel().addListSelectionListener(closeChangesetAction);
     204
     205        // -- show info action
     206        showChangesetInfoAction = new ShowChangesetInfoAction();
     207        cbInSelectionOnly.addItemListener(showChangesetInfoAction);
     208        lstInActiveDataLayer.getSelectionModel().addListSelectionListener(showChangesetInfoAction);
     209        lstInSelection.getSelectionModel().addListSelectionListener(showChangesetInfoAction);
     210
     211        // -- launch changeset manager action
     212        launchChangesetManagerAction = new LaunchChangesetManagerAction();
     213        cbInSelectionOnly.addItemListener(launchChangesetManagerAction);
     214        lstInActiveDataLayer.getSelectionModel().addListSelectionListener(launchChangesetManagerAction);
     215        lstInSelection.getSelectionModel().addListSelectionListener(launchChangesetManagerAction);
     216
     217        createLayout(pnl, false, Arrays.asList(new SideButton[] {
     218            new SideButton(selectObjectsAction, false),
     219            new SideButton(readChangesetAction, false),
     220            new SideButton(closeChangesetAction, false),
     221            new SideButton(showChangesetInfoAction, false),
     222            new SideButton(launchChangesetManagerAction, false)
     223        }));
    228224    }
    229225
  • trunk/src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java

    r3801 r4363  
    1313import java.awt.event.MouseEvent;
    1414import java.util.ArrayList;
     15import java.util.Arrays;
    1516import java.util.LinkedHashSet;
    1617import java.util.List;
     
    102103        treesPanel.setBackground(redoTree.getBackground());
    103104
    104         scrollPane = new JScrollPane(treesPanel);
    105         add(scrollPane, BorderLayout.CENTER);
    106         add(createButtonPanel(), BorderLayout.SOUTH);
     105        SelectAction selectAction = new SelectAction();
     106        wireUpdateEnabledStateUpdater(selectAction, undoTree);
     107        wireUpdateEnabledStateUpdater(selectAction, redoTree);
     108
     109        UndoRedoAction undoAction = new UndoRedoAction(UndoRedoType.UNDO);
     110        wireUpdateEnabledStateUpdater(undoAction, undoTree);
     111
     112        UndoRedoAction redoAction = new UndoRedoAction(UndoRedoType.REDO);
     113        wireUpdateEnabledStateUpdater(redoAction, redoTree);
     114
     115        scrollPane = (JScrollPane)createLayout(treesPanel, true, Arrays.asList(new SideButton[] {
     116            new SideButton(selectAction),
     117            new SideButton(undoAction),
     118            new SideButton(redoAction)
     119        }));
    107120    }
    108121
     
    144157            }
    145158        }
    146     }
    147 
    148     protected JPanel createButtonPanel() {
    149         JPanel buttonPanel = getButtonPanel(3);
    150 
    151         SelectAction selectAction = new SelectAction();
    152         wireUpdateEnabledStateUpdater(selectAction, undoTree);
    153         wireUpdateEnabledStateUpdater(selectAction, redoTree);
    154         buttonPanel.add(new SideButton(selectAction));
    155 
    156         UndoRedoAction undoAction = new UndoRedoAction(UndoRedoType.UNDO);
    157         wireUpdateEnabledStateUpdater(undoAction, undoTree);
    158         buttonPanel.add(new SideButton(undoAction));
    159 
    160         UndoRedoAction redoAction = new UndoRedoAction(UndoRedoType.REDO);
    161         wireUpdateEnabledStateUpdater(redoAction, redoTree);
    162         buttonPanel.add(new SideButton(redoAction));
    163 
    164         return buttonPanel;
    165159    }
    166160
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r3973 r4363  
    66import static org.openstreetmap.josm.tools.I18n.tr;
    77
    8 import java.awt.BorderLayout;
    98import java.awt.Color;
    109import java.awt.Graphics;
     
    1413import java.awt.event.MouseAdapter;
    1514import java.awt.event.MouseEvent;
     15import java.util.Arrays;
    1616import java.util.Collection;
    1717import java.util.Iterator;
     
    2121import javax.swing.AbstractAction;
    2222import javax.swing.JList;
    23 import javax.swing.JPanel;
    24 import javax.swing.JScrollPane;
    2523import javax.swing.ListModel;
    2624import javax.swing.ListSelectionModel;
     
    9593        });
    9694
    97         add(new JScrollPane(lstConflicts), BorderLayout.CENTER);
    98 
    9995        SideButton btnResolve = new SideButton(actResolve = new ResolveAction());
    10096        lstConflicts.getSelectionModel().addListSelectionListener(actResolve);
     
    10399        lstConflicts.getSelectionModel().addListSelectionListener(actSelect);
    104100
    105         JPanel buttonPanel = getButtonPanel(2);
    106         buttonPanel.add(btnResolve);
    107         buttonPanel.add(btnSelect);
    108         add(buttonPanel, BorderLayout.SOUTH);
     101        createLayout(lstConflicts, true, Arrays.asList(new SideButton[] {
     102            btnResolve, btnSelect
     103        }));
    109104    }
    110105
  • trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java

    r4223 r4363  
    55import static org.openstreetmap.josm.tools.I18n.tr;
    66
    7 import java.awt.BorderLayout;
    87import java.awt.Component;
    98import java.awt.Graphics2D;
     
    1211import java.awt.event.KeyEvent;
    1312import java.awt.event.MouseEvent;
     13import java.util.Arrays;
    1414import java.util.Collection;
    1515import java.util.HashSet;
     
    1818
    1919import javax.swing.JCheckBox;
    20 import javax.swing.JPanel;
    21 import javax.swing.JScrollPane;
    2220import javax.swing.JTable;
    2321import javax.swing.ListSelectionModel;
     
    8280    }
    8381
    84     protected JPanel buildButtonRow() {
    85         JPanel pnl = getButtonPanel(5);
    86 
    87         addButton = new SideButton(marktr("Add"), "add", "SelectionList", tr("Add filter."),
    88                 new ActionListener(){
    89             public void actionPerformed(ActionEvent evt){
    90                 Filter filter = (Filter)SearchAction.showSearchDialog(new Filter());
    91                 if(filter != null){
    92                     filterModel.addFilter(filter);
    93                 }
    94             }
    95         });
    96         pnl.add(addButton);
    97 
    98         editButton = new SideButton(marktr("Edit"), "edit", "SelectionList", tr("Edit filter."),
    99                 new ActionListener(){
    100             public void actionPerformed(ActionEvent evt){
    101                 int index = userTable.getSelectionModel().getMinSelectionIndex();
    102                 if(index < 0) return;
    103                 Filter f = filterModel.getFilter(index);
    104                 Filter filter = (Filter)SearchAction.showSearchDialog(f);
    105                 if(filter != null){
    106                     filterModel.setFilter(index, filter);
    107                 }
    108             }
    109         });
    110         pnl.add(editButton);
    111 
    112         deleteButton = new SideButton(marktr("Delete"), "delete", "SelectionList", tr("Delete filter."),
    113                 new ActionListener(){
    114             public void actionPerformed(ActionEvent evt){
    115                 int index = userTable.getSelectionModel().getMinSelectionIndex();
    116                 if(index < 0) return;
    117                 filterModel.removeFilter(index);
    118             }
    119         });
    120         pnl.add(deleteButton);
    121 
    122         upButton = new SideButton(marktr("Up"), "up", "SelectionList", tr("Move filter up."),
    123                 new ActionListener(){
    124             public void actionPerformed(ActionEvent evt){
    125                 int index = userTable.getSelectionModel().getMinSelectionIndex();
    126                 if(index < 0) return;
    127                 filterModel.moveUpFilter(index);
    128                 userTable.getSelectionModel().setSelectionInterval(index-1, index-1);
    129             }
    130         });
    131         pnl.add(upButton);
    132 
    133         downButton = new SideButton(marktr("Down"), "down", "SelectionList", tr("Move filter down."),
    134                 new ActionListener(){
    135             public void actionPerformed(ActionEvent evt){
    136                 int index = userTable.getSelectionModel().getMinSelectionIndex();
    137                 if(index < 0) return;
    138                 filterModel.moveDownFilter(index);
    139                 userTable.getSelectionModel().setSelectionInterval(index+1, index+1);
    140             }
    141         });
    142         pnl.add(downButton);
    143         return pnl;
    144     }
    145 
    14682    protected String[] columnToolTips = {
    14783            tr("Enable filter"),
     
    15389
    15490    protected void build() {
    155         JPanel pnl = new JPanel();
    156         pnl.setLayout(new BorderLayout());
    15791        userTable = new JTable(filterModel){
    15892            @Override
     
    185119        userTable.setDefaultRenderer(String.class, new StringRenderer());
    186120
    187         pnl.add(new JScrollPane(userTable), BorderLayout.CENTER);
    188 
    189         // -- the button row
    190         pnl.add(buildButtonRow(), BorderLayout.SOUTH);
    191         /*userTable.addMouseListener(new DoubleClickAdapter());*/
    192         add(pnl, BorderLayout.CENTER);
     121        addButton = new SideButton(marktr("Add"), "add", "SelectionList", tr("Add filter."),
     122                new ActionListener(){
     123            public void actionPerformed(ActionEvent evt){
     124                Filter filter = (Filter)SearchAction.showSearchDialog(new Filter());
     125                if(filter != null){
     126                    filterModel.addFilter(filter);
     127                }
     128            }
     129        });
     130
     131        editButton = new SideButton(marktr("Edit"), "edit", "SelectionList", tr("Edit filter."),
     132                new ActionListener(){
     133            public void actionPerformed(ActionEvent evt){
     134                int index = userTable.getSelectionModel().getMinSelectionIndex();
     135                if(index < 0) return;
     136                Filter f = filterModel.getFilter(index);
     137                Filter filter = (Filter)SearchAction.showSearchDialog(f);
     138                if(filter != null){
     139                    filterModel.setFilter(index, filter);
     140                }
     141            }
     142        });
     143
     144        deleteButton = new SideButton(marktr("Delete"), "delete", "SelectionList", tr("Delete filter."),
     145                new ActionListener(){
     146            public void actionPerformed(ActionEvent evt){
     147                int index = userTable.getSelectionModel().getMinSelectionIndex();
     148                if(index < 0) return;
     149                filterModel.removeFilter(index);
     150            }
     151        });
     152
     153        upButton = new SideButton(marktr("Up"), "up", "SelectionList", tr("Move filter up."),
     154                new ActionListener(){
     155            public void actionPerformed(ActionEvent evt){
     156                int index = userTable.getSelectionModel().getMinSelectionIndex();
     157                if(index < 0) return;
     158                filterModel.moveUpFilter(index);
     159                userTable.getSelectionModel().setSelectionInterval(index-1, index-1);
     160            }
     161        });
     162
     163        downButton = new SideButton(marktr("Down"), "down", "SelectionList", tr("Move filter down."),
     164                new ActionListener(){
     165            public void actionPerformed(ActionEvent evt){
     166                int index = userTable.getSelectionModel().getMinSelectionIndex();
     167                if(index < 0) return;
     168                filterModel.moveDownFilter(index);
     169                userTable.getSelectionModel().setSelectionInterval(index+1, index+1);
     170            }
     171        });
     172
     173        createLayout(userTable, true, Arrays.asList(new SideButton[] {
     174            addButton, editButton, deleteButton, upButton, downButton
     175        }));
    193176    }
    194177
  • trunk/src/org/openstreetmap/josm/gui/dialogs/HistoryDialog.java

    r4072 r4363  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.awt.BorderLayout;
    76import java.awt.Component;
    87import java.awt.event.ActionEvent;
     
    1110import java.awt.event.MouseEvent;
    1211import java.util.ArrayList;
     12import java.util.Arrays;
    1313import java.util.Collection;
    1414import java.util.Collections;
     
    2020import javax.swing.JComponent;
    2121import javax.swing.JLabel;
    22 import javax.swing.JPanel;
    23 import javax.swing.JScrollPane;
    2422import javax.swing.JTable;
    2523import javax.swing.ListSelectionModel;
     
    7573
    7674    /**
    77      * builds the row with the command buttons
    78      *
    79      * @return the rows with the command buttons
    80      */
    81     protected JPanel buildButtonRow() {
    82         JPanel buttons = getButtonPanel(2);
    83 
    84         SideButton btn = new SideButton(reloadAction = new ReloadAction());
    85         btn.setName("btn.reload");
    86         buttons.add(btn);
    87 
    88         btn = new SideButton(showHistoryAction = new ShowHistoryAction());
    89         btn.setName("btn.showhistory");
    90         buttons.add(btn);
    91 
    92         return buttons;
    93     }
    94 
    95     /**
    9675     * builds the GUI
    9776     */
     
    10483        );
    10584        historyTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
    106         historyTable.setName("table.historyitems");
    10785        final TableCellRenderer oldRenderer = historyTable.getTableHeader().getDefaultRenderer();
    10886        historyTable.getTableHeader().setDefaultRenderer(new DefaultTableCellRenderer(){
     
    12199        });
    122100        historyTable.addMouseListener(new ShowHistoryMouseAdapter());
    123 
    124         JScrollPane pane = new JScrollPane(historyTable);
    125         pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    126         pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    127101        historyTable.setTableHeader(null);
    128         pane.setColumnHeaderView(null);
    129         add(pane, BorderLayout.CENTER);
    130 
    131         add(buildButtonRow(), BorderLayout.SOUTH);
     102
     103        createLayout(historyTable, true, Arrays.asList(new SideButton[] {
     104            new SideButton(reloadAction = new ReloadAction()),
     105            new SideButton(showHistoryAction = new ShowHistoryAction())
     106        }));
    132107
    133108        // wire actions
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java

    r4222 r4363  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.awt.BorderLayout;
    76import java.awt.Component;
    87import java.awt.Dimension;
     
    2524import java.io.InputStreamReader;
    2625import java.util.ArrayList;
     26import java.util.Arrays;
    2727import java.util.List;
    2828
     
    9191
    9292    protected void build() {
    93         JPanel pnl = new JPanel();
    94         pnl.setLayout(new BorderLayout());
    95 
    9693        model = new StylesModel();
    9794
     
    136133        p.add(tblStyles, GBC.std(0, 1).span(2).fill());
    137134
    138         pnl.add(new JScrollPane(p), BorderLayout.CENTER);
    139 
    140         pnl.add(buildButtonRow(), BorderLayout.SOUTH);
    141 
    142         add(pnl, BorderLayout.CENTER);
    143     }
    144 
    145     protected static class StylesTable extends JTable {
    146 
    147         public StylesTable(TableModel dm) {
    148             super(dm);
    149         }
    150 
    151         public void scrollToVisible(int row, int col) {
    152             if (!(getParent() instanceof JViewport))
    153                 return;
    154             JViewport viewport = (JViewport) getParent();
    155             Rectangle rect = getCellRect(row, col, true);
    156             Point pt = viewport.getViewPosition();
    157             rect.setLocation(rect.x - pt.x, rect.y - pt.y);
    158             viewport.scrollRectToVisible(rect);
    159         }
    160     }
    161 
    162     protected JPanel buildButtonRow() {
    163         JPanel p = getButtonPanel(4);
    164135        reloadAction = new ReloadAction();
    165136        onoffAction = new OnOffAction();
     
    170141        selectionModel.addListSelectionListener(upAction);
    171142        selectionModel.addListSelectionListener(downAction);
    172         p.add(new SideButton(onoffAction));
    173         p.add(new SideButton(upAction));
    174         p.add(new SideButton(downAction));
    175         p.add(new SideButton(new LaunchMapPaintPreferencesAction()));
    176 
    177         return p;
     143
     144        createLayout(p, true, Arrays.asList(new SideButton[] {
     145            new SideButton(onoffAction),
     146            new SideButton(upAction),
     147            new SideButton(downAction),
     148            new SideButton(new LaunchMapPaintPreferencesAction())
     149        }));
     150    }
     151
     152    protected static class StylesTable extends JTable {
     153
     154        public StylesTable(TableModel dm) {
     155            super(dm);
     156        }
     157
     158        public void scrollToVisible(int row, int col) {
     159            if (!(getParent() instanceof JViewport))
     160                return;
     161            JViewport viewport = (JViewport) getParent();
     162            Rectangle rect = getCellRect(row, col, true);
     163            Point pt = viewport.getViewPosition();
     164            rect.setLocation(rect.x - pt.x, rect.y - pt.y);
     165            viewport.scrollRectToVisible(rect);
     166        }
    178167    }
    179168
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r4355 r4363  
    670670    }
    671671
    672     protected void createLayout(Component data, boolean scroll, Collection<SideButton> buttons) {
     672    protected Component createLayout(Component data, boolean scroll, Collection<SideButton> buttons) {
    673673        if(scroll)
    674             add(new JScrollPane(data), BorderLayout.CENTER);
    675         else
    676             add(data, BorderLayout.CENTER);
     674            data = new JScrollPane(data);
     675        add(data, BorderLayout.CENTER);
    677676        if(buttons != null && buttons.size() != 0) {
    678677            buttonsPanel = new JPanel(Main.pref.getBoolean("dialog.align.left", false)
     
    686685            }
    687686        }
     687        return data;
    688688    }
    689689
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r4035 r4363  
    55import static org.openstreetmap.josm.tools.I18n.tr;
    66
    7 import java.awt.BorderLayout;
    87import java.awt.GridLayout;
    98import java.awt.event.ActionEvent;
     
    1514import java.lang.reflect.InvocationTargetException;
    1615import java.util.ArrayList;
     16import java.util.Arrays;
    1717import java.util.Collection;
    1818import java.util.Enumeration;
     
    2424import javax.swing.JMenuItem;
    2525import javax.swing.JOptionPane;
    26 import javax.swing.JPanel;
    2726import javax.swing.JPopupMenu;
    28 import javax.swing.JScrollPane;
    2927import javax.swing.SwingUtilities;
    3028import javax.swing.event.TreeSelectionEvent;
     
    108106        tree.addTreeSelectionListener(new SelectionWatch());
    109107
    110         add(new JScrollPane(tree), BorderLayout.CENTER);
    111 
    112         JPanel buttonPanel = new JPanel(new GridLayout(1, 3));
    113 
     108        List<SideButton> buttons = new LinkedList<SideButton>();
    114109        selectButton = new SideButton(marktr("Select"), "select", "Validator",
    115110                tr("Set the selected elements on the map to the selected items in the list above."), this);
    116111        selectButton.setEnabled(false);
    117         buttonPanel.add(selectButton);
    118         buttonPanel.add(new SideButton(Main.main.validator.validateAction), "refresh");
     112        buttons.add(selectButton);
     113
     114        buttons.add(new SideButton(Main.main.validator.validateAction));
     115
    119116        fixButton = new SideButton(marktr("Fix"), "fix", "Validator", tr("Fix the selected issue."), this);
    120117        fixButton.setEnabled(false);
    121         buttonPanel.add(fixButton);
     118        buttons.add(fixButton);
     119
    122120        if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) {
    123121            ignoreButton = new SideButton(marktr("Ignore"), "delete", "Validator",
    124122                    tr("Ignore the selected issue next time."), this);
    125123            ignoreButton.setEnabled(false);
    126             buttonPanel.add(ignoreButton);
     124            buttons.add(ignoreButton);
    127125        } else {
    128126            ignoreButton = null;
    129127        }
    130         add(buttonPanel, BorderLayout.SOUTH);
     128        createLayout(tree, true, buttons);
    131129    }
    132130
     
    466464            }
    467465            selectButton.setEnabled(false);
    468 
    469             if (e.getSource() instanceof JScrollPane) {
    470                 System.out.println(e.getSource());
    471                 return;
    472             }
    473466
    474467            boolean hasFixes = setSelection(null, false);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r4356 r4363  
    759759        }
    760760
    761         DblClickWatch dblClickWatch = new DblClickWatch();
    762         propertyTable.addMouseListener(dblClickWatch);
    763         membershipTable.addMouseListener(dblClickWatch);
    764         JScrollPane scrollPane = new JScrollPane(bothTables);
    765         scrollPane.addMouseListener(dblClickWatch);
    766 
    767         selectSth.setPreferredSize(scrollPane.getSize());
    768         presets.setSize(scrollPane.getSize());
    769 
    770761        // -- add action and shortcut
    771762        this.btnAdd = new SideButton(addAction);
     
    792783        getActionMap().put("delete", deleteAction);
    793784
    794         createLayout(scrollPane, false, Arrays.asList(new SideButton[] {
     785        JScrollPane scrollPane = (JScrollPane) createLayout(bothTables, true, Arrays.asList(new SideButton[] {
    795786            this.btnAdd, this.btnEdit, this.btnDel
    796787        }));
     788
     789        DblClickWatch dblClickWatch = new DblClickWatch();
     790        propertyTable.addMouseListener(dblClickWatch);
     791        membershipTable.addMouseListener(dblClickWatch);
     792        scrollPane.addMouseListener(dblClickWatch);
     793
     794        selectSth.setPreferredSize(scrollPane.getSize());
     795        presets.setSize(scrollPane.getSize());
    797796
    798797        // -- help action
Note: See TracChangeset for help on using the changeset viewer.