Ignore:
Timestamp:
13.03.2010 10:23:39 (2 years ago)
Author:
jttt
Message:

Fix #4728 display of gps-tracks (points, lines) does not refresh, cosmetics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java

    r2990 r3127  
    109109        String projname = proj.getClass().getName(); 
    110110        Collection<String> prefs = null; 
    111         if(projHasPrefs(proj)) { 
     111        if(proj instanceof ProjectionSubPrefs) { 
    112112            prefs = ((ProjectionSubPrefs) proj).getPreferences(projSubPrefPanel); 
    113113        } 
     
    121121        } 
    122122 
    123         return false; 
    124     } 
    125  
    126     /** 
    127      * Finds out if the given projection implements the ProjectionPreference 
    128      * interface 
    129      * @param proj 
    130      * @return 
    131      */ 
    132     @SuppressWarnings("unchecked") 
    133     static private boolean projHasPrefs(Projection proj) { 
    134         Class[] ifaces = proj.getClass().getInterfaces(); 
    135         for(int i = 0; i < ifaces.length; i++) { 
    136             if(ifaces[i].getSimpleName().equals("ProjectionSubPrefs")) 
    137                 return true; 
    138         } 
    139123        return false; 
    140124    } 
     
    167151        String sname = name.substring(name.lastIndexOf(".")+1); 
    168152        Main.pref.putCollection("projection.sub."+sname, coll); 
    169         if(projHasPrefs(Main.proj)) { 
     153        if(Main.proj instanceof ProjectionSubPrefs) { 
    170154            ((ProjectionSubPrefs) Main.proj).setPreferences(coll); 
    171155        } 
     
    200184     */ 
    201185    private void selectedProjectionChanged(Projection proj) { 
    202         if(!projHasPrefs(proj)) { 
     186        if(!(proj instanceof ProjectionSubPrefs)) { 
    203187            projSubPrefPanel = new JPanel(); 
    204188        } else { 
     
    229213            String name = proj.getClass().getName(); 
    230214            String sname = name.substring(name.lastIndexOf(".")+1); 
    231             if(projHasPrefs(proj)) { 
     215            if(proj instanceof ProjectionSubPrefs) { 
    232216                ((ProjectionSubPrefs) proj).setPreferences(Main.pref.getCollection("projection.sub."+sname, null)); 
    233217            } 
Note: See TracChangeset for help on using the changeset viewer.