Changeset 32329 in osm for applications/editors/josm/plugins/mapillary/src
- Timestamp:
- 2016-06-19T16:08:56+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r32078 r32329 111 111 MapView.addEditLayerChangeListener(this, false); 112 112 MapView.addLayerChangeListener(this); 113 if (Main. map.mapView.getEditLayer() != null)114 Main. map.mapView.getEditLayer().data.addDataSetListener(this);113 if (Main.getLayerManager().getEditLayer() != null) 114 Main.getLayerManager().getEditLayer().data.addDataSetListener(this); 115 115 if (MapillaryDownloader.getMode() == MapillaryDownloader.MODES.Automatic) 116 116 MapillaryDownloader.automaticDownload(); … … 223 223 Main.map.mapView.removeMouseMotionListener(this.mode); 224 224 MapView.removeEditLayerChangeListener(this); 225 if (Main. map.mapView.getEditLayer() != null)226 Main. map.mapView.getEditLayer().data.removeDataSetListener(this);225 if (Main.getLayerManager().getEditLayer() != null) 226 Main.getLayerManager().getEditLayer().data.removeDataSetListener(this); 227 227 clearInstance(); 228 228 super.destroy(); … … 286 286 public synchronized void paint(final Graphics2D g, final MapView mv, final Bounds box) { 287 287 g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); 288 if (Main. map.mapView.getActiveLayer() == this) {288 if (Main.getLayerManager().getActiveLayer() == this) { 289 289 // paint remainder 290 290 g.setPaint(this.hatched); … … 323 323 selectedImageKey = selectedImage.getSequence().getKey(); 324 324 } 325 g.setStroke(new BasicStroke(this == Main. map.mapView.getActiveLayer() ? 3 : 2));325 g.setStroke(new BasicStroke(this == Main.getLayerManager().getActiveLayer() ? 3 : 2)); 326 326 for (MapillarySequence seq : getData().getSequences()) { 327 327 if (selectedImageKey != null && selectedImageKey.equals(seq.getKey())) { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/actions/MapillaryDownloadAction.java
r31973 r32329 48 48 } 49 49 // Successive calls to this action toggle the active layer between the OSM data layer and the mapillary layer 50 Main. map.mapView.setActiveLayer(51 Main. map.mapView.getActiveLayer() == MapillaryLayer.getInstance()52 ? Main. map.mapView.getEditLayer()50 Main.getLayerManager().setActiveLayer( 51 Main.getLayerManager().getActiveLayer() == MapillaryLayer.getInstance() 52 ? Main.getLayerManager().getEditLayer() 53 53 : MapillaryLayer.getInstance() 54 54 ); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/io/download/MapillaryDownloader.java
r32064 r32329 152 152 public static void automaticDownload() { 153 153 MapillaryLayer layer = MapillaryLayer.getInstance(); 154 if (Main. map.mapView.getEditLayer() == null)154 if (Main.getLayerManager().getEditLayer() == null) 155 155 return; 156 156 if (isAreaTooBig()) { … … 160 160 if (getMode() != MODES.Automatic) 161 161 throw new IllegalStateException("Must be in automatic mode."); 162 for (Bounds bounds : Main. map.mapView.getEditLayer().data162 for (Bounds bounds : Main.getLayerManager().getEditLayer().data 163 163 .getDataSourceBounds()) { 164 164 if (!layer.getData().getBounds().contains(bounds)) { … … 177 177 private static boolean isAreaTooBig() { 178 178 double area = 0; 179 for (Bounds bounds : Main. map.mapView.getEditLayer().data.getDataSourceBounds()) {179 for (Bounds bounds : Main.getLayerManager().getEditLayer().data.getDataSourceBounds()) { 180 180 area += bounds.getArea(); 181 181 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/JoinMode.java
r31974 r32329 71 71 public void mouseMoved(MouseEvent e) { 72 72 this.lastPos = e; 73 if (!(Main. map.mapView.getActiveLayer() instanceof MapillaryLayer))73 if (!(Main.getLayerManager().getActiveLayer() instanceof MapillaryLayer)) 74 74 return; 75 75 MapillaryAbstractImage closestTemp = getClosest(e.getPoint()); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java
r32199 r32329 52 52 return; 53 53 MapillaryAbstractImage closest = getClosest(e.getPoint()); 54 if (!(Main. map.mapView.getActiveLayer() instanceof MapillaryLayer)54 if (!(Main.getLayerManager().getActiveLayer() instanceof MapillaryLayer) 55 55 && closest != null && Main.map.mapMode == Main.map.mapModeSelect) { 56 56 this.lastClicked = this.closest; 57 57 this.data.setSelectedImage(closest); 58 58 return; 59 } else if (Main. map.mapView.getActiveLayer() != MapillaryLayer59 } else if (Main.getLayerManager().getActiveLayer() != MapillaryLayer 60 60 .getInstance()) 61 61 return; … … 98 98 @Override 99 99 public void mouseDragged(MouseEvent e) { 100 if (Main. map.mapView.getActiveLayer() != MapillaryLayer.getInstance()) {100 if (Main.getLayerManager().getActiveLayer() != MapillaryLayer.getInstance()) { 101 101 return; 102 102 } … … 156 156 @Override 157 157 public void mouseMoved(MouseEvent e) { 158 if (Main. map.mapView.getActiveLayer() instanceof OsmDataLayer158 if (Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer 159 159 && Main.map.mapMode != Main.map.mapModeSelect) { 160 160 return; … … 167 167 168 168 if (closestTemp != null 169 && Main. map.mapView.getActiveLayer() instanceof OsmDataLayer169 && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer 170 170 && !this.imageHighlighted) { 171 171 Main.map.mapMode.putValue("active", Boolean.FALSE); … … 173 173 174 174 } else if (closestTemp == null 175 && Main. map.mapView.getActiveLayer() instanceof OsmDataLayer175 && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer 176 176 && this.imageHighlighted && this.nothingHighlighted) { 177 177 this.nothingHighlighted = false; … … 179 179 180 180 } else if (this.imageHighlighted && !this.nothingHighlighted 181 && Main. map.mapView.getEditLayer().data != null182 && Main. map.mapView.getActiveLayer() instanceof OsmDataLayer) {183 184 for (OsmPrimitive primivitive : Main. map.mapView.getEditLayer().data181 && Main.getLayerManager().getEditLayer().data != null 182 && Main.getLayerManager().getActiveLayer() instanceof OsmDataLayer) { 183 184 for (OsmPrimitive primivitive : Main.getLayerManager().getEditLayer().data 185 185 .allPrimitives()) { 186 186 primivitive.setHighlighted(false);
Note:
See TracChangeset
for help on using the changeset viewer.