Ignore:
Timestamp:
2009-09-02T21:17:52+02:00 (15 years ago)
Author:
Gubaer
Message:

new: improved dialog for uploading/saving modified layers on exit
new: improved dialog for uploading/saving modified layers if layers are deleted
new: new progress monitor which can delegate rendering to any Swing component
more setters/getters for properties in OSM data classes (fields are @deprecated); started to update references in the code base

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

Legend:

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

    r1990 r2025  
    3636        super.executeCommand();
    3737        osm.cloneFrom(newOsm);
    38         osm.modified = true;
     38        osm.setModified(true);
    3939        return true;
    4040    }
     
    4747        String msg = "";
    4848        switch(OsmPrimitiveType.from(osm)) {
    49         case NODE: msg = marktr("Change node {0}"); break;
    50         case WAY: msg = marktr("Change way {0}"); break;
    51         case RELATION: msg = marktr("Change relation {0}"); break;
     49            case NODE: msg = marktr("Change node {0}"); break;
     50            case WAY: msg = marktr("Change way {0}"); break;
     51            case RELATION: msg = marktr("Change relation {0}"); break;
    5252        }
    5353        return new DefaultMutableTreeNode(
  • trunk/src/org/openstreetmap/josm/command/ChangePropertyCommand.java

    r2008 r2025  
    7777        if (value == null) {
    7878            for (OsmPrimitive osm : objects) {
    79                 osm.modified = true;
     79                osm.setModified(true);
    8080                osm.remove(key);
    8181            }
    8282        } else {
    8383            for (OsmPrimitive osm : objects) {
    84                 osm.modified = true;
     84                osm.setModified(true);
    8585                osm.put(key, value);
    8686            }
  • trunk/src/org/openstreetmap/josm/command/ChangeRelationMemberRoleCommand.java

    r1990 r2025  
    5151        relation.getMember(position).role = newRole;
    5252
    53         oldModified = relation.modified;
    54         relation.modified = true;
     53        oldModified = relation.isModified();
     54        relation.setModified(true);
    5555        return true;
    5656    }
     
    5858    @Override public void undoCommand() {
    5959        relation.getMember(position).role = oldRole;
    60         relation.modified = oldModified;
     60        relation.setModified(oldModified);
    6161    }
    6262
  • trunk/src/org/openstreetmap/josm/command/Command.java

    r1894 r2025  
    8989            e.getKey().cloneFrom(e.getValue());
    9090        }
    91         getLayer().setModified(true);
    9291    }
    9392
     
    114113        if (o != null)
    115114            return o;
    116         Main.debug("unable to find osm with id: " + osm.id + " hashCode: " + osm.hashCode());
     115        Main.debug("unable to find osm with id: " + osm.getId() + " hashCode: " + osm.hashCode());
    117116        for (OsmPrimitive t : cloneMap.keySet()) {
    118117            OsmPrimitive to = cloneMap.get(t);
    119             Main.debug("now: " + t.id + " hashCode: " + t.hashCode());
    120             Main.debug("orig: " + to.id + " hashCode: " + to.hashCode());
     118            Main.debug("now: " + t.getId() + " hashCode: " + t.hashCode());
     119            Main.debug("orig: " + to.getId() + " hashCode: " + to.hashCode());
    121120        }
    122121        return o;
  • trunk/src/org/openstreetmap/josm/command/CoordinateConflictResolveCommand.java

    r1954 r2025  
    4545        return new DefaultMutableTreeNode(
    4646                new JLabel(
    47                         tr("Resolve conflicts in coordinates in {0}",conflict.getMy().id),
     47                        tr("Resolve conflicts in coordinates in {0}",conflict.getMy().getId()),
    4848                        ImageProvider.get("data", "object"),
    4949                        JLabel.HORIZONTAL
  • trunk/src/org/openstreetmap/josm/command/DeleteCommand.java

    r1990 r2025  
    110110            String msg = "";
    111111            switch(OsmPrimitiveType.from(primitive)) {
    112             case NODE: msg = "Delete node {0}"; break;
    113             case WAY: msg = "Delete way {0}"; break;
    114             case RELATION:msg = "Delete relation {0}"; break;
     112                case NODE: msg = "Delete node {0}"; break;
     113                case WAY: msg = "Delete way {0}"; break;
     114                case RELATION:msg = "Delete relation {0}"; break;
    115115            }
    116116
     
    131131            apiname = t.getAPIName();
    132132            switch(t) {
    133             case NODE: msg = trn("Delete {0} node", "Delete {0} nodes", toDelete.size(), toDelete.size()); break;
    134             case WAY: msg = trn("Delete {0} way", "Delete {0} ways", toDelete.size(), toDelete.size()); break;
    135             case RELATION: msg = trn("Delete {0} relation", "Delete {0} relations", toDelete.size(), toDelete.size()); break;
     133                case NODE: msg = trn("Delete {0} node", "Delete {0} nodes", toDelete.size(), toDelete.size()); break;
     134                case WAY: msg = trn("Delete {0} way", "Delete {0} ways", toDelete.size(), toDelete.size()); break;
     135                case RELATION: msg = trn("Delete {0} relation", "Delete {0} relations", toDelete.size(), toDelete.size()); break;
    136136            }
    137137        }
     
    355355            }
    356356            Way w = (Way) primitive;
    357             if (w.id == 0) { // new ways with id == 0 are fine,
     357            if (w.getId() == 0) { // new ways with id == 0 are fine,
    358358                continue; // process existing ways only
    359359            }
     
    363363            // nodes ...
    364364            for (Node n : wnew.getNodes()) {
    365                 if (n.id != 0 || !primitivesToDelete.contains(n)) {
     365                if (n.getId() != 0 || !primitivesToDelete.contains(n)) {
    366366                    nodesToKeep.add(n);
    367367                }
     
    426426        if (a != null) {
    427427            for (OsmPrimitive osm : primitivesToDelete) {
    428                 if (osm instanceof Node && osm.id != 0) {
     428                if (osm instanceof Node && osm.getId() != 0) {
    429429                    Node n = (Node) osm;
    430430                    if (!a.contains(n.getCoor())) {
  • trunk/src/org/openstreetmap/josm/command/DeletedStateConflictResolveCommand.java

    r1954 r2025  
    4545        return new DefaultMutableTreeNode(
    4646                new JLabel(
    47                         tr("Resolve conflicts in deleted state in {0}",conflict.getMy().id),
     47                        tr("Resolve conflicts in deleted state in {0}",conflict.getMy().getId()),
    4848                        ImageProvider.get("data", "object"),
    4949                        JLabel.HORIZONTAL
     
    6262
    6363        if (decision.equals(MergeDecisionType.KEEP_MINE)) {
    64             if (conflict.getMy().deleted) {
     64            if (conflict.getMy().isDeleted()) {
    6565                // because my was involved in a conflict it my still be referred
    6666                // to from a way or a relation. Fix this now.
  • trunk/src/org/openstreetmap/josm/command/MoveCommand.java

    r2017 r2025  
    6969            OldState os = new OldState();
    7070            os.latlon = new LatLon(n.getCoor());
    71             os.modified = n.modified;
     71            os.modified = n.isModified();
    7272            oldState.add(os);
    7373        }
     
    9393        for (Node n : nodes) {
    9494            n.setEastNorth(n.getEastNorth().add(x, y));
    95             n.modified = true;
     95            n.setModified(true);
    9696        }
    9797        return true;
     
    103103            OldState os = it.next();
    104104            n.setCoor(os.latlon);
    105             n.modified = os.modified;
     105            n.setModified(os.modified);
    106106        }
    107107    }
Note: See TracChangeset for help on using the changeset viewer.