Ignore:
Timestamp:
2018-08-12T14:27:32+02:00 (6 years ago)
Author:
Don-vip
Message:

see #15229 - deprecate Main.main - new class OsmDataManager

Location:
trunk/src/org/openstreetmap/josm/command
Files:
4 edited

Legend:

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

    r13852 r14143  
    219219     *
    220220     * Note that changes are not applied to the data yet. You have to
    221      * submit the command first, i.e. {@code Main.main.undoredo.add(result)}.
     221     * submit the command first, i.e. {@code UndoRedoHandler.getInstance().add(result)}.
    222222     *
    223223     * @param way the way to split. Must not be null.
     
    237237     *
    238238     * Note that changes are not applied to the data yet. You have to
    239      * submit the command first, i.e. {@code Main.main.undoredo.add(result)}.
     239     * submit the command first, i.e. {@code UndoRedoHandler.getInstance().add(result)}.
    240240     *
    241241     * @param way the way to split. Must not be null.
     
    464464     *
    465465     * Note that changes are not applied to the data yet. You have to
    466      * submit the command first, i.e. {@code Main.main.undoredo.add(result)}.
     466     * submit the command first, i.e. {@code UndoRedoHandler.getInstance().add(result)}.
    467467     *
    468468     * Replies null if the way couldn't be split at the given nodes.
  • trunk/src/org/openstreetmap/josm/command/conflict/ConflictAddCommand.java

    r13173 r14143  
    1515import org.openstreetmap.josm.data.osm.DataSet;
    1616import org.openstreetmap.josm.data.osm.DefaultNameFormatter;
     17import org.openstreetmap.josm.data.osm.OsmDataManager;
    1718import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1819import org.openstreetmap.josm.tools.ImageProvider;
     
    6667    public void undoCommand() {
    6768        DataSet ds = getAffectedDataSet();
    68         if (Main.main != null && !Main.main.containsDataSet(ds)) {
     69        if (!OsmDataManager.getInstance().containsDataSet(ds)) {
    6970            Logging.warn(tr("Layer ''{0}'' does not exist any more. Cannot remove conflict for object ''{1}''.",
    7071                    ds.getName(),
  • trunk/src/org/openstreetmap/josm/command/conflict/ConflictResolveCommand.java

    r13434 r14143  
    66import java.util.Objects;
    77
    8 import org.openstreetmap.josm.Main;
    98import org.openstreetmap.josm.command.Command;
    109import org.openstreetmap.josm.data.conflict.Conflict;
    1110import org.openstreetmap.josm.data.conflict.ConflictCollection;
    1211import org.openstreetmap.josm.data.osm.DataSet;
     12import org.openstreetmap.josm.data.osm.OsmDataManager;
    1313import org.openstreetmap.josm.tools.Logging;
    1414
     
    6363
    6464        DataSet ds = getAffectedDataSet();
    65         if (Main.main != null) {
    66             if (!Main.main.containsDataSet(ds)) {
    67                 Logging.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
    68                         this.toString(),
    69                         ds.getName()
    70                 ));
    71                 return;
    72             }
     65        if (!OsmDataManager.getInstance().containsDataSet(ds)) {
     66            Logging.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
     67                    this.toString(),
     68                    ds.getName()
     69            ));
     70            return;
     71        }
    7372
    74             Main.main.setActiveDataSet(ds);
    75         }
     73        OsmDataManager.getInstance().setActiveDataSet(ds);
    7674        reconstituteConflicts();
    7775    }
  • trunk/src/org/openstreetmap/josm/command/conflict/RelationMemberConflictResolverCommand.java

    r13434 r14143  
    1010import javax.swing.Icon;
    1111
    12 import org.openstreetmap.josm.Main;
    1312import org.openstreetmap.josm.data.conflict.Conflict;
    1413import org.openstreetmap.josm.data.osm.DataSet;
     14import org.openstreetmap.josm.data.osm.OsmDataManager;
    1515import org.openstreetmap.josm.data.osm.OsmPrimitive;
    1616import org.openstreetmap.josm.data.osm.Relation;
     
    7373    public void undoCommand() {
    7474        DataSet ds = getAffectedDataSet();
    75         if (!Main.main.containsDataSet(ds)) {
     75        if (!OsmDataManager.getInstance().containsDataSet(ds)) {
    7676            Logging.warn(tr("Cannot undo command ''{0}'' because layer ''{1}'' is not present any more",
    7777                    this.toString(),
     
    8181        }
    8282
    83         Main.main.setActiveDataSet(ds);
     83        OsmDataManager.getInstance().setActiveDataSet(ds);
    8484
    8585        // restore the former state
Note: See TracChangeset for help on using the changeset viewer.