Changeset 5429 in osm for applications/editors/josm/plugins/surveyor/src/at
- Timestamp:
- 2007-11-10T12:46:57+01:00 (17 years ago)
- Location:
- applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveAction.java
r4277 r5429 4 4 */ 5 5 package at.dallermassl.josm.plugin.surveyor; 6 7 import static org.openstreetmap.josm.tools.I18n.tr; 6 8 7 9 import java.awt.event.ActionEvent; … … 13 15 import javax.swing.AbstractAction; 14 16 import javax.swing.AbstractButton; 17 import java.awt.event.KeyEvent; 15 18 16 19 import at.dallermassl.josm.plugin.surveyor.action.SetWaypointAction; 20 import org.openstreetmap.josm.actions.JosmAction; 17 21 18 22 import livegps.LiveGpsLayer; … … 22 26 * 23 27 */ 24 public class AutoSaveAction extends AbstractAction {28 public class AutoSaveAction extends JosmAction { 25 29 private static final long serialVersionUID = -8608679323231116043L; 26 30 private static final long AUTO_SAVE_PERIOD_SEC = 60; // once a minute … … 31 35 32 36 33 public AutoSaveAction( String name) {34 super(name);37 public AutoSaveAction() { 38 super(tr("AutoSave LiveData"), "autosave.png", tr("Save captured data to file every minute."), KeyEvent.VK_S, KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK, true); 35 39 // <FIXXME date="23.06.2007" author="cdaller"> 36 40 // TODO set accelerator key -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java
r4522 r5429 15 15 import javax.swing.JOptionPane; 16 16 import javax.swing.KeyStroke; 17 import java.awt.event.KeyEvent; 17 18 18 19 import livegps.LiveGpsPlugin; … … 75 76 throw new IllegalStateException("SurveyorPlugin needs LiveGpsPlugin, but could not find it!"); 76 77 } 77 SurveyorShowAction surveyorAction = new SurveyorShowAction( "Surveyor",gpsPlugin);78 SurveyorShowAction surveyorAction = new SurveyorShowAction(gpsPlugin); 78 79 JMenuItem surveyorMenuItem = new JMenuItem(surveyorAction); 79 surveyor Action.putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke("alt S"));80 // surveyorMenuItem.addActionListener(new ActionListener() { 80 surveyorMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.VK_ALT)); 81 81 82 gpsPlugin.getLgpsMenu().addSeparator(); 82 83 gpsPlugin.getLgpsMenu().add(surveyorMenuItem); 83 84 84 AutoSaveAction autoSaveAction = new AutoSaveAction(tr("AutoSave LiveData")); 85 autoSaveAction.putValue(AbstractAction.ACCELERATOR_KEY, KeyStroke.getKeyStroke("alt ctrl S")); 85 AutoSaveAction autoSaveAction = new AutoSaveAction(); 86 86 JCheckBoxMenuItem autoSaveMenu = new JCheckBoxMenuItem(autoSaveAction); 87 87 gpsPlugin.getLgpsMenu().add(autoSaveMenu); 88 autoSaveMenu.setAccelerator(autoSaveAction.shortCut); 88 89 } 89 90 -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java
r4522 r5429 27 27 import org.openstreetmap.josm.Main; 28 28 import org.openstreetmap.josm.tools.XmlObjectParser; 29 import org.openstreetmap.josm.actions.JosmAction; 29 30 import org.xml.sax.SAXException; 30 31 … … 35 36 * 36 37 */ 37 public class SurveyorShowAction extends AbstractAction {38 public class SurveyorShowAction extends JosmAction { 38 39 private static final long serialVersionUID = 2184570223633094734L; 39 40 private static final String DEFAULT_SOURCE = "resource://surveyor.xml"; … … 42 43 43 44 public SurveyorShowAction(LiveGpsPlugin gpsPlugin) { 44 this(null, gpsPlugin); 45 } 46 47 public SurveyorShowAction(String name, LiveGpsPlugin gpsPlugin) { 48 super(name); 45 super(tr("Surveyor ..."), "surveyormenu.png", tr("Open surveyor tool."), KeyEvent.VK_S, KeyEvent.CTRL_MASK, true); 49 46 this.gpsPlugin = gpsPlugin; 50 47 } … … 107 104 surveyorFrame.pack(); 108 105 surveyorFrame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); 109 surveyorFrame.setTitle((String)getValue(AbstractAction.NAME)); 106 //surveyorFrame.setTitle((String)getValue(AbstractAction.NAME)); 107 surveyorFrame.setTitle(tr("Surveyor")); 110 108 // <FIXXME date="28.04.2007" author="cdaller"> 111 109 // TODO get old pos of frame from properties
Note:
See TracChangeset
for help on using the changeset viewer.