Changeset 30634 in osm for applications/editors/josm/plugins/editgpx/src/org/openstreetmap
- Timestamp:
- 2014-09-14T22:42:41+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java
r29533 r30634 32 32 import org.openstreetmap.josm.tools.ImageProvider; 33 33 34 35 34 public class EditGpxLayer extends Layer { 36 35 … … 51 50 public void initializeImport() { 52 51 try { 53 if (data.isEmpty()) {52 if (data.isEmpty()) { 54 53 layerImport.activateImport(); 55 54 } 56 55 } catch (Exception e) { 57 System.out.println(e.getMessage()); 58 e.printStackTrace(); 56 Main.error(e); 59 57 } 60 58 } -
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java
r29595 r30634 21 21 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 22 22 import org.openstreetmap.josm.gui.layer.Layer; 23 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 23 24 import org.openstreetmap.josm.plugins.editgpx.data.EditGpxData; 24 25 import org.openstreetmap.josm.plugins.editgpx.data.EditGpxTrack; 25 26 import org.openstreetmap.josm.plugins.editgpx.data.EditGpxTrackSegment; 26 27 import org.openstreetmap.josm.plugins.editgpx.data.EditGpxWayPoint; 27 28 28 29 29 public class EditGpxMode extends MapMode implements LayerChangeListener { … … 40 40 } 41 41 42 @Override public void enterMode() { 42 @Override 43 public void enterMode() { 43 44 super.enterMode(); 44 45 Main.map.mapView.addMouseListener(this); … … 48 49 } 49 50 50 @Override public void exitMode() { 51 @Override 52 public void exitMode() { 51 53 super.exitMode(); 52 54 Main.map.mapView.removeMouseListener(this); … … 54 56 } 55 57 56 57 @Overridepublic void mousePressed(MouseEvent e) {58 @Override 59 public void mousePressed(MouseEvent e) { 58 60 pointPressed = new Point(e.getPoint()); 59 61 } 60 62 61 62 @Overridepublic void mouseDragged(MouseEvent e) {63 @Override 64 public void mouseDragged(MouseEvent e) { 63 65 if ( (e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) == InputEvent.BUTTON1_DOWN_MASK) { 64 66 //if button1 is hold, draw the rectangle. … … 67 69 } 68 70 69 @Override public void mouseReleased(MouseEvent e) { 71 @Override 72 public void mouseReleased(MouseEvent e) { 70 73 if (e.getButton() != MouseEvent.BUTTON1) { 71 74 return; … … 93 96 oldRect = null; 94 97 Main.map.mapView.repaint(); 95 96 98 } 97 99 … … 149 151 } 150 152 151 152 153 public void setFrame(MapFrame mapFrame) { 153 154 frame = mapFrame; … … 177 178 if (oldLayer instanceof EditGpxLayer) { 178 179 currentEditLayer = null; 179 if(Main.map.mapMode instanceof EditGpxMode) 180 Main.map.selectSelectTool(false); 180 if (Main.map.mapMode instanceof EditGpxMode) { 181 if (Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) { 182 Main.map.selectSelectTool(false); 183 } else { 184 Main.map.selectZoomTool(false); 185 } 186 } 181 187 } 182 188 } -
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/GPXLayerImportAction.java
r30532 r30634 31 31 32 32 /** 33 * Import GPX data from available layers 34 * 33 * Import GPX data from available layers. 35 34 * 36 35 */ … … 47 46 48 47 /** 49 * shows a list of GPX layers. if user selects one the data from this layer is 50 * imported. 48 * shows a list of GPX layers. if user selects one the data from this layer is imported. 51 49 */ 52 50 public void activateImport() {
Note:
See TracChangeset
for help on using the changeset viewer.