Changeset 11934 in osm for applications/editors
- Timestamp:
- 2008-11-14T22:04:35+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/livegps
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/livegps/build.xml
r8775 r11934 48 48 <attribute name="Plugin-Description" value="${plugin.description}" /> 49 49 <attribute name="Plugin-Version" value="${plugin.version}" /> 50 <attribute name="Plugin-Mainversion" value="1065" /> 50 51 <!--attribute name="Plugin-Dependencies" value="org.eigenheimstrasse.josm" /--> 51 52 <attribute name="Plugin-Stage" value="${plugin.stage}" /> … … 58 59 <mkdir dir="${plugin.build.dir}"/> 59 60 <javac srcdir="livegps" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5"> 61 <compilerarg value="-Xlint:deprecation"/> 60 62 <classpath> 61 63 <pathelement path="${josm.build.dir}/build"/> -
applications/editors/josm/plugins/livegps/livegps/LiveGpsDialog.java
r6709 r11934 19 19 import org.openstreetmap.josm.gui.MapFrame; 20 20 import org.openstreetmap.josm.gui.dialogs.ToggleDialog; 21 import org.openstreetmap.josm.tools.ShortCut; 21 22 22 23 /** … … 42 43 */ 43 44 public LiveGpsDialog(final MapFrame mapFrame) { 44 super(tr("Live GPS"), "livegps", tr("Show GPS data."), KeyEvent.VK_G, 100); 45 super(tr("Live GPS"), "livegps", tr("Show GPS data."), 46 ShortCut.registerShortCut("subwindow:livegps", tr("Toggle: {0}", tr("Live GPS")), 47 KeyEvent.VK_G, ShortCut.GROUP_LAYER, ShortCut.SHIFT_DEFAULT), 100); 45 48 panel = new JPanel(); 46 49 panel.setLayout(new GridLayout(6,2)); -
applications/editors/josm/plugins/livegps/livegps/LiveGpsLayer.java
r6166 r11934 1 1 package livegps; 2 3 import static org.openstreetmap.josm.tools.I18n.tr; 2 4 3 5 import java.awt.Color; … … 21 23 22 24 public class LiveGpsLayer extends GpxLayer implements PropertyChangeListener { 23 public static final String LAYER_NAME = "LiveGPS layer";25 public static final String LAYER_NAME = tr("LiveGPS layer"); 24 26 public static final String KEY_LIVEGPS_COLOR ="color.livegps.position"; 25 27 LatLon lastPos; … … 112 114 // g.fillRect(mvs.x, mvs.y, mvs.width, mvs.height); 113 115 114 115 116 if (lastPoint != null) 116 117 { 117 String colorString = Main.pref.get(KEY_LIVEGPS_COLOR);118 if(colorString.length() == 0) {119 colorString = ColorHelper.color2html(Color.RED);120 Main.pref.put(KEY_LIVEGPS_COLOR, colorString);121 }122 Color color = ColorHelper.html2color(colorString);123 118 Point screen = mv.getPoint(lastPoint.eastNorth); 124 g.setColor( color);119 g.setColor(Main.pref.getColor(KEY_LIVEGPS_COLOR, Color.RED)); 125 120 g.drawOval(screen.x-10, screen.y-10,20,20); 126 121 g.drawOval(screen.x-9, screen.y-9,18,18); -
applications/editors/josm/plugins/livegps/livegps/LiveGpsPlugin.java
r8572 r11934 17 17 import org.openstreetmap.josm.actions.JosmAction; 18 18 import org.openstreetmap.josm.data.gpx.GpxData; 19 import org.openstreetmap.josm.gui.MainMenu; 19 20 import org.openstreetmap.josm.gui.MapFrame; 20 21 import org.openstreetmap.josm.plugins.Plugin; 22 import org.openstreetmap.josm.tools.ShortCut; 21 23 22 24 public class LiveGpsPlugin extends Plugin … … 37 39 public class CaptureAction extends JosmAction { 38 40 public CaptureAction() { 39 super(tr("Capture GPS Track"), "capturemenu", tr("Connect to gpsd server and show current position in LiveGPS layer."), KeyEvent.VK_R, KeyEvent.ALT_MASK, true); 41 super(tr("Capture GPS Track"), "capturemenu", tr("Connect to gpsd server and show current position in LiveGPS layer."), 42 ShortCut.registerShortCut("menu:livegps:capture", tr("Menu: {0}", tr("Capture GPS Track")), 43 KeyEvent.VK_R, ShortCut.GROUP_MENU), true); 40 44 } 41 45 … … 47 51 public class CenterAction extends JosmAction { 48 52 public CenterAction() { 49 super(tr("Center Once"), "centermenu", tr("Center the LiveGPS layer to current position."), KeyEvent.VK_C, 0, true); 53 super(tr("Center Once"), "centermenu", tr("Center the LiveGPS layer to current position."), 54 ShortCut.registerShortCut("edit:centergps", tr("Edit: {0}", tr("Center Once")), 55 KeyEvent.VK_HOME, ShortCut.GROUP_EDIT), true); 50 56 } 51 57 … … 59 65 public class AutoCenterAction extends JosmAction { 60 66 public AutoCenterAction() { 61 super(tr("Auto-Center"), "autocentermenu", tr("Continuously center the LiveGPS layer to current position."), KeyEvent.VK_HOME, 0, true); 67 super(tr("Auto-Center"), "autocentermenu", tr("Continuously center the LiveGPS layer to current position."), 68 ShortCut.registerShortCut("menu:livegps:autocenter", tr("Menu: {0}", tr("Capture GPS Track")), 69 KeyEvent.VK_HOME, ShortCut.GROUP_MENU), true); 62 70 } 63 71 … … 70 78 71 79 public LiveGpsPlugin() 72 { 73 JMenuBarmenu = Main.main.menu;74 lgpsmenu = new JMenu( "LiveGPS");75 lgpsmenu.setMnemonic(KeyEvent.VK_G);80 { 81 MainMenu menu = Main.main.menu; 82 lgpsmenu = new JMenu(tr("LiveGPS")); 83 menu.add(lgpsmenu, KeyEvent.VK_G, "livegps"); 76 84 menu.add(lgpsmenu, 5); 77 85 78 86 JosmAction captureAction = new CaptureAction(); 79 87 lgpscapture = new JCheckBoxMenuItem(captureAction); 80 lgpsmenu.add(lgpscapture); 81 lgpscapture.setAccelerator(captureAction. shortCut);88 lgpsmenu.add(lgpscapture); 89 lgpscapture.setAccelerator(captureAction.getShortCut().getKeyStroke()); 82 90 83 91 JosmAction centerAction = new CenterAction(); 84 92 JMenuItem centerMenu = new JMenuItem(centerAction); 85 lgpsmenu.add(centerMenu); 86 centerMenu.setAccelerator(centerAction. shortCut);93 lgpsmenu.add(centerMenu); 94 centerMenu.setAccelerator(centerAction.getShortCut().getKeyStroke()); 87 95 88 96 JosmAction autoCenterAction = new AutoCenterAction(); 89 97 lgpsautocenter = new JCheckBoxMenuItem(autoCenterAction); 90 lgpsmenu.add(lgpsautocenter); 91 lgpsautocenter.setAccelerator(autoCenterAction. shortCut);98 lgpsmenu.add(lgpsautocenter); 99 lgpsautocenter.setAccelerator(autoCenterAction.getShortCut().getKeyStroke()); 92 100 } 93 101 94 102 /** 95 103 * Set to <code>true</code> if the current position should always be in the center of the map.
Note:
See TracChangeset
for help on using the changeset viewer.