001 // License: GPL. Copyright 2007 by Immanuel Scholz and others 002 package org.openstreetmap.josm.actions; 003 004 import static org.openstreetmap.josm.tools.I18n.tr; 005 import static org.openstreetmap.josm.gui.help.HelpUtil.ht; 006 007 import java.awt.event.ActionEvent; 008 import java.awt.event.KeyEvent; 009 010 import org.openstreetmap.josm.Main; 011 import org.openstreetmap.josm.tools.Shortcut; 012 013 public class ToggleGPXLinesAction extends JosmAction { 014 015 public ToggleGPXLinesAction() { 016 super(tr("Toggle GPX Lines"), "gps-lines", tr("Toggles the global setting ''{0}''.", tr("Draw lines between raw gps points.")), 017 Shortcut.registerShortcut("view:gpxlines", tr("View: {0}", tr("Toggle GPX Lines")), KeyEvent.VK_X, Shortcut.SHIFT), true); 018 putValue("help", ht("/Action/ToggleGPXLines")); 019 } 020 021 public void actionPerformed(ActionEvent e) { 022 Main.pref.put("draw.rawgps.lines", !Main.pref.getBoolean("draw.rawgps.lines", true)); 023 if (Main.isDisplayingMapView()) { 024 Main.map.mapView.repaint(); 025 } 026 } 027 }