Changeset 10428 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java
- Timestamp:
- 2016-06-19T18:28:26+02:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java
r10395 r10428 6 6 import java.awt.BorderLayout; 7 7 import java.awt.Component; 8 import java.awt.Image;9 8 import java.awt.event.ActionEvent; 10 9 import java.awt.event.MouseAdapter; … … 56 55 */ 57 56 public class NotesDialog extends ToggleDialog implements LayerChangeListener { 58 59 /** Small icon size for use in graphics calculations */60 public static final int ICON_SMALL_SIZE = 16;61 /** 24x24 icon for unresolved notes */62 public static final ImageIcon ICON_OPEN = ImageProvider.get("dialogs/notes", "note_open");63 /** 16x16 icon for unresolved notes */64 public static final ImageIcon ICON_OPEN_SMALL =65 new ImageIcon(ICON_OPEN.getImage().getScaledInstance(ICON_SMALL_SIZE, ICON_SMALL_SIZE, Image.SCALE_SMOOTH));66 /** 24x24 icon for resolved notes */67 public static final ImageIcon ICON_CLOSED = ImageProvider.get("dialogs/notes", "note_closed");68 /** 16x16 icon for resolved notes */69 public static final ImageIcon ICON_CLOSED_SMALL =70 new ImageIcon(ICON_CLOSED.getImage().getScaledInstance(ICON_SMALL_SIZE, ICON_SMALL_SIZE, Image.SCALE_SMOOTH));71 /** 24x24 icon for new notes */72 public static final ImageIcon ICON_NEW = ImageProvider.get("dialogs/notes", "note_new");73 /** 16x16 icon for new notes */74 public static final ImageIcon ICON_NEW_SMALL =75 new ImageIcon(ICON_NEW.getImage().getScaledInstance(ICON_SMALL_SIZE, ICON_SMALL_SIZE, Image.SCALE_SMOOTH));76 /** Icon for note comments */77 public static final ImageIcon ICON_COMMENT = ImageProvider.get("dialogs/notes", "note_comment");78 57 79 58 private NoteTableModel model; … … 257 236 ImageIcon icon; 258 237 if (note.getId() < 0) { 259 icon = I CON_NEW_SMALL;238 icon = ImageProvider.get("dialogs/notes", "note_new", ImageProvider.ImageSizes.SMALLICON); 260 239 } else if (note.getState() == State.CLOSED) { 261 icon = I CON_CLOSED_SMALL;240 icon = ImageProvider.get("dialogs/notes", "note_closed", ImageProvider.ImageSizes.SMALLICON); 262 241 } else { 263 icon = I CON_OPEN_SMALL;242 icon = ImageProvider.get("dialogs/notes", "note_open", ImageProvider.ImageSizes.SMALLICON); 264 243 } 265 244 jlabel.setIcon(icon); … … 313 292 putValue(SHORT_DESCRIPTION, tr("Add comment")); 314 293 putValue(NAME, tr("Comment")); 315 putValue(SMALL_ICON, ICON_COMMENT);294 new ImageProvider("dialogs/notes", "note_comment").getResource().attachImageIcon(this, true); 316 295 } 317 296 … … 327 306 } 328 307 NoteInputDialog dialog = new NoteInputDialog(Main.parent, tr("Comment on note"), tr("Add comment")); 329 dialog.showNoteDialog(tr("Add comment to note:"), NotesDialog.ICON_COMMENT);308 dialog.showNoteDialog(tr("Add comment to note:"), ImageProvider.get("dialogs/notes", "note_comment")); 330 309 if (dialog.getValue() != 1) { 331 310 return; … … 345 324 putValue(SHORT_DESCRIPTION, tr("Close note")); 346 325 putValue(NAME, tr("Close")); 347 putValue(SMALL_ICON, ICON_CLOSED);326 new ImageProvider("dialogs/notes", "note_closed").getResource().attachImageIcon(this, true); 348 327 } 349 328 … … 351 330 public void actionPerformed(ActionEvent e) { 352 331 NoteInputDialog dialog = new NoteInputDialog(Main.parent, tr("Close note"), tr("Close note")); 353 dialog.showNoteDialog(tr("Close note with message:"), NotesDialog.ICON_CLOSED);332 dialog.showNoteDialog(tr("Close note with message:"), ImageProvider.get("dialogs/notes", "note_closed")); 354 333 if (dialog.getValue() != 1) { 355 334 return; … … 370 349 putValue(SHORT_DESCRIPTION, tr("Create a new note")); 371 350 putValue(NAME, tr("Create")); 372 putValue(SMALL_ICON, ICON_NEW);351 new ImageProvider("dialogs/notes", "note_new").getResource().attachImageIcon(this, true); 373 352 } 374 353 … … 390 369 putValue(SHORT_DESCRIPTION, tr("Reopen note")); 391 370 putValue(NAME, tr("Reopen")); 392 putValue(SMALL_ICON, ICON_OPEN);371 new ImageProvider("dialogs/notes", "note_open").getResource().attachImageIcon(this, true); 393 372 } 394 373 … … 396 375 public void actionPerformed(ActionEvent e) { 397 376 NoteInputDialog dialog = new NoteInputDialog(Main.parent, tr("Reopen note"), tr("Reopen note")); 398 dialog.showNoteDialog(tr("Reopen note with message:"), NotesDialog.ICON_OPEN);377 dialog.showNoteDialog(tr("Reopen note with message:"), ImageProvider.get("dialogs/notes", "note_open")); 399 378 if (dialog.getValue() != 1) { 400 379 return; … … 416 395 putValue(SHORT_DESCRIPTION, tr("Sort notes")); 417 396 putValue(NAME, tr("Sort")); 418 putValue(SMALL_ICON, ImageProvider.get("dialogs", "sort"));397 new ImageProvider("dialogs", "sort").getResource().attachImageIcon(this, true); 419 398 } 420 399
Note:
See TracChangeset
for help on using the changeset viewer.