Changeset 13584 in osm
- Timestamp:
- 2009-02-08T11:38:00+01:00 (16 years ago)
- Location:
- applications/editors/josm/plugins/wmsplugin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin/build.xml
r13332 r13584 37 37 <attribute name="Plugin-Date" value="${version.entry.commit.date}"/> 38 38 <attribute name="Plugin-Description" value="Allows external WMS resources to be displayed." /> 39 <attribute name="Plugin-Mainversion" value="1 180" />39 <attribute name="Plugin-Mainversion" value="1379" /> 40 40 </manifest> 41 41 </jar> -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSAdjustAction.java
r13497 r13584 17 17 18 18 public class WMSAdjustAction extends MapMode implements 19 19 MouseListener, MouseMotionListener{ 20 20 21 21 GeorefImage selectedImage; … … 26 26 public WMSAdjustAction(MapFrame mapFrame) { 27 27 super(tr("Adjust WMS"), "adjustwms", 28 tr("Adjust the position of the WMS layer"), mapFrame, 28 tr("Adjust the position of the selected WMS layer"), mapFrame, 29 29 ImageProvider.getCursor("normal", "move")); 30 30 } … … 45 45 if (e.getButton() != MouseEvent.BUTTON1) 46 46 return; 47 48 for(Layer layer:Main.map.mapView.getAllLayers()) { 49 if (layer.visible && layer instanceof WMSLayer) { 50 prevEastNorth=Main.map.mapView.getEastNorth(e.getX(),e.getY()); 51 selectedLayer = ((WMSLayer)layer); 52 selectedImage = selectedLayer.findImage(prevEastNorth); 53 if(selectedImage!=null){ 54 Main.map.mapView.setCursor 55 (Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); 56 } 47 48 Layer layer=Main.map.mapView.getActiveLayer(); 49 if (layer.visible && layer instanceof WMSLayer) { 50 prevEastNorth=Main.map.mapView.getEastNorth(e.getX(),e.getY()); 51 selectedLayer = ((WMSLayer)layer); 52 selectedImage = selectedLayer.findImage(prevEastNorth); 53 if(selectedImage!=null) { 54 Main.map.mapView.setCursor 55 (Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR)); 57 56 } 58 57 } … … 60 59 61 60 @Override public void mouseDragged(MouseEvent e) { 62 /*63 if (e.getButton() != MouseEvent.BUTTON1)64 return;65 */66 67 61 if(selectedImage!=null) { 68 62 EastNorth eastNorth= 69 63 Main.map.mapView.getEastNorth(e.getX(),e.getY()); 70 selectedLayer.displace(eastNorth.east()-prevEastNorth.east(), 71 eastNorth.north()-prevEastNorth.north()); 64 selectedLayer.displace( 65 eastNorth.east()-prevEastNorth.east(), 66 eastNorth.north()-prevEastNorth.north() 67 ); 72 68 prevEastNorth = eastNorth; 73 69 Main.map.mapView.repaint(); … … 92 88 @Override public void mouseClicked(MouseEvent e) { 93 89 } 90 91 // This only makes the buttons look disabled, but since no keyboard shortcut is 92 // provided there aren't any other means to activate this tool 93 @Override public boolean layerIsSupported(Layer l) { 94 return (l instanceof WMSLayer) && l.visible; 95 } 94 96 }
Note:
See TracChangeset
for help on using the changeset viewer.