- Timestamp:
- 2009-07-25T18:44:11+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/PasteAction.java
r1834 r1844 120 120 @Override 121 121 protected void updateEnabledState() { 122 if (getCurrentDataSet() == null ) {122 if (getCurrentDataSet() == null || Main.pasteBuffer == null) { 123 123 setEnabled(false); 124 124 return; 125 }126 if (Main.pasteBuffer == null) {127 setEnabled(false);128 125 } 129 126 setEnabled( -
trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java
r1820 r1844 18 18 import org.openstreetmap.josm.corrector.ReverseWayTagCorrector; 19 19 import org.openstreetmap.josm.corrector.UserCancelException; 20 import org.openstreetmap.josm.data.SelectionChangedListener;21 20 import org.openstreetmap.josm.data.osm.DataSet; 22 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 23 22 import org.openstreetmap.josm.data.osm.Way; 24 import org.openstreetmap.josm.gui.layer.Layer;25 import org.openstreetmap.josm.gui.layer.Layer.LayerChangeListener;26 23 import org.openstreetmap.josm.tools.Shortcut; 27 24 28 public final class ReverseWayAction extends JosmAction implements SelectionChangedListener, LayerChangeListener{25 public final class ReverseWayAction extends JosmAction { 29 26 30 27 public ReverseWayAction() { 31 28 super(tr("Reverse Ways"), "wayflip", tr("Reverse the direction of all selected ways."), 32 29 Shortcut.registerShortcut("tools:reverse", tr("Tool: {0}", tr("Reverse Ways")), KeyEvent.VK_R, Shortcut.GROUP_EDIT), true); 33 DataSet.selListeners.add(this);34 Layer.listeners.add(this);35 refreshEnabled();36 30 } 37 31 … … 93 87 } 94 88 95 protected void refreshEnabled() { 89 @Override 90 protected void updateEnabledState() { 96 91 setEnabled(getNumWaysInSelection() > 0); 97 92 } 98 99 public void activeLayerChange(Layer oldLayer, Layer newLayer) {100 refreshEnabled();101 }102 103 public void layerAdded(Layer newLayer) {104 refreshEnabled();105 106 }107 108 public void layerRemoved(Layer oldLayer) {109 refreshEnabled();110 }111 112 public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {113 refreshEnabled();114 }115 93 } -
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r1842 r1844 31 31 import java.util.Map; 32 32 import java.util.Set; 33 import java.util.logging.Logger; 33 34 34 35 import javax.swing.JComponent; … … 62 63 */ 63 64 public class DrawAction extends MapMode implements MapViewPaintable, SelectionChangedListener, AWTEventListener { 65 static private final Logger logger = Logger.getLogger(DrawAction.class.getName()); 66 64 67 final private Cursor cursorCrosshair; 65 68 final private Cursor cursorJoinNode; … … 239 242 } catch (SecurityException ex) { 240 243 } 244 245 // when exiting we let everybody know about the currently selected 246 // primitives 247 // 248 DataSet.fireSelectionChanged(getCurrentDataSet().getSelected()); 241 249 } 242 250 … … 274 282 */ 275 283 private void finishDrawing() { 284 // let everybody else know about the current selection 285 // 286 DataSet.fireSelectionChanged(getCurrentDataSet().getSelected()); 276 287 lastUsedNode = null; 277 288 wayIsFinished = true; -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r1842 r1844 18 18 import java.util.List; 19 19 import java.util.TreeSet; 20 import java.util.logging.Logger; 20 21 21 22 import javax.swing.JOptionPane; … … 59 60 */ 60 61 public class SelectAction extends MapMode implements SelectionEnded { 62 static private final Logger logger = Logger.getLogger(SelectAction.class.getName()); 61 63 62 64 /**
Note:
See TracChangeset
for help on using the changeset viewer.