Changeset 11993 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2017-04-24T01:39:24+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java
r11713 r11993 1296 1296 1297 1297 @Override 1298 public Collection<? extends OsmPrimitive> getPreservedPrimitives() { 1299 DataSet ds = getLayerManager().getEditDataSet(); 1300 return ds != null ? ds.getSelected() : null; 1301 } 1302 1303 @Override 1298 1304 public boolean layerIsSupported(Layer l) { 1299 1305 return l instanceof OsmDataLayer; -
trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java
r11713 r11993 8 8 import java.awt.event.MouseListener; 9 9 import java.awt.event.MouseMotionListener; 10 import java.util.Collection; 11 import java.util.Collections; 10 12 11 13 import org.openstreetmap.josm.Main; … … 13 15 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent; 14 16 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener; 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 15 18 import org.openstreetmap.josm.gui.MapFrame; 16 19 import org.openstreetmap.josm.gui.layer.Layer; … … 201 204 readPreferences(); 202 205 } 206 207 /** 208 * Gets a collection of primitives that should not be hidden by the filter. 209 * @return The primitives that the filter should not hide. 210 * @since 11993 211 */ 212 public Collection<? extends OsmPrimitive> getPreservedPrimitives() { 213 return Collections.emptySet(); 214 } 203 215 } -
trunk/src/org/openstreetmap/josm/data/osm/FilterMatcher.java
r11385 r11993 6 6 import java.util.List; 7 7 8 import org.openstreetmap.josm.Main; 8 9 import org.openstreetmap.josm.actions.search.SearchAction.SearchMode; 9 10 import org.openstreetmap.josm.actions.search.SearchCompiler; … … 224 225 private static FilterType test(List<FilterInfo> filters, OsmPrimitive primitive, boolean hidden) { 225 226 226 if (primitive.isIncomplete() )227 if (primitive.isIncomplete() || Main.map.mapMode.getPreservedPrimitives().contains(primitive)) 227 228 return FilterType.NOT_FILTERED; 228 229 -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
r11366 r11993 29 29 30 30 import org.openstreetmap.josm.Main; 31 import org.openstreetmap.josm.actions.mapmode.MapMode; 31 32 import org.openstreetmap.josm.actions.search.SearchAction; 32 33 import org.openstreetmap.josm.data.osm.Filter; … … 46 47 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent; 47 48 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; 49 import org.openstreetmap.josm.gui.MapFrame; 50 import org.openstreetmap.josm.gui.MapFrame.MapModeChangeListener; 48 51 import org.openstreetmap.josm.gui.SideButton; 49 52 import org.openstreetmap.josm.tools.ImageProvider; … … 57 60 * @author Petr_Dlouhý 58 61 */ 59 public class FilterDialog extends ToggleDialog implements DataSetListener {62 public class FilterDialog extends ToggleDialog implements DataSetListener, MapModeChangeListener { 60 63 61 64 private JTable userTable; … … 82 85 public void showNotify() { 83 86 DatasetEventManager.getInstance().addDatasetListener(this, FireMode.IN_EDT_CONSOLIDATED); 87 MapFrame.addMapModeChangeListener(this); 84 88 filterModel.executeFilters(); 85 89 } … … 88 92 public void hideNotify() { 89 93 DatasetEventManager.getInstance().removeDatasetListener(this); 94 MapFrame.removeMapModeChangeListener(this); 90 95 filterModel.clearFilterFlags(); 91 96 Main.map.mapView.repaint(); … … 108 113 }; 109 114 115 /** 116 * Builds the GUI. 117 */ 110 118 protected void build() { 111 119 userTable = new UserTable(filterModel); … … 375 383 } 376 384 385 @Override 386 public void mapModeChange(MapMode oldMapMode, MapMode newMapMode) { 387 filterModel.executeFilters(); 388 } 389 377 390 /** 378 * This method is intende tfor Plugins getting the filtermodel and using .addFilter() to391 * This method is intended for Plugins getting the filtermodel and using .addFilter() to 379 392 * add a new filter. 380 393 * @return the filtermodel
Note:
See TracChangeset
for help on using the changeset viewer.