Ignore:
Timestamp:
2016-11-12T14:52:32+01:00 (7 years ago)
Author:
Don-vip
Message:

see #10387 - refactor various actions and commands so they can be used without data layer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/command/AddCommand.java

    r11140 r11240  
    1111import javax.swing.Icon;
    1212
     13import org.openstreetmap.josm.data.osm.DataSet;
    1314import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1415import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
     
    4748    public AddCommand(OsmDataLayer layer, OsmPrimitive osm) {
    4849        super(layer);
     50        this.osm = Objects.requireNonNull(osm, "osm");
     51    }
     52
     53    /**
     54     * Creates the command and specify the element to add in the context of the given data set.
     55     * @param data The data set. Must not be {@code null}
     56     * @param osm The primitive to add
     57     * @since 11240
     58     */
     59    public AddCommand(DataSet data, OsmPrimitive osm) {
     60        super(data);
    4961        this.osm = Objects.requireNonNull(osm, "osm");
    5062    }
Note: See TracChangeset for help on using the changeset viewer.