Changeset 29757 in osm for applications/viewer/jmapviewer


Ignore:
Timestamp:
2013-07-17T00:02:17+02:00 (11 years ago)
Author:
stoecker
Message:

see #josm8853 remove tabs, trailing spaces, windows line ends, strange characters

Location:
applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/AttributionSupport.java

    r29385 r29757  
    2727    public static final Font ATTR_FONT = new Font("Arial", Font.PLAIN, 10);
    2828    public static final Font ATTR_LINK_FONT;
    29    
     29
    3030    protected Rectangle attrTextBounds = null;
    3131    protected Rectangle attrToUBounds = null;
     
    5959            attrImageBounds = null;
    6060            attrTextBounds = null;
    61             return;           
     61            return;
    6262        }
    63        
     63
    6464        // Draw attribution
    6565        Font font = g.getFont();
     
    128128        return false;
    129129    }
    130    
     130
    131131    public boolean handleAttribution(Point p, boolean click) {
    132132        if (source == null || !source.requiresAttribution())
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Demo.java

    r29517 r29757  
    198198        map().addMapPolygon( bermudas );
    199199        map().addMapPolygon( new MapPolygonImpl(germanyEastLayer, "Riedstadt", ebersheim, darmstadt, eberstadt, empty));
    200        
     200
    201201        map().addMapMarker(new MapMarkerCircle(germanyWestLayer, "North of Suisse", new Coordinate(48, 7), .5));
    202202        Layer spain = treeMap.addLayer("Spain");
    203203        map().addMapMarker(new MapMarkerCircle(spain, "La Garena", new Coordinate(40.4838, -3.39), .002));
    204204        spain.setVisible(false);
    205        
     205
    206206        Layer wales = treeMap.addLayer("UK");
    207207        map().addMapRectangle(new MapRectangleImpl(wales, "Wales", c(53.35,-4.57), c(51.64,-2.63)));
     
    209209        // map.setDisplayPositionByLatLon(49.807, 8.6, 11);
    210210        // map.setTileGridVisible(true);
    211        
     211
    212212        map().addMouseListener(new MouseAdapter() {
    213213            @Override
     
    218218            }
    219219        });
    220        
     220
    221221        map().addMouseMotionListener(new MouseAdapter() {
    222222            @Override
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java

    r29516 r29757  
    8282    protected JButton zoomInButton;
    8383    protected JButton zoomOutButton;
    84        
     84
    8585    public static enum ZOOM_BUTTON_STYLE {
    8686        HORIZONTAL,
     
    425425        return new Point(x, y);
    426426    }
    427    
     427
    428428    /**
    429429     * Calculates the position on the map of a given coordinate
     
    454454        return getMapPosition(lat, lon, true);
    455455    }
    456    
     456
    457457    /**
    458458     * Calculates the position on the map of a given coordinate
     
    561561        int x_max = getWidth();
    562562        int y_max = getHeight();
    563        
     563
    564564        // calculate the length of the grid (number of squares per edge)
    565565        int gridLength = 1 << zoom;
     
    617617            center.x = center.x % mapSize;
    618618        }
    619        
     619
    620620        if (mapPolygonsVisible && mapPolygonList != null) {
    621621            for (MapPolygon polygon : mapPolygonList) {
     
    704704                        rectangle.paint(g, pTopLeft, pBottomRight);
    705705                    }
    706                    
     706
    707707                }
    708708            }
     
    10101010        repaint();
    10111011    }
    1012    
     1012
    10131013    public boolean isScrollWrapEnabled() {
    10141014        return scrollWrapEnabled;
    10151015    }
    1016    
     1016
    10171017    public void setScrollWrapEnabled(boolean scrollWrapEnabled) {
    10181018        this.scrollWrapEnabled = scrollWrapEnabled;
    10191019        repaint();
    10201020    }
    1021    
     1021
    10221022    public ZOOM_BUTTON_STYLE getZoomButtonStyle() {
    10231023        return zoomButtonStyle;
    10241024    }
    1025    
     1025
    10261026    public void setZoomButtonStyle(ZOOM_BUTTON_STYLE style) {
    10271027        zoomButtonStyle = style;
     
    10521052        return tileController;
    10531053    }
    1054    
     1054
    10551055    /**
    10561056     * Return tile information caching class
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapMarkerCircle.java

    r29517 r29757  
    6161        return coord.getLon();
    6262    }
    63    
     63
    6464    public double getRadius() {
    6565        return radius;
    6666    }
    67    
     67
    6868    public STYLE getMarkerStyle() {
    6969        return markerStyle;
     
    7373        int size_h = radio;
    7474        int size = size_h * 2;
    75        
     75
    7676        if (g instanceof Graphics2D && getBackColor()!=null) {
    7777            Graphics2D g2 = (Graphics2D) g;
     
    8484        g.setColor(getColor());
    8585        g.drawOval(position.x - size_h, position.y - size_h, size, size);
    86        
     86
    8787        if(getLayer()==null||getLayer().isVisibleTexts()) paintText(g, position);
    8888    }
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapMarkerDot.java

    r29517 r29757  
    4747        super(layer, name, coord, DOT_RADIUS, STYLE.FIXED, style);
    4848    }
    49    
     49
    5050    public static Style getDefaultStyle(){
    5151        return new Style(Color.BLACK, Color.YELLOW, null, getDefaultFont());
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/MapPolygonImpl.java

    r29516 r29757  
    8080        Color oldColor = g.getColor();
    8181        g.setColor(getColor());
    82        
     82
    8383        Stroke oldStroke = null;
    8484        if (g instanceof Graphics2D) {
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmFileCacheTileLoader.java

    r29731 r29757  
    5555
    5656    protected String cacheDirBase;
    57    
     57
    5858    protected final Map<TileSource, File> sourceCacheDirMap;
    5959
     
    128128        return dir;
    129129    }
    130    
     130
    131131    protected class FileLoadJob implements TileJob {
    132132        InputStream input = null;
     
    342342         * </ul>
    343343         *
    344          * @param fileAge time of the 
     344         * @param fileAge time of the
    345345         * @return <code>true</code> if the tile on the server is newer than the
    346346         *         file
     
    492492        this.cacheDirBase = dir.getAbsolutePath();
    493493    }
    494    
     494
    495495    @Override
    496496    public void clearCache(TileSource source) {
    497497        clearCache(source, null);
    498498    }
    499    
     499
    500500    @Override
    501501    public void clearCache(TileSource source, TileClearController controller) {
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmMercator.java

    r28505 r29757  
    1919    public static final double MAX_LAT = 85.05112877980659;
    2020    public static final double MIN_LAT = -85.05112877980659;
    21     private static double EARTH_RADIUS = 6378137; // equatorial earth radius for EPSG:3857 (Mercator) 
     21    private static double EARTH_RADIUS = 6378137; // equatorial earth radius for EPSG:3857 (Mercator)
    2222
    2323    public static double radius(int aZoomlevel) {
     
    5151     * @param x2 the second x coordinate
    5252     * @param y2 the second y coordinate
    53      * 
     53     *
    5454     * @param zoomLevel the zoom level
    5555     * @return the distance
     
    8585                * Math.cos(aEndLong - aStartLong));
    8686
    87         return (EARTH_RADIUS * distance);               
     87        return (EARTH_RADIUS * distance);
    8888    }
    8989
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/OsmTileLoader.java

    r29528 r29757  
    6060                        try {
    6161                            tile.loadImage(input);
    62                         } finally { 
     62                        } finally {
    6363                            input.close();
    6464                            input = null;
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/Tile.java

    r29362 r29757  
    284284    /**
    285285     * Puts the given key/value pair to the metadata of the tile.
    286      * If value is null, the (possibly existing) key/value pair is removed from 
     286     * If value is null, the (possibly existing) key/value pair is removed from
    287287     * the meta data.
    288      * 
     288     *
    289289     * @param key
    290      * @param value 
     290     * @param value
    291291     */
    292292    public void putValue(String key, String value) {
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/events/JMVCommandEvent.java

    r26701 r29757  
    88 * Used for passing events between UI components and other
    99 * objects that register as a JMapViewerEventListener
    10  * 
     10 *
    1111 * @author Jason Huntley
    1212 *
     
    2020    private COMMAND command;
    2121    /**
    22      * 
     22     *
    2323     */
    2424    private static final long serialVersionUID = 8701544867914969620L;
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/JMapViewerEventListener.java

    r26701 r29757  
    1010 * Must be implemented for processing commands while user
    1111 * interacts with map viewer.
    12  * 
     12 *
    1313 * @author Jason Huntley
    1414 *
    1515 */
    1616public interface JMapViewerEventListener extends EventListener {
    17         public void processCommand(JMVCommandEvent command);
     17    public void processCommand(JMVCommandEvent command);
    1818}
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/MapMarker.java

    r29513 r29757  
    3333     */
    3434    public double getLon();
    35    
     35
    3636    /**
    3737     * @return Radius of the map marker position
    3838     */
    3939    public double getRadius();
    40    
     40
    4141    /**
    4242     * @return Style of the map marker
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/interfaces/MapPolygon.java

    r29516 r29757  
    2020
    2121    /**
    22      * Paints the map rectangle on the map. The <code>points</code> 
     22     * Paints the map rectangle on the map. The <code>points</code>
    2323     * are specifying the coordinates within <code>g</code>
    2424     *
     
    2929
    3030    /**
    31      * Paints the map rectangle on the map. The <code>polygon</code> 
     31     * Paints the map rectangle on the map. The <code>polygon</code>
    3232     * is specifying the coordinates within <code>g</code>
    3333     *
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/tilesources/ScanexTileSource.java

    r26976 r29757  
    6565    }
    6666
    67     private static double RADIUS_E = 6378137;   /* radius of Earth at equator, m */
     67    private static double RADIUS_E = 6378137;   /* radius of Earth at equator, m */
    6868    private static double EQUATOR = 40075016.68557849; /* equator length, m */
    69     private static double E = 0.0818191908426;  /* eccentricity of Earth's ellipsoid */
     69    private static double E = 0.0818191908426;  /* eccentricity of Earth's ellipsoid */
    7070
    7171    @Override
     
    9393    @Override
    9494    public double tileYToLat(int y, int zoom) {
    95         Random r= new Random();
     95    Random r= new Random();
    9696        double lat0, lat;
    9797
    98         lat = cached_lat;
    99         do {
    100             lat0 = lat;
     98    lat = cached_lat;
     99    do {
     100        lat0 = lat;
    101101            lat = lat - Math.toDegrees(NextTerm(Math.toRadians(lat), y, zoom));
    102102            if (lat > OsmMercator.MAX_LAT || lat < OsmMercator.MIN_LAT) {
     
    105105                    OsmMercator.MIN_LAT));
    106106            }
    107         } while ((Math.abs(lat0 - lat) > 0.000001));
     107    } while ((Math.abs(lat0 - lat) > 0.000001));
    108108
    109         cached_lat = lat;
     109    cached_lat = lat;
    110110
    111111        return (lat);
     
    116116        double sinl=Math.sin(lat);
    117117        double cosl=Math.cos(lat);
    118         double ec, f, df;
     118    double ec, f, df;
    119119
    120120        zoom = (int )Math.pow(2.0, zoom - 1);
    121         ec = Math.exp((1 - y/zoom)*Math.PI);
     121    ec = Math.exp((1 - y/zoom)*Math.PI);
    122122
    123         f = (Math.tan(Math.PI/4+lat/2) -
    124             ec * Math.pow(Math.tan(Math.PI/4 + Math.asin(E * sinl)/2), E));
     123    f = (Math.tan(Math.PI/4+lat/2) -
     124        ec * Math.pow(Math.tan(Math.PI/4 + Math.asin(E * sinl)/2), E));
    125125        df = 1/(1 - sinl) - ec * E * cosl/((1 - E * sinl) *
    126126            (Math.sqrt (1 - E * E * sinl * sinl)));
Note: See TracChangeset for help on using the changeset viewer.