Changeset 33819 in osm for applications/editors/josm


Ignore:
Timestamp:
2017-11-17T00:59:50+01:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 12840

Location:
applications/editors/josm/plugins/videomapping
Files:
5 edited

Legend:

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

    r32680 r33819  
    55    <property name="commit.message" value="fix after JOSM update"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="10580"/>
     7    <property name="plugin.main.version" value="12840"/>
    88    <property name="plugin.author" value="Matthias Meißer"/>
    99    <property name="plugin.class" value="org.openstreetmap.josm.plugins.videomapping.VideoPlugin"/>
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoPlugin.java

    r32630 r33819  
    2828import org.openstreetmap.josm.Main;
    2929import org.openstreetmap.josm.actions.JosmAction;
     30import org.openstreetmap.josm.gui.MainApplication;
    3031import org.openstreetmap.josm.gui.layer.GpxLayer;
    3132import org.openstreetmap.josm.gui.layer.Layer;
     
    7172        super(info);
    7273        VideoEngine.setupPlayer();
    73         Main.getLayerManager().addLayerChangeListener(this);
    74         Main.getLayerManager().addActiveLayerChangeListener(this);
     74        MainApplication.getLayerManager().addLayerChangeListener(this);
     75        MainApplication.getLayerManager().addActiveLayerChangeListener(this);
    7576        createMenusAndShortCuts();
    7677        enableVideoControlMenus(false);
     
    8081
    8182    private void createMenusAndShortCuts() {
    82         VMenu = Main.main.menu.addMenu("Video", tr("Video"), KeyEvent.VK_Q, Main.main.menu.getDefaultMenuPos(), ht("/Plugin/Videomapping"));
     83        VMenu = MainApplication.getMenu().addMenu("Video", tr("Video"), KeyEvent.VK_Q,
     84                MainApplication.getMenu().getDefaultMenuPos(), ht("/Plugin/Videomapping"));
    8385        VMenu.setEnabled(false);
    8486        VAdd = new JosmAction(tr("Import Video"), "videomapping", tr("Sync a video against this GPS track"), null, false) {
     
    286288
    287289    private void saveProperties() {
    288         Main.pref.put(PROP_AUTOCENTER, autoCenter);
     290        Main.pref.putBoolean(PROP_AUTOCENTER, autoCenter);
    289291        Main.pref.put(PROP_JUMPLENGTH, jumpLength.toString());
    290292        Main.pref.put(PROP_LOOPLENGTH, loopLength.toString());
     
    343345    @Override
    344346    public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) {
    345         handleLayer(Main.getLayerManager().getActiveLayer());
     347        handleLayer(MainApplication.getLayerManager().getActiveLayer());
    346348    }
    347349
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoPositionLayer.java

    r32630 r33819  
    2828import org.openstreetmap.josm.data.gpx.WayPoint;
    2929import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
     30import org.openstreetmap.josm.gui.MainApplication;
    3031import org.openstreetmap.josm.gui.MapView;
    3132import org.openstreetmap.josm.gui.dialogs.LayerListDialog;
     
    5152        gpsTimeFormat = new SimpleDateFormat("HH:mm:ss");
    5253        iconPosition = gpsTrack.get(0);
    53         Main.getLayerManager().addLayer(this);
     54        MainApplication.getLayerManager().addLayer(this);
    5455    }
    5556
     
    7778        g.setColor(Color.YELLOW);
    7879        for (WayPoint n: gpsTrack) {
    79             Point p = map.getPoint(n.getEastNorth());
     80            Point p = map.getPoint(n.getEastNorth(Main.getProjection()));
    8081            g.drawOval(p.x - 2, p.y - 2, 4, 4);
    8182        }
     
    8687        for (WayPoint n : gpsTrack) {
    8788            if (n.attr.containsKey("synced")) {
    88                 Point p = map.getPoint(n.getEastNorth());
     89                Point p = map.getPoint(n.getEastNorth(Main.getProjection()));
    8990                g.drawOval(p.x - 2, p.y - 2, 4, 4);
    9091            }
     
    9495    private void paintPositionIcon(Graphics2D g, MapView map) {
    9596        if (iconPosition != null) {
    96             Point p = map.getPoint(iconPosition.getEastNorth());
     97            Point p = map.getPoint(iconPosition.getEastNorth(Main.getProjection()));
    9798            layerIcon.paintIcon(null, g, p.x-layerIcon.getIconWidth()/2, p.y-layerIcon.getIconHeight()/2);
    9899            g.drawString(gpsTimeFormat.format(iconPosition.getTime()), p.x-15, p.y-15);
     
    216217    public void setIconPosition(WayPoint wp) {
    217218        iconPosition = wp;
    218         if (Main.isDisplayingMapView()) {
    219             Main.map.mapView.repaint();
     219        if (MainApplication.isDisplayingMapView()) {
     220            invalidate();
    220221            if (autoCenter)
    221                 Main.map.mapView.zoomTo(iconPosition.getCoor());
     222                MainApplication.getMap().mapView.zoomTo(iconPosition.getCoor());
    222223        }
    223224    }
     
    244245        //iterate through all possible notes
    245246        for (WayPoint n : gpsTrack) {
    246             p = Main.map.mapView.getPoint(n.getEastNorth());
     247            p = MainApplication.getMap().mapView.getPoint(n.getEastNorth(Main.getProjection()));
    247248            if (rect.contains(p)) {
    248249                return n;
     
    300301
    301302    public void unload() {
    302         Main.getLayerManager().removeLayer(this);
     303        MainApplication.getLayerManager().removeLayer(this);
    303304    }
    304305}
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideo.java

    r32630 r33819  
    77import javax.swing.JComponent;
    88
    9 import org.openstreetmap.josm.Main;
    109import org.openstreetmap.josm.data.gpx.WayPoint;
     10import org.openstreetmap.josm.gui.MainApplication;
    1111import org.openstreetmap.josm.plugins.videomapping.VideoPositionLayer;
    1212
     
    5252        lastWayPoint = getLastGPS();
    5353        markSyncedWayPoints();
    54         Main.map.mapView.repaint();
     54        MainApplication.getMap().mapView.repaint();
    5555    }
    5656
  • applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/VideoEngine.java

    r33376 r33819  
    88import java.util.List;
    99
    10 import org.openstreetmap.josm.Main;
     10import org.openstreetmap.josm.tools.Logging;
    1111
    1212import com.sun.jna.NativeLibrary;
     
    5151                            WindowsRuntimeUtil.VLC_INSTALL_DIR_KEY);
    5252                } catch (RuntimeException e) {
    53                     Main.error(e);
     53                    Logging.error(e);
    5454                }
    5555            }
     
    6161
    6262        if (vlcInstallDir != null) {
    63             Main.info("videomapping: found VLC install dir: "+vlcInstallDir);
     63            Logging.info("videomapping: found VLC install dir: "+vlcInstallDir);
    6464            NativeLibrary.addSearchPath("libvlc", vlcInstallDir);
    6565        } else {
    66             Main.error("videomapping: unable to locate VLC install dir");
     66            Logging.error("videomapping: unable to locate VLC install dir");
    6767        }
    6868    }
     
    7676            fullScreenStrategy = new DefaultFullScreenStrategy(parent);
    7777        } catch (NoClassDefFoundError e) {
    78             Main.error(tr("Unable to find JNA Java library!"));
     78            Logging.error(tr("Unable to find JNA Java library!"));
    7979        } catch (UnsatisfiedLinkError e) {
    80             Main.error(tr("Unable to find native libvlc library!"));
     80            Logging.error(tr("Unable to find native libvlc library!"));
    8181        } catch (Exception t) {
    82             Main.error(t);
     82            Logging.error(t);
    8383        }
    8484    }
     
    9797            //now fetching and playback starts automatically
    9898        } catch (NoClassDefFoundError e) {
    99             Main.error(tr("Unable to find JNA Java library!"));
     99            Logging.error(tr("Unable to find JNA Java library!"));
    100100        } catch (UnsatisfiedLinkError e) {
    101             Main.error(tr("Unable to find native libvlc library!"));
     101            Logging.error(tr("Unable to find native libvlc library!"));
    102102        }
    103103    }
Note: See TracChangeset for help on using the changeset viewer.