Changeset 2488 in josm for trunk/src/org
- Timestamp:
- 2009-11-21T13:44:33+01:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java
r2487 r2488 45 45 import org.openstreetmap.josm.gui.dialogs.relation.GenericRelationEditor; 46 46 import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor; 47 import org.openstreetmap.josm.gui.layer.DataChangeListener; 47 48 import org.openstreetmap.josm.gui.layer.Layer; 48 49 import org.openstreetmap.josm.gui.layer.OsmDataLayer; … … 59 60 * objects are visible on the map and can be selected there. Relations are not. 60 61 */ 61 public class RelationListDialog extends ToggleDialog implements LayerChangeListener, DataSetListener {62 public class RelationListDialog extends ToggleDialog implements LayerChangeListener, DataSetListener, DataChangeListener { 62 63 //private static final Logger logger = Logger.getLogger(RelationListDialog.class.getName()); 63 64 … … 522 523 523 524 public synchronized void setRelations(Collection<Relation> relations) { 525 List<Relation> sel = getSelectedRelations(); 524 526 if (relations == null) { 525 527 this.relations = null; … … 534 536 sort(); 535 537 fireIntervalAdded(this, 0, getSize()); 536 se lectionModel.clearSelection();538 setSelectedRelations(sel); 537 539 } 538 540 … … 631 633 public List<Relation> getSelectedNonNewRelations() { 632 634 ArrayList<Relation> ret = new ArrayList<Relation>(); 635 if (relations == null) return ret; 633 636 for (int i=0; i<getSize();i++) { 634 637 if (!selectionModel.isSelectedIndex(i)) { … … 651 654 public List<Relation> getSelectedRelations() { 652 655 ArrayList<Relation> ret = new ArrayList<Relation>(); 656 if (relations == null) return ret; 653 657 for (int i=0; i<getSize();i++) { 654 658 if (!selectionModel.isSelectedIndex(i)) { … … 706 710 if (a != null && a instanceof OsmDataLayer) { 707 711 ((OsmDataLayer)a).data.removeDataSetListener(this); 712 ((OsmDataLayer)a).listenerDataChanged.remove(this); 708 713 } 709 714 if (b != null && b instanceof OsmDataLayer) { 710 715 ((OsmDataLayer)b).data.addDataSetListener(this); 716 ((OsmDataLayer)b).listenerDataChanged.add(this); 711 717 } 712 718 … … 786 792 } 787 793 } 794 795 /* ---------------------------------------------------------------------------------- */ 796 /* DataSetListener */ 797 /* ---------------------------------------------------------------------------------- */ 798 public void dataChanged(OsmDataLayer l) { 799 if (l != null && l == Main.main.getEditLayer()) { 800 initFromLayer(l); 801 } 802 } 788 803 }
Note:
See TracChangeset
for help on using the changeset viewer.