Changeset 2912 in josm


Ignore:
Timestamp:
2010-01-31T16:13:51+01:00 (10 years ago)
Author:
jttt
Message:

Fixed #4330 java.lang.ArrayIndexOutOfBoundsException: 6 >= 6, added SelectionEventManager (similar to DatasetEventManager)

Location:
trunk/src/org/openstreetmap/josm
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/search/SearchAction.java

    r2863 r2912  
    5757        SearchSetting s = lastSearch;
    5858        if (s == null) {
    59             s = new SearchSetting("", SearchMode.replace, false /* case insensitive */, false /* no regexp */);
     59            s = new SearchSetting();
    6060        }
    6161        SearchSetting se = showSearchDialog(s);
     
    303303        public boolean regexSearch;
    304304
     305        public SearchSetting() {
     306            this("", SearchMode.replace, false /* case insensitive */, false /* no regexp */);
     307        }
     308
    305309        public SearchSetting(String text, SearchMode mode, boolean caseSensitive, boolean regexSearch) {
    306             super();
    307310            this.caseSensitive = caseSensitive;
    308311            this.regexSearch = regexSearch;
     
    312315
    313316        public SearchSetting(SearchSetting original) {
    314             super();
    315             this.caseSensitive = original.caseSensitive;
    316             this.regexSearch = original.regexSearch;
    317             this.mode = original.mode;
    318             this.text = original.text;
     317            this(original.text, original.mode, original.caseSensitive, original.regexSearch);
    319318        }
    320319
  • trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java

    r2906 r2912  
    6060
    6161    public static class Always extends Match {
     62        public static Always INSTANCE = new Always();
    6263        @Override public boolean match(OsmPrimitive osm) {
    6364            return true;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java

    r2903 r2912  
    4040import org.openstreetmap.josm.data.osm.Relation;
    4141import org.openstreetmap.josm.data.osm.Way;
     42import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
     43import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
    4244import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
    4345import org.openstreetmap.josm.gui.MapView;
     
    163165    @Override
    164166    public void showNotify() {
    165         DataSet.selListeners.add(this);
     167        SelectionEventManager.getInstance().addSelectionListener(this, FireMode.IN_EDT_CONSOLIDATED);
    166168        MapView.addEditLayerChangeListener(this);
    167169        updateSelection();
     
    170172    @Override
    171173    public void hideNotify() {
    172         DataSet.selListeners.remove(this);
     174        SelectionEventManager.getInstance().removeSelectionListener(this);
    173175        MapView.removeEditLayerChangeListener(this);
    174176    }
     
    277279            setTitle(tr("Selection"));
    278280        }
    279        
     281
    280282        if (selectionHistory != null && newSelection.size() > 0 && !newSelection.equals(historyIgnoreSelection)) {
    281283            historyIgnoreSelection = null;
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r2906 r2912  
    5959import org.openstreetmap.josm.command.SequenceCommand;
    6060import org.openstreetmap.josm.data.SelectionChangedListener;
    61 import org.openstreetmap.josm.data.osm.DataSet;
    6261import org.openstreetmap.josm.data.osm.Node;
    6362import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    6867import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter;
    6968import org.openstreetmap.josm.data.osm.event.DatasetEventManager;
     69import org.openstreetmap.josm.data.osm.event.SelectionEventManager;
    7070import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode;
    7171import org.openstreetmap.josm.gui.DefaultNameFormatter;
     
    154154        DatasetEventManager.getInstance().addDatasetListener(dataChangedAdapter, FireMode.IN_EDT_CONSOLIDATED);
    155155        listOfUsedTags.rebuildNecessary();
    156         DataSet.selListeners.add(this);
     156        SelectionEventManager.getInstance().addSelectionListener(this, FireMode.IN_EDT_CONSOLIDATED);
    157157        MapView.addEditLayerChangeListener(this);
    158158        updateSelection();
     
    163163        DatasetEventManager.getInstance().removeDatasetListener(listOfUsedTags);
    164164        DatasetEventManager.getInstance().removeDatasetListener(dataChangedAdapter);
    165         DataSet.selListeners.remove(this);
     165        SelectionEventManager.getInstance().removeSelectionListener(this);
    166166        MapView.removeEditLayerChangeListener(this);
    167167    }
Note: See TracChangeset for help on using the changeset viewer.