Changeset 33819 in osm for applications/editors/josm
- Timestamp:
- 2017-11-17T00:59:50+01:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/videomapping
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/videomapping/build.xml
r32680 r33819 5 5 <property name="commit.message" value="fix after JOSM update"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="1 0580"/>7 <property name="plugin.main.version" value="12840"/> 8 8 <property name="plugin.author" value="Matthias Meißer"/> 9 9 <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 28 28 import org.openstreetmap.josm.Main; 29 29 import org.openstreetmap.josm.actions.JosmAction; 30 import org.openstreetmap.josm.gui.MainApplication; 30 31 import org.openstreetmap.josm.gui.layer.GpxLayer; 31 32 import org.openstreetmap.josm.gui.layer.Layer; … … 71 72 super(info); 72 73 VideoEngine.setupPlayer(); 73 Main .getLayerManager().addLayerChangeListener(this);74 Main .getLayerManager().addActiveLayerChangeListener(this);74 MainApplication.getLayerManager().addLayerChangeListener(this); 75 MainApplication.getLayerManager().addActiveLayerChangeListener(this); 75 76 createMenusAndShortCuts(); 76 77 enableVideoControlMenus(false); … … 80 81 81 82 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")); 83 85 VMenu.setEnabled(false); 84 86 VAdd = new JosmAction(tr("Import Video"), "videomapping", tr("Sync a video against this GPS track"), null, false) { … … 286 288 287 289 private void saveProperties() { 288 Main.pref.put (PROP_AUTOCENTER, autoCenter);290 Main.pref.putBoolean(PROP_AUTOCENTER, autoCenter); 289 291 Main.pref.put(PROP_JUMPLENGTH, jumpLength.toString()); 290 292 Main.pref.put(PROP_LOOPLENGTH, loopLength.toString()); … … 343 345 @Override 344 346 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) { 345 handleLayer(Main .getLayerManager().getActiveLayer());347 handleLayer(MainApplication.getLayerManager().getActiveLayer()); 346 348 } 347 349 -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/VideoPositionLayer.java
r32630 r33819 28 28 import org.openstreetmap.josm.data.gpx.WayPoint; 29 29 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 30 import org.openstreetmap.josm.gui.MainApplication; 30 31 import org.openstreetmap.josm.gui.MapView; 31 32 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; … … 51 52 gpsTimeFormat = new SimpleDateFormat("HH:mm:ss"); 52 53 iconPosition = gpsTrack.get(0); 53 Main .getLayerManager().addLayer(this);54 MainApplication.getLayerManager().addLayer(this); 54 55 } 55 56 … … 77 78 g.setColor(Color.YELLOW); 78 79 for (WayPoint n: gpsTrack) { 79 Point p = map.getPoint(n.getEastNorth( ));80 Point p = map.getPoint(n.getEastNorth(Main.getProjection())); 80 81 g.drawOval(p.x - 2, p.y - 2, 4, 4); 81 82 } … … 86 87 for (WayPoint n : gpsTrack) { 87 88 if (n.attr.containsKey("synced")) { 88 Point p = map.getPoint(n.getEastNorth( ));89 Point p = map.getPoint(n.getEastNorth(Main.getProjection())); 89 90 g.drawOval(p.x - 2, p.y - 2, 4, 4); 90 91 } … … 94 95 private void paintPositionIcon(Graphics2D g, MapView map) { 95 96 if (iconPosition != null) { 96 Point p = map.getPoint(iconPosition.getEastNorth( ));97 Point p = map.getPoint(iconPosition.getEastNorth(Main.getProjection())); 97 98 layerIcon.paintIcon(null, g, p.x-layerIcon.getIconWidth()/2, p.y-layerIcon.getIconHeight()/2); 98 99 g.drawString(gpsTimeFormat.format(iconPosition.getTime()), p.x-15, p.y-15); … … 216 217 public void setIconPosition(WayPoint wp) { 217 218 iconPosition = wp; 218 if (Main .isDisplayingMapView()) {219 Main.map.mapView.repaint();219 if (MainApplication.isDisplayingMapView()) { 220 invalidate(); 220 221 if (autoCenter) 221 Main .map.mapView.zoomTo(iconPosition.getCoor());222 MainApplication.getMap().mapView.zoomTo(iconPosition.getCoor()); 222 223 } 223 224 } … … 244 245 //iterate through all possible notes 245 246 for (WayPoint n : gpsTrack) { 246 p = Main .map.mapView.getPoint(n.getEastNorth());247 p = MainApplication.getMap().mapView.getPoint(n.getEastNorth(Main.getProjection())); 247 248 if (rect.contains(p)) { 248 249 return n; … … 300 301 301 302 public void unload() { 302 Main .getLayerManager().removeLayer(this);303 MainApplication.getLayerManager().removeLayer(this); 303 304 } 304 305 } -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/GPSVideo.java
r32630 r33819 7 7 import javax.swing.JComponent; 8 8 9 import org.openstreetmap.josm.Main;10 9 import org.openstreetmap.josm.data.gpx.WayPoint; 10 import org.openstreetmap.josm.gui.MainApplication; 11 11 import org.openstreetmap.josm.plugins.videomapping.VideoPositionLayer; 12 12 … … 52 52 lastWayPoint = getLastGPS(); 53 53 markSyncedWayPoints(); 54 Main .map.mapView.repaint();54 MainApplication.getMap().mapView.repaint(); 55 55 } 56 56 -
applications/editors/josm/plugins/videomapping/src/org/openstreetmap/josm/plugins/videomapping/video/VideoEngine.java
r33376 r33819 8 8 import java.util.List; 9 9 10 import org.openstreetmap.josm. Main;10 import org.openstreetmap.josm.tools.Logging; 11 11 12 12 import com.sun.jna.NativeLibrary; … … 51 51 WindowsRuntimeUtil.VLC_INSTALL_DIR_KEY); 52 52 } catch (RuntimeException e) { 53 Main.error(e);53 Logging.error(e); 54 54 } 55 55 } … … 61 61 62 62 if (vlcInstallDir != null) { 63 Main.info("videomapping: found VLC install dir: "+vlcInstallDir);63 Logging.info("videomapping: found VLC install dir: "+vlcInstallDir); 64 64 NativeLibrary.addSearchPath("libvlc", vlcInstallDir); 65 65 } else { 66 Main.error("videomapping: unable to locate VLC install dir");66 Logging.error("videomapping: unable to locate VLC install dir"); 67 67 } 68 68 } … … 76 76 fullScreenStrategy = new DefaultFullScreenStrategy(parent); 77 77 } catch (NoClassDefFoundError e) { 78 Main.error(tr("Unable to find JNA Java library!"));78 Logging.error(tr("Unable to find JNA Java library!")); 79 79 } catch (UnsatisfiedLinkError e) { 80 Main.error(tr("Unable to find native libvlc library!"));80 Logging.error(tr("Unable to find native libvlc library!")); 81 81 } catch (Exception t) { 82 Main.error(t);82 Logging.error(t); 83 83 } 84 84 } … … 97 97 //now fetching and playback starts automatically 98 98 } catch (NoClassDefFoundError e) { 99 Main.error(tr("Unable to find JNA Java library!"));99 Logging.error(tr("Unable to find JNA Java library!")); 100 100 } catch (UnsatisfiedLinkError e) { 101 Main.error(tr("Unable to find native libvlc library!"));101 Logging.error(tr("Unable to find native libvlc library!")); 102 102 } 103 103 }
Note:
See TracChangeset
for help on using the changeset viewer.