Changeset 3020 in josm


Ignore:
Timestamp:
2010-02-18T22:05:19+01:00 (10 years ago)
Author:
bastiK
Message:

fixed #4573 - Relation count does not update on adding or deletion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/RelationListDialog.java

    r2914 r3020  
    176176        OsmDataLayer l = (OsmDataLayer)layer;
    177177        model.setRelations(l.data.getRelations());
    178         if(model.getSize() > 0) {
    179             setTitle(tr("Relations: {0}", model.getSize()));
    180         } else {
    181             setTitle(tr("Relations"));
    182         }
     178        model.updateTitle();
    183179    }
    184180
     
    519515     *
    520516     */
    521     private static  class RelationListModel extends AbstractListModel {
     517    private class RelationListModel extends AbstractListModel {
    522518        private final ArrayList<Relation> relations = new ArrayList<Relation>();
    523519        private DefaultListSelectionModel selectionModel;
     
    702698        }
    703699
     700        public void updateTitle() {
     701            if (getSize() > 0) {
     702                RelationListDialog.this.setTitle(tr("Relations: {0}", getSize()));
     703            } else {
     704                RelationListDialog.this.setTitle(tr("Relations"));
     705            }
     706        }
    704707    }
    705708
     
    734737    public void primtivesAdded(final PrimitivesAddedEvent event) {
    735738        model.addRelations(event.getPrimitives());
     739        model.updateTitle();
    736740    }
    737741
    738742    public void primtivesRemoved(final PrimitivesRemovedEvent event) {
    739743        model.removeRelations(event.getPrimitives());
     744        model.updateTitle();
    740745    }
    741746
Note: See TracChangeset for help on using the changeset viewer.