Changeset 8224 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2015-04-18T22:37:12+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java
r8212 r8224 13 13 import java.util.ArrayList; 14 14 import java.util.Arrays; 15 import java.util.Collection; 15 16 import java.util.List; 16 17 … … 186 187 noteData = ((NoteLayer)newLayer).getNoteData(); 187 188 model.setData(noteData.getNotes()); 188 setNote List(noteData.getNotes());189 setNotes(noteData.getSortedNotes()); 189 190 } 190 191 } … … 193 194 public void layerRemoved(Layer oldLayer) { 194 195 if (oldLayer instanceof NoteLayer) { 195 if (Main.isDebugEnabled()) {196 Main.debug("note layer removed. Clearing everything");197 }198 196 noteData = null; 199 197 model.clearData(); … … 209 207 * @param noteList List of notes to display 210 208 */ 211 public void setNote List(List<Note> noteList) {209 public void setNotes(Collection<Note> noteList) { 212 210 model.setData(noteList); 213 211 updateButtonStates(); … … 265 263 266 264 public NoteTableModel() { 267 data = new ArrayList< Note>();265 data = new ArrayList<>(); 268 266 } 269 267 … … 281 279 } 282 280 283 public void setData( List<Note> noteList) {281 public void setData(Collection<Note> noteList) { 284 282 data.clear(); 285 283 data.addAll(noteList); … … 315 313 dialog.showNoteDialog(tr("Add comment to note:"), NotesDialog.ICON_COMMENT); 316 314 if (dialog.getValue() != 1) { 317 Main.debug("User aborted note reopening");318 315 return; 319 316 } … … 337 334 dialog.showNoteDialog(tr("Close note with message:"), NotesDialog.ICON_CLOSED); 338 335 if (dialog.getValue() != 1) { 339 Main.debug("User aborted note closing");340 336 return; 341 337 } … … 377 373 dialog.showNoteDialog(tr("Reopen note with message:"), NotesDialog.ICON_OPEN); 378 374 if (dialog.getValue() != 1) { 379 Main.debug("User aborted note reopening");380 375 return; 381 376 } -
trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java
r8214 r8224 13 13 import java.text.DateFormat; 14 14 import java.util.ArrayList; 15 import java.util.Collection; 16 import java.util.Collections; 15 17 import java.util.List; 16 18 … … 56 58 * @param name The name of the layer. Typically "Notes" 57 59 */ 58 public NoteLayer( List<Note> notes, String name) {60 public NoteLayer(Collection<Note> notes, String name) { 59 61 super(name); 60 62 noteData = new NoteData(notes); … … 63 65 /** Convenience constructor that creates a layer with an empty note list */ 64 66 public NoteLayer() { 65 super(tr("Notes")); 66 noteData = new NoteData(); 67 this(Collections.<Note>emptySet(), tr("Notes")); 67 68 } 68 69 … … 97 98 @Override 98 99 public boolean requiresSaveToFile() { 99 Main.debug("associated notes file: " + getAssociatedFile());100 100 return getAssociatedFile() != null && isModified(); 101 101 }
Note:
See TracChangeset
for help on using the changeset viewer.