Ignore:
Timestamp:
2011-01-08T01:04:23+01:00 (13 years ago)
Author:
Upliner
Message:

Identify projections in offset bookmarks by EPSG codes, bugfixes in getPreferencesFromCode() functions as they're critical now.

File:
1 edited

Legend:

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

    r3473 r3779  
    99
    1010import java.awt.GridBagLayout;
     11import java.awt.event.ActionListener;
    1112import java.util.Collection;
    1213import java.util.Collections;
     
    410411    }
    411412
    412     public void setupPreferencePanel(JPanel p) {
     413    @Override
     414    public void setupPreferencePanel(JPanel p, ActionListener listener) {
    413415        JComboBox prefcb = new JComboBox(utmGeodesicsNames);
    414416
     
    419421        p.add(prefcb, GBC.eop().fill(GBC.HORIZONTAL));
    420422        p.add(GBC.glue(1, 1), GBC.eol().fill(GBC.BOTH));
     423        if (listener != null) {
     424            prefcb.addActionListener(listener);
     425        }
    421426    }
    422427
     
    430435    }
    431436
     437    @Override
     438    public String[] allCodes() {
     439        return utmEPSGs;
     440    }
     441
    432442    public Collection<String> getPreferencesFromCode(String code) {
    433443        for (int i=0; i < utmEPSGs.length; i++ )
    434444            if (utmEPSGs[i].endsWith(code))
    435                 return Collections.singleton(Integer.toString(i));
     445                return Collections.singleton(Integer.toString(i+1));
    436446        return null;
    437447    }
     
    444454                {
    445455                    currentGeodesic = Integer.parseInt(s)-1;
    446                     if(currentGeodesic < 0 || currentGeodesic > 4) {
     456                    if(currentGeodesic < 0 || currentGeodesic >= utmEPSGs.length) {
    447457                        currentGeodesic = DEFAULT_GEODESIC;
    448458                    }
Note: See TracChangeset for help on using the changeset viewer.