Changeset 10454 in josm for trunk/src/org


Ignore:
Timestamp:
2016-06-22T09:47:26+02:00 (8 years ago)
Author:
Don-vip
Message:

fix #12999 - Exception after resolving conflicts (patch by michael2402, modified) - gsoc-core

Location:
trunk/src/org/openstreetmap/josm/gui
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ConflictResolver.java

    r10378 r10454  
    347347
    348348    /**
     349     * Adds all registered listeners by this conflict resolver
     350     * @see #unregisterListeners()
     351     * @since 10454
     352     */
     353    public void registerListeners() {
     354        nodeListMerger.registerListeners();
     355        relationMemberMerger.registerListeners();
     356    }
     357
     358    /**
    349359     * Removes all registered listeners by this conflict resolver
    350360     */
    351361    public void unregisterListeners() {
    352         nodeListMerger.unlinkAsListener();
    353         relationMemberMerger.unlinkAsListener();
     362        nodeListMerger.unregisterListeners();
     363        relationMemberMerger.unregisterListeners();
    354364    }
    355365
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ListMerger.java

    r10378 r10454  
    883883    }
    884884
    885     public void unlinkAsListener() {
    886         myEntriesTable.unlinkAsListener();
    887         mergedEntriesTable.unlinkAsListener();
    888         theirEntriesTable.unlinkAsListener();
     885    /**
     886     * Adds all registered listeners by this merger
     887     * @see #unregisterListeners()
     888     * @since 10454
     889     */
     890    public void registerListeners() {
     891        myEntriesTable.registerListeners();
     892        mergedEntriesTable.registerListeners();
     893        theirEntriesTable.registerListeners();
     894    }
     895
     896    /**
     897     * Removes all registered listeners by this merger
     898     * @since 10454
     899     */
     900    public void unregisterListeners() {
     901        myEntriesTable.unregisterListeners();
     902        mergedEntriesTable.unregisterListeners();
     903        theirEntriesTable.unregisterListeners();
    889904    }
    890905
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java

    r10369 r10454  
    5252
    5353    @Override
     54    public void addNotify() {
     55        super.addNotify();
     56        registerListeners();
     57    }
     58
     59    @Override
    5460    public void setVisible(boolean isVisible) {
    5561        String geom = getClass().getName() + ".geometry";
     
    6268                new WindowGeometry(this).remember(geom);
    6369            }
    64             unregisterListeners();
    6570        }
    6671        super.setVisible(isVisible);
     
    99104    private void registerListeners() {
    100105        resolver.addPropertyChangeListener(applyResolutionAction);
     106        resolver.registerListeners();
    101107    }
    102108
     
    126132        resolver.addPropertyChangeListener(this);
    127133        HelpUtil.setHelpContext(this.getRootPane(), ht("Dialog/Conflict"));
    128 
    129         registerListeners();
    130134    }
    131135
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java

    r10424 r10454  
    756756            selectionTableModel.unregister();
    757757            memberTableModel.unregister();
    758             memberTable.unlinkAsListener();
     758            memberTable.unregisterListeners();
    759759            if (windowMenuItem != null) {
    760760                Main.main.menu.windowMenu.remove(windowMenuItem);
  • trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTable.java

    r10413 r10454  
    139139
    140140    @Override
    141     public void unlinkAsListener() {
    142         super.unlinkAsListener();
     141    public void unregisterListeners() {
     142        super.unregisterListeners();
    143143        Main.getLayerManager().removeLayerChangeListener(zoomToGap);
    144144        Main.getLayerManager().removeActiveLayerChangeListener(zoomToGap);
  • trunk/src/org/openstreetmap/josm/gui/widgets/OsmPrimitivesTable.java

    r10386 r10454  
    8383        JPopupMenu menu = new JPopupMenu();
    8484        zoomToAction = buildZoomToAction();
    85         Main.getLayerManager().addLayerChangeListener(zoomToAction);
    86         Main.getLayerManager().addActiveLayerChangeListener(zoomToAction);
    8785        getSelectionModel().addListSelectionListener(zoomToAction);
    8886        menu.add(zoomToAction);
     
    9088    }
    9189
    92     public void unlinkAsListener() {
     90    /**
     91     * Adds all registered listeners by this table
     92     * @see #unregisterListeners()
     93     * @since 10454
     94     */
     95    public void registerListeners() {
     96        Main.getLayerManager().addLayerChangeListener(zoomToAction);
     97        Main.getLayerManager().addActiveLayerChangeListener(zoomToAction);
     98    }
     99
     100    /**
     101     * Removes all registered listeners by this table
     102     * @since 10454
     103     */
     104    public void unregisterListeners() {
    93105        Main.getLayerManager().removeLayerChangeListener(zoomToAction);
    94106        Main.getLayerManager().removeActiveLayerChangeListener(zoomToAction);
Note: See TracChangeset for help on using the changeset viewer.