Changeset 5415 in osm for applications/editors/josm/plugins/wmsplugin/src
- Timestamp:
- 2007-11-10T01:23:47+01:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSPlugin.java
r5319 r5415 19 19 import org.openstreetmap.josm.gui.IconToggleButton; 20 20 import org.openstreetmap.josm.gui.preferences.PreferenceSetting; 21 import org.openstreetmap.josm.actions.JosmAction; 21 22 22 23 … … 95 96 if (wmsJMenu == null) { 96 97 wmsJMenu = new JMenu(tr("WMS")); 97 menu.add(wmsJMenu, 3); 98 wmsJMenu.setEnabled(false); 98 menu.add(wmsJMenu, 5); 99 99 } else { 100 100 wmsJMenu.removeAll(); … … 104 104 for (final WMSInfo u : wmsList) { 105 105 wmsJMenu.add(new JMenuItem(new WMSDownloadAction(u))); 106 } 106 } 107 107 wmsJMenu.addSeparator(); 108 108 wmsJMenu.add(new JMenuItem(new Map_Rectifier_WMSmenuAction())); 109 109 110 110 wmsJMenu.addSeparator(); 111 wmsJMenu.add(new JMenuItem(new AbstractAction("Blank Layer") { 111 wmsJMenu.add(new JMenuItem(new 112 JosmAction("Blank Layer", "blankmenu", "Open a blank WMS layer to load data from a file", 0, 0, false) { 112 113 public void actionPerformed(ActionEvent ev) { 113 114 Main.main.addLayer(new WMSLayer()); … … 116 117 wmsJMenu.addSeparator(); 117 118 wmsJMenu.add(new JMenuItem(new Help_WMSmenuAction())); 119 setEnabledAll(false); 120 } 121 122 private static void setEnabledAll(boolean isEnabled) { 123 for(int i=0; i < wmsJMenu.getItemCount(); i++) { 124 JMenuItem item = wmsJMenu.getItem(i); 125 126 if(item != null) item.setEnabled(isEnabled); 127 } 118 128 } 119 129 120 130 public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) { 121 131 if (oldFrame==null && newFrame!=null) { 122 wmsJMenu.setEnabled(true);132 setEnabledAll(true); 123 133 Main.map.toolBarActions.addSeparator(); 124 134 Main.map.toolBarActions.add(new IconToggleButton 125 135 (new WMSAdjustAction(Main.map))); 126 136 } else if (oldFrame!=null && newFrame==null ) { 127 wmsJMenu.setEnabled(false);137 setEnabledAll(false); 128 138 } 129 139 }
Note:
See TracChangeset
for help on using the changeset viewer.