Changeset 16781 in osm for applications/editors/josm/plugins/wmsplugin/src
- Timestamp:
- 2009-08-03T10:45:15+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/wmsplugin/src/wmsplugin
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java
r15091 r16781 160 160 ImageProducer ip = img.getSource(); 161 161 RGBImageFilter filter = new RGBImageFilter() { 162 @Override 162 163 public int filterRGB(int x, int y, int rgb) { 163 164 return rgb | 0xff000000; -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/Map_Rectifier_WMSmenuAction.java
r16442 r16781 23 23 import org.openstreetmap.josm.actions.JosmAction; 24 24 import org.openstreetmap.josm.gui.ExtendedDialog; 25 import org.openstreetmap.josm.gui.OptionPaneUtil; 25 26 import org.openstreetmap.josm.tools.GBC; 26 27 import org.openstreetmap.josm.tools.Shortcut; … … 195 196 196 197 // and display an error message. The while(true) ensures that the dialog pops up again 197 JOptionPane.showMessageDialog(Main.parent,198 OptionPaneUtil.showMessageDialog(Main.parent, 198 199 tr("Couldn't match the entered link or id to the selected service. Please try again."), 199 200 tr("No valid WMS URL or id"), -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSAdjustAction.java
r15960 r16781 47 47 48 48 Layer layer=Main.map.mapView.getActiveLayer(); 49 if (layer. visible&& layer instanceof WMSLayer) {49 if (layer.isVisible() && layer instanceof WMSLayer) { 50 50 prevEastNorth=Main.map.mapView.getEastNorth(e.getX(),e.getY()); 51 51 selectedLayer = ((WMSLayer)layer); … … 78 78 selectedLayer = null; 79 79 } 80 80 81 @Override 81 82 public void mouseEntered(MouseEvent e) { 82 83 } 84 85 @Override 83 86 public void mouseExited(MouseEvent e) { 84 87 } 88 89 @Override 85 90 public void mouseMoved(MouseEvent e) { 86 91 } … … 92 97 // provided there aren't any other means to activate this tool 93 98 @Override public boolean layerIsSupported(Layer l) { 94 return (l instanceof WMSLayer) && l. visible;99 return (l instanceof WMSLayer) && l.isVisible(); 95 100 } 96 101 } -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSGrabber.java
r16363 r16781 30 30 import org.openstreetmap.josm.data.projection.Mercator; 31 31 import org.openstreetmap.josm.gui.MapView; 32 import org.openstreetmap.josm.gui.OptionPaneUtil; 32 33 import org.openstreetmap.josm.io.CacheFiles; 33 34 import org.openstreetmap.josm.io.OsmTransferException; … … 51 52 } 52 53 54 @Override 53 55 void fetch() throws Exception{ 54 56 URL url = null; … … 122 124 if(!projname.equals(m.group(1)) && warn) 123 125 { 124 JOptionPane.showMessageDialog(Main.parent,126 OptionPaneUtil.showMessageDialog(Main.parent, 125 127 tr("The projection ''{0}'' in URL and current projection ''{1}'' mismatch.\n" 126 128 + "This may lead to wrong coordinates.", 127 m.group(1), projname)); 129 m.group(1), projname), 130 tr("Warning"), 131 JOptionPane.WARNING_MESSAGE); 128 132 } 129 133 } -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
r16290 r16781 31 31 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 32 32 import org.openstreetmap.josm.gui.MapView; 33 import org.openstreetmap.josm.gui.OptionPaneUtil; 33 34 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 34 35 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; … … 117 118 @Override public String getToolTipText() { 118 119 if(startstop.isSelected()) 119 return tr("WMS layer ({0}), automatically downloading in zoom {1}", name, resolution);120 return tr("WMS layer ({0}), automatically downloading in zoom {1}", getName(), resolution); 120 121 else 121 return tr("WMS layer ({0}), downloading in zoom {1}", name, resolution);122 return tr("WMS layer ({0}), downloading in zoom {1}", getName(), resolution); 122 123 } 123 124 … … 163 164 164 165 if((bmaxx - bminx > dax) || (bmaxy - bminy > day)){ 165 JOptionPane.showMessageDialog(Main.parent, tr("The requested area is too big. Please zoom in a little, or change resolution")); 166 OptionPaneUtil.showMessageDialog( 167 Main.parent, 168 tr("The requested area is too big. Please zoom in a little, or change resolution"), 169 tr("Error"), 170 JOptionPane.ERROR_MESSAGE 171 ); 166 172 return; 167 173 } … … 196 202 @Override public Component[] getMenuEntries() { 197 203 return new Component[]{ 198 new JMenuItem( new LayerListDialog.ShowHideLayerAction(this)),199 new JMenuItem( new LayerListDialog.DeleteLayerAction(this)),204 new JMenuItem(LayerListDialog.getInstance().createShowHideLayerAction(this)), 205 new JMenuItem(LayerListDialog.getInstance().createDeleteLayerAction(this)), 200 206 new JSeparator(), 201 207 new JMenuItem(new LoadWmsAction()), … … 299 305 oos.writeInt(ImageSize); 300 306 oos.writeDouble(pixelPerDegree); 301 oos.writeObject( name);307 oos.writeObject(getName()); 302 308 oos.writeObject(baseURL); 303 309 oos.writeObject(images); … … 327 333 int sfv = ois.readInt(); 328 334 if (sfv != serializeFormatVersion) { 329 JOptionPane.showMessageDialog(Main.parent,335 OptionPaneUtil.showMessageDialog(Main.parent, 330 336 tr("Unsupported WMS file version; found {0}, expected {1}", sfv, serializeFormatVersion), 331 337 tr("File Format Error"), … … 338 344 ImageSize = ois.readInt(); 339 345 pixelPerDegree = ois.readDouble(); 340 name = (String) ois.readObject();346 setName((String)ois.readObject()); 341 347 baseURL = (String) ois.readObject(); 342 348 images = (GeorefImage[][])ois.readObject(); … … 348 354 // FIXME be more specific 349 355 ex.printStackTrace(System.out); 350 JOptionPane.showMessageDialog(Main.parent,356 OptionPaneUtil.showMessageDialog(Main.parent, 351 357 tr("Error loading file"), 352 358 tr("Error"), -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java
r16351 r16781 58 58 // wmsplugin.1.url=http://and.so.on/ 59 59 60 @Override 60 61 public void copy(String from, String to) throws FileNotFoundException, IOException 61 62 { … … 202 203 } 203 204 205 @Override 204 206 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 205 207 if (oldFrame==null && newFrame!=null) { … … 212 214 } 213 215 216 @Override 214 217 public PreferenceSetting getPreferenceSetting() { 215 218 return new WMSPreferenceEditor(); -
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPreferenceEditor.java
r16308 r16781 26 26 import javax.swing.table.DefaultTableModel; 27 27 28 import org.openstreetmap.josm.gui.OptionPaneUtil; 28 29 import org.openstreetmap.josm.gui.preferences.PreferenceDialog; 29 30 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; … … 53 54 new String[]{tr("Menu Name (Default)"), tr("WMS URL (Default)")}, 0); 54 55 final JTable listdef = new JTable(modeldef){ 56 @Override 55 57 public boolean isCellEditable(int row,int column){return false;} 56 58 };; … … 76 78 p.add(new JLabel(tr("WMS URL")), GBC.std().insets(0,0,5,0)); 77 79 p.add(value, GBC.eol().insets(5,0,0,0).fill(GBC.HORIZONTAL)); 78 int answer = JOptionPane.showConfirmDialog(gui, p, tr("Enter a menu name and WMS URL"), JOptionPane.OK_CANCEL_OPTION); 80 int answer = OptionPaneUtil.showConfirmationDialog( 81 gui, p, 82 tr("Enter a menu name and WMS URL"), 83 JOptionPane.OK_CANCEL_OPTION, 84 JOptionPane.QUESTION_MESSAGE); 79 85 if (answer == JOptionPane.OK_OPTION) { 80 86 model.addRow(new String[]{key.getText(), value.getText()}); … … 104 110 Integer line = listdef.getSelectedRow(); 105 111 if (line == -1) 106 JOptionPane.showMessageDialog(gui, tr("Please select the row to copy.")); 112 OptionPaneUtil.showMessageDialog( 113 gui, 114 tr("Please select the row to copy."), 115 tr("Information"), 116 JOptionPane.INFORMATION_MESSAGE 117 ); 107 118 else 108 119 {
Note:
See TracChangeset
for help on using the changeset viewer.