Changeset 31214 in osm
- Timestamp:
- 2015-06-04T11:51:23+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/.classpath
r31211 r31214 5 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> 6 6 <classpathentry combineaccessrules="false" kind="src" path="/JOSM-commons-imaging"/> 7 <classpathentry kind="lib" path="/home/nokutu/josm/dist/commons-imaging.jar"/> 7 8 <classpathentry kind="output" path="bin"/> 8 9 </classpath> -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r31194 r31214 4 4 5 5 import org.apache.commons.jcs.access.CacheAccess; 6 import org.openstreetmap.josm.plugins.mapillary.cache.MapillaryCache; 6 7 import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader; 7 8 import org.openstreetmap.josm.Main; … … 50 51 51 52 public final static int SEQUENCE_MAX_JUMP_DISTANCE = 100; 52 53 53 54 public static Boolean INSTANCED = false; 54 55 public static MapillaryLayer INSTANCE; … … 252 253 private MapillaryImage[] getClosestImagesFromDifferentSequences() { 253 254 MapillaryImage[] ret = new MapillaryImage[2]; 254 double[] distances = { SEQUENCE_MAX_JUMP_DISTANCE, SEQUENCE_MAX_JUMP_DISTANCE }; 255 double[] distances = { SEQUENCE_MAX_JUMP_DISTANCE, 256 SEQUENCE_MAX_JUMP_DISTANCE }; 255 257 LatLon selectedCoords = mapillaryData.getSelectedImage().getLatLon(); 256 258 for (MapillaryImage image : mapillaryData.getImages()) { … … 274 276 } 275 277 } 278 // Predownloads the thumbnails 279 if (ret[0] != null) 280 new MapillaryCache(ret[0].getKey(), MapillaryCache.Type.THUMBNAIL) 281 .submit(MapillaryData.getInstance(), false); 282 if (ret[1] != null) 283 new MapillaryCache(ret[1].getKey(), MapillaryCache.Type.THUMBNAIL) 284 .submit(MapillaryData.getInstance(), false); 276 285 return ret; 277 286 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPreferenceSetting.java
r31213 r31214 6 6 import javax.swing.JPanel; 7 7 8 import org.openstreetmap.josm.Main; 8 9 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane; 9 10 import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting; … … 12 13 public class MapillaryPreferenceSetting implements SubPreferenceSetting { 13 14 14 private JCheckBox reverseButtons ;15 private JCheckBox reverseButtons = new JCheckBox("Reverse buttons position when displaying images.");; 15 16 16 17 @Override … … 23 24 // TODO Auto-generated method stub 24 25 JPanel panel = new JPanel(); 25 reverseButtons = new JCheckBox("Reverse buttons position when displaying images."); 26 27 reverseButtons.setSelected(Main.pref.getBoolean("mapillary.reverse-buttons")); 28 26 29 panel.add(reverseButtons); 27 30 panel.setLayout(new FlowLayout(FlowLayout.LEFT)); … … 31 34 @Override 32 35 public boolean ok() { 33 // TODO Auto-generated method stub 34 return false; 36 boolean mod = false; 37 Main.pref.put("mapillary.reverse-buttons", reverseButtons.isSelected()); 38 return mod; 35 39 } 36 40 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryToggleDialog.java
r31194 r31214 7 7 import java.awt.BorderLayout; 8 8 import java.awt.Color; 9 import java.awt.Component; 9 10 import java.awt.FlowLayout; 11 import java.awt.GridLayout; 10 12 import java.io.ByteArrayInputStream; 11 13 import java.io.IOException; 12 14 import java.util.Arrays; 15 import java.util.Collection; 16 import java.util.List; 13 17 14 18 import org.openstreetmap.josm.Main; … … 22 26 23 27 import javax.imageio.ImageIO; 28 import javax.swing.BoxLayout; 29 import javax.swing.JButton; 30 import javax.swing.JScrollPane; 24 31 import javax.swing.SwingUtilities; 25 32 import javax.swing.AbstractAction; … … 45 52 final SideButton blueButton = new SideButton(new blueAction()); 46 53 54 private JPanel buttonsPanel; 55 private JPanel top; 56 47 57 public MapillaryImageDisplay mapillaryImageDisplay; 48 58 49 59 private MapillaryCache imageCache; 50 60 private MapillaryCache thumbnailCache; 51 52 final JPanel buttons;53 61 54 62 public MapillaryToggleDialog() { … … 56 64 tr("Open Mapillary window"), null, 200); 57 65 mapillaryImageDisplay = new MapillaryImageDisplay(); 58 this.add(mapillaryImageDisplay); 59 buttons = new JPanel(); 60 buttons.setLayout(new FlowLayout(FlowLayout.CENTER)); 66 67 // this.add(mapillaryImageDisplay); 61 68 blueButton.setForeground(Color.BLUE); 62 69 redButton.setForeground(Color.RED); 63 buttons.add(blueButton); 64 buttons.add(previousButton); 65 buttons.add(nextButton); 66 buttons.add(redButton); 67 68 this.add(buttons, BorderLayout.SOUTH); 70 71 this.setLayout(new BorderLayout()); 72 top = new JPanel(); 73 top.setLayout(new BorderLayout()); 74 top.add(titleBar, BorderLayout.NORTH); 69 75 70 76 createLayout( 71 77 mapillaryImageDisplay, 72 true,73 78 Arrays.asList(new SideButton[] { blueButton, previousButton, 74 nextButton, redButton })); 79 nextButton, redButton }), 80 Main.pref.getBoolean("mapillary.reverse-buttons")); 75 81 } 76 82 … … 269 275 } 270 276 } 277 278 public void createLayout(Component data, List<SideButton> buttons, 279 boolean reverse) { 280 add(data, BorderLayout.CENTER); 281 if (!buttons.isEmpty() && buttons.get(0) != null) { 282 buttonsPanel = new JPanel(new GridLayout(1, 1)); 283 final JPanel buttonRowPanel = new JPanel(Main.pref.getBoolean( 284 "dialog.align.left", false) ? new FlowLayout( 285 FlowLayout.LEFT) : new GridLayout(1, buttons.size())); 286 buttonsPanel.add(buttonRowPanel); 287 for (SideButton button : buttons) { 288 buttonRowPanel.add(button); 289 } 290 if (reverse) 291 top.add(buttonsPanel, BorderLayout.SOUTH); 292 else 293 add(buttonsPanel, BorderLayout.SOUTH); 294 } 295 add(top, BorderLayout.NORTH); 296 } 271 297 }
Note:
See TracChangeset
for help on using the changeset viewer.