Changeset 8426 in josm


Ignore:
Timestamp:
2015-05-26T01:37:50+02:00 (7 years ago)
Author:
Don-vip
Message:

Accessibility - global use of JLabel.setLabelFor() + various fixes (javadoc, code style)

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java

    r8404 r8426  
    239239            JLabel lbl = new JLabel(layer.getName(), layer.getIcon(), SwingConstants.LEFT);
    240240            lbl.setToolTipText(tr("No exporter for this layer"));
     241            lbl.setLabelFor(include);
    241242            lbl.setEnabled(false);
    242243            p.add(include, GBC.std());
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r8395 r8426  
    224224        // -- prepare the combo box with the search expressions
    225225        //
    226         JLabel label = new JLabel( initialValues instanceof Filter ? tr("Filter string:") : tr("Search string:"));
     226        JLabel label = new JLabel(initialValues instanceof Filter ? tr("Filter string:") : tr("Search string:"));
    227227        final HistoryComboBox hcbSearchString = new HistoryComboBox();
    228228        hcbSearchString.setText(initialValues.text);
    229229        hcbSearchString.setToolTipText(tr("Enter the search expression"));
    230         // we have to reverse the history, because ComboBoxHistory will reverse it again
    231         // in addElement()
     230        // we have to reverse the history, because ComboBoxHistory will reverse it again in addElement()
    232231        //
    233232        List<String> searchExpressionHistory = getSearchExpressionHistory();
     
    235234        hcbSearchString.setPossibleItems(searchExpressionHistory);
    236235        hcbSearchString.setPreferredSize(new Dimension(40, hcbSearchString.getPreferredSize().height));
     236        label.setLabelFor(hcbSearchString);
    237237
    238238        JRadioButton replace = new JRadioButton(tr("replace selection"), initialValues.mode == SearchMode.replace);
  • trunk/src/org/openstreetmap/josm/corrector/TagCorrector.java

    r7005 r8426  
    1212import java.util.List;
    1313import java.util.Map;
     14import java.util.Map.Entry;
    1415import java.util.Set;
    15 import java.util.Map.Entry;
    1616
    1717import javax.swing.JLabel;
     
    115115                );
    116116                p.add(primitiveLabel, GBC.eol());
     117                rolesLabel.setLabelFor(primitiveLabel);
    117118
    118119                final RoleCorrectionTable table = new RoleCorrectionTable(roleCorrections);
    119120                final JScrollPane scrollPane = new JScrollPane(table);
    120121                p.add(scrollPane, GBC.eop().fill(GBC.HORIZONTAL));
     122                primitiveLabel.setLabelFor(table);
    121123
    122124                roleTableMap.put(primitive, table);
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r8413 r8426  
    331331
    332332                                    // Popup Information
    333                                     // display them if the middle mouse button is pressed and
    334                                     // keep them until the mouse is moved
     333                                    // display them if the middle mouse button is pressed and keep them until the mouse is moved
    335334                                    if (middleMouseDown || isAtOldPosition) {
    336335                                        Collection<OsmPrimitive> osms = mv.getAllNearest(ms.mousePos, OsmPrimitive.isUsablePredicate);
     
    346345                                        c.add(lbl, GBC.eol().insets(2, 0, 2, 0));
    347346
    348                                         // Only cycle if the mouse has not been moved and the
    349                                         // middle mouse button has been pressed at least twice
    350                                         // (the reason for this is the popup != null check for
    351                                         // isAtOldPosition, see above. This is a nice side
    352                                         // effect though, because it does not change selection
    353                                         // of the first middle click)
    354                                         if(isAtOldPosition && middleMouseDown) {
    355                                             // Hand down mouse modifiers so the SHIFT mod can be
    356                                             // handled correctly (see funcion)
     347                                        // Only cycle if the mouse has not been moved and the middle mouse button has been pressed at least
     348                                        // twice (the reason for this is the popup != null check for isAtOldPosition, see above.
     349                                        // This is a nice side effect though, because it does not change selection of the first middle click)
     350                                        if (isAtOldPosition && middleMouseDown) {
     351                                            // Hand down mouse modifiers so the SHIFT mod can be handled correctly (see function)
    357352                                            popupCycleSelection(osms, ms.modifiers);
    358353                                        }
    359354
    360                                         // These labels may need to be updated from the outside
    361                                         // so collect them
     355                                        // These labels may need to be updated from the outside so collect them
    362356                                        List<JLabel> lbls = new ArrayList<>(osms.size());
    363357                                        for (final OsmPrimitive osm : osms) {
  • trunk/src/org/openstreetmap/josm/gui/NoteInputDialog.java

    r8211 r8426  
    4141     */
    4242    public void showNoteDialog(String message, Icon icon) {
    43         JLabel label = new JLabel(message);
    4443        textArea.setRows(6);
    4544        textArea.setColumns(30);
     
    4847        JScrollPane scrollPane = new JScrollPane(textArea);
    4948        scrollPane.setAlignmentX(Component.LEFT_ALIGNMENT); //without this the label gets pushed to the right
     49
     50        JLabel label = new JLabel(message);
     51        label.setLabelFor(textArea);
    5052
    5153        JPanel contentPanel = new JPanel();
  • trunk/src/org/openstreetmap/josm/gui/PleaseWaitDialog.java

    r8394 r8426  
    3838    private JButton btnInBackground;
    3939    /** the text area and the scroll pane for the log */
    40     private JosmTextArea taLog = new JosmTextArea(5,50);
     40    private final JosmTextArea taLog = new JosmTextArea(5,50);
    4141    private  JScrollPane spLog;
    4242
     
    136136    @Override
    137137    public void appendLogMessage(String message) {
    138         if (message == null || message.trim().length() ==0 )
     138        if (message == null || message.trim().isEmpty())
    139139            return;
    140140        if (!spLog.isVisible()) {
     
    200200        this.progressBar.repaint();
    201201    }
    202 
    203202}
  • trunk/src/org/openstreetmap/josm/gui/actionsupport/AlignImageryPanel.java

    r7937 r8426  
    3232
    3333    public AlignImageryPanel(boolean oneLine) {
    34         super();
    35 
    3634        Font font = getFont().deriveFont(Font.PLAIN, 14.0f);
    3735        JLabel nagLabel = new JLabel(tr("Aerial imagery might be misaligned. Please check its offset using GPS tracks!"));
    3836        UrlLabel detailsList = new UrlLabel(tr("http://wiki.openstreetmap.org/wiki/Using_Imagery"), tr("Details..."));
     37        nagLabel.setLabelFor(detailsList);
    3938        nagLabel.setFont(font);
    4039        detailsList.setFont(font);
     
    4746        closeButton.addActionListener(new ActionListener() {
    4847            @Override
    49             public void actionPerformed( ActionEvent e ) {
     48            public void actionPerformed(ActionEvent e) {
    5049                if (Main.isDisplayingMapView()) {
    5150                    Main.map.removeTopPanel(AlignImageryPanel.class);
     
    7069
    7170    public static void addNagPanelIfNeeded() {
    72         if (Main.isDisplayingMapView() && !Main.pref.getBoolean("expert") && Main.pref.getBoolean(PREF, true) ) {
     71        if (Main.isDisplayingMapView() && !Main.pref.getBoolean("expert") && Main.pref.getBoolean(PREF, true)) {
    7372            if (Main.map.getTopPanel(AlignImageryPanel.class) == null) {
    7473                double w = Toolkit.getDefaultToolkit().getScreenSize().getWidth();
    75                 AlignImageryPanel p = new AlignImageryPanel(w>1300);
     74                AlignImageryPanel p = new AlignImageryPanel(w > 1300);
    7675                Main.map.addTopPanel(p);
    7776            }
  • trunk/src/org/openstreetmap/josm/gui/actionsupport/LogShowDialog.java

    r8419 r8426  
    1919 * Generic dialog with message and scrolling area
    2020 * @author Alexei
     21 * @since 5114
    2122 */
    2223public class LogShowDialog extends ExtendedDialog {
    2324
    24 
     25    /**
     26     * Constructs a new {@code LogShowDialog}.
     27     * @param title The text that will be shown in the window titlebar
     28     * @param msg Single-line Label
     29     * @param log Multi-line log
     30     */
    2531    public LogShowDialog(String title, String msg, String log) {
    2632        super(Main.parent, title, new String[] {tr("OK")});
     
    4248        txt.setOpaque(false);
    4349
     50        lbl.setLabelFor(txt);
     51
    4452        JScrollPane sp = new JScrollPane(txt);
    4553        sp.setOpaque(false);
    4654        sp.setPreferredSize(new Dimension(600,300));
    47 
    4855
    4956        p.add(sp, GBC.eop().insets(5,15,0,0).fill(GBC.HORIZONTAL));
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java

    r8419 r8426  
    4545 * A UI component for resolving conflicts in two lists of entries of type T.
    4646 *
    47  * @param <T>  the type of the entries
     47 * @param <T> the type of the entries
    4848 * @see ListMergeModel
     49 * @since 1631
    4950 */
    5051public abstract class ListMerger<T extends PrimitiveId> extends JPanel implements PropertyChangeListener, Observer {
     
    7475    private transient AdjustmentSynchronizer adjustmentSynchronizer;
    7576
    76     private  JLabel lblMyVersion;
    77     private  JLabel lblMergedVersion;
    78     private  JLabel lblTheirVersion;
    79 
    80     private  JLabel lblFrozenState;
     77    private JLabel lblMyVersion;
     78    private JLabel lblMergedVersion;
     79    private JLabel lblTheirVersion;
     80
     81    private JLabel lblFrozenState;
    8182
    8283    protected abstract JScrollPane buildMyElementsTable();
     
    124125
    125126    protected JPanel buildLeftButtonPanel() {
    126         JPanel pnl = new JPanel();
    127         pnl.setLayout(new GridBagLayout());
     127        JPanel pnl = new JPanel(new GridBagLayout());
    128128        GridBagConstraints gc = new GridBagConstraints();
    129129
     
    167167
    168168    protected JPanel buildRightButtonPanel() {
    169         JPanel pnl = new JPanel();
    170         pnl.setLayout(new GridBagLayout());
     169        JPanel pnl = new JPanel(new GridBagLayout());
    171170        GridBagConstraints gc = new GridBagConstraints();
    172171
     
    200199
    201200    protected JPanel buildMergedListControlButtons() {
    202         JPanel pnl = new JPanel();
    203         pnl.setLayout(new GridBagLayout());
     201        JPanel pnl = new JPanel(new GridBagLayout());
    204202        GridBagConstraints gc = new GridBagConstraints();
    205203
     
    229227
    230228    protected JPanel buildAdjustmentLockControlPanel(JCheckBox cb) {
    231         JPanel panel = new JPanel();
    232         panel.setLayout(new FlowLayout(FlowLayout.RIGHT));
     229        JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    233230        panel.add(new JLabel(tr("lock scrolling")));
    234231        panel.add(cb);
     
    237234
    238235    protected JPanel buildComparePairSelectionPanel() {
    239         JPanel p = new JPanel();
    240         p.setLayout(new FlowLayout(FlowLayout.LEFT));
     236        JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
    241237        p.add(new JLabel(tr("Compare ")));
    242238        JosmComboBox<ComparePairType> cbComparePair = new JosmComboBox<>(model.getComparePairListModel());
     
    247243
    248244    protected JPanel buildFrozeStateControlPanel() {
    249         JPanel p = new JPanel();
    250         p.setLayout(new FlowLayout(FlowLayout.LEFT));
     245        JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT));
    251246        lblFrozenState = new JLabel();
    252247        p.add(lblFrozenState);
     
    327322        gc.insets = new Insets(0,0,0,0);
    328323        JScrollPane pane = buildMyElementsTable();
     324        lblMyVersion.setLabelFor(pane);
    329325        adjustmentSynchronizer.adapt(cbLockMyScrolling, pane.getVerticalScrollBar());
    330326        add(pane, gc);
     
    345341        gc.weighty = 0.0;
    346342        pane = buildMergedElementsTable();
     343        lblMergedVersion.setLabelFor(pane);
    347344        adjustmentSynchronizer.adapt(cbLockMergedScrolling, pane.getVerticalScrollBar());
    348345        add(pane, gc);
     
    363360        gc.weighty = 0.0;
    364361        pane = buildTheirElementsTable();
     362        lblTheirVersion.setLabelFor(pane);
    365363        adjustmentSynchronizer.adapt(cbLockTheirScrolling, pane.getVerticalScrollBar());
    366364        add(pane, gc);
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/nodes/NodeListMerger.java

    r6084 r8426  
    1313/**
    1414 * A UI component for resolving conflicts in the node lists of two {@link Way}s.
    15  *
     15 * @since 1622
    1616 */
    1717public class NodeListMerger extends ListMerger<Node> implements IConflictResolver {
     18
     19    /**
     20     * Constructs a new {@code NodeListMerger}.
     21     */
    1822    public NodeListMerger() {
    1923        super(new NodeListMergeModel());
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/properties/PropertiesMerger.java

    r8390 r8426  
    3030
    3131/**
    32  * This class represents a UI component for resolving conflicts in some properties
    33  * of {@link OsmPrimitive}.
    34  *
     32 * This class represents a UI component for resolving conflicts in some properties of {@link OsmPrimitive}.
     33 * @since 1654
    3534 */
    3635public class PropertiesMerger extends JPanel implements Observer, IConflictResolver {
     
    4948
    5049    private final transient PropertiesMergeModel model;
     50
     51    /**
     52     * Constructs a new {@code PropertiesMerger}.
     53     */
     54    public PropertiesMerger() {
     55        model = new PropertiesMergeModel();
     56        model.addObserver(this);
     57        build();
     58    }
    5159
    5260    protected JLabel buildValueLabel(String name) {
     
    275283        buildDeletedStateConflictRows();
    276284        buildReferrersRow();
    277     }
    278 
    279     /**
    280      * Constructs a new {@code PropertiesMerger}.
    281      */
    282     public PropertiesMerger() {
    283         model = new PropertiesMergeModel();
    284         model.addObserver(this);
    285         build();
    286285    }
    287286
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/relation/RelationMemberMerger.java

    r6084 r8426  
    1212
    1313/**
    14  * A UI component for resolving conflicts in the member lists of two {@link Relation}
     14 * A UI component for resolving conflicts in the member lists of two {@link Relation}s.
     15 * @since 1631
    1516 */
    1617public class RelationMemberMerger extends ListMerger<RelationMember> implements IConflictResolver {
     18
     19    /**
     20     * Constructs a new {@code RelationMemberMerger}.
     21     */
     22    public RelationMemberMerger() {
     23        super(new RelationMemberListMergeModel());
     24    }
     25
    1726    @Override
    1827    protected JScrollPane buildMyElementsTable() {
     
    5867    }
    5968
    60     public RelationMemberMerger() {
    61         super(new RelationMemberListMergeModel());
    62     }
    63 
    6469    @Override
    6570    public void deletePrimitive(boolean deleted) {
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/tags/TagMerger.java

    r8390 r8426  
    3232import org.openstreetmap.josm.gui.conflict.pair.MergeDecisionType;
    3333import org.openstreetmap.josm.tools.ImageProvider;
     34
    3435/**
    3536 * UI component for resolving conflicts in the tag sets of two {@link OsmPrimitive}s.
    36  *
     37 * @since 1622
    3738 */
    3839public class TagMerger extends JPanel implements IConflictResolver {
     
    4546
    4647    /**
     48     * Constructs a new {@code TagMerger}.
     49     */
     50    public TagMerger() {
     51        model = new TagMergeModel();
     52        build();
     53    }
     54
     55    /**
    4756     * embeds table in a new {@link JScrollPane} and returns th scroll pane
    4857     *
     
    6271     */
    6372    protected JScrollPane buildMineTagTable() {
    64         mineTable  = new JTable(
     73        mineTable = new JTable(
    6574                model,
    6675                new TagMergeColumnModel(
     
    7887     */
    7988    protected JScrollPane buildTheirTable() {
    80         theirTable  = new JTable(
     89        theirTable = new JTable(
    8190                model,
    8291                new TagMergeColumnModel(
     
    95104
    96105    protected JScrollPane buildMergedTable() {
    97         mergedTable  = new JTable(
     106        mergedTable = new JTable(
    98107                model,
    99108                new TagMergeColumnModel(
     
    123132        gc.weighty = 0.0;
    124133        gc.insets = new Insets(10,0,10,0);
    125         JLabel lbl = new JLabel(tr("My version (local dataset)"));
    126         add(lbl, gc);
     134        JLabel lblMy = new JLabel(tr("My version (local dataset)"));
     135        add(lblMy, gc);
    127136
    128137        gc.gridx = 2;
     
    134143        gc.weightx = 0.0;
    135144        gc.weighty = 0.0;
    136         lbl = new JLabel(tr("Merged version"));
    137         add(lbl, gc);
     145        JLabel lblMerge = new JLabel(tr("Merged version"));
     146        add(lblMerge, gc);
    138147
    139148        gc.gridx = 4;
     
    146155        gc.weighty = 0.0;
    147156        gc.insets = new Insets(0,0,0,0);
    148         lbl = new JLabel(tr("Their version (server dataset)"));
    149         add(lbl, gc);
     157        JLabel lblTheir = new JLabel(tr("Their version (server dataset)"));
     158        add(lblTheir, gc);
    150159
    151160        gc.gridx = 0;
     
    157166        gc.weightx = 0.3;
    158167        gc.weighty = 1.0;
    159         add(buildMineTagTable(), gc);
     168        JScrollPane tabMy = buildMineTagTable();
     169        lblMy.setLabelFor(tabMy);
     170        add(tabMy, gc);
    160171
    161172        gc.gridx = 1;
     
    181192        gc.weightx = 0.3;
    182193        gc.weighty = 1.0;
    183         add(buildMergedTable(), gc);
     194        JScrollPane tabMerge = buildMergedTable();
     195        lblMerge.setLabelFor(tabMerge);
     196        add(tabMerge, gc);
    184197
    185198        gc.gridx = 3;
     
    204217        gc.weightx = 0.3;
    205218        gc.weighty = 1.0;
    206         add(buildTheirTable(), gc);
     219        JScrollPane tabTheir = buildTheirTable();
     220        lblTheir.setLabelFor(tabTheir);
     221        add(tabTheir, gc);
    207222        theirTable.getSelectionModel().addListSelectionListener(keepTheirAction);
    208223
     
    224239        btnUndecide.setName("button.undecide");
    225240        add(btnUndecide, gc);
    226 
    227     }
    228 
    229     /**
    230      * Constructs a new {@code TagMerger}.
    231      */
    232     public TagMerger() {
    233         model = new TagMergeModel();
    234         build();
    235241    }
    236242
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java

    r8379 r8426  
    9999    protected JCheckBox cbWireframe;
    100100
     101    /**
     102     * Action that opens the map paint preferences.
     103     */
    101104    public static final JosmAction PREFERENCE_ACTION = PreferencesAction.forPreferenceSubTab(
    102105            tr("Map paint preferences"), null, MapPaintPreference.class, /* ICON */ "dialogs/mappaintpreference");
     
    118121        JLabel wfLabel = new JLabel(tr("Wireframe View"), ImageProvider.get("dialogs/mappaint", "wireframe_small"), JLabel.HORIZONTAL);
    119122        wfLabel.setFont(wfLabel.getFont().deriveFont(Font.PLAIN));
     123        wfLabel.setLabelFor(cbWireframe);
    120124
    121125        cbWireframe.setModel(new DefaultButtonModel() {
     
    208212    protected class StylesModel extends AbstractTableModel implements MapPaintSylesUpdateListener {
    209213
     214        private final Class<?>[] columnClasses = {Boolean.class, StyleSource.class};
     215
    210216        private transient List<StyleSource> data = new ArrayList<>();
    211217
     218        /**
     219         * Constructs a new {@code StylesModel}.
     220         */
    212221        public StylesModel() {
    213222            data = new ArrayList<>(MapPaintStyles.getStyles().getStyleSources());
     
    240249            return column == 0;
    241250        }
    242 
    243         private Class<?>[] columnClasses = {Boolean.class, StyleSource.class};
    244251
    245252        @Override
     
    286293    private class MyCheckBoxRenderer extends JCheckBox implements TableCellRenderer {
    287294
     295        /**
     296         * Constructs a new {@code MyCheckBoxRenderer}.
     297         */
    288298        public MyCheckBoxRenderer() {
    289299            setHorizontalAlignment(SwingConstants.CENTER);
     
    318328
    319329    protected class OnOffAction extends AbstractAction implements ListSelectionListener {
     330        /**
     331         * Constructs a new {@code OnOffAction}.
     332         */
    320333        public OnOffAction() {
    321334            putValue(NAME, tr("On/Off"));
     
    352365        private final int increment;
    353366
     367        /**
     368         * Constructs a new {@code MoveUpDownAction}.
     369         * @param isDown {@code true} to move the entry down, {@code false} to move it up
     370         */
    354371        public MoveUpDownAction(boolean isDown) {
    355372            increment = isDown ? 1 : -1;
     
    384401
    385402    protected class ReloadAction extends AbstractAction implements ListSelectionListener {
     403        /**
     404         * Constructs a new {@code ReloadAction}.
     405         */
    386406        public ReloadAction() {
    387407            putValue(NAME, tr("Reload from file"));
     
    425445                        }
    426446                    });
    427 
    428447                }
    429448            });
     
    433452    protected class SaveAsAction extends AbstractAction {
    434453
     454        /**
     455         * Constructs a new {@code SaveAsAction}.
     456         */
    435457        public SaveAsAction() {
    436458            putValue(NAME, tr("Save as..."));
     
    523545    }
    524546
     547    /**
     548     * Displays information about selected paint style in a new dialog.
     549     */
    525550    protected class InfoAction extends AbstractAction {
    526551
     
    528553        private boolean sourceTabLoaded;
    529554
     555        /**
     556         * Constructs a new {@code InfoAction}.
     557         */
    530558        public InfoAction() {
    531559            putValue(NAME, tr("Info"));
  • trunk/src/org/openstreetmap/josm/gui/dialogs/OsmIdSelectionDialog.java

    r8308 r8426  
    7171
    7272        JLabel lbl1 = new JLabel(tr("Object type:"));
     73        lbl1.setLabelFor(cbType);
    7374
    7475        cbType.addItem(trc("osm object types", "mixed"));
    7576        cbType.setToolTipText(tr("Choose the OSM object type"));
    7677        JLabel lbl2 = new JLabel(tr("Object ID:"));
     78        lbl2.setLabelFor(cbId);
    7779
    7880        cbId.setEditor(new BasicComboBoxEditor() {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r8378 r8426  
    7373/**
    7474 * This class is a toggle dialog that can be turned on and off.
    75  *
     75 * @since 8
    7676 */
    7777public class ToggleDialog extends JPanel implements ShowHideButtonListener, Helpful, AWTEventListener, Destroyable, PreferenceChangedListener {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/TagEditHelper.java

    r8399 r8426  
    635635        }
    636636
     637        private String code(String text) {
     638            return "<code>" + text + "</code> ";
     639        }
     640
    637641        @Override
    638642        public void setContentPane(Container contentPane) {
    639643            final int commandDownMask = GuiHelper.getMenuShortcutKeyMaskEx();
    640             ArrayList<String> lines = new ArrayList<>();
     644            List<String> lines = new ArrayList<>();
    641645            Shortcut sc = Shortcut.findShortcut(KeyEvent.VK_1, commandDownMask);
    642646            if (sc != null) {
    643                 lines.add("<code>"+sc.getKeyText()+"</code> "+tr("to apply first suggestion"));
    644             }
    645             lines.add("<code>"+KeyEvent.getKeyModifiersText(KeyEvent.SHIFT_MASK)+"+"+KeyEvent.getKeyText(KeyEvent.VK_ENTER)+"</code> "
     647                lines.add(code(sc.getKeyText()) + tr("to apply first suggestion"));
     648            }
     649            lines.add(code(KeyEvent.getKeyModifiersText(KeyEvent.SHIFT_MASK)+"+"+KeyEvent.getKeyText(KeyEvent.VK_ENTER))
    646650                    +tr("to add without closing the dialog"));
    647651            sc = Shortcut.findShortcut(KeyEvent.VK_1, commandDownMask|KeyEvent.SHIFT_DOWN_MASK);
    648652            if (sc != null) {
    649                 lines.add("<code>"+sc.getKeyText()+"</code> "+tr("to add first suggestion without closing the dialog"));
     653                lines.add(code(sc.getKeyText()) + tr("to add first suggestion without closing the dialog"));
    650654            }
    651655            final JLabel helpLabel = new JLabel("<html>" + Utils.join("<br>", lines) + "</html>");
  • trunk/src/org/openstreetmap/josm/gui/history/VersionInfoPanel.java

    r8308 r8426  
    5656    private JLabel lblSource;
    5757    private JLabel lblImageryUsed;
    58     private JTextArea lblChangesetComment;
    59     private JTextArea lblChangesetSource;
    60     private JTextArea lblChangesetImageryUsed;
     58    private JTextArea texChangesetComment;
     59    private JTextArea texChangesetSource;
     60    private JTextArea texChangesetImageryUsed;
    6161
    6262    protected static JTextArea buildTextArea(String tooltip) {
     
    7676        lbl.setFont(textArea.getFont());
    7777        lbl.setToolTipText(tooltip);
     78        lbl.setLabelFor(textArea);
    7879        return lbl;
    7980    }
     
    100101        pnlUserAndChangeset.add(lblChangeset);
    101102
    102         lblChangesetComment = buildTextArea(tr("Changeset comment"));
    103         lblChangesetSource = buildTextArea(tr("Changeset source"));
    104         lblChangesetImageryUsed = buildTextArea(tr("Imagery used"));
    105 
    106         lblSource = buildLabel(tr("<b>Source</b>:"), tr("Changeset source"), lblChangesetSource);
    107         lblImageryUsed = buildLabel(tr("<b>Imagery</b>:"), tr("Imagery used"), lblChangesetImageryUsed);
    108         pnlChangesetSource = buildTextPanel(lblSource, lblChangesetSource);
    109         pnlChangesetImageryUsed = buildTextPanel(lblImageryUsed, lblChangesetImageryUsed);
     103        texChangesetComment = buildTextArea(tr("Changeset comment"));
     104        texChangesetSource = buildTextArea(tr("Changeset source"));
     105        texChangesetImageryUsed = buildTextArea(tr("Imagery used"));
     106
     107        lblSource = buildLabel(tr("<b>Source</b>:"), tr("Changeset source"), texChangesetSource);
     108        lblImageryUsed = buildLabel(tr("<b>Imagery</b>:"), tr("Imagery used"), texChangesetImageryUsed);
     109        pnlChangesetSource = buildTextPanel(lblSource, texChangesetSource);
     110        pnlChangesetImageryUsed = buildTextPanel(lblImageryUsed, texChangesetImageryUsed);
    110111
    111112        setLayout(new GridBagLayout());
     
    120121        add(pnlUserAndChangeset, gc);
    121122        gc.gridy = 2;
    122         add(lblChangesetComment, gc);
     123        add(texChangesetComment, gc);
    123124        gc.gridy = 3;
    124125        add(pnlChangesetSource, gc);
     
    228229
    229230        final Changeset oppCs = model.getPointInTime(pointInTimeType.opposite()).getChangeset();
    230         updateText(cs, "comment", lblChangesetComment, null, oppCs, lblChangesetComment);
    231         updateText(cs, "source", lblChangesetSource, lblSource, oppCs, pnlChangesetSource);
    232         updateText(cs, "imagery_used", lblChangesetImageryUsed, lblImageryUsed, oppCs, pnlChangesetImageryUsed);
     231        updateText(cs, "comment", texChangesetComment, null, oppCs, texChangesetComment);
     232        updateText(cs, "source", texChangesetSource, lblSource, oppCs, pnlChangesetSource);
     233        updateText(cs, "imagery_used", texChangesetImageryUsed, lblImageryUsed, oppCs, pnlChangesetImageryUsed);
    233234    }
    234235
  • trunk/src/org/openstreetmap/josm/gui/io/DownloadPrimitivesWithReferrersTask.java

    r8378 r8426  
    4949
    5050    /** Temporary layer where downloaded primitives are put */
    51     private OsmDataLayer tmpLayer;
     51    private final OsmDataLayer tmpLayer;
    5252    /** Reference to the task that download requested primitives */
    5353    private DownloadPrimitivesTask mainTask;
     
    209209        JPanel p = new JPanel(new GridBagLayout());
    210210        p.add(new HtmlPanel(text), GBC.eop());
     211        JosmTextArea txt = new JosmTextArea();
    211212        if (listLabel != null) {
    212213            JLabel missing = new JLabel(listLabel);
    213214            missing.setFont(missing.getFont().deriveFont(Font.PLAIN));
     215            missing.setLabelFor(txt);
    214216            p.add(missing, GBC.eol());
    215217        }
    216         JosmTextArea txt = new JosmTextArea();
    217218        txt.setFont(GuiHelper.getMonospacedFont(txt));
    218219        txt.setEditable(false);
     
    227228                Main.parent,
    228229                title,
    229                 new String[] { tr("Ok") })
    230         .setButtonIcons(new String[] { "ok" })
     230                new String[] {tr("Ok")})
     231        .setButtonIcons(new String[] {"ok"})
    231232        .setIcon(msgType)
    232233        .setContent(p, false);
  • trunk/src/org/openstreetmap/josm/gui/io/LayerNameAndFilePathTableCell.java

    r8379 r8426  
    5454        lblFilename.setPreferredSize(new Dimension(lblFilename.getPreferredSize().width, 19));
    5555        lblFilename.setOpaque(true);
     56        lblFilename.setLabelFor(btnFileChooser);
    5657
    5758        tfFilename.setToolTipText(tr("Either edit the path manually in the text field or click the \"...\" button to open a file chooser."));
  • trunk/src/org/openstreetmap/josm/gui/io/SaveLayersTableColumnModel.java

    r6889 r8426  
    2525        private static final GBC defaultCellStyle = GBC.eol().fill(GBC.HORIZONTAL).insets(2, 0, 2, 0);
    2626
     27        /**
     28         * Constructs a new {@code RecommendedActionsTableCell}.
     29         */
    2730        public RecommendedActionsTableCell() {
    2831            pnlEmpty.setPreferredSize(new Dimension(1, 19));
     
    3639            JPanel panel = new JPanel(new GridBagLayout());
    3740            SaveLayerInfo info = (SaveLayerInfo)value;
    38             StringBuilder sb = new StringBuilder();
     41            StringBuilder sb = new StringBuilder(24);
    3942            sb.append("<html>");
    4043            if (info.getLayer().requiresUploadToServer() && !info.getLayer().isUploadDiscouraged()) {
     
    5457            if (info.getLayer().requiresSaveToFile()) {
    5558                panel.add(needsSave, defaultCellStyle);
    56                 sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.", info.getName(), info.getFile().toString()));
     59                sb.append(tr("Layer ''{0}'' has modifications which should be saved to its associated file ''{1}''.",
     60                        info.getName(), info.getFile().toString()));
    5761            } else {
    5862                panel.add(pnlEmpty, defaultCellStyle);
     
    6367            return panel;
    6468        }
     69    }
     70
     71    /**
     72     * Constructs a new {@code SaveLayersTableColumnModel}.
     73     */
     74    public SaveLayersTableColumnModel() {
     75        build();
    6576    }
    6677
     
    97108        addColumn(col);
    98109    }
    99 
    100     public SaveLayersTableColumnModel() {
    101         build();
    102     }
    103110}
  • trunk/src/org/openstreetmap/josm/gui/io/UploadAndSaveProgressRenderer.java

    r6084 r8426  
    2020    private JLabel lblCustomText;
    2121    private JProgressBar progressBar;
     22
     23    /**
     24     * Constructs a new {@code UploadAndSaveProgressRenderer}.
     25     */
     26    public UploadAndSaveProgressRenderer() {
     27        build();
     28        // initially not visible
     29        setVisible(false);
     30    }
    2231
    2332    protected void build() {
     
    4756        gc.insets = new Insets(5,0,0,5);
    4857        add(progressBar = new JProgressBar(JProgressBar.HORIZONTAL), gc);
    49     }
    50 
    51     public UploadAndSaveProgressRenderer() {
    52         build();
    53         // initially not visible
    54         setVisible(false);
    5558    }
    5659
  • trunk/src/org/openstreetmap/josm/gui/io/UploadParameterSummaryPanel.java

    r8390 r8426  
    3131    private transient ConfigurationParameterRequestHandler configHandler;
    3232
     33    /**
     34     * Constructs a new {@code UploadParameterSummaryPanel}.
     35     */
     36    public UploadParameterSummaryPanel() {
     37        build();
     38        updateSummary();
     39    }
     40
    3341    protected String buildChangesetSummary() {
    3442        StringBuilder msg = new StringBuilder(96);
     
    5664        if (spec == null)
    5765            return "";
    58         // check whether we can use one changeset only or whether we have to use
    59         // multiple changesets
     66        // check whether we can use one changeset only or whether we have to use multiple changesets
    6067        //
    6168        boolean useOneChangeset = true;
     
    113120    }
    114121
    115     /**
    116      * Constructs a new {@code UploadParameterSummaryPanel}.
    117      */
    118     public UploadParameterSummaryPanel() {
    119         build();
    120         updateSummary();
    121     }
    122 
    123122    public void setConfigurationParameterRequestListener(ConfigurationParameterRequestHandler handler) {
    124123        this.configHandler = handler;
     
    141140
    142141    protected void updateSummary() {
    143         StringBuilder sb = new StringBuilder();
     142        StringBuilder sb = new StringBuilder(32);
    144143        sb.append("<html>")
    145144          .append(buildStrategySummary())
  • trunk/src/org/openstreetmap/josm/gui/io/UploadSelectionDialog.java

    r8415 r8426  
    4747 * This dialog can be used to select individual object for uploading.
    4848 *
    49  *
     49 * @since 2250
    5050 */
    5151public class UploadSelectionDialog extends JDialog {
     
    5757    private SideButton btnContinue;
    5858
     59    /**
     60     * Constructs a new {@code UploadSelectionDialog}.
     61     */
     62    public UploadSelectionDialog() {
     63        super(JOptionPane.getFrameForComponent(Main.parent), ModalityType.DOCUMENT_MODAL);
     64        build();
     65    }
     66
    5967    protected JPanel buildSelectedPrimitivesPanel() {
    6068        JPanel pnl = new JPanel();
    6169        pnl.setLayout(new BorderLayout());
    62         JLabel lbl = new JLabel(tr("<html>Mark modified objects <strong>from the current selection</strong> to be uploaded to the server.</html>"));
     70        JLabel lbl = new JLabel(
     71                tr("<html>Mark modified objects <strong>from the current selection</strong> to be uploaded to the server.</html>"));
    6372        lbl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    6473        pnl.add(lbl, BorderLayout.NORTH);
    6574        pnl.add(new JScrollPane(lstSelectedPrimitives = new OsmPrimitiveList()), BorderLayout.CENTER);
     75        lbl.setLabelFor(lstSelectedPrimitives);
    6676        return pnl;
    6777    }
     
    7484        pnl.add(lbl, BorderLayout.NORTH);
    7585        pnl.add(new JScrollPane(lstDeletedPrimitives = new OsmPrimitiveList()), BorderLayout.CENTER);
     86        lbl.setLabelFor(lstDeletedPrimitives);
    7687        return pnl;
    7788    }
     
    114125        setTitle(tr("Select objects to upload"));
    115126        HelpUtil.setHelpContext(getRootPane(), HelpUtil.ht("/Dialog/UploadSelection"));
    116     }
    117 
    118     public UploadSelectionDialog() {
    119         super(JOptionPane.getFrameForComponent(Main.parent), ModalityType.DOCUMENT_MODAL);
    120         build();
    121127    }
    122128
  • trunk/src/org/openstreetmap/josm/gui/io/UploadedObjectsSummaryPanel.java

    r8308 r8426  
    2020
    2121/**
    22  * This panel displays a summary of the objects to upload. It is displayed in
    23  * the upper part of the {@link UploadDialog}.
    24  *
     22 * This panel displays a summary of the objects to upload. It is displayed in the upper part of the {@link UploadDialog}.
     23 * @since 2599
    2524 */
    2625public class UploadedObjectsSummaryPanel extends JPanel {
     
    4039    private JScrollPane spDelete;
    4140
     41    /**
     42     * Constructs a new {@code UploadedObjectsSummaryPanel}.
     43     */
     44    public UploadedObjectsSummaryPanel() {
     45        build();
     46    }
     47
    4248    protected void build() {
    4349        setLayout(new GridBagLayout());
    4450        OsmPrimitivRenderer renderer = new OsmPrimitivRenderer();
    45         // initialize the three lists for uploaded primitives, but don't add
    46         // them to the dialog yet,  see setUploadedPrimitives()
     51        // initialize the three lists for uploaded primitives, but don't add them to the dialog yet, see setUploadedPrimitives()
    4752        //
    4853        lstAdd = new PrimitiveList();
     
    5156        spAdd = new JScrollPane(lstAdd);
    5257        lblAdd = new JLabel(tr("Objects to add:"));
     58        lblAdd.setLabelFor(lstAdd);
    5359
    5460        lstUpdate = new PrimitiveList();
     
    5763        spUpdate = new JScrollPane(lstUpdate);
    5864        lblUpdate = new JLabel(tr("Objects to modify:"));
     65        lblUpdate.setLabelFor(lstUpdate);
    5966
    6067        lstDelete = new PrimitiveList();
     
    6370        spDelete = new JScrollPane(lstDelete);
    6471        lblDelete = new JLabel(tr("Objects to delete:"));
     72        lblDelete.setLabelFor(lstDelete);
    6573    }
    6674
     
    121129    }
    122130
    123     public UploadedObjectsSummaryPanel() {
    124         build();
    125     }
    126 
    127131    /**
    128132     * Replies the number of objects to upload
     
    138142    /**
    139143     * A simple list of OSM primitives.
    140      *
    141144     */
    142145    static class PrimitiveList extends JList<OsmPrimitive> {
     146        /**
     147         * Constructs a new {@code PrimitiveList}.
     148         */
    143149        public PrimitiveList() {
    144150            super(new PrimitiveListModel());
     
    152158    /**
    153159     * A list model for a list of OSM primitives.
    154      *
    155160     */
    156161    static class PrimitiveListModel extends AbstractListModel<OsmPrimitive> {
    157162        private transient List<OsmPrimitive> primitives;
    158163
     164        /**
     165         * Constructs a new {@code PrimitiveListModel}.
     166         */
    159167        public PrimitiveListModel() {
    160168            primitives = new ArrayList<>();
  • trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java

    r8405 r8426  
    655655                Main.parent,
    656656                tr("Correlate images with GPX track"),
    657                 new String[] { tr("Correlate"), tr("Cancel") },
     657                new String[] {tr("Correlate"), tr("Cancel")},
    658658                false
    659659        );
    660660        syncDialog.setContent(panelTf, false);
    661         syncDialog.setButtonIcons(new String[] { "ok", "cancel" });
     661        syncDialog.setButtonIcons(new String[] {"ok", "cancel"});
    662662        syncDialog.setupDialog();
    663663        outerPanel.add(syncDialog.getContentPane(), BorderLayout.PAGE_START);
  • trunk/src/org/openstreetmap/josm/gui/oauth/OAuthAuthorizationWizard.java

    r8308 r8426  
    131131        pnl.add(cbAuthorisationProcedure = new AuthorizationProcedureComboBox(),gc);
    132132        cbAuthorisationProcedure.addItemListener(new AuthorisationProcedureChangeListener());
     133        lbl.setLabelFor(cbAuthorisationProcedure);
    133134        return pnl;
    134135    }
  • trunk/src/org/openstreetmap/josm/gui/oauth/SemiAutomaticAuthorizationUI.java

    r8308 r8426  
    110110
    111111    /**
    112      * This is the panel displayed in the first step of the semi-automatic authorisation
    113      * process.
     112     * This is the panel displayed in the first step of the semi-automatic authorisation process.
    114113     */
    115114    private class RetrieveRequestTokenPanel extends JPanel {
    116115        private JCheckBox cbShowAdvancedParameters;
     116
     117        /**
     118         * Constructs a new {@code RetrieveRequestTokenPanel}.
     119         */
     120        public RetrieveRequestTokenPanel() {
     121            build();
     122        }
    117123
    118124        protected JPanel buildAdvancedParametersPanel() {
     
    195201            add(buildCommandPanel(), BorderLayout.SOUTH);
    196202        }
    197 
    198         public RetrieveRequestTokenPanel() {
     203    }
     204
     205    /**
     206     * This is the panel displayed in the second step of the semi-automatic authorization process.
     207     */
     208    private class RetrieveAccessTokenPanel extends JPanel {
     209
     210        private JosmTextField tfAuthoriseUrl;
     211
     212        /**
     213         * Constructs a new {@code RetrieveAccessTokenPanel}.
     214         */
     215        public RetrieveAccessTokenPanel() {
    199216            build();
    200217        }
    201     }
    202 
    203 
    204     /**
    205      * This is the panel displayed in the second step of the semi-automatic authorization
    206      * process.
    207      */
    208     private class RetrieveAccessTokenPanel extends JPanel {
    209 
    210         private JosmTextField tfAuthoriseUrl;
    211218
    212219        protected JPanel buildTitlePanel() {
     
    268275        }
    269276
    270         public RetrieveAccessTokenPanel() {
    271             build();
    272         }
    273 
    274277        public void setAuthoriseUrl(String url) {
    275278            tfAuthoriseUrl.setText(url);
     
    298301    class ShowAccessTokenPanel extends JPanel {
    299302
     303        /**
     304         * Constructs a new {@code ShowAccessTokenPanel}.
     305         */
     306        public ShowAccessTokenPanel() {
     307            build();
     308        }
     309
    300310        protected JPanel buildTitlePanel() {
    301311            JPanel pnl = new JPanel(new BorderLayout());
     
    345355            add(buildContentPanel(), BorderLayout.CENTER);
    346356            add(buildActionPanel(), BorderLayout.SOUTH);
    347         }
    348 
    349         public ShowAccessTokenPanel() {
    350             build();
    351357        }
    352358
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java

    r8419 r8426  
    279279            label = new JLabel(tr("Waypoint labelling"));
    280280            add(label, GBC.std().insets(20,0,0,0));
     281            label.setLabelFor(waypointLabel);
    281282            add(waypointLabel, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
    282283            waypointLabel.addActionListener(new ActionListener() {
     
    299300            label = new JLabel(tr("Audio waypoint labelling"));
    300301            add(label, GBC.std().insets(20,0,0,0));
     302            label.setLabelFor(audioWaypointLabel);
    301303            add(audioWaypointLabel, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
    302304            audioWaypointLabel.addActionListener(new ActionListener() {
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java

    r8308 r8426  
    3232
    3333/**
    34  * An imagery panel used to add WMS imagery sources
     34 * An imagery panel used to add WMS imagery sources.
     35 * @since 2599
    3536 */
    3637public class AddWMSLayerPanel extends AddImageryPanel {
     
    6667
    6768        add(wmsInstruction = new JLabel(tr("4. Verify generated WMS URL")), GBC.eol());
     69        wmsInstruction.setLabelFor(wmsUrl);
    6870        add(wmsUrl, GBC.eop().fill());
    6971        wmsUrl.setLineWrap(true);
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/ImageryPreference.java

    r8401 r8426  
    6969/**
    7070 * Imagery preferences, including imagery providers, settings and offsets.
     71 * @since 3715
    7172 */
    7273public final class ImageryPreference extends DefaultTabPreferenceSetting {
     
    8384
    8485    private ImageryPreference() {
    85         super(/* ICON(preferences/) */ "imagery", tr("Imagery Preferences"), tr("Modify list of imagery layers displayed in the Imagery menu"), false, new JTabbedPane());
     86        super(/* ICON(preferences/) */ "imagery", tr("Imagery Preferences"), tr("Modify list of imagery layers displayed in the Imagery menu"),
     87                false, new JTabbedPane());
    8688    }
    8789
     
    100102        final JLabel lbl = new JLabel(name);
    101103        lbl.setFont(lbl.getFont().deriveFont(Font.BOLD));
     104        lbl.setLabelFor(section);
    102105        p.add(lbl,GBC.std());
    103106        p.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 0));
  • trunk/src/org/openstreetmap/josm/gui/preferences/imagery/WMSSettingsPanel.java

    r7937 r8426  
    6060        JLabel labelSimConn = new JLabel(tr("Simultaneous connections:"));
    6161        spinSimConn = new JSpinner(new SpinnerNumberModel(WMSLayer.PROP_SIMULTANEOUS_CONNECTIONS.get().intValue(), 1, 30, 1));
     62        labelSimConn.setLabelFor(spinSimConn);
    6263        add(labelSimConn, GBC.std());
    6364        add(GBC.glue(5, 0), GBC.std());
     
    7273        spinEast = new JSpinner(new SpinnerNumberModel(WMSLayer.PROP_OVERLAP_EAST.get().intValue(), 1, 50, 1));
    7374        spinNorth = new JSpinner(new SpinnerNumberModel(WMSLayer.PROP_OVERLAP_NORTH.get().intValue(), 1, 50, 1));
     75        labelEast.setLabelFor(spinEast);
     76        labelNorth.setLabelFor(spinNorth);
    7477
    7578        JPanel overlapPanel = new JPanel(new FlowLayout());
     
    8285        add(overlapPanel, GBC.eop());
    8386    }
    84    
     87
    8588    /**
    8689     * Loads the WMS settings.
     
    9497        this.spinSimConn.setValue(WMSLayer.PROP_SIMULTANEOUS_CONNECTIONS.get());
    9598    }
    96    
     99
    97100    /**
    98101     * Saves the WMS settings.
     
    107110
    108111        HTMLGrabber.PROP_BROWSER.put(browser.getEditor().getItem().toString());
    109        
     112
    110113        return false;
    111114    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/map/BackupPreference.java

    r7509 r8426  
    6060
    6161        final JLabel autosaveIntervalLabel = new JLabel(tr("Auto save interval (seconds)"));
     62        autosaveIntervalLabel.setLabelFor(autosaveInterval);
    6263        panel.add(autosaveIntervalLabel, GBC.std().insets(60,0,0,0));
    6364        autosaveInterval.setText(Integer.toString(AutosaveTask.PROP_INTERVAL.get()));
     
    6768
    6869        final JLabel backupPerLayerLabel = new JLabel(tr("Auto saved files per layer"));
     70        backupPerLayerLabel.setLabelFor(backupPerLayer);
    6971        panel.add(backupPerLayerLabel, GBC.std().insets(60,0,0,0));
    7072        backupPerLayer.setText(Integer.toString(AutosaveTask.PROP_FILES_PER_LAYER.get()));
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java

    r8390 r8426  
    256256                }
    257257            });
     258            lblPlugin.setLabelFor(description);
    258259
    259260            gbc.gridx = 1;
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java

    r8404 r8426  
    9696        pnl.add(lblUpdateInterval = new JLabel(tr("Update interval (in days):")));
    9797        pnl.add(tfUpdateInterval = new JosmTextField(5));
     98        lblUpdateInterval.setLabelFor(tfUpdateInterval);
    9899        SelectAllOnFocusGainedDecorator.decorate(tfUpdateInterval);
    99100        return pnl;
     
    126127        bgTimeBasedUpdatePolicy.add(btn);
    127128
    128         JMultilineLabel lbl = new JMultilineLabel(tr("Please decide whether JOSM shall automatically update active plugins after a certain period of time."));
     129        JMultilineLabel lbl = new JMultilineLabel(
     130                tr("Please decide whether JOSM shall automatically update active plugins after a certain period of time."));
    129131        gc.gridy=0;
    130132        pnl.add(lbl, gc);
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java

    r7021 r8426  
    329329        projPanel.add(projSubPrefPanelWrapper, GBC.eol().fill(GBC.HORIZONTAL).insets(20,5,5,5));
    330330
     331        projectionCodeLabel.setLabelFor(projectionCode);
     332        projectionNameLabel.setLabelFor(projectionName);
     333
    331334        projPanel.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(0,5,0,10));
    332335        projPanel.add(new JLabel(tr("Display coordinates as")), GBC.std().insets(5,5,0,5));
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/FeaturesPanel.java

    r8218 r8426  
    5050            }
    5151        });
    52        
     52
    5353        intervalLabel = new JLabel(tr("Check interval (minutes):"));
     54        intervalLabel.setLabelFor(notifierInterval);
    5455        add(intervalLabel, GBC.std().insets(25, 0, 0, 0));
    5556
     
    5960
    6061        final JLabel notesDaysClosedLabel = new JLabel(tr("Max age for closed notes (days):"));
     62        notesDaysClosedLabel.setLabelFor(notesDaysClosed);
    6163        notesDaysClosedLabel.setToolTipText(tr("Specifies the number of days a note needs to be closed to no longer be downloaded"));
    6264        add(notesDaysClosedLabel, GBC.std().insets(0, 20, 0, 0));
     
    6466        notesDaysClosed.setMinimumSize(notesDaysClosed.getPreferredSize());
    6567        add(notesDaysClosed, GBC.eol().insets(5, 20, 0, 0));
     68    }
    6669
    67     }
    68    
    6970    private void updateEnabledState() {
    7071        boolean enabled = notifier.isSelected();
     
    100101        // Even if they have not changed,
    101102        } else {
    102             // notifier should be stopped if user is no more identified enough 
     103            // notifier should be stopped if user is no more identified enough
    103104            if (!MessageNotifier.isUserEnoughIdentified()) {
    104105                MessageNotifier.stop();
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    r8373 r8426  
    8888        gc.weightx = 1.0;
    8989        add(tfOsmServerUrl = new JosmTextField(), gc);
     90        lblApiUrl.setLabelFor(tfOsmServerUrl);
    9091        SelectAllOnFocusGainedDecorator.decorate(tfOsmServerUrl);
    9192        valOsmServerUrl = new ApiUrlValidator(tfOsmServerUrl);
  • trunk/src/org/openstreetmap/josm/io/GpxExporter.java

    r8061 r8426  
    9595        JCheckBox author = new JCheckBox(tr("Add author information"), Main.pref.getBoolean("lastAddAuthor", true));
    9696        p.add(author, GBC.eol());
     97
    9798        JLabel nameLabel = new JLabel(tr("Real name"));
    9899        p.add(nameLabel, GBC.std().insets(10, 0, 5, 0));
    99100        JosmTextField authorName = new JosmTextField();
    100101        p.add(authorName, GBC.eol().fill(GBC.HORIZONTAL));
     102        nameLabel.setLabelFor(authorName);
     103
    101104        JLabel emailLabel = new JLabel(tr("E-Mail"));
    102105        p.add(emailLabel, GBC.std().insets(10, 0, 5, 0));
    103106        JosmTextField email = new JosmTextField();
    104107        p.add(email, GBC.eol().fill(GBC.HORIZONTAL));
     108        emailLabel.setLabelFor(email);
     109
    105110        JLabel copyrightLabel = new JLabel(tr("Copyright (URL)"));
    106111        p.add(copyrightLabel, GBC.std().insets(10, 0, 5, 0));
    107112        JosmTextField copyright = new JosmTextField();
    108113        p.add(copyright, GBC.std().fill(GBC.HORIZONTAL));
     114        copyrightLabel.setLabelFor(copyright);
     115
    109116        JButton predefined = new JButton(tr("Predefined"));
    110117        p.add(predefined, GBC.eol().insets(5, 0, 0, 0));
     118
    111119        JLabel copyrightYearLabel = new JLabel(tr("Copyright year"));
    112120        p.add(copyrightYearLabel, GBC.std().insets(10, 0, 5, 5));
    113121        JosmTextField copyrightYear = new JosmTextField("");
    114122        p.add(copyrightYear, GBC.eol().fill(GBC.HORIZONTAL));
     123        copyrightYearLabel.setLabelFor(copyrightYear);
     124
    115125        JLabel warning = new JLabel("<html><font size='-2'>&nbsp;</html");
    116126        p.add(warning, GBC.eol().fill(GBC.HORIZONTAL).insets(15, 0, 0, 0));
  • trunk/src/org/openstreetmap/josm/io/session/GeoImageSessionExporter.java

    r7937 r8426  
    4545        final JLabel lbl = new JLabel(layer.getName(), layer.getIcon(), SwingConstants.LEFT);
    4646        lbl.setToolTipText(layer.getToolTipText());
     47        lbl.setLabelFor(export);
    4748        p.add(export, GBC.std());
    4849        p.add(lbl, GBC.std());
  • trunk/src/org/openstreetmap/josm/io/session/GpxTracksSessionExporter.java

    r7937 r8426  
    6464        final JLabel lbl = new JLabel(layer.getName(), layer.getIcon(), SwingConstants.LEFT);
    6565        lbl.setToolTipText(layer.getToolTipText());
    66 
     66        lbl.setLabelFor(export);
    6767        JLabel lblData = new JLabel(tr("Data:"));
    6868        /* I18n: Refer to a OSM data file in session file */ link = new JRadioButton(tr("local file"));
  • trunk/src/org/openstreetmap/josm/io/session/ImagerySessionExporter.java

    r7937 r8426  
    5757        final JLabel lbl = new JLabel(layer.getName(), layer.getIcon(), SwingConstants.LEFT);
    5858        lbl.setToolTipText(layer.getToolTipText());
     59        lbl.setLabelFor(export);
    5960        p.add(export, GBC.std());
    6061        p.add(lbl, GBC.std());
  • trunk/src/org/openstreetmap/josm/io/session/MarkerSessionExporter.java

    r7937 r8426  
    5252        final JLabel lbl = new JLabel(layer.getName(), layer.getIcon(), SwingConstants.LEFT);
    5353        lbl.setToolTipText(layer.getToolTipText());
     54        lbl.setLabelFor(export);
    5455        p.add(export, GBC.std());
    5556        p.add(lbl, GBC.std());
  • trunk/src/org/openstreetmap/josm/io/session/OsmDataSessionExporter.java

    r7082 r8426  
    8989        final JLabel lbl = new JLabel(layer.getName(), layer.getIcon(), SwingConstants.LEFT);
    9090        lbl.setToolTipText(layer.getToolTipText());
    91 
     91        lbl.setLabelFor(export);
    9292        JLabel lblData = new JLabel(tr("Data:"));
    9393        /* I18n: Refer to a OSM data file in session file */ link = new JRadioButton(tr("local file"));
Note: See TracChangeset for help on using the changeset viewer.