Changeset 31164 in osm for applications
- Timestamp:
- 2015-05-31T16:56:42+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java
r31163 r31164 152 152 /** 153 153 * Selects a new image and then starts a new MapillaryImageDownloadThread 154 * thread in order to download its surrounding thumbnails and images. 154 * thread in order to download its surrounding thumbnails and images. If the 155 * user does ctrl+click, this isn't triggered. 155 156 * 156 157 * @param image … … 203 204 } 204 205 206 /** 207 * Returns a list containing all MapillaryImage objects selected with ctrl + 208 * click 209 * 210 * @return 211 */ 205 212 public List<MapillaryImage> getMultiSelectedImages() { 206 213 return multiSelectedImages; 207 214 } 208 215 216 /** 217 * This is empty because it is used just to make sure that certain images 218 * have already been downloaded. 219 */ 209 220 @Override 210 221 public void loadingFinished(CacheEntry data, 211 222 CacheEntryAttributes attributes, LoadResult result) { 212 223 // DO NOTHING 213 224 214 225 } 215 226 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryDownloadAction.java
r31158 r31164 53 53 else 54 54 this.layer.download(); 55 /*56 * MapillaryDialog dialog = new MapillaryDialog(); JOptionPane pane =57 * new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE,58 * JOptionPane.OK_CANCEL_OPTION); JDialog dlg =59 * pane.createDialog(Main.parent, tr("Export"));60 * dialog.setOptionPane(pane); dlg.setVisible(true);61 * if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){ //62 * MapillaryTask task = new MapillaryTask(); //63 * Main.worker.execute(task); } dlg.dispose();64 */65 55 } 66 56 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryExportDialog.java
r31158 r31164 25 25 26 26 protected JOptionPane optionPane; 27 // Button to export all downloaded images. 27 28 protected JRadioButton all; 29 // Button to export all images in the sequence of the selected 30 // MapillaryImage. 28 31 protected JRadioButton sequence; 32 // Button to export all images belonging to the selected MapillaryImage 33 // objects. 29 34 protected JRadioButton selected; 30 35 protected ButtonGroup group; … … 35 40 36 41 public MapillaryExportDialog() { 37 setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); 38 42 setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS)); 39 43 40 44 group = new ButtonGroup(); … … 49 53 sequence.setEnabled(false); 50 54 } 51 if (MapillaryData.getInstance().getMultiSelectedImages().isEmpty()) {55 if (MapillaryData.getInstance().getMultiSelectedImages().isEmpty()) { 52 56 selected.setEnabled(false); 53 57 } … … 55 59 choose = new JButton(tr("Explore")); 56 60 choose.addActionListener(this); 57 61 58 62 JPanel jpanel = new JPanel(); 59 63 jpanel.setLayout(new BoxLayout(jpanel, BoxLayout.PAGE_AXIS)); … … 61 65 jpanel.add(sequence); 62 66 jpanel.add(selected); 63 //all.setAlignmentX(Component.CENTER_ALIGNMENT);64 //sequence.setAlignmentX(Component.CENTER_ALIGNMENT);65 67 jpanel.setAlignmentX(Component.CENTER_ALIGNMENT); 66 68 path.setAlignmentX(Component.CENTER_ALIGNMENT); 67 69 choose.setAlignmentX(Component.CENTER_ALIGNMENT); 68 //container.setAlignmentX(Component.CENTER_ALIGNMENT);69 70 70 71 71 add(jpanel); 72 72 add(path); 73 73 add(choose); 74 74 75 76 75 } 77 76 78 77 /** 79 * Has to be called after this dialog has been added to a JOptionPane. 80 * 81 * @param optionPane 78 * Creates the folder choser GUI. 82 79 */ 83 public void setOptionPane(JOptionPane optionPane) {84 this.optionPane = optionPane;85 }86 87 80 @Override 88 81 public void actionPerformed(ActionEvent e) { 89 82 chooser = new JFileChooser(); 90 chooser.setCurrentDirectory(new java.io.File(System.getProperty("user.home"))); 83 chooser.setCurrentDirectory(new java.io.File(System 84 .getProperty("user.home"))); 91 85 chooser.setDialogTitle("Select a directory"); 92 86 chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java
r31163 r31164 12 12 private String key; 13 13 private LatLon latLon; 14 15 /**16 * 0 means north.17 */18 14 private Double ca; 19 15 private boolean isModified = false; 20 21 /**22 * Used to prevent old running threads from setting images in an object23 * which are no longer needed.24 */25 26 16 public MapillarySequence sequence; 27 17 … … 44 34 } 45 35 36 /** 37 * Returns whether the object has been modified or not. 38 * 39 * @return true if the object has been modified; false otherwise. 40 */ 46 41 public boolean isModified() { 47 42 return this.isModified; 48 43 } 49 44 45 /** 46 * Returns a LatLon object containing the coordintes of the object. 47 * 48 * @return The LatLon object with the position of the object. 49 */ 50 50 public LatLon getLatLon() { 51 51 return latLon; 52 52 } 53 53 54 /** 55 * Returns the direction towards the image has been taken. 56 * 57 * @return The direction of the image (0 means north and goes clockwise). 58 */ 54 59 public Double getCa() { 55 60 return ca; 56 61 } 57 62 63 /** 64 * Returns the unique identifier of the object. 65 * 66 * @return A String containing the unique identifier of the object. 67 */ 58 68 public String getKey() { 59 69 return this.key; … … 70 80 } 71 81 82 /** 83 * Returns the sequence which contains this image. 84 * 85 * @return The MapillarySequence object that contains this MapillaryImage. 86 */ 72 87 public MapillarySequence getSequence() { 73 88 return this.sequence; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java
r31163 r31164 56 56 } 57 57 58 /** 59 * Initializes the Layer. 60 */ 58 61 private void init() { 59 62 INSTANCED = true; … … 81 84 } 82 85 86 /** 87 * Downloads all images of the area covered by the OSM data. 88 */ 83 89 protected void download() { 84 90 for (Bounds bounds : Main.map.mapView.getEditLayer().data … … 92 98 } 93 99 100 /** 101 * Returs the MapillaryData object, which acts as the database of the Layer. 102 * 103 * @return 104 */ 94 105 public MapillaryData getMapillaryData() { 95 106 return mapillaryData; 96 107 } 97 108 109 /** 110 * Method invoqued when the layer is destroyed. 111 */ 98 112 @Override 99 113 public void destroy() { 100 MapillaryToggleDialog.getInstance().mapillaryImageDisplay.setImage(null); 114 MapillaryToggleDialog.getInstance().mapillaryImageDisplay 115 .setImage(null); 101 116 INSTANCED = false; 102 117 MapillaryPlugin.setMenuEnabled(MapillaryPlugin.EXPORT_MENU, false); … … 108 123 } 109 124 125 /** 126 * Returns true any of the images from the database has been modified. 127 */ 110 128 @Override 111 129 public boolean isModified() { … … 118 136 } 119 137 138 /** 139 * Paints the database in the map. 140 */ 120 141 @Override 121 142 public void paint(Graphics2D g, MapView mv, Bounds box) { … … 150 171 @Override 151 172 public boolean isMergable(Layer other) { 152 return other instanceof MapillaryLayer;173 return false; 153 174 } 154 175 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java
r31159 r31164 12 12 13 13 /** 14 * This is the main class for the mapillary plugin.14 * This is the main class of the Mapillary plugin. 15 15 * 16 16 * @author nokutu … … 49 49 MapillaryToggleDialog.deleteInstance (); 50 50 } 51 if (oldFrame != null && newFrame == null) { // map frame added 52 System.out.println("Mapframe destroyed"); 53 } 51 54 } 52 55 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillarySequence.java
r31158 r31164 21 21 } 22 22 23 /** 24 * Returns all MapillaryImages objects contained by this object. 25 * 26 * @return 27 */ 23 28 public List<MapillaryImage> getImages() { 24 29 return this.images; 25 30 } 26 31 32 /** 33 * Adds a new MapillaryImage object to this object. 34 * 35 * @param image 36 */ 27 37 public synchronized void add(MapillaryImage image) { 28 38 this.images.add(image); 29 39 } 30 40 41 /** 42 * Adds a set of MapillaryImage objects to this object. 43 * 44 * @param images 45 */ 31 46 public synchronized void add(List<MapillaryImage> images) { 32 47 for (MapillaryImage image : images) { … … 35 50 } 36 51 52 /** 53 * Removes a MapillaryImage object from this object. 54 * 55 * @param image 56 */ 37 57 public void remove(MapillaryImage image) { 38 58 this.images.remove(image); … … 71 91 } 72 92 93 /** 94 * Returns the difference of index between two MapillaryImage objects 95 * belonging to the same MapillarySequence. 96 * 97 * @param image1 98 * @param image2 99 * @return 100 */ 73 101 public int getDistance(MapillaryImage image1, MapillaryImage image2) { 74 102 if (!this.images.contains(image1) || !this.images.contains(image2)) -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryToggleDialog.java
r31163 r31164 103 103 } 104 104 105 /** 106 * Sets a new MapillaryImage to be shown. 107 * 108 * @param image 109 */ 105 110 public synchronized void setImage(MapillaryImage image) { 106 111 this.image = image; 107 112 } 108 113 114 /** 115 * Returns the MapillaryImage objects which is being shown. 116 * 117 * @return 118 */ 109 119 public synchronized MapillaryImage getImage() { 110 120 return this.image; 111 121 } 112 122 123 /** 124 * Action class form the next image button. 125 * 126 * @author Jorge 127 * 128 */ 113 129 class nextPictureAction extends AbstractAction { 114 130 public nextPictureAction() { … … 128 144 } 129 145 146 /** 147 * Action class for the previous image button. 148 * 149 * @author Jorge 150 * 151 */ 130 152 class previousPictureAction extends AbstractAction { 131 153 public previousPictureAction() { … … 145 167 } 146 168 169 /** 170 * When the pictures are returned from the cache, they are set in the 171 * {@link MapillaryImageDisplay} object. 172 */ 147 173 @Override 148 174 public void loadingFinished(CacheEntry data, … … 157 183 } else { 158 184 try { 159 /*160 * BufferedImage img = ImageIO.read(new161 * ByteArrayInputStream(data .getContent()));162 * this.remove(active); JLabel label = new JLabel("", new163 * ImageIcon(img), JLabel.CENTER); active = label;164 * this.add(active); this.updateUI();165 */166 185 BufferedImage img = ImageIO.read(new ByteArrayInputStream(data 167 186 .getContent())); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillaryDownloader.java
r31163 r31164 26 26 this.data = data; 27 27 } 28 29 /*30 * public List<MapillaryImage> getImagesAround(LatLon latLon, double31 * distance) { String u rl = BASE_URL; url += "search/im/close/";32 * Hashtable<String, Double> hash = new Hashtable<String, Double>();33 * hash.put("lat", latLon.lat()); hash.put("lon", latLon.lon());34 * hash.put("distance", distance); url += buildParameters(hash); try {35 * return parseImages(parseUrl(url)); } catch (Exception e) { return null; }36 * }37 */38 28 39 29 /**
Note:
See TracChangeset
for help on using the changeset viewer.