Changeset 12486 in osm for applications/editors
- Timestamp:
- 2008-12-22T18:37:46+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/surveyor
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/surveyor/build.xml
r10336 r12486 64 64 </copy> 65 65 <javac srcdir="src" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5"> 66 <compilerarg value="-Xlint:deprecation"/> 67 <compilerarg value="-Xlint:unchecked"/> 66 68 <classpath> 67 69 <pathelement path="${josm.build.dir}/build"/> -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/AutoSaveAction.java
r6164 r12486 19 19 import at.dallermassl.josm.plugin.surveyor.action.SetWaypointAction; 20 20 import org.openstreetmap.josm.actions.JosmAction; 21 import org.openstreetmap.josm.tools.Shortcut; 21 22 22 23 import livegps.LiveGpsLayer; … … 33 34 private boolean autoSave = false; 34 35 private Timer gpsDataTimer; 35 36 36 37 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); 39 // <FIXXME date="23.06.2007" author="cdaller"> 40 // TODO set accelerator key 41 // </FIXXME> 38 super(tr("AutoSave LiveData"), "autosave.png", tr("Save captured data to file every minute."), 39 Shortcut.registerShortcut("surveyor:autosave", tr("Tool: {0}", tr("AutoSave LiveData")), 40 KeyEvent.VK_S, Shortcut.GROUP_EDIT, Shortcut.SHIFT_DEFAULT), true); 42 41 } 43 42 -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorComponent.java
r6159 r12486 49 49 hotKeys = new HashSet<String>(); 50 50 setLayout(new BorderLayout()); 51 streetLabel = new JLabel( "Way: ");51 streetLabel = new JLabel(tr("Way: ")); 52 52 float fontSize = Float.parseFloat(Main.pref.get(SurveyorPlugin.PREF_KEY_STREET_NAME_FONT_SIZE, "35")); 53 53 Main.pref.put(SurveyorPlugin.PREF_KEY_STREET_NAME_FONT_SIZE, String.valueOf(fontSize)); … … 177 177 if("gpsdata".equals(evt.getPropertyName())) { 178 178 gpsData = (LiveGpsData) evt.getNewValue(); 179 streetLabel.setText( "Way: "+ gpsData.getWayInfo());179 streetLabel.setText(tr("Way: ") + gpsData.getWayInfo()); 180 180 } 181 181 -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java
r11974 r12486 12 12 import javax.swing.JCheckBoxMenuItem; 13 13 import javax.swing.JFrame; 14 import javax.swing.JMenu; 14 15 import javax.swing.JMenuItem; 15 16 import javax.swing.JOptionPane; … … 20 21 21 22 import org.openstreetmap.josm.Main; 23 import org.openstreetmap.josm.gui.MainMenu; 22 24 import org.openstreetmap.josm.plugins.PluginProxy; 23 25 … … 73 75 } 74 76 } 75 if(gpsPlugin == null) { 76 throw new IllegalStateException("SurveyorPlugin needs LiveGpsPlugin, but could not find it!"); 77 } 78 SurveyorShowAction surveyorAction = new SurveyorShowAction(gpsPlugin); 79 JMenuItem surveyorMenuItem = new JMenuItem(surveyorAction); 80 surveyorMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.VK_ALT)); 77 if(gpsPlugin == null) 78 throw new IllegalStateException(tr("SurveyorPlugin needs LiveGpsPlugin, but could not find it!")); 81 79 82 gpsPlugin.getLgpsMenu().addSeparator(); 83 gpsPlugin.getLgpsMenu().add(surveyorMenuItem); 84 80 JMenu m = gpsPlugin.getLgpsMenu(); 81 m.addSeparator(); 82 MainMenu.add(m, new SurveyorShowAction(gpsPlugin)); 83 85 84 AutoSaveAction autoSaveAction = new AutoSaveAction(); 86 85 JCheckBoxMenuItem autoSaveMenu = new JCheckBoxMenuItem(autoSaveAction); 87 gpsPlugin.getLgpsMenu().add(autoSaveMenu);88 autoSaveMenu.setAccelerator(autoSaveAction. shortcut);86 m.add(autoSaveMenu); 87 autoSaveMenu.setAccelerator(autoSaveAction.getShortcut().getKeyStroke()); 89 88 } 90 89 -
applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorShowAction.java
r5429 r12486 26 26 27 27 import org.openstreetmap.josm.Main; 28 import org.openstreetmap.josm.tools.Shortcut; 28 29 import org.openstreetmap.josm.tools.XmlObjectParser; 29 30 import org.openstreetmap.josm.actions.JosmAction; … … 43 44 44 45 public SurveyorShowAction(LiveGpsPlugin gpsPlugin) { 45 super(tr("Surveyor ..."), "surveyormenu.png", tr("Open surveyor tool."), KeyEvent.VK_S, KeyEvent.CTRL_MASK, true); 46 super(tr("Surveyor ..."), "surveyormenu.png", tr("Open surveyor tool."), 47 Shortcut.registerShortcut("surveyor:open", tr("Tool: {0}", tr("Surveyor ...")), 48 KeyEvent.VK_R, Shortcut.GROUP_MENU, Shortcut.SHIFT_DEFAULT), true); 46 49 this.gpsPlugin = gpsPlugin; 47 50 }
Note:
See TracChangeset
for help on using the changeset viewer.