- Timestamp:
- 2010-02-03T09:07:36+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java
r2880 r2930 165 165 conflicts = editLayer == null?new ConflictCollection():editLayer.getConflicts(); 166 166 model.fireContentChanged(); 167 updateTitle(conflicts.size()); 168 } 169 170 private void updateTitle(int conflictsCount) { 171 if (conflictsCount > 0) { 172 setTitle(tr("Conflicts: {0} unresolved", conflicts.size())); 173 } else { 174 setTitle(tr("Conflict")); 175 } 167 176 } 168 177 -
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 -
trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r2912 r2930 174 174 SelectionEventManager.getInstance().removeSelectionListener(this); 175 175 MapView.removeEditLayerChangeListener(this); 176 updateTitle(0, 0, 0); 176 177 } 177 178 … … 274 275 } 275 276 276 if( (nodes+ways+relations) != 0) { 277 setTitle(tr("Sel.: Rel.:{0} / Ways:{1} / Nodes:{2}", relations, ways, nodes)); 278 } else { 279 setTitle(tr("Selection")); 280 } 277 updateTitle(nodes, ways, relations); 281 278 282 279 if (selectionHistory != null && newSelection.size() > 0 && !newSelection.equals(historyIgnoreSelection)) { … … 293 290 selectionHistory.removeLast(); 294 291 } 292 } 293 } 294 295 private void updateTitle(int nodes, int ways, int relations) { 296 if( (nodes+ways+relations) != 0) { 297 setTitle(tr("Sel.: Rel.:{0} / Ways:{1} / Nodes:{2}", relations, ways, nodes)); 298 } else { 299 setTitle(tr("Selection")); 295 300 } 296 301 } -
trunk/src/org/openstreetmap/josm/tools/CopyList.java
r2907 r2930 130 130 131 131 private void rangeCheck(int index) { 132 if (index >= size || index < 0) throw new IndexOutOfBoundsException( );132 if (index >= size || index < 0) throw new IndexOutOfBoundsException("Index:" + index + " Size:" + size); 133 133 } 134 134
Note:
See TracChangeset
for help on using the changeset viewer.