Changeset 2869 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
- Timestamp:
- 17.01.2010 11:56:07 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
r2847 r2869 47 47 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 48 48 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher; 49 import org.openstreetmap.josm.tools.CheckParameterUtil; 49 50 import org.openstreetmap.josm.tools.ImageProvider; 50 51 import org.openstreetmap.josm.tools.Shortcut; 51 52 import org.openstreetmap.josm.tools.ImageProvider.OverlayPosition; 52 import org.openstreetmap.josm.tools.CheckParameterUtil;53 53 54 54 /** … … 70 70 */ 71 71 static public void createInstance(MapFrame mapFrame) { 72 if (instance != null) 73 throw new IllegalStateException("Dialog was already created"); 72 74 instance = new LayerListDialog(mapFrame); 73 75 } … … 115 117 activateLayerAction = new ActivateLayerAction(); 116 118 adaptTo(activateLayerAction, selectionModel); 117 MapView.addLayerChangeListener(activateLayerAction);118 119 buttonPanel.add(new SideButton(activateLayerAction)); 119 120 … … 153 154 selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); 154 155 model = new LayerListModel(selectionModel); 155 MapView.addLayerChangeListener(model);156 156 157 157 // create the list control … … 185 185 186 186 @Override 187 public void tearDown() { 187 public void showNotify() { 188 MapView.addLayerChangeListener(activateLayerAction); 189 MapView.addLayerChangeListener(model); 190 } 191 192 @Override 193 public void hideNotify() { 188 194 MapView.removeLayerChangeListener(model); 189 195 MapView.removeLayerChangeListener(activateLayerAction); … … 240 246 } 241 247 ); 248 } 249 250 @Override 251 public void destroy() { 252 super.destroy(); 253 instance = null; 242 254 } 243 255
Note: See TracChangeset
for help on using the changeset viewer.
