Changeset 33229 in osm for applications/editors/josm/plugins/imagewaypoint/src
- Timestamp:
- 2017-04-12T21:29:51+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageChangeListener.java
r33228 r33229 14 14 final ImageEntries entries) { 15 15 this.dialog.imageDisplay.setImage(entries.getCurrentImage()); 16 this.dialog.update UI();16 this.dialog.updateGUI(); 17 17 } 18 18 … … 20 20 public void onSelectedImageEntryChanged(final ImageEntries entries) { 21 21 this.dialog.imageDisplay.setImage(entries.getCurrentImage()); 22 this.dialog.update UI();22 this.dialog.updateGUI(); 23 23 } 24 24 } -
applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointDialog.java
r33228 r33229 19 19 import org.openstreetmap.josm.tools.Shortcut; 20 20 21 public final class ImageWayPointDialog { 22 private static final ImageWayPointDialog INSTANCE = new ImageWayPointDialog(); 23 private final ToggleDialog dialog; 21 public final class ImageWayPointDialog extends ToggleDialog { 24 22 final ImageComponent imageDisplay; 25 23 private final Action previousAction; … … 30 28 private final IImageChangeListener listener; 31 29 32 private ImageWayPointDialog() { 33 this.dialog = new ToggleDialog(tr("WayPoint Image"), 34 "imagewaypoint", 35 tr("Display non-geotagged photos"), 30 public ImageWayPointDialog() { 31 super(tr("WayPoint Image"), "imagewaypoint", tr("Display non-geotagged photos"), 36 32 Shortcut.registerShortcut("subwindow:imagewaypoint", tr("Toggle: {0}", tr("WayPoint Image")), 37 KeyEvent.VK_Y, Shortcut.ALT_SHIFT), 38 200); 33 KeyEvent.VK_Y, Shortcut.ALT_SHIFT), 200); 39 34 40 35 this.previousAction = new PreviousAction(); … … 65 60 ImageEntries.getInstance().addListener(this.listener); 66 61 67 this.update UI();68 dialog.add(mainPanel);62 this.updateGUI(); 63 add(mainPanel); 69 64 } 70 65 71 void update UI() {66 void updateGUI() { 72 67 this.previousAction.setEnabled(ImageEntries.getInstance().hasPrevious()); 73 68 this.nextAction.setEnabled(ImageEntries.getInstance().hasNext()); 74 this.rotateLeftAction.setEnabled(null != ImageEntries.getInstance() 75 .getCurrentImageEntry()); 76 this.rotateRightAction.setEnabled(null != ImageEntries.getInstance() 77 .getCurrentImageEntry()); 69 this.rotateLeftAction.setEnabled(null != ImageEntries.getInstance().getCurrentImageEntry()); 70 this.rotateRightAction.setEnabled(null != ImageEntries.getInstance().getCurrentImageEntry()); 78 71 79 72 if (null != Main.map) { … … 81 74 } 82 75 } 83 84 public static ImageWayPointDialog getInstance() {85 return ImageWayPointDialog.INSTANCE;86 }87 88 public ToggleDialog getDisplayComponent() {89 return this.dialog;90 }91 76 } -
applications/editors/josm/plugins/imagewaypoint/src/org/insignificant/josm/plugins/imagewaypoint/ImageWayPointPlugin.java
r33086 r33229 8 8 import java.util.Iterator; 9 9 import java.util.List; 10 import java.util.Locale; 10 11 11 12 import org.openstreetmap.josm.Main; … … 57 58 } 58 59 if (!foundImageWayPointLayer) { 59 GuiHelper.runInEDT(new Runnable() { 60 @Override 61 public void run() { 62 new ImageWayPointLayer(); 63 } 64 }); 60 GuiHelper.runInEDT(ImageWayPointLayer::new); 65 61 } 66 62 } … … 79 75 public void mapFrameInitialized(final MapFrame oldFrame, final MapFrame newFrame) { 80 76 if (newFrame != null) { 81 newFrame.addToggleDialog(ImageWayPointDialog.getInstance() 82 .getDisplayComponent()); 77 newFrame.addToggleDialog(new ImageWayPointDialog()); 83 78 } else { 84 79 ImageEntries.getInstance().setCurrentImageEntry(null); … … 90 85 final File selectedFile = selectedFiles[index]; 91 86 if (selectedFile.isDirectory()) 92 this.addFiles(allFiles, selectedFile.listFiles());93 else if (selectedFile.getName().toLowerCase( ).endsWith(".jpg"))94 allFiles.add(selectedFile);87 this.addFiles(allFiles, selectedFile.listFiles()); 88 else if (selectedFile.getName().toLowerCase(Locale.ENGLISH).endsWith(".jpg")) 89 allFiles.add(selectedFile); 95 90 } 96 91 }
Note:
See TracChangeset
for help on using the changeset viewer.