Changeset 24572 in osm
- Timestamp:
- 2010-12-04T12:14:12+01:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPlugin.java
r24501 r24572 29 29 import org.openstreetmap.josm.plugins.imagery.wms.WMSAdapter; 30 30 import org.openstreetmap.josm.plugins.imagery.wms.WMSLayer; 31 import org.openstreetmap.josm.plugins.imagery.wms.WMSRemoteHandler;32 31 import org.openstreetmap.josm.plugins.imagery.wms.io.WMSLayerExporter; 33 32 import org.openstreetmap.josm.plugins.imagery.wms.io.WMSLayerImporter; … … 124 123 // replace command and class when you copy this to some other plug-in 125 124 // for compatibility with old remotecontrol add leading "/" 126 method.invoke(plugin, "/" + WMSRemoteHandler.command, WMSRemoteHandler.class);125 method.invoke(plugin, "/" + ImageryRemoteHandler.command, ImageryRemoteHandler.class); 127 126 remoteControlInitialized = true; 128 127 } -
applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferenceEditor.java
r24567 r24572 57 57 private JButton btnFadeColor; 58 58 private JSlider fadeAmount = new JSlider(0, 100); 59 private JCheckBox remoteCheckBox; 60 boolean allowRemoteControl = true; 59 61 60 62 // WMS Settings … … 63 65 JSpinner spinNorth; 64 66 JSpinner spinSimConn; 65 JCheckBox remoteCheckBox;66 boolean allowRemoteControl = true;67 67 WMSAdapter wmsAdapter = ImageryPlugin.wmsAdapter; 68 68 ImageryPlugin plugin = ImageryPlugin.instance; … … 226 226 p.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL)); 227 227 p.add(this.fadeAmount, GBC.eol().fill(GBC.HORIZONTAL)); 228 229 228 this.fadeAmount.setValue(ImageryPreferences.PROP_FADE_AMOUNT.get()); 229 230 allowRemoteControl = ImageryPreferences.PROP_REMOTE_CONTROL.get(); 231 remoteCheckBox = new JCheckBox(tr("Allow remote control (reqires remotecontrol plugin)"), allowRemoteControl); 232 p.add(remoteCheckBox,GBC.eol().fill(GBC.HORIZONTAL)); 233 230 234 return p; 231 235 } … … 270 274 p.add(overlapPanelSimConn, GBC.eol().fill(GBC.HORIZONTAL)); 271 275 272 allowRemoteControl = Main.pref.getBoolean("wmsplugin.remotecontrol", true);273 remoteCheckBox = new JCheckBox(tr("Allow remote control (reqires remotecontrol plugin)"), allowRemoteControl);274 JPanel remotePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));275 remotePanel.add(remoteCheckBox);276 277 p.add(remotePanel,GBC.eol().fill(GBC.HORIZONTAL));278 276 return p; 279 277 } … … 314 312 p.add(lbl,GBC.std()); 315 313 p.add(new JSeparator(), GBC.eol().fill(GBC.HORIZONTAL).insets(5, 0, 0, 0)); 316 p.add(section,GBC.eol().insets(20,5,0, 5));314 p.add(section,GBC.eol().insets(20,5,0,10)); 317 315 } 318 316 … … 353 351 Main.pref.put("wmsplugin.browser", browser.getEditor().getItem().toString()); 354 352 355 Main.pref.put("wmsplugin.remotecontrol", String.valueOf(allowRemoteControl));356 353 357 354 TMSPreferences.PROP_DEFAULT_AUTOZOOM.put(this.autozoomActive.isSelected()); … … 360 357 TMSPreferences.setMinZoomLvl((Integer)this.minZoomLvl.getValue()); 361 358 359 ImageryPreferences.PROP_REMOTE_CONTROL.put(allowRemoteControl); 362 360 ImageryPreferences.PROP_FADE_AMOUNT.put(this.fadeAmount.getValue()); 363 361 ImageryPreferences.setFadeColor(this.colFadeColor); -
applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryPreferences.java
r24548 r24572 4 4 5 5 import org.openstreetmap.josm.Main; 6 import org.openstreetmap.josm.data.preferences.BooleanProperty; 6 7 import org.openstreetmap.josm.data.preferences.IntegerProperty; 7 8 8 9 public class ImageryPreferences { 9 10 11 public static final BooleanProperty PROP_REMOTE_CONTROL = new BooleanProperty("imagery.remotecontrol", true); 10 12 public static final IntegerProperty PROP_FADE_AMOUNT = new IntegerProperty("imagery.fade_amount", 0); 11 13 -
applications/editors/josm/plugins/imagery/src/org/openstreetmap/josm/plugins/imagery/ImageryRemoteHandler.java
r24566 r24572 1 package org.openstreetmap.josm.plugins.imagery .wms;1 package org.openstreetmap.josm.plugins.imagery; 2 2 3 3 import static org.openstreetmap.josm.tools.I18n.tr; … … 9 9 10 10 import org.openstreetmap.josm.Main; 11 import org.openstreetmap.josm.plugins.imagery.ImageryInfo;12 11 import org.openstreetmap.josm.plugins.remotecontrol.PermissionPrefWithDefault; 13 12 import org.openstreetmap.josm.plugins.remotecontrol.RequestHandler; 14 13 import org.openstreetmap.josm.plugins.remotecontrol.RequestHandlerErrorException; 15 14 16 public class WMSRemoteHandler extends RequestHandler {15 public class ImageryRemoteHandler extends RequestHandler { 17 16 18 public static final String command = " wms";17 public static final String command = "imagery"; 19 18 20 19 @Override 21 20 public String getPermissionMessage() { 22 return tr("Remote Control has been asked to load a WMSlayer from the following URL:") +21 return tr("Remote Control has been asked to load an imagery layer from the following URL:") + 23 22 "<br>" + args.get("url"); 24 23 } … … 28 27 { 29 28 return new PermissionPrefWithDefault( 30 " wmsplugin.remotecontrol",29 "imagery.remotecontrol", 31 30 true, 32 "RemoteControl: WMSforbidden by preferences");31 "RemoteControl: Imagery forbidden by preferences"); 33 32 } 34 33 … … 41 40 @Override 42 41 protected void handleRequest() throws RequestHandlerErrorException { 42 if (Main.map == null) //Avoid exception when creating ImageryLayer with null MapFrame 43 throw new RequestHandlerErrorException(); 43 44 String url = args.get("url"); 44 45 String title = args.get("title"); 45 46 if((title == null) || (title.length() == 0)) 46 47 { 47 title = tr("Remote WMS");48 title = tr("Remote imagery"); 48 49 } 49 50 String cookies = args.get("cookies"); 50 WMSLayer wmsLayer = new WMSLayer(new ImageryInfo(title, url, cookies));51 Main.main.addLayer( wmsLayer);51 ImageryLayer imgLayer = ImageryLayer.create(new ImageryInfo(title, url, cookies)); 52 Main.main.addLayer(imgLayer); 52 53 53 54 }
Note:
See TracChangeset
for help on using the changeset viewer.