Changeset 31389 in osm for applications/editors/josm/plugins/mapillary
- Timestamp:
- 2015-07-16T13:56:20+02:00 (9 years ago)
- Location:
- applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryExportDialog.java
r31387 r31389 24 24 /** 25 25 * GUI for exporting images. 26 * 26 * 27 27 * @author nokutu 28 28 * … … 38 38 /** Button to export all images belonging to the selected {@link MapillaryImage} objects. */ 39 39 public JRadioButton selected; 40 /** Button to rewrite all imported images */40 /** Button to rewrite all imported images. */ 41 41 public JRadioButton rewrite; 42 /** Group of button containing all the options. */ 42 43 public ButtonGroup group; 43 44 private JButton choose; 44 45 private JLabel path; 46 /** File chooser. */ 45 47 public JFileChooser chooser; 46 48 protected String exportDirectory; 47 49 private JButton ok; 48 50 51 /** 52 * Main constructor. 53 */ 49 54 public MapillaryExportDialog(JButton ok) { 50 55 this.ok = ok; … … 120 125 } 121 126 127 /** 128 * Enables/disables some parts of the panel depending if the rewrite button is 129 * active. 130 * 131 * @author nokutu 132 * 133 */ 122 134 public class RewriteButtonAction extends AbstractAction { 123 135 … … 126 138 private MapillaryExportDialog dlg; 127 139 140 /** 141 * Main constructor. 142 * 143 * @param dlg 144 * Parent dialog. 145 */ 128 146 public RewriteButtonAction(MapillaryExportDialog dlg) { 129 147 this.dlg = dlg; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterChooseSigns.java
r31350 r31389 4 4 5 5 import java.awt.Dimension; 6 import java.awt.event.ActionEvent;7 import java.awt.event.ActionListener;8 6 9 7 import javax.swing.JCheckBox; … … 13 11 import org.openstreetmap.josm.tools.ImageProvider; 14 12 15 public class MapillaryFilterChooseSigns extends JPanel implements 16 ActionListener { 13 /** 14 * UI to choose which signs must be displayed. 15 * 16 * @author nokutu 17 * 18 */ 19 public class MapillaryFilterChooseSigns extends JPanel { 17 20 18 public final JCheckBox maxspeed = new JCheckBox(); 21 private static final long serialVersionUID = -3513805549022406720L; 22 23 /** Max speed signs */ 24 public final JCheckBox maxSpeed = new JCheckBox(); 25 /** Stop signs */ 19 26 public final JCheckBox stop = new JCheckBox(); 27 /** Give way signs */ 20 28 public final JCheckBox giveWay = new JCheckBox(); 29 /** Roundabout sings */ 21 30 public final JCheckBox roundabout = new JCheckBox(); 31 /** Forbidden access or forbidden direction signs */ 22 32 public final JCheckBox access = new JCheckBox(); 33 /** Intersection danger signs */ 23 34 public final JCheckBox intersection = new JCheckBox(); 35 /** Mandatory direction signs */ 24 36 public final JCheckBox direction = new JCheckBox(); 37 /** Uneven pavement signs */ 25 38 public final JCheckBox uneven = new JCheckBox(); 39 /** No parking signs */ 26 40 public final JCheckBox noParking = new JCheckBox(); 41 /** Forbidden overtaking signs */ 27 42 public final JCheckBox noOvertaking = new JCheckBox(); 43 /** Pedestrian crossing signs */ 28 44 public final JCheckBox crossing = new JCheckBox(); 45 /** Forbidden turn signs */ 29 46 public final JCheckBox noTurn = new JCheckBox(); 30 47 31 48 private static MapillaryFilterChooseSigns INSTANCE; 32 49 33 p ublicMapillaryFilterChooseSigns() {34 max speed.setSelected(true);50 private MapillaryFilterChooseSigns() { 51 maxSpeed.setSelected(true); 35 52 stop.setSelected(true); 36 53 giveWay.setSelected(true); … … 50 67 maxspeedLabel.setIcon(new ImageProvider("signs/speed.png").get()); 51 68 maxspeedPanel.add(maxspeedLabel); 52 maxspeedPanel.add(max speed);69 maxspeedPanel.add(maxSpeed); 53 70 this.add(maxspeedPanel); 54 71 … … 148 165 } 149 166 167 /** 168 * Return the unique instance of the class. 169 * 170 * @return THe unique instance of the class. 171 */ 150 172 public static MapillaryFilterChooseSigns getInstance() { 151 173 if (INSTANCE == null) … … 153 175 return INSTANCE; 154 176 } 155 156 @Override157 public void actionPerformed(ActionEvent arg0) {158 // TODO Auto-generated method stub159 160 }161 162 177 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryFilterDialog.java
r31350 r31389 32 32 /** 33 33 * ToggleDialog that lets you filter the images that are being shown. 34 * 34 * 35 35 * @author nokutu 36 36 * @see MapillaryFilterChooseSigns … … 40 40 MapillaryDataListener { 41 41 42 public static MapillaryFilterDialog INSTANCE; 42 private static final long serialVersionUID = -4192029663670922103L; 43 44 private static MapillaryFilterDialog INSTANCE; 43 45 44 46 private final static String[] TIME_LIST = { tr("All time"), tr("This year"), … … 50 52 private final JPanel panel = new JPanel(new GridLayout(ROWS, COLUMNS)); 51 53 52 p ublicfinal JCheckBox imported = new JCheckBox("Imported images");53 p ublicfinal JCheckBox downloaded = new JCheckBox(54 private final JCheckBox imported = new JCheckBox("Imported images"); 55 private final JCheckBox downloaded = new JCheckBox( 54 56 new downloadCheckBoxAction()); 55 p ublicfinal JCheckBox onlySigns = new JCheckBox(new OnlySignsAction());56 p ublicfinal JComboBox<String> time;57 p ublicfinal JTextField user;58 59 p ublicfinal SideButton updateButton = new SideButton(new UpdateAction());60 p ublicfinal SideButton resetButton = new SideButton(new ResetAction());61 p ublicfinal JButton signChooser = new JButton(new SignChooserAction());62 63 p ublicfinal MapillaryFilterChooseSigns signFilter = MapillaryFilterChooseSigns57 private final JCheckBox onlySigns = new JCheckBox(new OnlySignsAction()); 58 private final JComboBox<String> time; 59 private final JTextField user; 60 61 private final SideButton updateButton = new SideButton(new UpdateAction()); 62 private final SideButton resetButton = new SideButton(new ResetAction()); 63 private final JButton signChooser = new JButton(new SignChooserAction()); 64 65 private final MapillaryFilterChooseSigns signFilter = MapillaryFilterChooseSigns 64 66 .getInstance(); 65 67 … … 74 76 "prohibitory_noturn" }; 75 77 /** The the {@link JCheckBox} where the respective tag should be searched */ 76 private final JCheckBox[] SIGN_CHECKBOXES = { signFilter.max speed,78 private final JCheckBox[] SIGN_CHECKBOXES = { signFilter.maxSpeed, 77 79 signFilter.stop, signFilter.giveWay, signFilter.roundabout, 78 80 signFilter.access, signFilter.access, signFilter.intersection, … … 81 83 signFilter.crossing, signFilter.noTurn, signFilter.noTurn }; 82 84 83 p ublicMapillaryFilterDialog() {85 private MapillaryFilterDialog() { 84 86 super(tr("Mapillary filter"), "mapillaryfilter.png", 85 87 tr("Open Mapillary filter dialog"), Shortcut.registerShortcut( … … 119 121 } 120 122 123 /** 124 * Returns the unique instance of the class. 125 * 126 * @return THe unique instance of the class. 127 */ 121 128 public static MapillaryFilterDialog getInstance() { 122 129 if (INSTANCE == null) … … 209 216 /** 210 217 * Checks if the image fulfills the sign conditions. 211 * 218 * 212 219 * @param img 213 220 * The {@link MapillaryAbstractImage} object that is going to be … … 243 250 private class downloadCheckBoxAction extends AbstractAction { 244 251 252 private static final long serialVersionUID = 4672634002899519496L; 253 245 254 public downloadCheckBoxAction() { 246 255 putValue(NAME, tr("Downloaded images")); … … 254 263 255 264 private class UpdateAction extends AbstractAction { 265 266 private static final long serialVersionUID = -7417238601979689863L; 267 256 268 public UpdateAction() { 257 269 putValue(NAME, tr("Update")); … … 265 277 266 278 private class ResetAction extends AbstractAction { 279 /** 280 * 281 */ 282 private static final long serialVersionUID = 1178261778165525040L; 283 267 284 public ResetAction() { 268 285 putValue(NAME, tr("Reset")); … … 276 293 277 294 private class OnlySignsAction extends AbstractAction { 295 296 private static final long serialVersionUID = -2937440338019185723L; 297 278 298 public OnlySignsAction() { 279 299 putValue(NAME, tr("Only images with signs")); … … 288 308 /** 289 309 * Opens a new window where you can specifically filter signs. 290 * 310 * 291 311 * @author nokutu 292 312 * 293 313 */ 294 314 private class SignChooserAction extends AbstractAction { 315 316 private static final long serialVersionUID = 8706299665735930148L; 317 295 318 public SignChooserAction() { 296 319 putValue(NAME, tr("Choose signs")); … … 310 333 } 311 334 335 /** 336 * Destroys the unique instance of the class. 337 */ 312 338 public static void destroyInstance() { 313 339 MapillaryFilterDialog.INSTANCE = null; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryHistoryDialog.java
r31350 r31389 33 33 * Toggle dialog that shows you the latest {@link MapillaryCommand} done and 34 34 * allows the user to revert them. 35 * 35 * 36 36 * @see MapillaryRecord 37 37 * @see MapillaryCommand … … 42 42 MapillaryRecordListener { 43 43 44 public static MapillaryHistoryDialog INSTANCE; 44 private static final long serialVersionUID = -3019715241209349372L; 45 46 private static MapillaryHistoryDialog INSTANCE; 45 47 46 48 private final DefaultTreeModel undoTreeModel = new DefaultTreeModel( … … 57 59 private SideButton redoButton; 58 60 59 p ublicMapillaryHistoryDialog() {61 private MapillaryHistoryDialog() { 60 62 super(tr("Mapillary history"), "mapillaryhistory.png", 61 63 tr("Open Mapillary history dialog"), Shortcut.registerShortcut( … … 92 94 } 93 95 96 /** 97 * Returns the unique instance of the class. 98 * 99 * @return The unique instance of the class. 100 */ 94 101 public static MapillaryHistoryDialog getInstance() { 95 102 if (INSTANCE == null) … … 141 148 private class UndoAction extends AbstractAction { 142 149 150 private static final long serialVersionUID = -6435832206342007269L; 151 143 152 public UndoAction() { 144 153 putValue(NAME, tr("Undo")); … … 154 163 155 164 private class RedoAction extends AbstractAction { 165 166 private static final long serialVersionUID = -2761935780353053512L; 167 156 168 public RedoAction() { 157 169 putValue(NAME, tr("Redo")); … … 167 179 168 180 private static class MapillaryCellRenderer extends DefaultTreeCellRenderer { 181 182 private static final long serialVersionUID = -3129520241562296901L; 183 169 184 @Override 170 185 public Component getTreeCellRendererComponent(JTree tree, Object value, … … 177 192 } 178 193 194 /** 195 * Destroys the unique instance of the class. 196 */ 179 197 public static void destroyInstance() { 180 198 MapillaryHistoryDialog.INSTANCE = null; -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java
r31352 r31389 27 27 * included in a {@link MapillaryMainDialog} object. 28 28 * 29 * @author Jorge29 * @author nokutu 30 30 * @see MapillaryImageDisplay 31 31 * @see MapillaryMainDialog 32 32 */ 33 33 public class MapillaryImageDisplay extends JComponent { 34 35 private static final long serialVersionUID = 3369727203329307716L; 34 36 35 37 private static final int DRAG_BUTTON = Main.pref.getInteger( … … 55 57 private Rectangle selectedRect = null; 56 58 57 p ublicHyperlinkLabel hyperlink;59 protected HyperlinkLabel hyperlink; 58 60 59 61 private class ImgDisplayMouseListener implements MouseListener, … … 324 326 } 325 327 328 /** 329 * Main constructor. 330 */ 326 331 public MapillaryImageDisplay() { 327 332 ImgDisplayMouseListener mouseListener = new ImgDisplayMouseListener(); … … 356 361 357 362 /** 358 * Returns the picture that is being displaye rd363 * Returns the picture that is being displayed 359 364 * 360 * @return 365 * @return The picture that is being displayed. 361 366 */ 362 367 public BufferedImage getImage() { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryMainDialog.java
r31385 r31389 47 47 ICachedLoaderListener, MapillaryDataListener { 48 48 49 public final static String BASE_TITLE = "Mapillary picture"; 50 51 public static MapillaryMainDialog INSTANCE; 52 53 public volatile MapillaryAbstractImage image; 54 55 public final SideButton nextButton = new SideButton(new nextPictureAction()); 56 public final SideButton previousButton = new SideButton( 49 private static final long serialVersionUID = 6856496736429480600L; 50 51 private final static String BASE_TITLE = "Mapillary picture"; 52 53 private static MapillaryMainDialog INSTANCE; 54 55 private volatile MapillaryAbstractImage image; 56 57 private final SideButton nextButton = new SideButton(new nextPictureAction()); 58 private final SideButton previousButton = new SideButton( 57 59 new previousPictureAction()); 60 /** Button used to jump to the image following the red line */ 58 61 public final SideButton redButton = new SideButton(new redAction()); 62 /** Button used to jump to the image following the blue line */ 59 63 public final SideButton blueButton = new SideButton(new blueAction()); 60 64 61 65 private JPanel buttonsPanel; 62 66 63 p ublicMapillaryImageDisplay mapillaryImageDisplay;67 private MapillaryImageDisplay mapillaryImageDisplay; 64 68 65 69 private MapillaryCache imageCache; 66 70 private MapillaryCache thumbnailCache; 67 71 68 p ublicMapillaryMainDialog() {72 private MapillaryMainDialog() { 69 73 super(tr(BASE_TITLE), "mapillary.png", tr("Open Mapillary window"), 70 74 Shortcut.registerShortcut(tr("Mapillary dialog"), … … 105 109 } 106 110 111 /** 112 * Returns the unique instance of the class. 113 * 114 * @return The unique instance of the class. 115 */ 107 116 public static MapillaryMainDialog getInstance() { 108 117 if (INSTANCE == null) … … 111 120 } 112 121 122 /** 123 * Destroys the unique instance of the class. 124 */ 113 125 public static void destroyInstance() { 114 126 INSTANCE = null; … … 258 270 259 271 /** 260 * Returns the MapillaryImage objectswhich is being shown.261 * 262 * @return 272 * Returns the {@link MapillaryAbstractImage} object which is being shown. 273 * 274 * @return The {@link MapillaryAbstractImage} object which is being shown. 263 275 */ 264 276 public synchronized MapillaryAbstractImage getImage() { … … 269 281 * Action class form the next image button. 270 282 * 271 * @author Jorge283 * @author nokutu 272 284 * 273 285 */ 274 286 class nextPictureAction extends AbstractAction { 287 288 private static final long serialVersionUID = 3023827221453154340L; 289 275 290 public nextPictureAction() { 276 291 putValue(NAME, tr("Next picture")); … … 287 302 * Action class for the previous image button. 288 303 * 289 * @author Jorge304 * @author nokutu 290 305 * 291 306 */ 292 307 class previousPictureAction extends AbstractAction { 308 309 private static final long serialVersionUID = -6420511632957956012L; 310 293 311 public previousPictureAction() { 294 312 putValue(NAME, tr("Previous picture")); … … 310 328 */ 311 329 class redAction extends AbstractAction { 330 331 private static final long serialVersionUID = -6480229431481386376L; 332 312 333 public redAction() { 313 334 putValue(NAME, tr("Jump to red")); … … 331 352 */ 332 353 class blueAction extends AbstractAction { 354 355 private static final long serialVersionUID = 6250690644594703314L; 356 333 357 public blueAction() { 334 358 putValue(NAME, tr("Jump to blue")); -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryOAuthUI.java
r31388 r31389 19 19 public class MapillaryOAuthUI extends JPanel { 20 20 21 PortListener portListener; 22 JLabel text; 21 private static final long serialVersionUID = 5882019193626545915L; 22 23 private PortListener portListener; 24 private JLabel text; 23 25 24 26 /** -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryPreferenceSetting.java
r31350 r31389 19 19 import org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin; 20 20 21 /** 22 * Creates the preferences panel for the plugin. 23 * 24 * @author nokutu 25 * 26 */ 21 27 public class MapillaryPreferenceSetting implements SubPreferenceSetting { 22 28 … … 79 85 } 80 86 87 /** 88 * Opens the {@link MapillaryoAuthUI} window and lets the user log in. 89 * 90 * @author nokutu 91 * 92 */ 81 93 public class OAuthAction extends AbstractAction { 94 95 private static final long serialVersionUID = -3908477563072057344L; 82 96 83 97 @Override … … 97 111 98 112 private class LoginAction extends AbstractAction { 113 114 private static final long serialVersionUID = -7157028112711343289L; 115 99 116 private JOptionPane pane; 100 117 … … 111 128 112 129 private class CancelAction extends AbstractAction { 130 131 private static final long serialVersionUID = 2329066472975953270L; 132 113 133 private JOptionPane pane; 114 134 -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/AbstractMode.java
r31358 r31389 12 12 import org.openstreetmap.josm.plugins.mapillary.MapillaryData; 13 13 14 /** 15 * Superclass for all the mode of the {@link MapillaryLayer} 16 * 17 * @author nokutu 18 * @see MapillaryLayer 19 * 20 */ 14 21 public abstract class AbstractMode extends MouseAdapter { 15 22 16 23 protected MapillaryData data = MapillaryData.getInstance(); 17 24 25 /** 26 * Cursor that should become active when this mode is activated. 27 */ 18 28 public int cursor = Cursor.DEFAULT_CURSOR; 19 20 public AbstractMode() {21 super();22 }23 29 24 30 protected MapillaryAbstractImage getClosest(Point clickPoint) { … … 30 36 imagePoint.setLocation(imagePoint.getX(), imagePoint.getY()); 31 37 double dist = clickPoint.distanceSq(imagePoint); 32 if (minDistance > dist && clickPoint.distance(imagePoint) < snapDistance && image.isVisible()) { 38 if (minDistance > dist && clickPoint.distance(imagePoint) < snapDistance 39 && image.isVisible()) { 33 40 minDistance = dist; 34 41 closest = image; … … 38 45 } 39 46 47 /** 48 * Paints whatever the mode needs. 49 * 50 * @param g 51 * @param mv 52 * @param box 53 */ 40 54 public abstract void paint(Graphics2D g, MapView mv, Bounds box); 41 55 42 43 56 } -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/JoinMode.java
r31358 r31389 16 16 import org.openstreetmap.josm.plugins.mapillary.MapillarySequence; 17 17 18 /** 19 * In this mode the user can join pictures to make sequences or unjoin them. 20 * 21 * @author nokutu 22 * 23 */ 18 24 public class JoinMode extends AbstractMode { 19 25 20 public MapillaryImportedImage lastClick; 21 public MouseEvent lastPos; 22 26 private MapillaryImportedImage lastClick; 27 private MouseEvent lastPos; 28 29 /** 30 * Main constructor. 31 */ 23 32 public JoinMode() { 24 33 cursor = Cursor.CROSSHAIR_CURSOR; … … 29 38 if (data.getHighlighted() == null) 30 39 return; 31 if (lastClick == null && data.getHighlighted() instanceof MapillaryImportedImage) { 40 if (lastClick == null 41 && data.getHighlighted() instanceof MapillaryImportedImage) { 32 42 lastClick = (MapillaryImportedImage) data.getHighlighted(); 33 } else if (lastClick != null && data.getHighlighted() instanceof MapillaryImportedImage) { 34 if (((data.getHighlighted().previous() == null && lastClick.next() == null) || (data.getHighlighted().next() == null && lastClick 35 .previous() == null)) 36 && (data.getHighlighted().getSequence() != lastClick.getSequence() || lastClick.getSequence() == null)) { 43 } else if (lastClick != null 44 && data.getHighlighted() instanceof MapillaryImportedImage) { 45 if (((data.getHighlighted().previous() == null && lastClick.next() == null) || (data 46 .getHighlighted().next() == null && lastClick.previous() == null)) 47 && (data.getHighlighted().getSequence() != lastClick.getSequence() || lastClick 48 .getSequence() == null)) { 37 49 join(lastClick, (MapillaryImportedImage) data.getHighlighted()); 38 } else if (lastClick.next() == data.getHighlighted() || lastClick.previous() == data.getHighlighted()) 50 } else if (lastClick.next() == data.getHighlighted() 51 || lastClick.previous() == data.getHighlighted()) 39 52 unjoin(lastClick, (MapillaryImportedImage) data.getHighlighted()); 40 53 lastClick = null; … … 93 106 } 94 107 95 ArrayList<MapillaryAbstractImage> firstHalf = new ArrayList<>(img1.getSequence().getImages() 108 ArrayList<MapillaryAbstractImage> firstHalf = new ArrayList<>(img1 109 .getSequence().getImages() 96 110 .subList(0, img1.getSequence().getImages().indexOf(img2))); 97 ArrayList<MapillaryAbstractImage> secondHalf = new ArrayList<>(img1.getSequence().getImages() 98 .subList(img1.getSequence().getImages().indexOf(img2), img1.getSequence().getImages().size())); 111 ArrayList<MapillaryAbstractImage> secondHalf = new ArrayList<>(img1 112 .getSequence() 113 .getImages() 114 .subList(img1.getSequence().getImages().indexOf(img2), 115 img1.getSequence().getImages().size())); 99 116 100 117 MapillarySequence seq1 = new MapillarySequence(); … … 110 127 } 111 128 } 112 129 113 130 @Override 114 131 public String toString() { -
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/mode/SelectMode.java
r31385 r31389 38 38 private boolean imageHighlighted = false; 39 39 40 /** 41 * Main constructor. 42 */ 40 43 public SelectMode() { 41 44 record = MapillaryRecord.getInstance();
Note:
See TracChangeset
for help on using the changeset viewer.