Changeset 85 in josm for src/org/openstreetmap
- Timestamp:
- 2006-04-19T20:51:33+02:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/PreferenceDialog.java
r81 r85 57 57 super(UIManager.getString("OptionPane.okButtonText"), 58 58 UIManager.getIcon("OptionPane.okIcon")); 59 putValue(MNEMONIC_KEY, new Integer((String)UIManager.get("OptionPane.okButtonMnemonic"))); 59 try { 60 putValue(MNEMONIC_KEY, new Integer((String)UIManager.get("OptionPane.okButtonMnemonic"))); 61 } catch (NumberFormatException e) { 62 // just don't set the mnemonic 63 } 60 64 } 61 65 public void actionPerformed(ActionEvent e) { … … 93 97 super(UIManager.getString("OptionPane.cancelButtonText"), 94 98 UIManager.getIcon("OptionPane.cancelIcon")); 95 putValue(MNEMONIC_KEY, new Integer((String)UIManager.get("OptionPane.cancelButtonMnemonic"))); 99 try { 100 putValue(MNEMONIC_KEY, new Integer((String)UIManager.get("OptionPane.cancelButtonMnemonic"))); 101 } catch (NumberFormatException e) { 102 // just don't set the mnemonic 103 } 96 104 } 97 105 public void actionPerformed(ActionEvent e) { … … 107 115 * ComboBox with all look and feels. 108 116 */ 109 117 private JComboBox lafCombo = new JComboBox(UIManager.getInstalledLookAndFeels()); 110 118 /** 111 119 * Combobox with all projections available 112 120 */ 113 121 private JComboBox projectionCombo = new JComboBox(Projection.allProjections); 114 122 /** 115 123 * The main tab panel. … … 120 128 * Editfield for the Base url to the REST API from OSM. 121 129 */ 122 130 private JTextField osmDataServer = new JTextField(20); 123 131 /** 124 132 * Editfield for the username to the OSM account. 125 133 */ 126 134 private JTextField osmDataUsername = new JTextField(20); 127 135 /** 128 136 * Passwordfield for the userpassword of the REST API. 129 137 */ 130 131 132 133 138 private JPasswordField osmDataPassword = new JPasswordField(20); 139 /** 140 * Base url of the WMS server. Holds everything except the bbox= argument. 141 */ 134 142 private JTextField wmsServerBaseUrl = new JTextField(20); 135 143 /** … … 137 145 * data line should be interpreted as one. 138 146 */ 139 147 private JTextField csvImportString = new JTextField(20); 140 148 /** 141 149 * The checkbox stating whether nodes should be merged together. 142 150 */ 143 151 private JCheckBox drawRawGpsLines = new JCheckBox("Draw lines between raw gps points."); 144 152 /** 145 153 * The checkbox stating whether raw gps lines should be forced. 146 154 */ 147 148 149 150 151 155 private JCheckBox forceRawGpsLines = new JCheckBox("Force lines if no line segments imported."); 156 157 private JTable colors; 158 159 152 160 /** 153 161 * Create a preference setting dialog from an preferences-file. If the file does not … … 191 199 } 192 200 }); 193 201 194 202 // drawRawGpsLines 195 203 drawRawGpsLines.addActionListener(new ActionListener(){ … … 204 212 osmDataUsername.setText(Main.pref.get("osm-server.username")); 205 213 osmDataPassword.setText(Main.pref.get("osm-server.password")); 206 207 214 wmsServerBaseUrl.setText(Main.pref.get("wmsServerBaseUrl", "http://wms.jpl.nasa.gov/wms.cgi?request=GetMap&width=512&height=512&layers=global_mosaic&styles=&srs=EPSG:4326&format=image/jpeg&")); 215 csvImportString.setText(Main.pref.get("csvImportString")); 208 216 drawRawGpsLines.setSelected(Main.pref.getBoolean("drawRawGpsLines")); 209 217 forceRawGpsLines.setToolTipText("Force drawing of lines if the imported data contain no line information."); … … 211 219 forceRawGpsLines.setEnabled(drawRawGpsLines.isSelected()); 212 220 213 214 221 222 215 223 Map<String,String> allColors = new TreeMap<String, String>(Main.pref.getAllPrefix("color.")); 216 224 … … 244 252 }); 245 253 colors.getColumnModel().getColumn(1).setWidth(100); 246 254 247 255 JButton colorEdit = new JButton("Choose"); 248 256 colorEdit.addActionListener(new ActionListener(){ … … 264 272 osmDataUsername.setToolTipText("Login name (email) to the OSM account."); 265 273 osmDataPassword.setToolTipText("Login password to the OSM account. Leave blank to not store any password."); 266 274 wmsServerBaseUrl.setToolTipText("The base URL to the server retrieving WMS background pictures from."); 267 275 csvImportString.setToolTipText("<html>Import string specification. lat/lon and time are imported.<br>" + 268 276 "<b>lat</b>: The latitude coordinate<br>" + … … 271 279 "<b>ignore</b>: Skip this field<br>" + 272 280 "An example: \"ignore ignore lat lon\" will use ' ' as delimiter, skip the first two values and read then lat/lon.<br>" + 273 281 "Other example: \"lat,lon\" will just read lat/lon values comma seperated.</html>"); 274 282 drawRawGpsLines.setToolTipText("If your gps device draw to few lines, select this to draw lines along your way."); 275 283 colors.setToolTipText("Colors used by different objects in JOSM."); 276 284 277 285 // creating the gui 278 286 279 287 // Display tab 280 288 JPanel display = createPreferenceTab("display", "Display Settings", "Various settings that influence the visual representation of the whole program."); … … 301 309 "WARNING: The password is stored in plain text in the preferences file.<br>" + 302 310 "The password is transfered in plain text to the server, encoded in the url.<br>" + 303 311 "<b>Do not use a valuable Password.</b></html>"); 304 312 warning.setFont(warning.getFont().deriveFont(Font.ITALIC)); 305 313 con.add(warning, GBC.eop().fill(GBC.HORIZONTAL)); … … 310 318 con.add(csvImportString, GBC.eop().fill(GBC.HORIZONTAL)); 311 319 con.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 312 320 313 321 // Map tab 314 322 JPanel map = createPreferenceTab("map", "Map Settings", "Settings for the map projection and data interpretation."); … … 320 328 321 329 tabPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); 322 330 323 331 // OK/Cancel panel at bottom 324 332 JPanel okPanel = new JPanel(new GridBagLayout()); … … 350 358 JPanel p = new JPanel(new GridBagLayout()); 351 359 p.add(new JLabel(title), GBC.eol().anchor(GBC.CENTER).insets(0,5,0,10)); 352 360 353 361 JLabel descLabel = new JLabel("<html>"+desc+"</html>"); 354 362 descLabel.setFont(descLabel.getFont().deriveFont(Font.ITALIC));
Note:
See TracChangeset
for help on using the changeset viewer.