Changeset 14555 in josm for trunk/src/org
- Timestamp:
- 2018-12-12T15:12:36+01:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/dialogs/changeset
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java
r14547 r14555 65 65 import org.openstreetmap.josm.io.NetworkManager; 66 66 import org.openstreetmap.josm.io.OnlineResource; 67 import org.openstreetmap.josm.tools.Destroyable; 67 68 import org.openstreetmap.josm.tools.ImageProvider; 68 69 import org.openstreetmap.josm.tools.InputMapUtils; … … 104 105 instance.setVisible(true); 105 106 instance.dispose(); 107 for (Component c : instance.pnlChangesetDetailTabs.getComponents()) { 108 if (c instanceof Destroyable) { 109 ((Destroyable) c).destroy(); 110 } 111 } 106 112 instance = null; 107 113 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetDetailPanel.java
r14547 r14555 11 11 import java.awt.Insets; 12 12 import java.awt.event.ActionEvent; 13 import java.awt.event.ComponentAdapter;14 import java.awt.event.ComponentEvent;15 13 import java.beans.PropertyChangeEvent; 16 14 import java.beans.PropertyChangeListener; … … 46 44 import org.openstreetmap.josm.io.NetworkManager; 47 45 import org.openstreetmap.josm.io.OnlineResource; 46 import org.openstreetmap.josm.tools.Destroyable; 48 47 import org.openstreetmap.josm.tools.ImageProvider; 49 48 import org.openstreetmap.josm.tools.Utils; … … 55 54 * @since 2689 56 55 */ 57 public class ChangesetDetailPanel extends JPanel implements PropertyChangeListener, ChangesetAware {56 public class ChangesetDetailPanel extends JPanel implements PropertyChangeListener, ChangesetAware, Destroyable { 58 57 59 58 // CHECKSTYLE.OFF: SingleSpaceSeparator … … 104 103 tb.add(actZoomInCurrentLayerAction); 105 104 MainApplication.getLayerManager().addActiveLayerChangeListener(actZoomInCurrentLayerAction); 106 107 addComponentListener(108 new ComponentAdapter() {109 @Override110 public void componentShown(ComponentEvent e) {111 MainApplication.getLayerManager().addAndFireActiveLayerChangeListener(actSelectInCurrentLayer);112 MainApplication.getLayerManager().addAndFireActiveLayerChangeListener(actZoomInCurrentLayerAction);113 }114 115 @Override116 public void componentHidden(ComponentEvent e) {117 // make sure the listener is unregistered when the panel becomes invisible118 MainApplication.getLayerManager().removeActiveLayerChangeListener(actSelectInCurrentLayer);119 MainApplication.getLayerManager().removeActiveLayerChangeListener(actZoomInCurrentLayerAction);120 }121 }122 );123 105 124 106 pnl.add(tb); … … 477 459 return currentChangeset; 478 460 } 461 462 @Override 463 public void destroy() { 464 MainApplication.getLayerManager().removeActiveLayerChangeListener(actSelectInCurrentLayer); 465 MainApplication.getLayerManager().removeActiveLayerChangeListener(actZoomInCurrentLayerAction); 466 } 479 467 }
Note:
See TracChangeset
for help on using the changeset viewer.