Ignore:
Timestamp:
2012-01-15T11:56:33+01:00 (13 years ago)
Author:
stoecker
Message:

use createLayout function

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

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/livegps/src/livegps/LiveGpsDialog.java

    r16933 r27464  
    6060        panel.add(new JLabel(tr("Course")));
    6161        panel.add(courseLabel = new JLabel());
    62         add(new JScrollPane(panel), BorderLayout.CENTER);
     62        createLayout(panel, true, null);
    6363    }
    6464
  • applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementDialog.java

    r25137 r27464  
    1111import java.awt.event.KeyEvent;
    1212import java.text.DecimalFormat;
     13import java.util.Arrays;
    1314import java.util.Collection;
    1415
     
    6869        KeyEvent.VK_M, Shortcut.GROUP_LAYER), 150);
    6970
    70         JPanel buttonPanel = new JPanel(new GridLayout(1,2));
    71 
    7271        resetButton = new SideButton(marktr("Reset"), "select", "Measurement",
    7372                tr("Reset current measurement results and delete measurement path."), this);
    74         buttonPanel.add(resetButton);
    75         add(buttonPanel, BorderLayout.SOUTH);
    7673
    7774        JPanel valuePanel = new JPanel(new GridLayout(0,2));
     
    9996        valuePanel.add(segAngleLabel);
    10097
    101         add(valuePanel, BorderLayout.CENTER);
     98        this.setPreferredSize(new Dimension(0, 92));
    10299
    103         this.setPreferredSize(new Dimension(0, 92));
     100        createLayout(valuePanel, false, Arrays.asList(new SideButton[] {
     101            resetButton
     102        }));
     103
    104104        final MeasurementDialog dlg = this;
    105105
  • applications/editors/josm/plugins/turnrestrictions/src/org/openstreetmap/josm/plugins/turnrestrictions/list/TurnRestrictionsListDialog.java

    r26509 r27464  
    99import java.awt.event.ItemListener;
    1010import java.awt.event.MouseEvent;
     11import java.util.Arrays;
    1112import java.util.Collection;
    1213import java.util.HashSet;
     
    9495
    9596    /**
    96      * Builds the panel with the checkbox for switching between the two
    97      * list views
    98      *
    99      * @return the panel
    100      */
    101     protected JPanel buildInSelectionOnlyTogglePanel(){
     97     * Builds the UI
     98     */
     99    protected void build() {
    102100        JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
    103101        pnl.setBorder(null);
     
    106104           "<html>Select to display turn restrictions related to object in the current selection only.<br>"
    107105         + "Deselect to display all turn restrictions in the current data set.</html>"));
    108         return pnl;
    109     }
    110    
    111     /**
    112      * Builds the panel with the action buttons
    113      *
    114      * @return the panel
    115      */
    116     protected JPanel buildCommandPanel() {
    117         JPanel pnl = new JPanel(new FlowLayout(FlowLayout.LEFT,0,0));
    118         pnl.setBorder(null);
    119         pnl.add(new SideButton(actNew = new NewAction(), false /* don't show the name */));
    120         pnl.add(new SideButton(actEdit = new EditAction(), false /* don't show the name */));
    121         pnl.add(new SideButton(actDelete = new DeleteAction(), false /* don't show the name */));
    122        
     106
     107        pnlContent = new JPanel(new BorderLayout(0,0));
     108        pnlContent.setBorder(null);
     109        pnlContent.add(pnl,  BorderLayout.NORTH);
     110
     111        actNew = new NewAction();
     112        actEdit = new EditAction();
     113        actDelete = new DeleteAction();
    123114        actSelectSelectedTurnRestrictions = new SelectSelectedTurnRestrictions();
    124115        actZoomTo = new ZoomToAction();
    125         return pnl;
    126     }
    127    
    128     /**
    129      * Builds the UI
    130      */
    131     protected void build() {
    132         pnlContent = new JPanel(new BorderLayout(0,0));
    133         pnlContent.setBorder(null);
    134         pnlContent.add(buildInSelectionOnlyTogglePanel(),  BorderLayout.NORTH);
    135         pnlContent.add(buildCommandPanel(), BorderLayout.SOUTH);
    136        
    137         add(pnlContent, BorderLayout.CENTER);
     116
     117        createLayout(pnlContent, false, Arrays.asList(new SideButton[] {
     118            new SideButton(actNew, false /* don't show the name */),
     119            new SideButton(actEdit, false /* don't show the name */),
     120            new SideButton(actDelete, false /* don't show the name */)
     121        }));
    138122       
    139123        // create the two list views
Note: See TracChangeset for help on using the changeset viewer.