Changeset 2779 in josm
- Timestamp:
- 2010-01-08T22:15:11+01:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/conflict/tags
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/conflict/tags/CombinePrimitiveResolverDialog.java
r2712 r2779 365 365 public void actionPerformed(ActionEvent arg0) { 366 366 setVisible(false); 367 pnlTagConflictResolver.rememberPreferences(); 367 368 } 368 369 -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolver.java
r2512 r2779 30 30 /** selects wheter only tags with conflicts are displayed */ 31 31 private JCheckBox cbShowTagsWithConflictsOnly; 32 private JCheckBox cbShowTagsWithMultiValuesOnly; 32 33 33 34 protected JPanel buildInfoPanel() { … … 50 51 public void stateChanged(ChangeEvent e) { 51 52 model.setShowTagsWithConflictsOnly(cbShowTagsWithConflictsOnly.isSelected()); 53 cbShowTagsWithMultiValuesOnly.setEnabled(cbShowTagsWithConflictsOnly.isSelected()); 52 54 } 53 55 } … … 56 58 Main.pref.getBoolean(getClass().getName() + ".showTagsWithConflictsOnly", false) 57 59 ); 60 pnl.add(cbShowTagsWithMultiValuesOnly = new JCheckBox(tr("Show tags with multiple values only")), gc); 61 cbShowTagsWithMultiValuesOnly.addChangeListener( 62 new ChangeListener() { 63 public void stateChanged(ChangeEvent e) { 64 model.setShowTagsWithMultiValuesOnly(cbShowTagsWithMultiValuesOnly.isSelected()); 65 } 66 } 67 ); 68 cbShowTagsWithMultiValuesOnly.setSelected( 69 Main.pref.getBoolean(getClass().getName() + ".showTagsWithMultiValuesOnly", false) 70 ); 71 cbShowTagsWithMultiValuesOnly.setEnabled(cbShowTagsWithConflictsOnly.isSelected()); 58 72 return pnl; 59 73 } … … 65 79 public void rememberPreferences() { 66 80 Main.pref.put(getClass().getName() + ".showTagsWithConflictsOnly", cbShowTagsWithConflictsOnly.isSelected()); 81 Main.pref.put(getClass().getName() + ".showTagsWithMultiValuesOnly", cbShowTagsWithMultiValuesOnly.isSelected()); 67 82 } 68 83 -
trunk/src/org/openstreetmap/josm/gui/conflict/tags/TagConflictResolverModel.java
r2512 r2779 28 28 private PropertyChangeSupport support; 29 29 private boolean showTagsWithConflictsOnly = false; 30 private boolean showTagsWithMultiValuesOnly = false; 30 31 31 32 public TagConflictResolverModel() { … … 91 92 if (showTagsWithConflictsOnly) { 92 93 keys.retainAll(keysWithConflicts); 94 if (showTagsWithMultiValuesOnly) { 95 Set<String> keysWithMultiValues = new HashSet<String>(); 96 for (String key: keys) { 97 if (decisions.get(key).canKeepAll()) { 98 keysWithMultiValues.add(key); 99 } 100 } 101 keys.retainAll(keysWithMultiValues); 102 } 93 103 for (String key: tags.getKeys()) { 94 104 if (!decisions.get(key).isDecided() && !keys.contains(key)) { … … 144 154 MultiValueDecisionType type = (MultiValueDecisionType)value; 145 155 switch(type) { 146 147 148 149 150 151 156 case KEEP_NONE: 157 decision.keepNone(); 158 break; 159 case KEEP_ALL: 160 decision.keepAll(); 161 break; 152 162 } 153 163 } … … 193 203 public void setShowTagsWithConflictsOnly(boolean showTagsWithConflictsOnly) { 194 204 this.showTagsWithConflictsOnly = showTagsWithConflictsOnly; 205 rebuild(); 206 } 207 208 /** 209 * Sets whether all conflicts or only conflicts with multiple values are displayed 210 * 211 * @param showTagsWithMultiValuesOnly if true, only tags with multiple values are displayed 212 */ 213 public void setShowTagsWithMultiValuesOnly(boolean showTagsWithMultiValuesOnly) { 214 this.showTagsWithMultiValuesOnly = showTagsWithMultiValuesOnly; 195 215 rebuild(); 196 216 }
Note:
See TracChangeset
for help on using the changeset viewer.