- Timestamp:
- 2010-03-09T13:27:07+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r2930 r3099 19 19 import java.util.NoSuchElementException; 20 20 21 import javax.swing.AbstractAction; 21 22 import javax.swing.BorderFactory; 22 23 import javax.swing.DefaultListModel; … … 46 47 import org.openstreetmap.josm.gui.OsmPrimitivRenderer; 47 48 import org.openstreetmap.josm.gui.SideButton; 49 import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener; 48 50 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 51 import org.openstreetmap.josm.tools.ImageProvider; 49 52 import org.openstreetmap.josm.tools.Shortcut; 50 53 … … 75 78 private JPopupMenu popupMenu; 76 79 private JMenuItem zoomToElement; 80 81 private SelectAction actSelect; 77 82 78 83 /** … … 113 118 114 119 JPanel buttonPanel = getButtonPanel(2); 115 116 selectButton = new SideButton(marktr("Select"), "select", "SelectionList", 117 tr("Set the selected elements on the map to the selected items in the list above."), 118 new ActionListener() { 119 public void actionPerformed(ActionEvent e) { 120 updateMap(); 121 } 122 }); 120 // 121 // selectButton = new SideButton(marktr("Select"), "select", "SelectionList", 122 // tr("Set the selected elements on the map to the selected items in the list above."), 123 // new ActionListener() { 124 // public void actionPerformed(ActionEvent e) { 125 // updateMap(); 126 // } 127 // }); 128 selectButton = new SideButton(actSelect = new SelectAction()); 123 129 buttonPanel.add(selectButton); 124 130 BasicArrowButton selectionHistoryMenuButton = createArrowButton(selectButton); … … 167 173 SelectionEventManager.getInstance().addSelectionListener(this, FireMode.IN_EDT_CONSOLIDATED); 168 174 MapView.addEditLayerChangeListener(this); 175 MapView.addEditLayerChangeListener(actSelect); 169 176 updateSelection(); 170 177 } … … 174 181 SelectionEventManager.getInstance().removeSelectionListener(this); 175 182 MapView.removeEditLayerChangeListener(this); 183 MapView.removeEditLayerChangeListener(actSelect); 176 184 updateTitle(0, 0, 0); 177 185 } … … 391 399 updateSelection(); 392 400 } 401 402 class SelectAction extends AbstractAction implements EditLayerChangeListener { 403 public SelectAction() { 404 putValue(NAME, tr("Select")); 405 putValue(SHORT_DESCRIPTION, tr("Set the selected elements on the map to the selected items in the list above.")); 406 putValue(SMALL_ICON, ImageProvider.get("dialogs","select")); 407 updateEnabledState(); 408 } 409 410 @Override 411 public void actionPerformed(ActionEvent e) { 412 updateMap(); 413 } 414 415 public void updateEnabledState() { 416 setEnabled(Main.main != null && Main.main.getEditLayer() != null); 417 } 418 419 @Override 420 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 421 updateEnabledState(); 422 } 423 } 393 424 }
Note:
See TracChangeset
for help on using the changeset viewer.