Changeset 11934 in osm for applications/editors


Ignore:
Timestamp:
2008-11-14T22:04:35+01:00 (16 years ago)
Author:
stoecker
Message:

updated to current JOSM stuff

Location:
applications/editors/josm/plugins/livegps
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/livegps/build.xml

    r8775 r11934  
    4848        <attribute name="Plugin-Description" value="${plugin.description}" />
    4949        <attribute name="Plugin-Version" value="${plugin.version}" />
     50        <attribute name="Plugin-Mainversion" value="1065" />
    5051        <!--attribute name="Plugin-Dependencies" value="org.eigenheimstrasse.josm" /-->
    5152        <attribute name="Plugin-Stage" value="${plugin.stage}" />
     
    5859    <mkdir dir="${plugin.build.dir}"/>
    5960    <javac srcdir="livegps" destdir="${plugin.build.dir}" debug="true" source="1.5" target="1.5">
     61      <compilerarg value="-Xlint:deprecation"/>
    6062      <classpath>
    6163        <pathelement path="${josm.build.dir}/build"/>
  • applications/editors/josm/plugins/livegps/livegps/LiveGpsDialog.java

    r6709 r11934  
    1919import org.openstreetmap.josm.gui.MapFrame;
    2020import org.openstreetmap.josm.gui.dialogs.ToggleDialog;
     21import org.openstreetmap.josm.tools.ShortCut;
    2122
    2223/**
     
    4243     */
    4344    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);
    4548        panel = new JPanel();
    4649        panel.setLayout(new GridLayout(6,2));
  • applications/editors/josm/plugins/livegps/livegps/LiveGpsLayer.java

    r6166 r11934  
    11package livegps;
     2
     3import static org.openstreetmap.josm.tools.I18n.tr;
    24
    35import java.awt.Color;
     
    2123
    2224public 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");
    2426    public static final String KEY_LIVEGPS_COLOR ="color.livegps.position";
    2527        LatLon lastPos;
     
    112114//              g.fillRect(mvs.x, mvs.y, mvs.width, mvs.height);
    113115
    114                
    115116                if (lastPoint != null)
    116117                {
    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);
    123118                    Point screen = mv.getPoint(lastPoint.eastNorth);
    124                     g.setColor(color);
     119                    g.setColor(Main.pref.getColor(KEY_LIVEGPS_COLOR, Color.RED));
    125120                    g.drawOval(screen.x-10, screen.y-10,20,20);
    126121                    g.drawOval(screen.x-9, screen.y-9,18,18);
  • applications/editors/josm/plugins/livegps/livegps/LiveGpsPlugin.java

    r8572 r11934  
    1717import org.openstreetmap.josm.actions.JosmAction;
    1818import org.openstreetmap.josm.data.gpx.GpxData;
     19import org.openstreetmap.josm.gui.MainMenu;
    1920import org.openstreetmap.josm.gui.MapFrame;
    2021import org.openstreetmap.josm.plugins.Plugin;
     22import org.openstreetmap.josm.tools.ShortCut;
    2123
    2224public class LiveGpsPlugin extends Plugin
     
    3739    public class CaptureAction extends JosmAction {
    3840        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);
    4044        }
    4145
     
    4751    public class CenterAction extends JosmAction {
    4852        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);
    5056        }
    5157
     
    5965    public class AutoCenterAction extends JosmAction {
    6066        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);
    6270        }
    6371
     
    7078
    7179    public LiveGpsPlugin()
    72     {       
    73         JMenuBar menu = 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");
    7684        menu.add(lgpsmenu, 5);
    77        
     85
    7886        JosmAction captureAction = new CaptureAction();
    7987        lgpscapture = new JCheckBoxMenuItem(captureAction);
    80         lgpsmenu.add(lgpscapture); 
    81         lgpscapture.setAccelerator(captureAction.shortCut);
     88        lgpsmenu.add(lgpscapture);
     89        lgpscapture.setAccelerator(captureAction.getShortCut().getKeyStroke());
    8290
    8391        JosmAction centerAction = new CenterAction();
    8492        JMenuItem centerMenu = new JMenuItem(centerAction);
    85         lgpsmenu.add(centerMenu); 
    86         centerMenu.setAccelerator(centerAction.shortCut);
     93        lgpsmenu.add(centerMenu);
     94        centerMenu.setAccelerator(centerAction.getShortCut().getKeyStroke());
    8795
    8896        JosmAction autoCenterAction = new AutoCenterAction();
    8997        lgpsautocenter = new JCheckBoxMenuItem(autoCenterAction);
    90         lgpsmenu.add(lgpsautocenter); 
    91         lgpsautocenter.setAccelerator(autoCenterAction.shortCut);
     98        lgpsmenu.add(lgpsautocenter);
     99        lgpsautocenter.setAccelerator(autoCenterAction.getShortCut().getKeyStroke());
    92100    }
    93    
     101
    94102    /**
    95103     * 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.