Changeset 6653 in josm


Ignore:
Timestamp:
2014-01-06T20:52:09+01:00 (11 years ago)
Author:
simon04
Message:

Preference dialog: allow to toggle the "Use the default OSM server URL" check box by clicking on the text

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    r6602 r6653  
    1919import javax.swing.AbstractAction;
    2020import javax.swing.JCheckBox;
     21import javax.swing.JComponent;
    2122import javax.swing.JLabel;
    2223import javax.swing.JPanel;
     
    5657    private ApiUrlPropagator propagator;
    5758
    58     protected JPanel buildDefaultServerUrlPanel() {
    59         JPanel pnl = new JPanel(new GridBagLayout());
    60         GridBagConstraints gc = new GridBagConstraints();
    61 
    62         gc.fill = GridBagConstraints.HORIZONTAL;
    63         gc.anchor = GridBagConstraints.NORTHWEST;
    64         gc.weightx = 0.0;
    65         gc.insets = new Insets(0,0,0,3);
    66         gc.gridwidth  = 1;
    67         pnl.add(cbUseDefaultServerUrl = new JCheckBox(), gc);
     59    protected JComponent buildDefaultServerUrlPanel() {
     60        cbUseDefaultServerUrl = new JCheckBox(tr("<html>Use the default OSM server URL (<strong>{0}</strong>)</html>", OsmApi.DEFAULT_API_URL));
    6861        cbUseDefaultServerUrl.addItemListener(new UseDefaultServerUrlChangeHandler());
    69 
    70         gc.gridx = 1;
    71         gc.weightx = 1.0;
    72         JLabel lbl = new JLabel(tr("<html>Use the default OSM server URL (<strong>{0}</strong>)</html>", OsmApi.DEFAULT_API_URL));
    73         lbl.setFont(lbl.getFont().deriveFont(Font.PLAIN));
    74         pnl.add(lbl, gc);
    75 
    76         return pnl;
     62        cbUseDefaultServerUrl.setFont(cbUseDefaultServerUrl.getFont().deriveFont(Font.PLAIN));
     63        return cbUseDefaultServerUrl;
    7764    }
    7865
Note: See TracChangeset for help on using the changeset viewer.