Changeset 43 in josm for src/org/openstreetmap/josm/gui/PreferenceDialog.java
- Timestamp:
- 2006-01-22T16:10:57+01:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/PreferenceDialog.java
r38 r43 15 15 import javax.swing.JCheckBox; 16 16 import javax.swing.JComboBox; 17 import javax.swing.JComponent;18 17 import javax.swing.JDialog; 19 18 import javax.swing.JLabel; … … 51 50 public void actionPerformed(ActionEvent e) { 52 51 Main.pref.laf = (LookAndFeelInfo)lafCombo.getSelectedItem(); 53 Projection projection = (Projection)projectionCombo.getSelectedItem(); 54 projection.commitConfigurationPanel(); 55 Main.pref.setProjection(projection); 52 Main.pref.setProjection((Projection)projectionCombo.getSelectedItem()); 56 53 Main.pref.osmDataServer = osmDataServer.getText(); 57 54 Main.pref.osmDataUsername = osmDataUsername.getText(); … … 99 96 * Combobox with all projections available 100 97 */ 101 JComboBox projectionCombo = new JComboBox(Preferences.allProjections .clone());98 JComboBox projectionCombo = new JComboBox(Preferences.allProjections); 102 99 /** 103 100 * The main tab panel. … … 160 157 } 161 158 } 162 JButton projectionDetail = new JButton("Configure");163 projectionDetail.addActionListener(new ActionListener(){164 public void actionPerformed(ActionEvent e) {165 Projection p = (Projection)projectionCombo.getSelectedItem();166 JComponent configurationPanel = p.getConfigurationPanel();167 if (configurationPanel == null) {168 JOptionPane.showMessageDialog(PreferenceDialog.this,169 "This projection does not need any configuration.");170 return;171 }172 JPanel detail = new JPanel(new GridBagLayout());173 detail.setLayout(new GridBagLayout());174 detail.add(configurationPanel, GBC.eop().fill());175 int result = JOptionPane.showConfirmDialog(176 PreferenceDialog.this, detail, "Configuration of "+p,177 JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);178 if (result != JOptionPane.OK_OPTION)179 p.getConfigurationPanel(); // rollback180 }181 });182 159 183 160 // drawRawGpsLines … … 242 219 map.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL)); 243 220 map.add(projectionCombo, GBC.eol().fill(GBC.HORIZONTAL).insets(0,0,0,5)); 244 map.add(new JLabel("Projection details:"), GBC.std());245 map.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL));246 map.add(projectionDetail, GBC.eop());247 221 map.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 248 222
Note:
See TracChangeset
for help on using the changeset viewer.