Changeset 36054 in osm
- Timestamp:
- 2023-02-21T17:12:09+01:00 (21 months ago)
- Location:
- applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxLayer.java
r34737 r36054 9 9 import java.awt.Graphics2D; 10 10 import java.awt.Point; 11 import java.awt.Toolkit;12 11 import java.awt.event.ActionEvent; 13 12 … … 15 14 import javax.swing.Action; 16 15 import javax.swing.Icon; 17 import javax.swing.ImageIcon;18 16 19 17 import org.openstreetmap.josm.data.Bounds; … … 34 32 import org.openstreetmap.josm.tools.ImageProvider; 35 33 34 /** 35 * The layer for editing GPX data 36 */ 36 37 public class EditGpxLayer extends Layer { 37 38 38 private static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(EditGpxPlugin.class.getResource("/images/editgpx_layer.png"))); 39 private static final Icon icon = new ImageProvider("editgpx_layer").get(); 40 /** The data that is being edited */ 39 41 public final EditGpxData data; 40 private GPXLayerImportAction layerImport;42 private final GPXLayerImportAction layerImport; 41 43 42 44 /** -
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxMode.java
r34737 r36054 12 12 import java.awt.Rectangle; 13 13 import java.awt.event.InputEvent; 14 import java.awt.event.KeyEvent; 14 15 import java.awt.event.MouseEvent; 15 16 import java.util.List; … … 29 30 import org.openstreetmap.josm.plugins.editgpx.data.EditGpxTrackSegment; 30 31 import org.openstreetmap.josm.plugins.editgpx.data.EditGpxWayPoint; 31 32 import org.openstreetmap.josm.tools.Shortcut; 33 34 /** 35 * Enter the mode for editing GPX data 36 */ 32 37 public class EditGpxMode extends MapMode implements LayerChangeListener { 33 38 … … 43 48 */ 44 49 public EditGpxMode(MapFrame mapFrame) { 45 super("editgpx", "editgpx_mode.png", tr("edit gpx tracks"), Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR)); 50 super("editgpx", "editgpx_mode", tr("edit gpx tracks"), 51 Shortcut.registerShortcut("editgpx:editgpx_mode", tr("EditGPX Mode"), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), 52 Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR)); 46 53 this.mapFrame = mapFrame; 47 54 } … … 100 107 } 101 108 } 109 currentEditLayer.invalidate(); 102 110 } 103 111 oldRect = null; 104 MainApplication.getMap().mapView.repaint();105 112 } 106 113 … … 176 183 currentEditLayer.initializeImport(); 177 184 } 178 MainApplication.getMap().mapView.repaint();185 currentEditLayer.invalidate(); 179 186 } 180 187 -
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/EditGpxPlugin.java
r33782 r36054 3 3 */ 4 4 package org.openstreetmap.josm.plugins.editgpx; 5 6 import javax.swing.ImageIcon;7 5 8 6 import org.openstreetmap.josm.gui.IconToggleButton; … … 44 42 } 45 43 } 46 47 public static ImageIcon loadIcon(String name) {48 return new ImageIcon(EditGpxPlugin.class.getResource("/images/editgpx.png"));49 }50 44 } -
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/GPXLayerImportAction.java
r34505 r36054 31 31 /** 32 32 * Import GPX data from available layers. 33 *34 33 */ 35 34 class GPXLayerImportAction extends AbstractAction { 36 35 37 private EditGpxData data;38 public Object importing = new Object(); //used for synchronization36 private final EditGpxData data; 37 public final Object importing = new Object(); //used for synchronization 39 38 40 39 public GPXLayerImportAction(EditGpxData data) { … … 103 102 } 104 103 } 105 MainApplication.getMap().mapView.repaint();106 104 107 105 } else {
Note:
See TracChangeset
for help on using the changeset viewer.