- Timestamp:
- 2010-02-14T16:47:44+01:00 (15 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/data
-
Property svn:ignore
set to
elemstyles.xml
-
Property svn:ignore
set to
-
trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java
r2842 r2985 274 274 Main.main.undoRedo.add(cmd); 275 275 RelationDialogManager.getRelationDialogManager().close(layer, toDelete); 276 layer.fireDataChange();277 276 } 278 277 } -
trunk/src/org/openstreetmap/josm/data/osm/DataSetMerger.java
r2935 r2985 24 24 25 25 /** the collection of conflicts created during merging */ 26 private ConflictCollection conflicts;26 private final ConflictCollection conflicts; 27 27 28 28 /** the target dataset for merging */ … … 35 35 * Key is the primitive id in their dataset, the value is the id in my dataset 36 36 */ 37 private Map<Long, Long> mergedMap;37 private final Map<Long, Long> mergedMap; 38 38 /** a set of primitive ids for which we have to fix references (to nodes and 39 39 * to relation members) after the first phase of merging 40 40 */ 41 private Set<PrimitiveId> objectsWithChildrenToMerge;42 private Set<OsmPrimitive> deletedObjectsToUnlink;41 private final Set<PrimitiveId> objectsWithChildrenToMerge; 42 private final Set<OsmPrimitive> deletedObjectsToUnlink; 43 43 44 44 /** -
trunk/src/org/openstreetmap/josm/data/osm/Filters.java
r2854 r2985 1 1 package org.openstreetmap.josm.data.osm; 2 2 3 import static org.openstreetmap.josm.tools.I18n.tr;4 3 import static org.openstreetmap.josm.tools.I18n.trc; 5 4 -
trunk/src/org/openstreetmap/josm/data/osm/event/DataSetListener.java
r2711 r2985 24 24 /** 25 25 * A listener listening for all DataSet changes. 26 * INCOMPLETE (missing relation-related events)!27 26 * 27 * @see DataSetListenerAdapter 28 28 * @author nenik 29 29 */ -
trunk/src/org/openstreetmap/josm/gui/dialogs/FilterDialog.java
r2869 r2985 26 26 import org.openstreetmap.josm.data.osm.Filter; 27 27 import org.openstreetmap.josm.data.osm.Filters; 28 import org.openstreetmap.josm.gui.MapView; 28 import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent; 29 import org.openstreetmap.josm.data.osm.event.DataSetListener; 30 import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter; 31 import org.openstreetmap.josm.data.osm.event.DatasetEventManager; 32 import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter.Listener; 33 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode; 29 34 import org.openstreetmap.josm.gui.SideButton; 30 import org.openstreetmap.josm.gui.layer.DataChangeListener;31 import org.openstreetmap.josm.gui.layer.Layer;32 import org.openstreetmap.josm.gui.layer.OsmDataLayer;33 35 import org.openstreetmap.josm.tools.Shortcut; 34 36 … … 37 39 * @author Petr_Dlouhý 38 40 */ 39 public class FilterDialog extends ToggleDialog implements DataChangeListener, MapView.LayerChangeListener, TableModelListener { 41 public class FilterDialog extends ToggleDialog implements Listener , TableModelListener { 42 40 43 private JTable userTable; 41 44 private Filters filters = new Filters(); … … 46 49 private SideButton downButton; 47 50 51 private final DataSetListener listenerAdapter = new DataSetListenerAdapter(this); 52 48 53 public FilterDialog(){ 49 54 super(tr("Filter"), "filter", tr("Filter objects and hide/disable them."), … … 54 59 @Override 55 60 public void showNotify() { 56 MapView.addLayerChangeListener(this);61 DatasetEventManager.getInstance().addDatasetListener(listenerAdapter, FireMode.IN_EDT_CONSOLIDATED); 57 62 } 58 63 59 64 @Override 60 65 public void hideNotify() { 61 MapView.removeLayerChangeListener(this);66 DatasetEventManager.getInstance().removeDatasetListener(listenerAdapter); 62 67 } 63 68 … … 182 187 } 183 188 184 public void layerRemoved(Layer a) { 185 if (a instanceof OsmDataLayer) { 186 ((OsmDataLayer)a).listenerDataChanged.remove(this); 187 } 188 } 189 190 public void layerAdded(Layer a) { 191 if (a instanceof OsmDataLayer) { 192 ((OsmDataLayer)a).listenerDataChanged.add(this); 193 } 194 } 195 196 public void activeLayerChange(Layer oldLayer, Layer newLayer) { 197 filters.filter(); 198 } 199 200 public void dataChanged(OsmDataLayer l){ 189 public void processDatasetEvent(AbstractDatasetChangedEvent event) { 201 190 filters.filter(); 202 191 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationMemberTask.java
r2789 r2985 100 100 public void run() { 101 101 curLayer.mergeFrom(dataSet); 102 curLayer.fireDataChange();103 102 curLayer.onPostDownloadFromServer(); 104 103 } -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/DownloadRelationTask.java
r2847 r2985 100 100 public void run() { 101 101 layer.mergeFrom(allDownloads); 102 layer.fireDataChange();103 102 layer.onPostDownloadFromServer(); 104 103 Main.map.repaint(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r2974 r2985 115 115 DataSet.selListeners.add(memberTableModel); 116 116 getLayer().data.addDataSetListener(memberTableModel); 117 getLayer().listenerDataChanged.add(memberTableModel);118 117 selectionTableModel = new SelectionTableModel(getLayer()); 119 118 DataSet.selListeners.add(selectionTableModel); … … 1031 1030 // 1032 1031 getLayer().data.fireSelectionChanged(); 1033 getLayer().fireDataChange();1034 1032 GenericRelationEditor.this.setRelation(newRelation); 1035 1033 RelationDialogManager.getRelationDialogManager().updateContext( -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/MemberTableModel.java
r2886 r2985 43 43 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; 44 44 import org.openstreetmap.josm.gui.dialogs.relation.WayConnectionType.Direction; 45 import org.openstreetmap.josm.gui.layer.DataChangeListener;46 45 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 47 46 48 public class MemberTableModel extends AbstractTableModel implements TableModelListener, SelectionChangedListener, Data ChangeListener, DataSetListener{47 public class MemberTableModel extends AbstractTableModel implements TableModelListener, SelectionChangedListener, DataSetListener { 49 48 50 49 /** … … 83 82 } 84 83 85 /* --------------------------------------------------------------------------- */86 /* Interface DataChangeListener */87 /* --------------------------------------------------------------------------- */88 public void dataChanged(OsmDataLayer l) {89 if (l != this.layer) return;90 // just trigger a repaint91 Collection<RelationMember> sel = getSelectedMembers();92 fireTableDataChanged();93 setSelectedMembers(sel);94 }95 84 /* --------------------------------------------------------------------------- */ 96 85 /* Interface DataSetListener */ -
trunk/src/org/openstreetmap/josm/gui/history/HistoryBrowserModel.java
r2850 r2985 37 37 import org.openstreetmap.josm.gui.MapView; 38 38 import org.openstreetmap.josm.gui.MapView.LayerChangeListener; 39 import org.openstreetmap.josm.gui.layer.DataChangeListener;40 39 import org.openstreetmap.josm.gui.layer.Layer; 41 40 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 67 66 * @see HistoryBrowser 68 67 */ 69 public class HistoryBrowserModel extends Observable implements LayerChangeListener, DataSetListener , DataChangeListener{68 public class HistoryBrowserModel extends Observable implements LayerChangeListener, DataSetListener { 70 69 //private static Logger logger = Logger.getLogger(HistoryBrowserModel.class.getName()); 71 70 … … 102 101 if (getEditLayer() != null) { 103 102 getEditLayer().data.addDataSetListener(this); 104 getEditLayer().listenerDataChanged.add(this);105 103 } 106 104 MapView.addLayerChangeListener(this); … … 822 820 823 821 public void dataChanged(DataChangedEvent event) { 824 dataChanged(getEditLayer()); 825 } 826 827 public void otherDatasetChange(AbstractDatasetChangedEvent event) { 828 // Irrelevant 829 } 830 831 /* ---------------------------------------------------------------------- */ 832 /* DataChangeListener */ 833 /* ---------------------------------------------------------------------- */ 834 public void dataChanged(OsmDataLayer l) { 835 if (l != getEditLayer()) return; 836 OsmPrimitive primitive = l.data.getPrimitiveById(history.getId(), history.getType()); 822 OsmPrimitive primitive = event.getDataset().getPrimitiveById(history.getId(), history.getType()); 837 823 HistoryOsmPrimitive latest; 838 824 if (canShowAsLatest(primitive)) { … … 843 829 setLatest(latest); 844 830 fireModelChange(); 831 } 832 833 public void otherDatasetChange(AbstractDatasetChangedEvent event) { 834 // Irrelevant 845 835 } 846 836 … … 861 851 OsmDataLayer l = (OsmDataLayer)newLayer; 862 852 l.data.addDataSetListener(this); 863 l.listenerDataChanged.add(this);864 853 OsmPrimitive primitive = l.data.getPrimitiveById(history.getId(), history.getType()); 865 854 HistoryOsmPrimitive latest; -
trunk/src/org/openstreetmap/josm/gui/layer/DataChangeListener.java
r1169 r2985 2 2 package org.openstreetmap.josm.gui.layer; 3 3 4 import org.openstreetmap.josm.data.osm.event.DataSetListener; 5 6 /** 7 * 8 * 9 * @deprecated Use {@link DataSetListener} instead 10 */ 11 @Deprecated 4 12 public interface DataChangeListener { 5 13 14 @Deprecated 6 15 public void dataChanged(OsmDataLayer l); 7 16 -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r2982 r2985 159 159 private ConflictCollection conflicts; 160 160 161 /** 162 * @deprecated Use {@link DataSet#addDataSetListener(org.openstreetmap.josm.data.osm.event.DataSetListener)} instead 163 * @see DataSetListener, DatasetEventManager 164 */ 165 @Deprecated 161 166 public final LinkedList<DataChangeListener> listenerDataChanged = new LinkedList<DataChangeListener>(); 162 167
Note:
See TracChangeset
for help on using the changeset viewer.