Changeset 4844 in josm for trunk/src


Ignore:
Timestamp:
2012-01-22T10:25:45+01:00 (8 years ago)
Author:
bastiK
Message:

made most of the GPS display settings expert. (see #7299)

File:
1 edited

Legend:

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

    r4599 r4844  
    44import static org.openstreetmap.josm.tools.I18n.trc;
    55
     6import java.awt.Component;
    67import java.awt.GridBagLayout;
    78import java.awt.event.ActionEvent;
     
    2223
    2324import org.openstreetmap.josm.Main;
     25import org.openstreetmap.josm.actions.ExpertToggleAction;
    2426import org.openstreetmap.josm.gui.layer.markerlayer.Marker;
    2527import org.openstreetmap.josm.gui.layer.markerlayer.Marker.TemplateEntryProperty;
     
    9193        // makeAutoMarkers
    9294        makeAutoMarkers.setToolTipText(tr("Automatically make a marker layer from any waypoints when opening a GPX layer."));
     95        ExpertToggleAction.addVisibilitySwitcher(makeAutoMarkers);
    9396        add(makeAutoMarkers, GBC.eol().insets(20,0,0,5));
    9497
     
    104107        /* ensure that default is in data base */
    105108
    106         add(new JLabel(tr("Draw lines between raw GPS points")), GBC.eol().insets(20,0,0,0));
     109        JLabel label = new JLabel(tr("Draw lines between raw GPS points"));
     110        add(label, GBC.eol().insets(20,0,0,0));
    107111        if (layerName!=null) {
    108112            add(drawRawGpsLinesGlobal, GBC.eol().insets(40,0,0,0));
     
    115119            add(drawRawGpsLinesAll, GBC.eol().insets(40,0,0,0));
    116120        }
     121        ExpertToggleAction.addVisibilitySwitcher(label);
     122        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsLinesGlobal);
     123        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsLinesNone);
     124        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsLinesLocal);
     125        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsLinesAll);
    117126
    118127        drawRawGpsLinesActionListener = new ActionListener(){
     
    135144        // drawRawGpsMaxLineLengthLocal
    136145        drawRawGpsMaxLineLengthLocal.setToolTipText(tr("Maximum length (in meters) to draw lines for local files. Set to ''-1'' to draw all lines."));
    137         add(new JLabel(tr("Maximum length for local files (meters)")), GBC.std().insets(40,0,0,0));
     146        label = new JLabel(tr("Maximum length for local files (meters)"));
     147        add(label, GBC.std().insets(40,0,0,0));
    138148        add(drawRawGpsMaxLineLengthLocal, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
     149        ExpertToggleAction.addVisibilitySwitcher(label);
     150        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsMaxLineLengthLocal);
    139151
    140152        // drawRawGpsMaxLineLength
    141153        drawRawGpsMaxLineLength.setToolTipText(tr("Maximum length (in meters) to draw lines. Set to ''-1'' to draw all lines."));
    142         add(new JLabel(tr("Maximum length (meters)")), GBC.std().insets(40,0,0,0));
     154        label = new JLabel(tr("Maximum length (meters)"));
     155        add(label, GBC.std().insets(40,0,0,0));
    143156        add(drawRawGpsMaxLineLength, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
     157        ExpertToggleAction.addVisibilitySwitcher(label);
     158        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsMaxLineLength);
    144159
    145160        // forceRawGpsLines
    146161        forceRawGpsLines.setToolTipText(tr("Force drawing of lines if the imported data contain no line information."));
    147162        add(forceRawGpsLines, GBC.eop().insets(40,0,0,0));
     163        ExpertToggleAction.addVisibilitySwitcher(forceRawGpsLines);
    148164
    149165        // drawGpsArrows
     
    160176        drawGpsArrowsFast.setToolTipText(tr("Draw the direction arrows using table lookups instead of complex math."));
    161177        add(drawGpsArrowsFast, GBC.eop().insets(60,0,0,0));
     178        ExpertToggleAction.addVisibilitySwitcher(drawGpsArrowsFast);
    162179
    163180        // drawGpsArrowsMinDist
     
    169186        hdopCircleGpsPoints.setToolTipText(tr("Draw a circle from HDOP value."));
    170187        add(hdopCircleGpsPoints, GBC.eop().insets(20,0,0,0));
     188        ExpertToggleAction.addVisibilitySwitcher(hdopCircleGpsPoints);
    171189
    172190        // largeGpsPoints
     
    176194        // drawLineWidth
    177195        drawLineWidth.setToolTipText(tr("Width of drawn GPX line (0 for default)"));
    178         add(new JLabel(tr("Drawing width of GPX lines")), GBC.std().insets(40,0,0,0));
     196        add(new JLabel(tr("Drawing width of GPX lines")), GBC.std().insets(20,0,0,0));
    179197        add(drawLineWidth, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
    180198
     
    223241        add(colorTypeDilution, GBC.eol().insets(40,0,0,0));
    224242        add(colorTypeTime, GBC.eol().insets(40,0,0,0));
     243        ExpertToggleAction.addVisibilitySwitcher(colorTypeDirection);
     244        ExpertToggleAction.addVisibilitySwitcher(colorTypeDilution);
    225245
    226246        colorDynamic.setToolTipText(tr("Colors points and track segments by data limits."));
    227247        add(colorDynamic, GBC.eop().insets(40,0,0,0));
     248        ExpertToggleAction.addVisibilitySwitcher(colorDynamic);
    228249
    229250        if (layerName == null) {
     
    232253
    233254            // waypointLabel
    234             add(new JLabel(tr("Waypoint labelling")), GBC.std().insets(20,0,0,0));
     255            label = new JLabel(tr("Waypoint labelling"));
     256            add(label, GBC.std().insets(20,0,0,0));
    235257            add(waypointLabel, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
    236258            waypointLabel.addActionListener(new ActionListener() {
     
    242264            updateWaypointLabelCombobox(waypointLabel, waypointLabelPattern, TemplateEntryProperty.forMarker(layerName));
    243265            add(waypointLabelPattern, GBC.eol().fill(GBC.HORIZONTAL).insets(20,0,0,5));
     266            ExpertToggleAction.addVisibilitySwitcher(label);
     267            ExpertToggleAction.addVisibilitySwitcher(waypointLabel);
     268            ExpertToggleAction.addVisibilitySwitcher(waypointLabelPattern);
    244269
    245270            // audioWaypointLabel
    246             add(Box.createVerticalGlue(), GBC.eol().insets(0, 20, 0, 0));
    247 
    248             add(new JLabel(tr("Audio waypoint labelling")), GBC.std().insets(20,0,0,0));
     271            Component glue = Box.createVerticalGlue();
     272            add(glue, GBC.eol().insets(0, 20, 0, 0));
     273            ExpertToggleAction.addVisibilitySwitcher(glue);
     274
     275            label = new JLabel(tr("Audio waypoint labelling"));
     276            add(label, GBC.std().insets(20,0,0,0));
    249277            add(audioWaypointLabel, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
    250278            audioWaypointLabel.addActionListener(new ActionListener() {
     
    256284            updateWaypointLabelCombobox(audioWaypointLabel, audioWaypointLabelPattern, TemplateEntryProperty.forAudioMarker(layerName));
    257285            add(audioWaypointLabelPattern, GBC.eol().fill(GBC.HORIZONTAL).insets(20,0,0,5));
     286            ExpertToggleAction.addVisibilitySwitcher(label);
     287            ExpertToggleAction.addVisibilitySwitcher(audioWaypointLabel);
     288            ExpertToggleAction.addVisibilitySwitcher(audioWaypointLabelPattern);
    258289        }
    259290
Note: See TracChangeset for help on using the changeset viewer.