Index: trunk/src/org/openstreetmap/josm/gui/preferences/GPXSettingsPanel.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/preferences/GPXSettingsPanel.java	(revision 4843)
+++ trunk/src/org/openstreetmap/josm/gui/preferences/GPXSettingsPanel.java	(revision 4844)
@@ -4,4 +4,5 @@
 import static org.openstreetmap.josm.tools.I18n.trc;
 
+import java.awt.Component;
 import java.awt.GridBagLayout;
 import java.awt.event.ActionEvent;
@@ -22,4 +23,5 @@
 
 import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.ExpertToggleAction;
 import org.openstreetmap.josm.gui.layer.markerlayer.Marker;
 import org.openstreetmap.josm.gui.layer.markerlayer.Marker.TemplateEntryProperty;
@@ -91,4 +93,5 @@
         // makeAutoMarkers
         makeAutoMarkers.setToolTipText(tr("Automatically make a marker layer from any waypoints when opening a GPX layer."));
+        ExpertToggleAction.addVisibilitySwitcher(makeAutoMarkers);
         add(makeAutoMarkers, GBC.eol().insets(20,0,0,5));
 
@@ -104,5 +107,6 @@
         /* ensure that default is in data base */
 
-        add(new JLabel(tr("Draw lines between raw GPS points")), GBC.eol().insets(20,0,0,0));
+        JLabel label = new JLabel(tr("Draw lines between raw GPS points"));
+        add(label, GBC.eol().insets(20,0,0,0));
         if (layerName!=null) {
             add(drawRawGpsLinesGlobal, GBC.eol().insets(40,0,0,0));
@@ -115,4 +119,9 @@
             add(drawRawGpsLinesAll, GBC.eol().insets(40,0,0,0));
         }
+        ExpertToggleAction.addVisibilitySwitcher(label);
+        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsLinesGlobal);
+        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsLinesNone);
+        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsLinesLocal);
+        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsLinesAll);
 
         drawRawGpsLinesActionListener = new ActionListener(){
@@ -135,15 +144,22 @@
         // drawRawGpsMaxLineLengthLocal
         drawRawGpsMaxLineLengthLocal.setToolTipText(tr("Maximum length (in meters) to draw lines for local files. Set to ''-1'' to draw all lines."));
-        add(new JLabel(tr("Maximum length for local files (meters)")), GBC.std().insets(40,0,0,0));
+        label = new JLabel(tr("Maximum length for local files (meters)"));
+        add(label, GBC.std().insets(40,0,0,0));
         add(drawRawGpsMaxLineLengthLocal, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
+        ExpertToggleAction.addVisibilitySwitcher(label);
+        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsMaxLineLengthLocal);
 
         // drawRawGpsMaxLineLength
         drawRawGpsMaxLineLength.setToolTipText(tr("Maximum length (in meters) to draw lines. Set to ''-1'' to draw all lines."));
-        add(new JLabel(tr("Maximum length (meters)")), GBC.std().insets(40,0,0,0));
+        label = new JLabel(tr("Maximum length (meters)"));
+        add(label, GBC.std().insets(40,0,0,0));
         add(drawRawGpsMaxLineLength, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
+        ExpertToggleAction.addVisibilitySwitcher(label);
+        ExpertToggleAction.addVisibilitySwitcher(drawRawGpsMaxLineLength);
 
         // forceRawGpsLines
         forceRawGpsLines.setToolTipText(tr("Force drawing of lines if the imported data contain no line information."));
         add(forceRawGpsLines, GBC.eop().insets(40,0,0,0));
+        ExpertToggleAction.addVisibilitySwitcher(forceRawGpsLines);
 
         // drawGpsArrows
@@ -160,4 +176,5 @@
         drawGpsArrowsFast.setToolTipText(tr("Draw the direction arrows using table lookups instead of complex math."));
         add(drawGpsArrowsFast, GBC.eop().insets(60,0,0,0));
+        ExpertToggleAction.addVisibilitySwitcher(drawGpsArrowsFast);
 
         // drawGpsArrowsMinDist
@@ -169,4 +186,5 @@
         hdopCircleGpsPoints.setToolTipText(tr("Draw a circle from HDOP value."));
         add(hdopCircleGpsPoints, GBC.eop().insets(20,0,0,0));
+        ExpertToggleAction.addVisibilitySwitcher(hdopCircleGpsPoints);
 
         // largeGpsPoints
@@ -176,5 +194,5 @@
         // drawLineWidth
         drawLineWidth.setToolTipText(tr("Width of drawn GPX line (0 for default)"));
-        add(new JLabel(tr("Drawing width of GPX lines")), GBC.std().insets(40,0,0,0));
+        add(new JLabel(tr("Drawing width of GPX lines")), GBC.std().insets(20,0,0,0));
         add(drawLineWidth, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
 
@@ -223,7 +241,10 @@
         add(colorTypeDilution, GBC.eol().insets(40,0,0,0));
         add(colorTypeTime, GBC.eol().insets(40,0,0,0));
+        ExpertToggleAction.addVisibilitySwitcher(colorTypeDirection);
+        ExpertToggleAction.addVisibilitySwitcher(colorTypeDilution);
 
         colorDynamic.setToolTipText(tr("Colors points and track segments by data limits."));
         add(colorDynamic, GBC.eop().insets(40,0,0,0));
+        ExpertToggleAction.addVisibilitySwitcher(colorDynamic);
 
         if (layerName == null) {
@@ -232,5 +253,6 @@
 
             // waypointLabel
-            add(new JLabel(tr("Waypoint labelling")), GBC.std().insets(20,0,0,0));
+            label = new JLabel(tr("Waypoint labelling"));
+            add(label, GBC.std().insets(20,0,0,0));
             add(waypointLabel, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
             waypointLabel.addActionListener(new ActionListener() {
@@ -242,9 +264,15 @@
             updateWaypointLabelCombobox(waypointLabel, waypointLabelPattern, TemplateEntryProperty.forMarker(layerName));
             add(waypointLabelPattern, GBC.eol().fill(GBC.HORIZONTAL).insets(20,0,0,5));
+            ExpertToggleAction.addVisibilitySwitcher(label);
+            ExpertToggleAction.addVisibilitySwitcher(waypointLabel);
+            ExpertToggleAction.addVisibilitySwitcher(waypointLabelPattern);
 
             // audioWaypointLabel
-            add(Box.createVerticalGlue(), GBC.eol().insets(0, 20, 0, 0));
-
-            add(new JLabel(tr("Audio waypoint labelling")), GBC.std().insets(20,0,0,0));
+            Component glue = Box.createVerticalGlue();
+            add(glue, GBC.eol().insets(0, 20, 0, 0));
+            ExpertToggleAction.addVisibilitySwitcher(glue);
+
+            label = new JLabel(tr("Audio waypoint labelling"));
+            add(label, GBC.std().insets(20,0,0,0));
             add(audioWaypointLabel, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
             audioWaypointLabel.addActionListener(new ActionListener() {
@@ -256,4 +284,7 @@
             updateWaypointLabelCombobox(audioWaypointLabel, audioWaypointLabelPattern, TemplateEntryProperty.forAudioMarker(layerName));
             add(audioWaypointLabelPattern, GBC.eol().fill(GBC.HORIZONTAL).insets(20,0,0,5));
+            ExpertToggleAction.addVisibilitySwitcher(label);
+            ExpertToggleAction.addVisibilitySwitcher(audioWaypointLabel);
+            ExpertToggleAction.addVisibilitySwitcher(audioWaypointLabelPattern);
         }
 
