Changeset 104 in josm for src/org/openstreetmap/josm/gui/PreferenceDialog.java
- Timestamp:
- 2006-07-03T00:31:24+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/PreferenceDialog.java
r100 r104 1 1 package org.openstreetmap.josm.gui; 2 3 import static org.openstreetmap.josm.tools.I18n.tr; 2 4 3 5 import java.awt.Color; … … 81 83 String name = (String)colors.getValueAt(i, 0); 82 84 Color col = (Color)colors.getValueAt(i, 1); 83 Main.pref.put("color."+ name, ColorHelper.color2html(col));85 Main.pref.put("color."+tr(name), ColorHelper.color2html(col)); 84 86 } 85 87 86 88 if (requiresRestart) 87 JOptionPane.showMessageDialog(PreferenceDialog.this, "You have to restart JOSM for some settings to take effect.");89 JOptionPane.showMessageDialog(PreferenceDialog.this,tr("You have to restart JOSM for some settings to take effect.")); 88 90 Main.parent.repaint(); 89 91 setVisible(false); … … 150 152 * The checkbox stating whether nodes should be merged together. 151 153 */ 152 private JCheckBox drawRawGpsLines = new JCheckBox( "Draw lines between raw gps points.");154 private JCheckBox drawRawGpsLines = new JCheckBox(tr("Draw lines between raw gps points.")); 153 155 /** 154 156 * The checkbox stating whether raw gps lines should be forced. 155 157 */ 156 private JCheckBox forceRawGpsLines = new JCheckBox( "Force lines if no segments imported.");157 private JCheckBox directionHint = new JCheckBox( "Draw Direction Arrows");158 private JCheckBox forceRawGpsLines = new JCheckBox(tr("Force lines if no segments imported.")); 159 private JCheckBox directionHint = new JCheckBox(tr("Draw Direction Arrows")); 158 160 private JTable colors; 159 161 … … 166 168 */ 167 169 public PreferenceDialog() { 168 super(JOptionPane.getFrameForComponent(Main.parent), "Preferences");170 super(JOptionPane.getFrameForComponent(Main.parent), tr("Preferences")); 169 171 170 172 // look and feel combo box … … 215 217 csvImportString.setText(Main.pref.get("csv.importstring")); 216 218 drawRawGpsLines.setSelected(Main.pref.getBoolean("draw.rawgps.lines")); 217 forceRawGpsLines.setToolTipText( "Force drawing of lines if the imported data contain no line information.");219 forceRawGpsLines.setToolTipText(tr("Force drawing of lines if the imported data contain no line information.")); 218 220 forceRawGpsLines.setSelected(Main.pref.getBoolean("draw.rawgps.lines.force")); 219 221 forceRawGpsLines.setEnabled(drawRawGpsLines.isSelected()); 220 directionHint.setToolTipText( "Draw direction hints for all segments.");222 directionHint.setToolTipText(tr("Draw direction hints for all segments.")); 221 223 directionHint.setSelected(Main.pref.getBoolean("draw.segment.direction")); 222 224 … … 255 257 colors.getColumnModel().getColumn(1).setWidth(100); 256 258 257 JButton colorEdit = new JButton( "Choose");259 JButton colorEdit = new JButton(tr("Choose")); 258 260 colorEdit.addActionListener(new ActionListener(){ 259 261 public void actionPerformed(ActionEvent e) { 260 262 if (colors.getSelectedRowCount() == 0) { 261 JOptionPane.showMessageDialog(PreferenceDialog.this, "Please select a color.");263 JOptionPane.showMessageDialog(PreferenceDialog.this, tr("Please select a color.")); 262 264 return; 263 265 } 264 266 int sel = colors.getSelectedRow(); 265 267 JColorChooser chooser = new JColorChooser((Color)colors.getValueAt(sel, 1)); 266 int answer = JOptionPane.showConfirmDialog(PreferenceDialog.this, chooser, "Choose a color for "+colors.getValueAt(sel, 0), JOptionPane.OK_CANCEL_OPTION);268 int answer = JOptionPane.showConfirmDialog(PreferenceDialog.this, chooser, tr("Choose a color for {0}", colors.getValueAt(sel, 0)), JOptionPane.OK_CANCEL_OPTION); 267 269 if (answer == JOptionPane.OK_OPTION) 268 270 colors.setValueAt(chooser.getColor(), sel, 1); … … 271 273 272 274 // setting tooltips 273 osmDataServer.setToolTipText( "The base URL to the OSM server (REST API)");274 osmDataUsername.setToolTipText( "Login name (email) to the OSM account.");275 osmDataPassword.setToolTipText( "Login password to the OSM account. Leave blank to not store any password.");276 wmsServerBaseUrl.setToolTipText( "The base URL to the server retrieving WMS background pictures from.");277 csvImportString.setToolTipText( "<html>Import string specification. lat/lon and time are imported.<br>" +275 osmDataServer.setToolTipText(tr("The base URL to the OSM server (REST API)")); 276 osmDataUsername.setToolTipText(tr("Login name (email) to the OSM account.")); 277 osmDataPassword.setToolTipText(tr("Login password to the OSM account. Leave blank to not store any password.")); 278 wmsServerBaseUrl.setToolTipText(tr("The base URL to the server retrieving WMS background pictures from.")); 279 csvImportString.setToolTipText(tr("<html>Import string specification. lat/lon and time are imported.<br>" + 278 280 "<b>lat</b>: The latitude coordinate<br>" + 279 281 "<b>lon</b>: The longitude coordinate<br>" + … … 281 283 "<b>ignore</b>: Skip this field<br>" + 282 284 "An example: \"ignore ignore lat lon\" will use ' ' as delimiter, skip the first two values and read then lat/lon.<br>" + 283 "Other example: \"lat,lon\" will just read lat/lon values comma seperated.</html>") ;284 drawRawGpsLines.setToolTipText( "If your gps device draw to few lines, select this to draw lines along your way.");285 colors.setToolTipText( "Colors used by different objects in JOSM.");285 "Other example: \"lat,lon\" will just read lat/lon values comma seperated.</html>")); 286 drawRawGpsLines.setToolTipText(tr("If your gps device draw to few lines, select this to draw lines along your way.")); 287 colors.setToolTipText(tr("Colors used by different objects in JOSM.")); 286 288 287 289 // creating the gui 288 290 289 291 // Display tab 290 JPanel display = createPreferenceTab("display", "Display Settings", "Various settings that influence the visual representation of the whole program.");291 display.add(new JLabel( "Look and Feel"), GBC.std());292 JPanel display = createPreferenceTab("display", tr("Display Settings"), tr("Various settings that influence the visual representation of the whole program.")); 293 display.add(new JLabel(tr("Look and Feel")), GBC.std()); 292 294 display.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL)); 293 295 display.add(lafCombo, GBC.eol().fill(GBC.HORIZONTAL)); … … 295 297 display.add(forceRawGpsLines, GBC.eop().insets(40,0,0,0)); 296 298 display.add(directionHint, GBC.eop().insets(20,0,0,0)); 297 display.add(new JLabel( "Colors"), GBC.eol());299 display.add(new JLabel(tr("Colors")), GBC.eol()); 298 300 colors.setPreferredScrollableViewportSize(new Dimension(100,112)); 299 301 display.add(new JScrollPane(colors), GBC.eol().fill(GBC.BOTH)); … … 302 304 303 305 // Connection tab 304 JPanel con = createPreferenceTab("connection", "Connection Settings", "Connection Settings to the OSM server.");305 con.add(new JLabel( "Base Server URL"), GBC.std());306 JPanel con = createPreferenceTab("connection", tr("Connection Settings"), tr("Connection Settings to the OSM server.")); 307 con.add(new JLabel(tr("Base Server URL")), GBC.std()); 306 308 con.add(osmDataServer, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 307 con.add(new JLabel( "OSM username (email)"), GBC.std());309 con.add(new JLabel(tr("OSM username (email)")), GBC.std()); 308 310 con.add(osmDataUsername, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5)); 309 con.add(new JLabel( "OSM password"), GBC.std());311 con.add(new JLabel(tr("OSM password")), GBC.std()); 310 312 con.add(osmDataPassword, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,0)); 311 JLabel warning = new JLabel( "<html>" +313 JLabel warning = new JLabel(tr("<html>" + 312 314 "WARNING: The password is stored in plain text in the preferences file.<br>" + 313 315 "The password is transfered in plain text to the server, encoded in the url.<br>" + 314 "<b>Do not use a valuable Password.</b></html>") ;316 "<b>Do not use a valuable Password.</b></html>")); 315 317 warning.setFont(warning.getFont().deriveFont(Font.ITALIC)); 316 318 con.add(warning, GBC.eop().fill(GBC.HORIZONTAL)); … … 318 320 //con.add(wmsServerBaseUrl, GBC.eop().fill(GBC.HORIZONTAL)); 319 321 //con.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 320 con.add(new JLabel( "CSV import specification (empty: read from first line in data)"), GBC.eol());322 con.add(new JLabel(tr("CSV import specification (empty: read from first line in data)")), GBC.eol()); 321 323 con.add(csvImportString, GBC.eop().fill(GBC.HORIZONTAL)); 322 324 con.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 323 325 324 326 // Map tab 325 JPanel map = createPreferenceTab("map", "Map Settings", "Settings for the map projection and data interpretation.");326 map.add(new JLabel( "Projection method"), GBC.std());327 JPanel map = createPreferenceTab("map", tr("Map Settings"), tr("Settings for the map projection and data interpretation.")); 328 map.add(new JLabel(tr("Projection method")), GBC.std()); 327 329 map.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL)); 328 330 map.add(projectionCombo, GBC.eol().fill(GBC.HORIZONTAL).insets(0,0,0,5));
Note:
See TracChangeset
for help on using the changeset viewer.