Changeset 2930 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
- Timestamp:
- 03.02.2010 09:07:36 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictResolutionDialog.java
r2915 r2930 21 21 import javax.swing.JOptionPane; 22 22 import javax.swing.JPanel; 23 import javax.swing.WindowConstants; 23 24 24 25 import org.openstreetmap.josm.Main; … … 43 44 private ConflictResolver resolver; 44 45 46 private ApplyResolutionAction applyResolutionAction; 47 45 48 /** 46 49 * restore position and size on screen from preference settings … … 95 98 Main.pref.put("conflictresolutiondialog.width", Integer.toString(d.width)); 96 99 Main.pref.put("conflictresolutiondialog.height", Integer.toString(d.height)); 100 } 101 102 @Override 103 public void removeNotify() { 104 super.removeNotify(); 105 unregisterListeners(); 97 106 } 98 107 … … 104 113 } else { 105 114 rememberPositionAndDimension(); 115 unregisterListeners(); 106 116 } 107 117 super.setVisible(isVisible); 118 } 119 120 private void closeDialog() { 121 setVisible(false); 122 dispose(); 108 123 } 109 124 … … 117 132 pnl.setLayout(new FlowLayout(FlowLayout.CENTER)); 118 133 119 ApplyResolutionAction applyResolutionAction = new ApplyResolutionAction(); 120 resolver.addPropertyChangeListener(applyResolutionAction); 134 applyResolutionAction = new ApplyResolutionAction(); 121 135 JButton btn = new JButton(applyResolutionAction); 122 136 btn.setName("button.apply"); … … 135 149 } 136 150 151 private void registerListeners() { 152 resolver.addPropertyChangeListener(applyResolutionAction); 153 } 154 155 private void unregisterListeners() { 156 resolver.removePropertyChangeListener(applyResolutionAction); 157 } 158 137 159 /** 138 160 * builds the GUI 139 161 */ 140 162 protected void build() { 163 setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 141 164 updateTitle(); 142 165 getContentPane().setLayout(new BorderLayout()); … … 149 172 resolver.addPropertyChangeListener(this); 150 173 HelpUtil.setHelpContext(this.getRootPane(), "Dialog/ConflictDialog"); 174 175 registerListeners(); 151 176 } 152 177 … … 172 197 173 198 public void actionPerformed(ActionEvent arg0) { 174 setVisible(false);199 closeDialog(); 175 200 } 176 201 } … … 231 256 switch(ret) { 232 257 case JOptionPane.YES_OPTION: 233 setVisible(false);258 closeDialog(); 234 259 break; 235 260 default: … … 240 265 Command cmd = resolver.buildResolveCommand(); 241 266 Main.main.undoRedo.add(cmd); 242 setVisible(false);267 closeDialog(); 243 268 } catch(OperationCancelledException e) { 244 269 // do nothing. Exception already reported
Note: See TracChangeset
for help on using the changeset viewer.
