Ignore:
Timestamp:
2009-11-22T11:07:36+01:00 (14 years ago)
Author:
stoecker
Message:

see #3989 - subprojection fixes

File:
1 edited

Legend:

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

    r2491 r2496  
    9191        projPanel.add(bounds, GBC.eop().fill(GBC.HORIZONTAL).insets(0,5,5,5));
    9292        projPanel.add(projSubPrefPanel, projSubPrefPanelGBC);
     93
    9394        JScrollPane scrollpane = new JScrollPane(projPanel);
    9495        gui.mapcontent.addTab(tr("Map Projection"), scrollpane);
    9596
    96         projectionCode.setText(Main.proj.toCode());
    97         Bounds b = Main.proj.getWorldBoundsLatLon();
     97        updateMeta(Main.proj);
     98    }
     99
     100    private void updateMeta(Projection proj)
     101    {
     102        projectionCode.setText(proj.toCode());
     103        Bounds b = proj.getWorldBoundsLatLon();
    98104        CoordinateFormat cf = CoordinateFormat.getDefaultFormat();
    99105        bounds.setText(b.getMin().latToString(cf)+"; "+b.getMin().lonToString(cf)+" : "+b.getMax().latToString(cf)+"; "+b.getMax().lonToString(cf));
    100         /* TODO: Fix bugs, refresh code line and world bounds, fix design (e.g. add border around sub-prefs-stuff */
    101106    }
    102107
     
    109114            prefs = ((ProjectionSubPrefs) proj).getPreferences();
    110115
    111         if(Main.pref.put("projection", projname)) {
    112             setProjection(projname, prefs);
    113         }
     116        Main.pref.put("projection", projname);
     117        setProjection(projname, prefs);
    114118
    115119        if(Main.pref.put("coordinates",
     
    200204        projPanel.add(projSubPrefPanel, projSubPrefPanelGBC);
    201205        projPanel.revalidate();
     206        projSubPrefPanel.repaint();
     207        updateMeta(proj);
    202208    }
    203209
Note: See TracChangeset for help on using the changeset viewer.