Ignore:
Timestamp:
09/15/07 12:02:30 (5 years ago)
Author:
saua
Message:

add NauticalUnitConverter?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bbtracker/trunk/src/org/bbtracker/mobile/Preferences.java

    r102 r113  
    3333import org.bbtracker.ImperialUnitConverter; 
    3434import org.bbtracker.MetricUnitConverter; 
     35import org.bbtracker.NauticalUnitConverter; 
    3536import org.bbtracker.UnitConverter; 
    3637 
     
    6364        public static final int UNITS_IMPERIAL = 1; 
    6465 
    65         public static String[] UNITS = new String[] { "Metric (km/h, km, m)", "Imperial (mph, miles, feet)" }; 
     66        public static final int UNITS_NAUTICAL = 2; 
     67 
     68        public static String[] UNITS = new String[] { "Metric (km/h, km, m)", "Imperial (mph, miles, feet)", 
     69                        "Nautical (nm/h, nm, feet)" }; 
    6670 
    6771        private static Preferences instance; 
     
    153157 
    154158        public void setUnits(final int units) { 
    155                 if (units != UNITS_METRIC && units != UNITS_IMPERIAL) { 
     159                if (units != UNITS_METRIC && units != UNITS_IMPERIAL && units != UNITS_NAUTICAL) { 
    156160                        throw new IllegalArgumentException(); 
    157161                } 
     
    168172                        case UNITS_IMPERIAL: 
    169173                                unitConverter = new ImperialUnitConverter(); 
     174                                break; 
     175                        case UNITS_NAUTICAL: 
     176                                unitConverter = new NauticalUnitConverter(); 
    170177                                break; 
    171178                        default: 
Note: See TracChangeset for help on using the changeset viewer.