Changeset 29381 in osm for applications
- Timestamp:
- 2013-03-21T07:42:54+01:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/imagery_offset_db/src/iodb
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery_offset_db/src/iodb/DeprecateOffsetAction.java
r29380 r29381 1 1 package iodb; 2 2 3 import iodb.QuerySuccessListener;4 3 import java.awt.event.ActionEvent; 5 4 import java.io.UnsupportedEncodingException; -
applications/editors/josm/plugins/imagery_offset_db/src/iodb/GetImageryOffsetAction.java
r29380 r29381 10 10 import org.openstreetmap.josm.Main; 11 11 import org.openstreetmap.josm.actions.JosmAction; 12 import org.openstreetmap.josm.data.coor.CoordinateFormat; 12 13 import org.openstreetmap.josm.data.coor.LatLon; 13 14 import org.openstreetmap.josm.data.projection.Projection; … … 73 74 super(null, tr("Loading imagery offsets...")); 74 75 try { 75 String query = "get?lat=" + center.lat() + "&lon=" + center.lon() 76 String query = "get?lat=" + center.latToString(CoordinateFormat.DECIMAL_DEGREES) 77 + "&lon=" + center.lonToString(CoordinateFormat.DECIMAL_DEGREES) 76 78 + "&imagery=" + URLEncoder.encode(imagery, "UTF8"); 77 79 int radius = Main.pref.getInteger("iodb.radius", -1); -
applications/editors/josm/plugins/imagery_offset_db/src/iodb/OffsetInfoAction.java
r29380 r29381 6 6 import javax.swing.JOptionPane; 7 7 import org.openstreetmap.josm.Main; 8 import org.openstreetmap.josm.data.coor.LatLon;9 8 import static org.openstreetmap.josm.tools.I18n.tr; 10 9 import org.openstreetmap.josm.tools.ImageProvider; -
applications/editors/josm/plugins/imagery_offset_db/src/iodb/QuerySuccessListener.java
r29380 r29381 6 6 * @author zverik 7 7 */ 8 interface QuerySuccessListener {8 public interface QuerySuccessListener { 9 9 10 10 /** -
applications/editors/josm/plugins/imagery_offset_db/src/iodb/StoreImageryOffsetAction.java
r29380 r29381 28 28 29 29 public void actionPerformed(ActionEvent e) { 30 if( Main.map == null || Main.map.mapView == null || getCurrentDataSet() == null)30 if( Main.map == null || Main.map.mapView == null ) 31 31 return; 32 32 … … 43 43 // check if an object suitable for calibration is selected 44 44 OsmPrimitive calibration = null; 45 Collection<OsmPrimitive> selectedObjects = getCurrentDataSet().getSelected(); 46 if( selectedObjects.size() == 1 ) { 47 OsmPrimitive selection = selectedObjects.iterator().next(); 48 if( (selection instanceof Node || selection instanceof Way) && !selection.isIncomplete() && !selection.isReferredByWays(1) ) { 49 String[] options = new String[] {tr("Store calibration geometry"), tr("Store imagery offset")}; 50 int result = JOptionPane.showOptionDialog(Main.parent, 51 tr("The selected object can be used as a calibration geometry. What do you intend to do?"), 52 ImageryOffsetTools.DIALOG_TITLE, JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, 53 null, options, options[0]); 54 if( result == 2 || result == JOptionPane.CLOSED_OPTION ) 55 return; 56 if( result == 0 ) 57 calibration = selection; 45 if( getCurrentDataSet() != null ) { 46 Collection<OsmPrimitive> selectedObjects = getCurrentDataSet().getSelected(); 47 if( selectedObjects.size() == 1 ) { 48 OsmPrimitive selection = selectedObjects.iterator().next(); 49 if( (selection instanceof Node || selection instanceof Way) && !selection.isIncomplete() && !selection.isReferredByWays(1) ) { 50 String[] options = new String[] {tr("Store calibration geometry"), tr("Store imagery offset")}; 51 int result = JOptionPane.showOptionDialog(Main.parent, 52 tr("The selected object can be used as a calibration geometry. What do you intend to do?"), 53 ImageryOffsetTools.DIALOG_TITLE, JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, 54 null, options, options[0]); 55 if( result == 2 || result == JOptionPane.CLOSED_OPTION ) 56 return; 57 if( result == 0 ) 58 calibration = selection; 59 } 58 60 } 59 61 } … … 132 134 if( ImageryOffsetTools.getTopImageryLayer() == null ) 133 135 state = false; 134 if( getCurrentDataSet() == null )135 state = false;136 136 setEnabled(state); 137 137 }
Note:
See TracChangeset
for help on using the changeset viewer.