Changeset 3225 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2010-05-09T14:41:39+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 1 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadReferrersTask.java
r3083 r3225 164 164 new Runnable() { 165 165 public void run() { 166 targetLayer.fireDataChange();167 166 targetLayer.onPostDownloadFromServer(); 168 167 Main.map.mapView.repaint(); -
trunk/src/org/openstreetmap/josm/data/UndoRedoHandler.java
r3143 r3225 12 12 import org.openstreetmap.josm.gui.MapView; 13 13 import org.openstreetmap.josm.gui.layer.Layer; 14 import org.openstreetmap.josm.gui.layer.OsmDataLayer;15 14 import org.openstreetmap.josm.gui.layer.OsmDataLayer.CommandQueueListener; 16 15 … … 48 47 49 48 public void afterAdd() { 50 if (Main.map != null && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) {51 OsmDataLayer data = (OsmDataLayer)Main.map.mapView.getActiveLayer();52 data.fireDataChange();53 }54 49 fireCommandsChanged(); 55 50 … … 76 71 c.undoCommand(); 77 72 redoCommands.push(c); 78 if (Main.map != null && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) {79 OsmDataLayer data = (OsmDataLayer)Main.map.mapView.getActiveLayer();80 data.fireDataChange();81 }82 73 fireCommandsChanged(); 83 74 Collection<? extends OsmPrimitive> newSelection = Main.main.getCurrentDataSet().getSelected(); … … 98 89 c.executeCommand(); 99 90 commands.add(c); 100 if (Main.map != null && Main.map.mapView.getActiveLayer() instanceof OsmDataLayer) {101 OsmDataLayer data = (OsmDataLayer)Main.map.mapView.getActiveLayer();102 data.fireDataChange();103 }104 91 fireCommandsChanged(); 105 92 Collection<? extends OsmPrimitive> newSelection = Main.main.getCurrentDataSet().getSelected(); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ChildRelationBrowser.java
r3083 r3225 23 23 import javax.swing.JPanel; 24 24 import javax.swing.JScrollPane; 25 import javax.swing.SwingUtilities;26 25 import javax.swing.event.TreeSelectionEvent; 27 26 import javax.swing.event.TreeSelectionListener; … … 330 329 "There were {0} conflicts during import.", 331 330 conflictsCount, conflictsCount), 332 trn("Conflict in data", "Conflicts in data", conflictsCount),333 JOptionPane.WARNING_MESSAGE331 trn("Conflict in data", "Conflicts in data", conflictsCount), 332 JOptionPane.WARNING_MESSAGE 334 333 ); 335 334 } … … 384 383 final DataSetMerger visitor = new DataSetMerger(getLayer().data, ds); 385 384 visitor.merge(); 386 // FIXME: this is necessary because there are dialogs listening387 // for DataChangeEvents which manipulate Swing components on this388 // thread.389 //390 SwingUtilities.invokeLater(new Runnable() {391 public void run() {392 getLayer().fireDataChange();393 }394 });395 385 if (!visitor.getConflicts().isEmpty()) { 396 386 getLayer().getConflicts().add(visitor.getConflicts()); … … 485 475 "There were {0} conflicts during import.", 486 476 conflictsCount, conflictsCount), 487 trn("Conflict in data", "Conflicts in data", conflictsCount),488 JOptionPane.WARNING_MESSAGE477 trn("Conflict in data", "Conflicts in data", conflictsCount), 478 JOptionPane.WARNING_MESSAGE 489 479 ); 490 480 } … … 495 485 final DataSetMerger visitor = new DataSetMerger(getLayer().data, dataSet); 496 486 visitor.merge(); 497 // FIXME: this is necessary because there are dialogs listening498 // for DataChangeEvents which manipulate Swing components on this499 // thread.500 //501 SwingUtilities.invokeLater(new Runnable() {502 public void run() {503 getLayer().fireDataChange();504 }505 });506 487 if (!visitor.getConflicts().isEmpty()) { 507 488 getLayer().getConflicts().add(visitor.getConflicts()); -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditor.java
r3214 r3225 69 69 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField; 70 70 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList; 71 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionManager;72 71 import org.openstreetmap.josm.tools.ImageProvider; 73 72 import org.openstreetmap.josm.tools.Shortcut; … … 1074 1073 Main.main.undoRedo.add(new ChangeCommand(getRelation(), editedRelation)); 1075 1074 getLayer().data.fireSelectionChanged(); 1076 getLayer().fireDataChange();1077 1075 // this will refresh the snapshot and update the dialog title 1078 1076 // -
trunk/src/org/openstreetmap/josm/gui/dialogs/relation/ParentRelationLoadingTask.java
r3083 r3225 174 174 new Runnable() { 175 175 public void run() { 176 getLayer().fireDataChange();177 176 getLayer().onPostDownloadFromServer(); 178 177 } -
trunk/src/org/openstreetmap/josm/gui/io/UploadLayerTask.java
r3083 r3225 146 146 return; 147 147 layer.cleanupAfterUpload(processedPrimitives); 148 layer.fireDataChange();149 148 layer.onPostUploadToServer(); 150 149 -
trunk/src/org/openstreetmap/josm/gui/io/UploadPrimitivesTask.java
r3083 r3225 212 212 public void run() { 213 213 layer.cleanupAfterUpload(processedPrimitives); 214 layer.fireDataChange();215 214 layer.onPostUploadToServer(); 216 215 ChangesetCache.getInstance().update(changeset); -
trunk/src/org/openstreetmap/josm/gui/layer/OsmDataLayer.java
r3207 r3225 25 25 import java.util.HashMap; 26 26 import java.util.HashSet; 27 import java.util.LinkedList;28 27 import java.util.Map; 29 28 … … 165 164 166 165 /** 167 * @deprecated Use {@link DataSet#addDataSetListener(org.openstreetmap.josm.data.osm.event.DataSetListener)} instead168 * @see DataSetListener, DatasetEventManager169 */170 @Deprecated171 public final LinkedList<DataChangeListener> listenerDataChanged = new LinkedList<DataChangeListener>();172 173 /**174 166 * a paint texture for non-downloaded area 175 167 */ … … 330 322 Main.main.undoRedo.add(cmd); 331 323 } 332 fireDataChange();333 324 // repaint to make sure new data is displayed properly. 334 325 Main.map.mapView.repaint(); … … 546 537 } 547 538 548 public void fireDataChange() {549 setRequiresSaveToFile(true);550 setRequiresUploadToServer(true);551 for (DataChangeListener dcl : listenerDataChanged) {552 dcl.dataChanged(this);553 }554 }555 556 539 public static GpxData toGpxData(DataSet data, File file) { 557 540 GpxData gpxData = new GpxData(); … … 739 722 public void processDatasetEvent(AbstractDatasetChangedEvent event) { 740 723 isChanged = true; 724 setRequiresSaveToFile(true); 725 setRequiresUploadToServer(true); 741 726 } 742 727 -
trunk/src/org/openstreetmap/josm/gui/preferences/MapPaintPreference.java
r2745 r3225 83 83 84 84 public boolean ok() { 85 Boolean restart = Main.pref.put("mappaint.style.enable-defaults", enableDefault. getSelectedObjects() != null);86 if(Main.pref.put("mappaint.icon.enable-defaults", enableIconDefault. getSelectedObjects() != null)) {85 Boolean restart = Main.pref.put("mappaint.style.enable-defaults", enableDefault.isSelected()); 86 if(Main.pref.put("mappaint.icon.enable-defaults", enableIconDefault.isSelected())) { 87 87 restart = true; 88 88 } -
trunk/src/org/openstreetmap/josm/io/OsmImporter.java
r3083 r3225 47 47 public void run() { 48 48 Main.main.addLayer(layer); 49 layer.fireDataChange();50 49 layer.onPostLoadFromFile(); 51 50 }
Note:
See TracChangeset
for help on using the changeset viewer.