Changeset 31333 in osm for applications/editors/josm


Ignore:
Timestamp:
2015-07-02T16:33:39+02:00 (9 years ago)
Author:
nokutu
Message:

Code cleaned

Location:
applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary
Files:
1 added
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryAbstractImage.java

    r31331 r31333  
    2323    public static Lock lock = new ReentrantLock();
    2424
     25    /** The time the image was captured, in Epoch format */
    2526    private long capturedAt;
    26 
    2727    /** Position of the picture */
    2828    public final LatLon latLon;
     
    7878     * Returns whether the image is visible on the map or not.
    7979     *
    80      * @return
     80     * @return True if the image is visible; false otherwise.
    8181     */
    8282    public boolean isVisible() {
     
    9191     * Returns the last fixed coordinates of the object.
    9292     *
    93      * @return
     93     * @return A LatLon object containing.
    9494     */
    9595    public LatLon getTempLatLon() {
     
    101101     *
    102102     * @param x
     103     *            The movement of the image in longitude units.
    103104     * @param y
     105     *            The movement of the image in latitude units.
    104106     */
    105107    public void move(double x, double y) {
     
    113115     *
    114116     * @param ca
     117     *            The angle the image is moving.
    115118     */
    116119    public void turn(double ca) {
     
    140143     * Returns the last fixed direction of the object.
    141144     *
    142      * @return
     145     * @return The last fixed direction of the object. 0 means north.
    143146     */
    144147    public double getTempCa() {
     
    149152     * Returns the date the picture was taken in DMY format.
    150153     *
    151      * @return
     154     * @return A String object containing the date when the picture was taken.
    152155     */
    153156    public String getDate() {
     
    192195     *
    193196     * @param date
     197     *            The string containing the date.
    194198     * @param format
    195      * @return
     199     *            The format of the date.
     200     * @return The date in Epoch format.
    196201     */
    197202    public long getEpoch(String date, String format) {
     
    210215     * Returns current time in Epoch format
    211216     *
    212      * @return
     217     * @return The current date in Epoch format.
    213218     */
    214219    private long currentTime() {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryData.java

    r31331 r31333  
    9393
    9494    /**
    95      * Sets the image under the mouse cursor.
    96      *
    97      * @param image
    98      */
    99     public void setHoveredImage(MapillaryAbstractImage image) {
     95     * Highlights the image under the cursor.
     96     *
     97     * @param image
     98     *            The image under the cursor.
     99     */
     100    public void setHighlightedImage(MapillaryAbstractImage image) {
    100101        highlightedImage = image;
    101102    }
     
    104105     * Returns the image under the mouse cursor.
    105106     *
    106      * @return
     107     * @return The image under the mouse cursor.
    107108     */
    108109    public MapillaryAbstractImage getHoveredImage() {
     
    210211
    211212    /**
    212      * Selects a new image and then starts a new MapillaryImageDownloadThread
    213      * thread in order to download its surrounding thumbnails. If the user does
    214      * ctrl+click, this isn't triggered.
     213     * Selects a new image and then starts a new
     214     * {@link MapillaryImageDownloadThread} thread in order to download its
     215     * surrounding thumbnails. If the user does ctrl+click, this isn't
     216     * triggered.
    215217     *
    216218     * @param image
     
    222224
    223225    /**
    224      * Selects a new image and then starts a new MapillaryImageDownloadThread
    225      * thread in order to download its surrounding thumbnails. If the user does
    226      * ctrl+click, this isn't triggered. You can choose whether to center the
    227      * view on the new image or not.
    228      *
    229      * @param image
     226     * Selects a new image and then starts a new
     227     * {@link MapillaryImageDownloadThread} thread in order to download its
     228     * surrounding thumbnails. If the user does ctrl+click, this isn't
     229     * triggered. You can choose whether to center the view on the new image or
     230     * not.
     231     *
     232     * @param image
     233     *            The {@link MapillaryImage} which is going to be selected.
    230234     * @param zoom
     235     *            True if the view must be centered on the image; false
     236     *            otherwise.
    231237     */
    232238    public void setSelectedImage(MapillaryAbstractImage image, boolean zoom) {
     
    291297
    292298    /**
    293      * Adds a set of MapillaryImage objects to the list of selected images.
     299     * Adds a set of {@code MapillaryAbstractImage} objects to the list of
     300     * selected images.
    294301     *
    295302     * @param images
     303     *            A List object containing the set of images to be added.
    296304     */
    297305    public void addMultiSelectedImage(List<MapillaryAbstractImage> images) {
     
    307315
    308316    /**
    309      * Returns a list containing all MapillaryImage objects selected with ctrl +
    310      * click
    311      *
    312      * @return
     317     * Returns a List containing all {@code MapillaryAbstractImage} objects
     318     * selected with ctrl + click
     319     *
     320     * @return A List object containing all the images selected.
    313321     */
    314322    public List<MapillaryAbstractImage> getMultiSelectedImages() {
     
    329337     * Returns the amount of images contained by this object.
    330338     *
    331      * @return
     339     * @return The amount of images in stored.
    332340     */
    333341    public int size() {
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryDataListener.java

    r31328 r31333  
    33public interface MapillaryDataListener {
    44
     5    /**
     6     * Fired when any image is added to the database.
     7     */
    58    public void imagesAdded();
    69
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImage.java

    r31328 r31333  
    1717    private MapillarySequence sequence;
    1818
    19     /** Epoch time when the image was taken. */
    2019    /** The user that made the image */
    2120    private String user;
     
    6362     *
    6463     * @param sign
     64     *            A String that identifies the type of sign.
    6565     */
    6666    public void addSign(String sign) {
     
    6868    }
    6969
     70    /**
     71     * Returns a List containing the signs assigned to this image.
     72     *
     73     * @return A List object containing the signs assigned to this image.
     74     */
    7075    public List<String> getSigns() {
    7176        return signs;
    7277    }
    7378
     79    /**
     80     * Sets the username of the person who took the image.
     81     * @param user A String containing the username of the person who took the image.
     82     */
    7483    public void setUser(String user) {
    7584        this.user = user;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryImportedImage.java

    r31328 r31333  
    3939    }
    4040
     41    /**
     42     * Returns the File object where the picture is located.
     43     * @return The File object where the picture is located.
     44     */
    4145    public File getFile() {
    4246        return file;
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryLayer.java

    r31331 r31333  
    99import org.openstreetmap.josm.plugins.mapillary.downloads.MapillaryDownloader;
    1010import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryFilterDialog;
    11 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryToggleDialog;
     11import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog;
    1212import org.openstreetmap.josm.Main;
    1313import org.openstreetmap.josm.gui.layer.Layer;
     
    110110        }
    111111        MapillaryPlugin.setMenuEnabled(MapillaryPlugin.EXPORT_MENU, true);
    112         if (!MapillaryToggleDialog.getInstance().isShowing())
    113             MapillaryToggleDialog.getInstance().getButton().doClick();
     112        if (!MapillaryMainDialog.getInstance().isShowing())
     113            MapillaryMainDialog.getInstance().getButton().doClick();
    114114        createHatchTexture();
    115115        data.dataUpdated();
     
    178178    @Override
    179179    public void destroy() {
    180         MapillaryToggleDialog.getInstance().setImage(null);
    181         MapillaryToggleDialog.getInstance().updateImage();
     180        MapillaryMainDialog.getInstance().setImage(null);
     181        MapillaryMainDialog.getInstance().updateImage();
    182182        data.getImages().clear();
    183183        MapillaryLayer.INSTANCE = null;
     
    278278        MapillaryLayer.BLUE = null;
    279279        MapillaryLayer.RED = null;
    280         MapillaryToggleDialog.getInstance().blueButton.setEnabled(false);
    281         MapillaryToggleDialog.getInstance().redButton.setEnabled(false);
     280        MapillaryMainDialog.getInstance().blueButton.setEnabled(false);
     281        MapillaryMainDialog.getInstance().redButton.setEnabled(false);
    282282
    283283        // Sets blue and red lines and enables/disables the buttons
     
    291291                        mv.getPoint(closestImages[0].getLatLon()).y,
    292292                        selected.x, selected.y);
    293                 MapillaryToggleDialog.getInstance().blueButton.setEnabled(true);
     293                MapillaryMainDialog.getInstance().blueButton.setEnabled(true);
    294294            }
    295295            if (closestImages[1] != null) {
     
    299299                        mv.getPoint(closestImages[1].getLatLon()).y,
    300300                        selected.x, selected.y);
    301                 MapillaryToggleDialog.getInstance().redButton.setEnabled(true);
     301                MapillaryMainDialog.getInstance().redButton.setEnabled(true);
    302302            }
    303303        }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryMouseAdapter.java

    r31313 r31333  
    1313import org.openstreetmap.josm.plugins.mapillary.commands.CommandTurnImage;
    1414import org.openstreetmap.josm.plugins.mapillary.commands.MapillaryRecord;
    15 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryToggleDialog;
     15import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog;
    1616
    1717/**
     
    231231        if (MapillaryData.getInstance().getHoveredImage() != closestTemp
    232232                && closestTemp != null) {
    233             MapillaryData.getInstance().setHoveredImage(closestTemp);
    234             MapillaryToggleDialog.getInstance().setImage(closestTemp);
    235             MapillaryToggleDialog.getInstance().updateImage();
     233            MapillaryData.getInstance().setHighlightedImage(closestTemp);
     234            MapillaryMainDialog.getInstance().setImage(closestTemp);
     235            MapillaryMainDialog.getInstance().updateImage();
    236236        } else if (MapillaryData.getInstance().getHoveredImage() != closestTemp
    237237                && closestTemp == null) {
    238             MapillaryData.getInstance().setHoveredImage(null);
    239             MapillaryToggleDialog.getInstance().setImage(
     238            MapillaryData.getInstance().setHighlightedImage(null);
     239            MapillaryMainDialog.getInstance().setImage(
    240240                    MapillaryData.getInstance().getSelectedImage());
    241             MapillaryToggleDialog.getInstance().updateImage();
     241            MapillaryMainDialog.getInstance().updateImage();
    242242        }
    243243        MapillaryData.getInstance().dataUpdated();
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/MapillaryPlugin.java

    r31328 r31333  
    2121import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryHistoryDialog;
    2222import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryPreferenceSetting;
    23 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryToggleDialog;
     23import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog;
    2424import org.openstreetmap.josm.plugins.mapillary.actions.*;
    2525import org.openstreetmap.josm.tools.ImageProvider;
     
    101101    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
    102102        if (oldFrame == null && newFrame != null) { // map frame added
    103             Main.map.addToggleDialog(MapillaryToggleDialog.getInstance(), false);
     103            Main.map.addToggleDialog(MapillaryMainDialog.getInstance(), false);
    104104            Main.map.addToggleDialog(MapillaryHistoryDialog.getInstance(),
    105105                    false);
     
    111111        }
    112112        if (oldFrame != null && newFrame == null) { // map frame destroyed
    113             MapillaryToggleDialog.destroyInstance();
     113            MapillaryMainDialog.destroyInstance();
    114114            MapillaryHistoryDialog.destroyInstance();
    115115            MapillaryFilterDialog.destroyInstance();
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySequenceDownloadThread.java

    r31331 r31333  
    120120
    121121    private boolean isInside(MapillaryAbstractImage image) {
    122         for (int i = 0; i < bounds.size(); i++) {
     122        for (int i = 0; i < bounds.size(); i++)
    123123            if (bounds.get(i).contains(image.getLatLon()))
    124124                return true;
    125         }
    126125        return false;
    127126    }
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/downloads/MapillarySquareDownloadManagerThread.java

    r31331 r31333  
    1010import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
    1111import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryFilterDialog;
    12 import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryToggleDialog;
     12import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog;
    1313
    1414/**
     
    4545                        .setHelpText("Downloading image's information");
    4646                completeImages();
    47                 MapillaryToggleDialog.getInstance().updateTitle();
     47                MapillaryMainDialog.getInstance().updateTitle();
    4848                Main.map.statusLine.setHelpText("Downloading signs");
    4949                downloadSigns();
     
    5959        layer.data.dataUpdated();
    6060        MapillaryFilterDialog.getInstance().refresh();
    61         MapillaryToggleDialog.getInstance().updateImage();
     61        MapillaryMainDialog.getInstance().updateImage();
    6262    }
    6363
  • applications/editors/josm/plugins/mapillary/src/org/openstreetmap/josm/plugins/mapillary/gui/MapillaryImageDisplay.java

    r31331 r31333  
    2525/**
    2626 * This object is a responsible JComponent which lets you zoom and drag. It is
    27  * included in a {@link MapillaryToggleDialog} object.
     27 * included in a {@link MapillaryMainDialog} object.
    2828 *
    2929 * @author Jorge
    3030 * @see MapillaryImageDisplay
    31  * @see MapillaryToggleDialog
     31 * @see MapillaryMainDialog
    3232 */
    3333public class MapillaryImageDisplay extends JComponent {
Note: See TracChangeset for help on using the changeset viewer.