Ignore:
Timestamp:
2009-07-08T15:26:12+02:00 (15 years ago)
Author:
stoecker
Message:

close #2874 (NPE), improved external style handling

Location:
trunk/src/org/openstreetmap/josm/gui/preferences
Files:
2 edited

Legend:

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

    r1743 r1747  
    5454        projPanel.setBorder(BorderFactory.createEmptyBorder( 0, 0, 0, 0 ));
    5555        projPanel.setLayout(new GridBagLayout());
     56        projPanel.add(new JLabel(tr("Display coordinates as")), GBC.std().insets(5,5,0,5));
     57        projPanel.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL));
     58        projPanel.add(coordinatesCombo, GBC.eop().fill(GBC.HORIZONTAL).insets(0,5,5,5));
    5659        projPanel.add(new JLabel(tr("Projection method")), GBC.std().insets(5,5,0,5));
    5760        projPanel.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL));
    5861        projPanel.add(projectionCombo, GBC.eop().fill(GBC.HORIZONTAL).insets(0,5,5,5));
    59         projPanel.add(new JLabel(tr("Display coordinates as")), GBC.std().insets(5,5,0,5));
    60         projPanel.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL));
    61         projPanel.add(coordinatesCombo, GBC.eop().fill(GBC.HORIZONTAL).insets(0,5,5,5));
    6262        projPanel.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.BOTH));
    6363        JScrollPane scrollpane = new JScrollPane(projPanel);
  • trunk/src/org/openstreetmap/josm/gui/preferences/StyleSources.java

    r1743 r1747  
    9595    }
    9696
    97     public StyleSources(String pref, String iconpref, String url, boolean named, final String name)
     97    public StyleSources(String pref, String iconpref, final String url, boolean named, final String name)
    9898    {
    9999        sourcesList = new JList(new DefaultListModel());
     
    199199                    ((DefaultListModel)sourcesList.getModel()).addElement(
    200200                    ((SourceInfo)sourcesDefaults.getSelectedValue()).url);
     201                }
     202            }
     203        });
     204
     205        JButton update = new JButton(tr("Update"));
     206        update.addActionListener(new ActionListener(){
     207            public void actionPerformed(ActionEvent e) {
     208                MirroredInputStream.cleanup(url);
     209                getDefaults(url);
     210                int num = sourcesList.getModel().getSize();
     211                if (num > 0)
     212                {
     213                    ArrayList<String> l = new ArrayList<String>();
     214                    for (int i = 0; i < num; ++i)
     215                        MirroredInputStream.cleanup((String)sourcesList.getModel().getElementAt(i));
    201216                }
    202217            }
     
    219234        buttonPanel.add(edit, GBC.std().insets(5,5,5,0));
    220235        buttonPanel.add(delete, GBC.std().insets(0,5,5,0));
    221         buttonPanel.add(copy, GBC.std().insets(0,5,0,0));
     236        buttonPanel.add(copy, GBC.std().insets(0,5,5,0));
     237        buttonPanel.add(update, GBC.std().insets(0,5,0,0));
    222238        if(iconsList != null)
    223239        {
     
    265281    public void getDefaults(String name)
    266282    {
     283        ((DefaultListModel)sourcesDefaults.getModel()).removeAllElements();
    267284        String lang = Main.getLanguageCode()+"_";
    268285        try
Note: See TracChangeset for help on using the changeset viewer.