Ignore:
Timestamp:
2017-09-04T00:50:22+02:00 (9 years ago)
Author:
Don-vip
Message:

see #13036 - see #15229 - see #15182 - make Commands depends only on a DataSet, not a Layer. This removes a lot of GUI dependencies

File:
1 edited

Legend:

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

    r12636 r12718  
    3535 * one atomic action on a specific dataset, such as move or delete.
    3636 *
    37  * The command remembers the {@link OsmDataLayer} it is operating on.
     37 * The command remembers the {@link DataSet} it is operating on.
    3838 *
    3939 * @author imi
     
    135135    private Map<OsmPrimitive, PrimitiveData> cloneMap = new HashMap<>();
    136136
    137     /** the layer which this command is applied to */
     137    /**
     138     * the layer which this command is applied to
     139     * @deprecated to be removed end of 2017. Use {@link #data} instead
     140     */
     141    @Deprecated
    138142    private final OsmDataLayer layer;
    139143
     
    146150    public Command() {
    147151        this.layer = MainApplication.getLayerManager().getEditLayer();
    148         this.data = layer != null ? layer.data : null;
     152        this.data = layer != null ? layer.data : Main.main.getEditDataSet();
    149153    }
    150154
     
    154158     * @param layer the data layer. Must not be null.
    155159     * @throws IllegalArgumentException if layer is null
    156      */
     160     * @deprecated to be removed end of 2017. Use {@link #Command(DataSet)} instead
     161     */
     162    @Deprecated
    157163    public Command(OsmDataLayer layer) {
    158164        CheckParameterUtil.ensureParameterNotNull(layer, "layer");
     
    216222     * @param oldLayer the old layer that was removed
    217223     * @return true if this command is invalid after that layer is removed.
    218      */
     224     * @deprecated to be removed end of 2017.
     225     */
     226    @Deprecated
    219227    public boolean invalidBecauselayerRemoved(Layer oldLayer) {
    220228        return layer == oldLayer;
     
    234242     * Replies the layer this command is (or was) applied to.
    235243     * @return the layer this command is (or was) applied to
    236      */
     244     * @deprecated to be removed end of 2017. Use {@link #getAffectedDataSet} instead
     245     */
     246    @Deprecated
    237247    protected OsmDataLayer getLayer() {
    238248        return layer;
     
    371381     * Invalidate all layers that were affected by this command.
    372382     * @see Layer#invalidate()
    373      */
     383     * @deprecated to be removed end of 2017.
     384     */
     385    @Deprecated
    374386    public void invalidateAffectedLayers() {
    375387        OsmDataLayer layer = getLayer();
Note: See TracChangeset for help on using the changeset viewer.