Changeset 5759 in josm for trunk/src/org
- Timestamp:
- 2013-03-06T22:41:42+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/command/Command.java
r5266 r5759 1 1 //License: GPL. Copyright 2007 by Immanuel Scholz and others 2 2 package org.openstreetmap.josm.command; 3 4 import static org.openstreetmap.josm.tools.I18n.tr;5 3 6 4 import java.awt.GridBagLayout; … … 16 14 import javax.swing.JOptionPane; 17 15 import javax.swing.JPanel; 18 import javax.swing.tree.DefaultMutableTreeNode;19 import javax.swing.tree.MutableTreeNode;20 16 21 17 import org.openstreetmap.josm.Main; … … 59 55 60 56 /** the layer which this command is applied to */ 61 private OsmDataLayer layer; 62 57 private final OsmDataLayer layer; 58 59 /** 60 * Creates a new command in the context of the current edit layer, if any 61 */ 63 62 public Command() { 64 this.layer = Main.map .mapView.getEditLayer();63 this.layer = Main.map != null && Main.map.mapView != null ? Main.map.mapView.getEditLayer() : null; 65 64 } 66 65 … … 79 78 * Executes the command on the dataset. This implementation will remember all 80 79 * primitives returned by fillModifiedData for restoring them on undo. 80 * @return true 81 81 */ 82 82 public boolean executeCommand() { … … 124 124 * Lets other commands access the original version 125 125 * of the object. Usually for undoing. 126 * @param osm The requested OSM object 127 * @return The original version of the requested object, if any 126 128 */ 127 129 public PrimitiveData getOrig(OsmPrimitive osm) { 128 PrimitiveData o = cloneMap.get(osm); 129 if (o != null) 130 return o; 131 for (OsmPrimitive t : cloneMap.keySet()) { 132 PrimitiveData to = cloneMap.get(t); 133 } 134 return o; 130 return cloneMap.get(osm); 135 131 } 136 132
Note:
See TracChangeset
for help on using the changeset viewer.