Changeset 12432 in josm
- Timestamp:
- 2017-06-25T11:53:30+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/autofilter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilter.java
r12400 r12432 1 1 // License: GPL. For details, see LICENSE file. 2 2 package org.openstreetmap.josm.gui.autofilter; 3 4 import java.util.Objects; 3 5 4 6 import org.openstreetmap.josm.data.osm.Filter; … … 48 50 return filter; 49 51 } 52 53 @Override 54 public int hashCode() { 55 return Objects.hash(filter); 56 } 57 58 @Override 59 public boolean equals(Object obj) { 60 if (this == obj) 61 return true; 62 if (obj == null || getClass() != obj.getClass()) 63 return false; 64 AutoFilter other = (AutoFilter) obj; 65 return Objects.equals(filter, other.filter); 66 } 50 67 } -
trunk/src/org/openstreetmap/josm/gui/autofilter/AutoFilterManager.java
r12413 r12432 141 141 filter.text = enabledRule.getKey() + "=" + value; 142 142 String label = enabledRule.getValueFormatter().apply(value); 143 AutoFilterButton button = new AutoFilterButton(new AutoFilter(label, filter.text, filter)); 143 AutoFilter autoFilter = new AutoFilter(label, filter.text, filter); 144 AutoFilterButton button = new AutoFilterButton(autoFilter); 145 if (autoFilter.equals(currentAutoFilter)) { 146 button.getModel().setPressed(true); 147 } 144 148 buttons.put(value, button); 145 149 maxWidth = Math.max(maxWidth, button.getPreferredSize().width);
Note:
See TracChangeset
for help on using the changeset viewer.