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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.