Changeset 729 in josm for trunk/src/org/openstreetmap/josm


Ignore:
Timestamp:
2008-07-18T22:55:11+02:00 (11 years ago)
Author:
stoecker
Message:

added automatic tag correction system by Robin Rattay

Location:
trunk/src/org/openstreetmap/josm
Files:
7 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/ReverseWayAction.java

    r627 r729  
    1616import org.openstreetmap.josm.command.Command;
    1717import org.openstreetmap.josm.command.SequenceCommand;
     18import org.openstreetmap.josm.corrector.ReverseWayTagCorrector;
    1819import org.openstreetmap.josm.data.osm.Relation;
    1920import org.openstreetmap.josm.data.osm.Node;
     
    4748                return;
    4849        }
    49         Collection<Command> c = new LinkedList<Command>();
    50         for (Way w : sel) {
    51                 Way wnew = new Way(w);
     50
     51        boolean propertiesUpdated = false;
     52                ReverseWayTagCorrector reverseWayTagCorrector = new ReverseWayTagCorrector();
     53                Collection<Command> c = new LinkedList<Command>();
     54                for (Way w : sel) {
     55                        Way wnew = new Way(w);
    5256                        Collections.reverse(wnew.nodes);
    53                 c.add(new ChangeCommand(w, wnew));
    54         }
    55         Main.main.undoRedo.add(new SequenceCommand(tr("Reverse ways"), c));
    56         Main.map.repaint();
     57                        if (Main.pref.getBoolean("tag-correction.reverse-way", true))
     58                                propertiesUpdated = reverseWayTagCorrector.execute(wnew) || propertiesUpdated;
     59                        c.add(new ChangeCommand(w, wnew));
     60                }
     61                Main.main.undoRedo.add(new SequenceCommand(tr("Reverse ways"), c));
     62                if (propertiesUpdated)
     63                        Main.map.getPropertiesDialog().selectionChanged(Main.ds.getSelected());
     64                Main.map.repaint();
    5765    }
    5866}
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r627 r729  
    6767        public final ButtonGroup toolGroup = new ButtonGroup();
    6868
     69        private PropertiesDialog propertiesDialog;
    6970
    7071        public MapFrame() {
     
    9596
    9697                addToggleDialog(new LayerListDialog(this));
    97                 addToggleDialog(new PropertiesDialog(this));
     98                addToggleDialog(propertiesDialog = new PropertiesDialog(this));
    9899                addToggleDialog(new HistoryDialog());
    99100                addToggleDialog(new SelectionListDialog());
     
    188189                        panel.add(statusLine, BorderLayout.SOUTH);
    189190        }
     191
     192        public final PropertiesDialog getPropertiesDialog() {
     193        return propertiesDialog;
     194    }
    190195}
Note: See TracChangeset for help on using the changeset viewer.