- Timestamp:
- 2014-12-20T04:16:30+01:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java
r7720 r7852 14 14 import org.openstreetmap.josm.gui.NoteInputDialog; 15 15 import org.openstreetmap.josm.gui.Notification; 16 import org.openstreetmap.josm.gui.dialogs.Note Dialog;16 import org.openstreetmap.josm.gui.dialogs.NotesDialog; 17 17 import org.openstreetmap.josm.tools.ImageProvider; 18 18 … … 63 63 64 64 NoteInputDialog dialog = new NoteInputDialog(Main.parent, tr("Create new note"), tr("Create note")); 65 dialog.showNoteDialog(tr("Enter a detailed comment to create a note"), Note Dialog.ICON_NEW);65 dialog.showNoteDialog(tr("Enter a detailed comment to create a note"), NotesDialog.ICON_NEW); 66 66 67 67 if (dialog.getValue() != 1) { -
trunk/src/org/openstreetmap/josm/gui/MapFrame.java
r7750 r7852 66 66 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 67 67 import org.openstreetmap.josm.gui.dialogs.MapPaintDialog; 68 import org.openstreetmap.josm.gui.dialogs.Note Dialog;68 import org.openstreetmap.josm.gui.dialogs.NotesDialog; 69 69 import org.openstreetmap.josm.gui.dialogs.RelationListDialog; 70 70 import org.openstreetmap.josm.gui.dialogs.SelectionListDialog; … … 133 133 public SelectionListDialog selectionListDialog; 134 134 public PropertiesDialog propertiesDialog; 135 public Note Dialog noteDialog;135 public NotesDialog noteDialog; 136 136 137 137 // Map modes … … 245 245 //TODO: remove this if statement once note support is complete 246 246 if(Main.pref.getBoolean("osm.notes.enableDownload", false)) { 247 addToggleDialog(noteDialog = new Note Dialog());247 addToggleDialog(noteDialog = new NotesDialog()); 248 248 } 249 249 toolBarToggle.setFloatable(false); -
trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java
r7847 r7852 43 43 44 44 /** 45 * Dialog to display and manipulate notes 45 * Dialog to display and manipulate notes. 46 * @since 7852 (renaming) 47 * @since 7608 (creation) 46 48 */ 47 public class NoteDialog extends ToggleDialog implements LayerChangeListener { 48 49 public class NotesDialog extends ToggleDialog implements LayerChangeListener { 49 50 50 51 /** Small icon size for use in graphics calculations */ … … 82 83 83 84 /** Creates a new toggle dialog for notes */ 84 public Note Dialog() {85 public NotesDialog() { 85 86 super("Notes", "notes/note_open.png", "List of notes", null, 150); 86 if (Main.isDebugEnabled()) {87 Main.debug("constructed note dialog");88 }89 90 87 addCommentAction = new AddCommentAction(); 91 88 closeAction = new CloseAction(); … … 298 295 } 299 296 NoteInputDialog dialog = new NoteInputDialog(Main.parent, tr("Comment on note"), tr("Add comment")); 300 dialog.showNoteDialog(tr("Add comment to note:"), Note Dialog.ICON_COMMENT);297 dialog.showNoteDialog(tr("Add comment to note:"), NotesDialog.ICON_COMMENT); 301 298 if (dialog.getValue() != 1) { 302 299 Main.debug("User aborted note reopening"); … … 318 315 public void actionPerformed(ActionEvent e) { 319 316 NoteInputDialog dialog = new NoteInputDialog(Main.parent, tr("Close note"), tr("Close note")); 320 dialog.showNoteDialog(tr("Close note with message:"), Note Dialog.ICON_CLOSED);317 dialog.showNoteDialog(tr("Close note with message:"), NotesDialog.ICON_CLOSED); 321 318 if (dialog.getValue() != 1) { 322 319 Main.debug("User aborted note closing"); … … 356 353 public void actionPerformed(ActionEvent e) { 357 354 NoteInputDialog dialog = new NoteInputDialog(Main.parent, tr("Reopen note"), tr("Reopen note")); 358 dialog.showNoteDialog(tr("Reopen note with message:"), Note Dialog.ICON_OPEN);355 dialog.showNoteDialog(tr("Reopen note with message:"), NotesDialog.ICON_OPEN); 359 356 if (dialog.getValue() != 1) { 360 357 Main.debug("User aborted note reopening"); -
trunk/src/org/openstreetmap/josm/gui/layer/NoteLayer.java
r7820 r7852 30 30 import org.openstreetmap.josm.gui.dialogs.LayerListDialog; 31 31 import org.openstreetmap.josm.gui.dialogs.LayerListPopup; 32 import org.openstreetmap.josm.gui.dialogs.Note Dialog;32 import org.openstreetmap.josm.gui.dialogs.NotesDialog; 33 33 import org.openstreetmap.josm.io.NoteExporter; 34 34 import org.openstreetmap.josm.io.XmlWriter; … … 99 99 ImageIcon icon = null; 100 100 if (note.getId() < 0) { 101 icon = Note Dialog.ICON_NEW_SMALL;101 icon = NotesDialog.ICON_NEW_SMALL; 102 102 } else if (note.getState() == State.closed) { 103 icon = Note Dialog.ICON_CLOSED_SMALL;103 icon = NotesDialog.ICON_CLOSED_SMALL; 104 104 } else { 105 icon = Note Dialog.ICON_OPEN_SMALL;105 icon = NotesDialog.ICON_OPEN_SMALL; 106 106 } 107 107 int width = icon.getIconWidth(); … … 139 139 140 140 g.setColor(ColorHelper.html2color(Main.pref.get("color.selected"))); 141 g.drawRect(p.x - (Note Dialog.ICON_SMALL_SIZE / 2), p.y - NoteDialog.ICON_SMALL_SIZE, NoteDialog.ICON_SMALL_SIZE - 1, NoteDialog.ICON_SMALL_SIZE - 1);142 143 int tx = p.x + (Note Dialog.ICON_SMALL_SIZE / 2) + 5;144 int ty = p.y - Note Dialog.ICON_SMALL_SIZE - 1;141 g.drawRect(p.x - (NotesDialog.ICON_SMALL_SIZE / 2), p.y - NotesDialog.ICON_SMALL_SIZE, NotesDialog.ICON_SMALL_SIZE - 1, NotesDialog.ICON_SMALL_SIZE - 1); 142 143 int tx = p.x + (NotesDialog.ICON_SMALL_SIZE / 2) + 5; 144 int ty = p.y - NotesDialog.ICON_SMALL_SIZE - 1; 145 145 g.translate(tx, ty); 146 146 … … 159 159 @Override 160 160 public Icon getIcon() { 161 return Note Dialog.ICON_OPEN_SMALL;161 return NotesDialog.ICON_OPEN_SMALL; 162 162 } 163 163 … … 219 219 Point notePoint = Main.map.mapView.getPoint(note.getLatLon()); 220 220 //move the note point to the center of the icon where users are most likely to click when selecting 221 notePoint.setLocation(notePoint.getX(), notePoint.getY() - Note Dialog.ICON_SMALL_SIZE / 2);221 notePoint.setLocation(notePoint.getX(), notePoint.getY() - NotesDialog.ICON_SMALL_SIZE / 2); 222 222 double dist = clickPoint.distanceSq(notePoint); 223 223 if (minDistance > dist && clickPoint.distance(notePoint) < snapDistance ) {
Note:
See TracChangeset
for help on using the changeset viewer.