Changeset 6456 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2013-12-07T23:32:40+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer/geoimage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
r6450 r6456 677 677 } 678 678 679 public void showFirstPhoto() { 680 if (data != null && data.size() > 0) { 681 currentPhoto = 0; 682 ImageViewerDialog.showImage(this, data.get(currentPhoto)); 683 } else { 684 currentPhoto = -1; 685 } 686 Main.map.repaint(); 687 } 688 689 public void showLastPhoto() { 690 if (data != null && data.size() > 0) { 691 currentPhoto = data.size() - 1; 692 ImageViewerDialog.showImage(this, data.get(currentPhoto)); 693 } else { 694 currentPhoto = -1; 695 } 696 Main.map.repaint(); 697 } 698 679 699 public void checkPreviousNextButtons() { 680 700 ImageViewerDialog.setNextEnabled(currentPhoto < data.size() - 1); -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
r6450 r6456 37 37 private static final String COMMAND_PREVIOUS = "previous"; 38 38 private static final String COMMAND_COLLAPSE = "collapse"; 39 private static final String COMMAND_FIRST = "first"; 40 private static final String COMMAND_LAST = "last"; 39 41 40 42 private ImageDisplay imgDisplay = new ImageDisplay(); … … 116 118 btnNext.getActionMap().put(ANEXT, nextAction); 117 119 120 Main.registerActionShortcut( 121 new ImageAction(COMMAND_FIRST, null, null), 122 Shortcut.registerShortcut( 123 "geoimage:first", tr("Geoimage: {0}", tr("Show first Image")), KeyEvent.VK_HOME, Shortcut.DIRECT) 124 ); 125 Main.registerActionShortcut( 126 new ImageAction(COMMAND_LAST, null, null), 127 Shortcut.registerShortcut( 128 "geoimage:last", tr("Geoimage: {0}", tr("Show last Image")), KeyEvent.VK_END, Shortcut.DIRECT) 129 ); 130 118 131 JToggleButton tbCentre = new JToggleButton(new ImageAction(COMMAND_CENTERVIEW, ImageProvider.get("dialogs", "centreview"), tr("Center view"))); 119 132 tbCentre.setPreferredSize(buttonDim); … … 174 187 currentLayer.showPreviousPhoto(); 175 188 } 189 } else if (COMMAND_FIRST.equals(action) && currentLayer != null) { 190 currentLayer.showFirstPhoto(); 191 } else if (COMMAND_LAST.equals(action) && currentLayer != null) { 192 currentLayer.showLastPhoto(); 176 193 177 194 } else if (COMMAND_CENTERVIEW.equals(action)) {
Note:
See TracChangeset
for help on using the changeset viewer.