Ignore:
Timestamp:
2017-09-05T10:46:58+02:00 (4 years ago)
Author:
Don-vip
Message:

see #15182 - see #15229 - remove GUI dependence in NoteData

File:
1 edited

Legend:

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

    r12643 r12734  
    3636import org.openstreetmap.josm.data.notes.NoteComment;
    3737import org.openstreetmap.josm.data.osm.NoteData;
     38import org.openstreetmap.josm.data.osm.NoteData.NoteDataUpdateListener;
    3839import org.openstreetmap.josm.gui.MainApplication;
    3940import org.openstreetmap.josm.gui.MapFrame;
     
    5556 * @since 7608 (creation)
    5657 */
    57 public class NotesDialog extends ToggleDialog implements LayerChangeListener {
     58public class NotesDialog extends ToggleDialog implements LayerChangeListener, NoteDataUpdateListener {
    5859
    5960    private NoteTableModel model;
     
    155156            model.setData(noteData.getNotes());
    156157            setNotes(noteData.getSortedNotes());
     158            noteData.addNoteDataUpdateListener(this);
    157159        }
    158160    }
     
    161163    public void layerRemoving(LayerRemoveEvent e) {
    162164        if (e.getRemovedLayer() instanceof NoteLayer) {
     165            noteData.removeNoteDataUpdateListener(this);
    163166            noteData = null;
    164167            model.clearData();
     
    173176    public void layerOrderChanged(LayerOrderChangeEvent e) {
    174177        // ignored
     178    }
     179
     180    @Override
     181    public void noteDataUpdated(NoteData data) {
     182        setNotes(data.getSortedNotes());
     183    }
     184
     185    @Override
     186    public void selectedNoteChanged(NoteData noteData) {
     187        selectionChanged();
    175188    }
    176189
Note: See TracChangeset for help on using the changeset viewer.