Ignore:
Timestamp:
2018-05-29T01:26:17+02:00 (7 years ago)
Author:
donvip
Message:

fix some java/javadoc warnings

Location:
applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/actions/mapmode/Address.java

    r33706 r34223  
    8989    JLabel link = new JLabel();
    9090    private transient Way selectedWay;
    91     private boolean shift;
    92     private boolean ctrl;
    9391
    9492    /**
     
    129127        if (e.getButton() != MouseEvent.BUTTON1)
    130128            return;
    131         shift = (e.getModifiers() & ActionEvent.SHIFT_MASK) != 0;
    132         ctrl = (e.getModifiers() & ActionEvent.CTRL_MASK) != 0;
     129        updateKeyModifiers(e);
    133130        MapView mv = MainApplication.getMap().mapView;
    134131        Point mousePos = e.getPoint();
     
    379376            // fall through to default action.
    380377            // (for semi-parallel lines, intersection might be miles away!)
    381             if (MainApplication.getMap().mapView.getPoint(n).distance(MainApplication.getMap().mapView.getPoint(intersection)) < snapToIntersectionThreshold) {
     378            MapView mv = MainApplication.getMap().mapView;
     379            if (mv.getPoint(n).distance(mv.getPoint(intersection)) < snapToIntersectionThreshold) {
    382380                n.setEastNorth(intersection);
    383381                return;
    384382            }
    385 
     383            // fall through
    386384        default:
    387385            EastNorth P = n.getEastNorth();
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/actions/upload/CheckSourceUploadHook.java

    r34139 r34223  
    5555    /**
    5656     * Check whenever one of the keys of the object is "source"
     57     * @param osm primitive to check
    5758     * @return true if one of keys is "source"
    5859     */
    5960    private boolean tagSourceExist(OsmPrimitive osm) {
    60         for (String key : osm.keySet()) {
    61             if (key.equals("source")) {
    62                 return true;
    63             }
    64         }
    65         return false;
     61        return osm.hasKey("source");
    6662    }
    6763
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/download/CadastreDownloadData.java

    r33675 r34223  
    1818    /**
    1919     * Constructs a new {@code CadastreDownloadData}.
     20     * @param downloadWater whether to download water layer
     21     * @param downloadBuilding whether to download building layer
     22     * @param downloadSymbol whether to download symbol layer
     23     * @param downloadParcel whether to download parcel layer
     24     * @param downloadParcelNumber whether to download parcel number layer
     25     * @param downloadAddress whether to download address layer
     26     * @param downloadLocality whether to download locality layer
     27     * @param downloadSection whether to download section layer
     28     * @param downloadCommune whether to download communal layer
    2029     */
    2130    CadastreDownloadData(boolean downloadWater, boolean downloadBuilding, boolean downloadSymbol,
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/EdigeoLotFile.java

    r34115 r34223  
    7777    /**
    7878     * Finds a descriptor by its identifier.
     79     * @param <T> block type
    7980     * @param values 4 values obtained from a {@code EdigeoRecord}:<ol>
    8081     * <li>Lot identifier</li>
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/edigeo/utils/ClassToInstancesMap.java

    r33649 r34223  
    2020     * entry for this class is present. This will only return values that were
    2121     * bound to this specific class, not values that may have been bound to a subtype.
     22     * @param <T> block type
    2223     * @param type type
    2324     * @return the values the specified class is mapped to, or {@code null}
     
    2829     * Maps the specified class to the specified values. Does <i>not</i> associate
    2930     * these values with any of the class's supertypes.
     31     * @param <T> block type
    3032     * @param type type
    3133     * @param values new values
     
    3840    /**
    3941     * Adds a new value to the list mapped to the specified class.
     42     * @param <T> block type
    4043     * @param type type
    4144     * @param value value to add
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/wms/CacheFileLambert4ZoneFilter.java

    r33638 r34223  
    1717    private final String description;
    1818
     19    /**
     20     * Filters for each one of the 4 Lambert zones.
     21     */
    1922    public static final CacheFileLambert4ZoneFilter[] filters = {
    2023        new CacheFileLambert4ZoneFilter("1", tr("Lambert Zone {0} cache file (.{0})", 1)),
     
    2629    /**
    2730     * Construct an extension file filter by giving the extension to check after.
    28      *
     31     * @param extension file extension
     32     * @param description file description
    2933     */
    3034    private CacheFileLambert4ZoneFilter(String extension, String description) {
     
    3337    }
    3438
    35     public boolean acceptName(String filename) {
     39    boolean acceptName(String filename) {
    3640        String name = filename.toLowerCase(Locale.FRANCE);
    3741        for (String ext : extension.split(",")) {
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/wms/CacheFileLambert9ZoneFilter.java

    r33638 r34223  
    1616    private final String description;
    1717
     18    /**
     19     * Filters for each one of the 9 Lambert zones.
     20     */
    1821    public static CacheFileLambert9ZoneFilter[] filters = {
    1922        new CacheFileLambert9ZoneFilter("cc1", tr("Lambert CC9 Zone {0} cache file (.CC{0})", 1)),
     
    3033    /**
    3134     * Construct an extension file filter by giving the extension to check after.
    32      *
     35     * @param extension file extension
     36     * @param description file description
    3337     */
    3438    private CacheFileLambert9ZoneFilter(String extension, String description) {
     
    3741    }
    3842
    39     public boolean acceptName(String filename) {
     43    boolean acceptName(String filename) {
    4044        String name = filename.toLowerCase();
    4145        for (String ext : extension.split(",")) {
     
    5761        return description;
    5862    }
    59 
    6063}
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/wms/CacheFileUTM20NFilter.java

    r33638 r34223  
    1616    private final String description;
    1717
     18    /**
     19     * Filters for each one of the 4 French UTM zones.
     20     */
    1821    public static CacheFileUTM20NFilter[] filters = {
    1922        new CacheFileUTM20NFilter("utm1", tr("Guadeloupe Fort-Marigot cache file (.UTM1)")),
     
    2528    /**
    2629     * Construct an extension file filter by giving the extension to check after.
    27      *
     30     * @param extension file extension
     31     * @param description file description
    2832     */
    2933    private CacheFileUTM20NFilter(String extension, String description) {
     
    3236    }
    3337
    34     public boolean acceptName(String filename) {
     38    boolean acceptName(String filename) {
    3539        String name = filename.toLowerCase();
    3640        for (String ext : extension.split(",")) {
     
    5256        return description;
    5357    }
    54 
    5558}
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/wms/CadastreGrabber.java

    r33640 r34223  
    2121    private CadastreInterface wmsInterface = new CadastreInterface();
    2222
    23     public GeorefImage grab(WMSLayer wmsLayer, EastNorth lambertMin, EastNorth lambertMax)
     23    GeorefImage grab(WMSLayer wmsLayer, EastNorth lambertMin, EastNorth lambertMax)
    2424            throws IOException, OsmTransferException {
    2525        try {
     
    8989    }
    9090
    91     public CadastreInterface getWmsInterface() {
     91    CadastreInterface getWmsInterface() {
    9292        return wmsInterface;
    9393    }
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/wms/CadastreInterface.java

    r34115 r34223  
    3838
    3939public class CadastreInterface {
    40     public boolean downloadCanceled;
     40    boolean downloadCanceled;
    4141    private Response urlConn;
    4242
     
    6060    private long cookieTimestamp;
    6161
    62     public static final String BASE_URL = "https://www.cadastre.gouv.fr";
     62    static final String BASE_URL = "https://www.cadastre.gouv.fr";
    6363    static final String C_IMAGE_FORMAT = "Cette commune est au format ";
    6464    static final String C_COMMUNE_LIST_START = "<select name=\"codeCommune\"";
     
    8484    static final int RETRIES_GET_COOKIE = 10; // 10 times every 3 seconds means 30 seconds trying to get a cookie
    8585
    86     public boolean retrieveInterface(WMSLayer wmsLayer) throws DuplicateLayerException, WMSException {
     86    boolean retrieveInterface(WMSLayer wmsLayer) throws DuplicateLayerException, WMSException {
    8787        if (wmsLayer.getName().isEmpty())
    8888            return false;
     
    120120     * Returns if a cookie is delivered by WMS, throws exception if WMS is not opening a client session
    121121     * (too many clients or in maintenance)
     122     * @throws IOException if an I/O error occurs
    122123     */
    123124    private void getCookie() throws IOException {
     
    174175    }
    175176
    176     public void resetCookie() {
     177    void resetCookie() {
    177178        lastWMSLayerName = null;
    178179        cookie = null;
    179180    }
    180181
    181     public boolean isCookieExpired() {
     182    boolean isCookieExpired() {
    182183        long now = new Date().getTime();
    183184        if ((now - cookieTimestamp) > COOKIE_EXPIRATION) {
     
    188189    }
    189190
    190     public void resetInterfaceRefIfNewLayer(String newWMSLayerName) {
     191    void resetInterfaceRefIfNewLayer(String newWMSLayerName) {
    191192        if (!newWMSLayerName.equals(lastWMSLayerName)) {
    192193            interfaceRef = null;
     
    195196    }
    196197
    197     public HttpClient getHttpClient(URL url) {
     198    HttpClient getHttpClient(URL url) {
    198199        return HttpClient.create(url).setHeader("Cookie", cookie);
    199200    }
    200201
    201     public HttpClient getHttpClient(URL url, String method) {
     202    HttpClient getHttpClient(URL url, String method) {
    202203        return HttpClient.create(url, method).setHeader("Cookie", cookie);
    203204    }
     
    275276     * The returned string is the interface name used in further requests, e.g. "afficherCarteCommune.do?c=QP224"
    276277     * where QP224 is the code commune known by the WMS (or "afficherCarteTa.do?c=..." for raster images).
     278     * @param wmsLayer WMS layer
     279     * @param codeCommune Commune code
    277280     *
    278281     * @return retURL url to available code commune in the cadastre; "" if not found
     282     * @throws IOException if an I/O error occurs
    279283     */
    280284    private String postForm(WMSLayer wmsLayer, String codeCommune) throws IOException {
     
    466470     * @throws IOException if any I/O error occurs
    467471     */
    468     public void retrieveCommuneBBox(WMSLayer wmsLayer) throws IOException {
     472    void retrieveCommuneBBox(WMSLayer wmsLayer) throws IOException {
    469473        if (interfaceRef == null)
    470474            return;
     
    542546    }
    543547
    544     public void cancel() {
     548    void cancel() {
    545549        if (urlConn != null) {
    546550            urlConn.disconnect();
     
    550554    }
    551555
    552     public InputStream getContent(URL url) throws IOException, OsmTransferException {
     556    InputStream getContent(URL url) throws IOException, OsmTransferException {
    553557        urlConn = getHttpClient(url).setHeader("Connection", "close").connect();
    554558        return urlConn.getContent();
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/wms/GrabThread.java

    r33640 r34223  
    3636    /**
    3737     * Call directly grabber for raster images or prepare thread for vector images
     38     * @param moreImages more images to grab
    3839     */
    39     public void addImages(ArrayList<EastNorthBound> moreImages) {
     40    void addImages(ArrayList<EastNorthBound> moreImages) {
    4041        lockImagesToGrag.lock();
    4142        imagesToGrab.addAll(moreImages);
     
    5758    }
    5859
    59     public ArrayList<EastNorthBound> getImagesToGrabCopy() {
     60    ArrayList<EastNorthBound> getImagesToGrabCopy() {
    6061        ArrayList<EastNorthBound> copyList = new ArrayList<>();
    6162        lockImagesToGrag.lock();
     
    6869    }
    6970
    70     public void clearImagesToGrab() {
     71    void clearImagesToGrab() {
    7172        lockImagesToGrag.lock();
    7273        imagesToGrab.clear();
     
    143144    }
    144145
    145     public void saveToCache(GeorefImage image) {
     146    void saveToCache(GeorefImage image) {
    146147        if (CacheControl.cacheEnabled && !wmsLayer.isRaster()) {
    147148            getCacheControl().saveCache(image);
     
    160161    }
    161162
     163    /**
     164     * Cancel grab.
     165     */
    162166    public void cancel() {
    163167        clearImagesToGrab();
     
    170174    }
    171175
     176    /**
     177     * Returns the Cache control.
     178     * @return the Cache control
     179     */
    172180    public CacheControl getCacheControl() {
    173181        if (cacheControl == null)
     
    176184    }
    177185
    178     public GrabThread(WMSLayer wmsLayer) {
     186    GrabThread(WMSLayer wmsLayer) {
    179187        this.wmsLayer = wmsLayer;
    180188    }
    181189
    182     public void paintBoxesToGrab(Graphics g, MapView mv) {
     190    void paintBoxesToGrab(Graphics g, MapView mv) {
    183191        if (getImagesToGrabSize() > 0) {
    184192            ArrayList<EastNorthBound> imagesToGrab = getImagesToGrabCopy();
     
    207215    }
    208216
    209     public boolean isCanceled() {
     217    boolean isCanceled() {
    210218        return canceled;
    211219    }
    212220
    213     public void setCanceled(boolean canceled) {
     221    void setCanceled(boolean canceled) {
    214222        this.canceled = canceled;
    215223    }
    216224
    217     public CadastreGrabber getGrabber() {
     225    CadastreGrabber getGrabber() {
    218226        return grabber;
    219227    }
    220228
    221     public void setGrabber(CadastreGrabber grabber) {
     229    void setGrabber(CadastreGrabber grabber) {
    222230        this.grabber = grabber;
    223231    }
  • applications/editors/josm/plugins/cadastre-fr/src/org/openstreetmap/josm/plugins/fr/cadastre/wms/ImageModifier.java

    r33638 r34223  
    2020    protected BufferedImage bufferedImage;
    2121
    22     public static int[] cRoofColors = new int[] {-197380, -592138};
    23     public static int[] cBuilingFootColors = new int[] {-256};
     22    private static int[] cRoofColors = new int[] {-197380, -592138};
     23    private static int[] cBuilingFootColors = new int[] {-256};
    2424
    2525    protected BufferedImage convert1(BufferedImage src) {
     
    7070        };
    7171        return convert4(src, cmap);
    72       }
     72    }
    7373
    74       /**
    75        * Converts the source image to 4-bit colour
    76        * using the given colour map.  No transparency.
    77        * @param src the source image to convert
    78        * @param cmap the colour map, which should contain no more than 16 entries
    79        * The entries are in the form RRGGBB (hex).
    80        * @return a copy of the source image with a 4-bit colour depth, with the custom colour pallette
    81        */
     74    /**
     75     * Converts the source image to 4-bit colour
     76     * using the given colour map.  No transparency.
     77     * @param src the source image to convert
     78     * @param cmap the colour map, which should contain no more than 16 entries
     79     * The entries are in the form RRGGBB (hex).
     80     * @return a copy of the source image with a 4-bit colour depth, with the custom colour pallette
     81     */
    8282    protected BufferedImage convert4(BufferedImage src, int[] cmap) {
    8383        IndexColorModel icm = new IndexColorModel(
     
    156156    /**
    157157     * Checks if the rgb value is the black background color
     158     * @param img image
     159     * @param x X coordinate
     160     * @param y Y coordinate
     161     * @return {@code true} if the rgb value is the black background color
    158162     */
    159163    public boolean isBackgroundColor(BufferedImage img, int x, int y) {
Note: See TracChangeset for help on using the changeset viewer.