Changeset 301 in josm for src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
- Timestamp:
- 2007-08-08T14:56:38+02:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/dialogs/CommandStackDialog.java
r298 r301 19 19 import org.openstreetmap.josm.command.Command; 20 20 import org.openstreetmap.josm.gui.MapFrame; 21 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;22 import org.openstreetmap.josm.gui.layer.Layer;23 import org.openstreetmap.josm.gui.layer.OsmDataLayer;24 21 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener; 25 22 … … 31 28 public CommandStackDialog(final MapFrame mapFrame) { 32 29 super(tr("Command Stack"), "commandstack", tr("Open a list of all commands (undo buffer)."), KeyEvent.VK_O, 100); 33 mapFrame.mapView.addLayerChangeListener(new LayerChangeListener(){ 34 public void activeLayerChange(Layer oldLayer, Layer newLayer) {} 35 public void layerAdded(Layer newLayer) { 36 if (newLayer instanceof OsmDataLayer) 37 Main.main.editLayer().listenerCommands.add(CommandStackDialog.this); 38 } 39 public void layerRemoved(Layer oldLayer) { 40 if (oldLayer instanceof OsmDataLayer) 41 Main.main.editLayer().listenerCommands.remove(CommandStackDialog.this); 42 } 43 }); 44 if (mapFrame.mapView.editLayer != null) 45 mapFrame.mapView.editLayer.listenerCommands.add(this); 30 Main.main.undoRedo.listenerCommands.add(this); 46 31 47 32 tree.setRootVisible(false); … … 75 60 if (Main.map == null || Main.map.mapView == null || Main.map.mapView.editLayer == null) 76 61 return; 77 Collection<Command> commands = Main.main. editLayer().commands;62 Collection<Command> commands = Main.main.undoRedo.commands; 78 63 DefaultMutableTreeNode root = new DefaultMutableTreeNode(); 79 64 for (Command c : commands)
Note:
See TracChangeset
for help on using the changeset viewer.