Line | |
---|
1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
---|
2 | package org.openstreetmap.josm.actions;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 | import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
|
---|
6 |
|
---|
7 | import java.awt.event.ActionEvent;
|
---|
8 | import java.awt.event.KeyEvent;
|
---|
9 |
|
---|
10 | import org.openstreetmap.josm.Main;
|
---|
11 | import org.openstreetmap.josm.tools.Shortcut;
|
---|
12 |
|
---|
13 | public class ToggleGPXLinesAction extends JosmAction {
|
---|
14 |
|
---|
15 | public ToggleGPXLinesAction() {
|
---|
16 | super(tr("Toggle GPX Lines"), "gps-lines", tr("Toggles the global setting ''{0}''.", tr("Draw lines between raw gps points.")),
|
---|
17 | Shortcut.registerShortcut("view:gpxlines", tr("View: {0}", tr("Toggle GPX Lines")), KeyEvent.VK_X, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT), true);
|
---|
18 | putValue("help", ht("/Action/ToggleGPXLines"));
|
---|
19 | }
|
---|
20 |
|
---|
21 | public void actionPerformed(ActionEvent e) {
|
---|
22 | Main.pref.put("draw.rawgps.lines", !Main.pref.getBoolean("draw.rawgps.lines", true));
|
---|
23 | if(Main.map != null) {
|
---|
24 | Main.map.mapView.repaint();
|
---|
25 | }
|
---|
26 | }
|
---|
27 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.