Changeset 2098 in josm


Ignore:
Timestamp:
2009-09-12T15:15:42+02:00 (15 years ago)
Author:
Gubaer
Message:

see #3347: patches by singularita@…: Merging nodes, fixing duplicate nodes, unglueing ways and splitting ways is very slow with large datasets

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

Legend:

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

    r2095 r2098  
    6666    }
    6767
    68     protected void completeTagCollectionWithMissingTags(TagCollection tc, Collection<Node> mergedNodes) {
     68    protected static void completeTagCollectionWithMissingTags(TagCollection tc, Collection<Node> mergedNodes) {
    6969        for (String key: tc.getKeys()) {
    7070            // make sure the empty value is in the tag set if a tag is not present
     
    8282    }
    8383
    84     protected void completeTagCollectionForEditing(TagCollection tc) {
     84    protected static void completeTagCollectionForEditing(TagCollection tc) {
    8585        for (String key: tc.getKeys()) {
    8686            // make sure the empty value is in the tag set such that we can delete the tag
     
    9898     * @return the selected target node
    9999     */
    100     public Node selectTargetNode(Collection<Node> candidates) {
     100    public static Node selectTargetNode(Collection<Node> candidates) {
    101101        // Find which node to merge into (i.e. which one will be left)
    102102        // - this should be combined from two things:
     
    124124    }
    125125
    126 
    127126    /**
    128127     * Merges the nodes in <code>node</code> onto one of the nodes. Uses the dataset
     
    136135     *
    137136     */
    138     public Command mergeNodes(OsmDataLayer layer, Collection<Node> nodes, Node targetNode) throws IllegalArgumentException{
     137    public static Command mergeNodes(OsmDataLayer layer, Collection<Node> nodes, Node targetNode) throws IllegalArgumentException{
    139138        if (layer == null)
    140139            throw new IllegalArgumentException(tr("parameter ''{0}'' must not be null", "nodes"));
     
    163162     * @throw IllegalArgumentException thrown if  backreferences.getSource() != layer.data
    164163     */
    165     public Command mergeNodes(OsmDataLayer layer, BackreferencedDataSet backreferences, Collection<Node> nodes, Node targetNode) {
     164    public static Command mergeNodes(OsmDataLayer layer, BackreferencedDataSet backreferences, Collection<Node> nodes, Node targetNode) {
    166165        if (layer == null)
    167166            throw new IllegalArgumentException(tr("parameter ''{0}'' must not be null", "nodes"));
  • trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java

    r2025 r2098  
    3636     * Execute the command and add it to the intern command queue.
    3737     */
    38     public void add(final Command c) {
     38    public void addNoRedraw(final Command c) {
    3939        c.executeCommand();
    4040        commands.add(c);
    4141        redoCommands.clear();
     42    }
     43
     44    public void afterAdd() {
    4245        if (Main.map != null && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) {
    4346            OsmDataLayer data = (OsmDataLayer)Main.map.mapView.getActiveLayer();
     
    4851        // the command may have changed the selection so tell the listeners about the current situation
    4952        DataSet.fireSelectionChanged(Main.main.getCurrentDataSet().getSelected());
     53    }
     54
     55    /**
     56     * Execute the command and add it to the intern command queue.
     57     */
     58    public void add(final Command c) {
     59        addNoRedraw(c);
     60        afterAdd();
    5061    }
    5162
Note: See TracChangeset for help on using the changeset viewer.