Ignore:
Timestamp:
2009-12-24T08:48:40+01:00 (10 years ago)
Author:
jttt
Message:

Fix some of the warnings found by FindBugs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/projection/Puwg.java

    r2516 r2676  
    33package org.openstreetmap.josm.data.projection;
    44
     5import static org.openstreetmap.josm.tools.I18n.tr;
     6
     7import java.awt.GridBagLayout;
    58import java.text.DecimalFormat;
    6 
    7 import static org.openstreetmap.josm.tools.I18n.tr;
    8 
    9 import java.awt.GridBagLayout;
    109import java.util.Collection;
    1110import java.util.Collections;
     
    4039    private static DecimalFormat decFormatter = new DecimalFormat("###0");
    4140
     41    @Override
    4242    public EastNorth latlon2eastNorth(LatLon p) {
    4343        PuwgData z = Zones[zone];
     
    5050    }
    5151
     52    @Override
    5253    public LatLon eastNorth2latlon(EastNorth p) {
    5354        PuwgData z = Zones[zone];
     
    6364    }
    6465
     66    @Override
    6567    public String toCode() {
    6668        return Zones[zone].toCode();
     
    7274    }
    7375
     76    @Override
    7477    public String getCacheDirectoryName() {
    7578        return Zones[zone].getCacheDirectoryName();
    7679    }
    7780
     81    @Override
    7882    public Bounds getWorldBoundsLatLon() {
    7983        return Zones[zone].getWorldBoundsLatLon();
    8084    }
    8185
     86    @Override
    8287    public double getDefaultZoomInPPD() {
    8388        // This will set the scale bar to about 100 km
     
    9398    }
    9499
     100    @Override
    95101    public void setupPreferencePanel(JPanel p) {
    96102        JComboBox prefcb = new JComboBox(Puwg.Zones);
     
    105111    }
    106112
     113    @Override
    107114    public Collection<String> getPreferences(JPanel p) {
    108     Object prefcb = p.getComponent(2);
     115        Object prefcb = p.getComponent(2);
    109116        if(!(prefcb instanceof JComboBox))
    110117            return null;
     
    113120    }
    114121
     122    @Override
    115123    public Collection<String> getPreferencesFromCode(String code)
    116124    {
     
    118126        {
    119127            if(code.equals(p.toCode()))
    120             return Collections.singleton(code);
     128                return Collections.singleton(code);
    121129        }
    122130        return null;
    123131    }
    124132
     133    @Override
    125134    public void setPreferences(Collection<String> args)
    126135    {
     
    131140                for(String s : args)
    132141                {
    133                 for (int i=0; i < Puwg.Zones.length; ++i)
    134                     if(s.equals(Zones[i].toCode()))
    135                     zone = i;
    136                 break;
     142                    for (int i=0; i < Puwg.Zones.length; ++i)
     143                        if(s.equals(Zones[i].toCode())) {
     144                            zone = i;
     145                        }
     146                    break;
    137147                }
    138             } catch (NullPointerException e) {};
     148            } catch (NullPointerException e) {}
    139149        }
    140150    }
     
    151161class Epsg2180 implements PuwgData {
    152162
    153     final private double Epsg2180FalseEasting = 500000.0; /* y */
    154     final private double Epsg2180FalseNorthing = -5300000.0; /* x */
    155     final private double Epsg2180ScaleFactor = 0.9993;
    156     final private double Epsg2180CentralMeridian = 19.0;
     163    private static final double Epsg2180FalseEasting = 500000.0; /* y */
     164    private static final double Epsg2180FalseNorthing = -5300000.0; /* x */
     165    private static final double Epsg2180ScaleFactor = 0.9993;
     166    private static final double Epsg2180CentralMeridian = 19.0;
    157167    private static DecimalFormat decFormatter = new DecimalFormat("###0");
    158168
     
    202212abstract class Puwg2000 implements PuwgData {
    203213
    204     final private double PuwgFalseEasting = 500000.0;
    205     final private double PuwgFalseNorthing = 0;
    206     final private double PuwgScaleFactor = 0.999923;
    207     final private double[] Puwg2000CentralMeridian = {15.0, 18.0, 21.0, 24.0};
     214    private static final double PuwgFalseEasting = 500000.0;
     215    private static final double PuwgFalseNorthing = 0;
     216    private static final double PuwgScaleFactor = 0.999923;
     217    //final private double[] Puwg2000CentralMeridian = {15.0, 18.0, 21.0, 24.0};
    208218    final private String[] Puwg2000Code = { "EPSG:2176",  "EPSG:2177", "EPSG:2178", "EPSG:2179"};
    209219    final private String[] Puwg2000CDName = { "epsg2176",  "epsg2177", "epsg2178", "epsg2179"};
     
    258268
    259269class Epsg2176 extends Puwg2000 implements Projection {
    260     final private int PuwgZone = 5;
    261 
     270    private static final int PuwgZone = 5;
     271
     272    @Override
    262273    public int getZone() { return PuwgZone; }
    263274}
    264275
    265276class Epsg2177 extends Puwg2000 implements Projection {
    266     final private int PuwgZone = 6;
    267 
     277    private static final int PuwgZone = 6;
     278
     279    @Override
    268280    public int getZone() { return PuwgZone; }
    269281}
    270282
    271283class Epsg2178 extends Puwg2000 implements Projection {
    272     final private int PuwgZone = 7;
    273 
     284    private static final int PuwgZone = 7;
     285
     286    @Override
    274287    public int getZone() { return PuwgZone; }
    275288}
    276289
    277290class Epsg2179 extends Puwg2000 implements Projection {
    278     final private int PuwgZone = 8;
    279 
    280     public int getZone() { return PuwgZone; }
    281 }
     291    private static final int PuwgZone = 8;
     292
     293    @Override
     294    public int getZone() { return PuwgZone; }
     295}
Note: See TracChangeset for help on using the changeset viewer.