- Timestamp:
- 2006-07-20T01:29:55+02:00 (18 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/AboutAction.java
r116 r117 38 38 39 39 public static final String version; 40 40 41 41 private static JTextArea revision; 42 42 private static String time; … … 48 48 Matcher match = versionPattern.matcher(revision.getText()); 49 49 version = match.matches() ? match.group(1) : "UNKNOWN"; 50 50 51 51 Pattern timePattern = Pattern.compile(".*?Last Changed Date: ([^\n]*).*", Pattern.CASE_INSENSITIVE|Pattern.DOTALL); 52 52 match = timePattern.matcher(revision.getText()); 53 53 time = match.matches() ? match.group(1) : "UNKNOWN"; 54 54 } 55 55 56 56 public AboutAction() { 57 57 super(tr("About"), "about",tr("Display the about screen."), KeyEvent.VK_A); 58 58 } 59 59 60 60 public void actionPerformed(ActionEvent e) { 61 61 JTabbedPane about = new JTabbedPane(); 62 62 63 63 JTextArea readme = loadFile(Main.class.getResource("/README")); 64 JTextArea contribution = loadFile(Main.class.getResource("/CONTRIBUTION")); 64 65 65 66 JPanel info = new JPanel(new GridBagLayout()); 66 67 info.add(new JLabel(tr("Java OpenStreetMap Editor Version {0}",version)), GBC.eop()); 67 68 info.add(new JLabel(tr("last change at {0}",time)), GBC.eop()); 69 info.add(new JLabel(tr("Java Version {0}",System.getProperty("java.version"))), GBC.eop()); 68 70 info.add(new JLabel(tr("Homepage")), GBC.std().insets(0,0,10,0)); 69 71 info.add(new UrlLabel("http://wiki.eigenheimstrasse.de/wiki/JOSM"), GBC.eol()); 70 72 info.add(new JLabel(tr("Bug Reports")), GBC.std().insets(0,0,10,0)); 71 73 info.add(new UrlLabel("http://trac.openstreetmap.org"), GBC.eol()); 72 73 74 74 75 75 76 about.addTab(tr("Info"), info); 76 77 about.addTab(tr("Readme"), new JScrollPane(readme)); 77 78 about.addTab(tr("Revision"), new JScrollPane(revision)); 78 79 about.addTab(tr("Contribution"), new JScrollPane(contribution)); 80 79 81 about.setPreferredSize(new Dimension(500,300)); 80 82 81 83 JOptionPane.showMessageDialog(Main.parent, about, tr("About JOSM..."), 82 84 JOptionPane.INFORMATION_MESSAGE, ImageProvider.get("logo")); 83 85 } 84 86 85 87 /** 86 88 * Load the specified ressource into an TextArea and return it. -
src/org/openstreetmap/josm/data/Preferences.java
r116 r117 142 142 143 143 public final void upgrade(int oldVersion) { 144 if (oldVersion > 11 5) return;144 if (oldVersion > 117) return; 145 145 properties.put("color.scale", ColorHelper.color2html(Color.white)); 146 146 } -
src/org/openstreetmap/josm/gui/PreferenceDialog.java
r116 r117 292 292 293 293 // Annotation source panels 294 JPanel annoButton = new JPanel(new GridBagLayout());295 294 JButton addAnno = new JButton(tr("Add")); 296 295 addAnno.addActionListener(new ActionListener(){ … … 303 302 } 304 303 }); 305 GBC g = GBC.eol().fill(GBC.HORIZONTAL);306 g.weightx = 0;307 annoButton.add(addAnno,g);308 304 309 305 JButton editAnno = new JButton(tr("Edit")); … … 321 317 } 322 318 }); 323 annoButton.add(GBC.glue(0, 2), GBC.eol());324 annoButton.add(editAnno,g);325 319 326 320 JButton deleteAnno = new JButton(tr("Delete")); … … 335 329 } 336 330 }); 337 annoButton.add(GBC.glue(0, 2), GBC.eol()); 338 annoButton.add(deleteAnno,g); 339 annotationSources.setVisibleRowCount(5); 331 annotationSources.setVisibleRowCount(3); 340 332 341 333 … … 402 394 map.add(GBC.glue(5,0), GBC.std().fill(GBC.HORIZONTAL)); 403 395 map.add(projectionCombo, GBC.eop().fill(GBC.HORIZONTAL).insets(0,0,0,5)); 404 map.add(new JLabel(tr("Annotation preset sources")), GBC.eol()); 405 map.add(new JScrollPane(annotationSources), GBC.std().fill(GBC.HORIZONTAL).insets(10,0,10,0)); 406 map.add(annoButton, GBC.eol()); 407 396 map.add(new JLabel(tr("Annotation preset sources")), GBC.eol().insets(0,5,0,0)); 397 map.add(new JScrollPane(annotationSources), GBC.eol().fill(GBC.BOTH)); 398 map.add(GBC.glue(5, 0), GBC.std().fill(GBC.HORIZONTAL)); 399 map.add(addAnno, GBC.std()); 400 map.add(editAnno, GBC.std().insets(5,0,5,0)); 401 map.add(deleteAnno, GBC.std()); 402 403 // I HATE SWING! 404 map.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 405 map.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 406 map.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 407 map.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 408 408 map.add(Box.createVerticalGlue(), GBC.eol().fill(GBC.VERTICAL)); 409 409 -
src/org/openstreetmap/josm/gui/dialogs/AnnotationPreset.java
r116 r117 14 14 15 15 import javax.swing.JCheckBox; 16 import javax.swing.JComboBox; 16 17 import javax.swing.JLabel; 17 18 import javax.swing.JPanel; … … 76 77 public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) { 77 78 cmds.add(new ChangePropertyCommand(sel, key, check.isSelected() ? "true" : null)); 79 } 80 } 81 82 public static class Combo implements Item { 83 String key; 84 String label; 85 JComboBox combo; 86 87 public void addToPanel(JPanel p) { 88 p.add(new JLabel(label), GBC.std().insets(0,0,10,0)); 89 p.add(combo, GBC.eol().fill(GBC.HORIZONTAL)); 90 } 91 public Combo(String key, String label, String def, String[] values, boolean editable) { 92 this.key = key; 93 this.label = label; 94 combo = new JComboBox(values); 95 combo.setEditable(editable); 96 combo.setSelectedItem(def); 97 } 98 public void addCommands(Collection<OsmPrimitive> sel, List<Command> cmds) { 99 String str = combo.isEditable()?combo.getEditor().getItem().toString() : combo.getSelectedItem().toString(); 100 cmds.add(new ChangePropertyCommand(sel, key, str)); 78 101 } 79 102 } … … 120 143 currentName = "Unnamed Preset #"+(unknownCounter++); 121 144 } else if (qname.equals("text")) 122 current.add(new Text(a.getValue("key"), a.getValue(" label"), a.getValue("default")));145 current.add(new Text(a.getValue("key"), a.getValue("text"), a.getValue("default"))); 123 146 else if (qname.equals("check")) { 124 147 String s = a.getValue("default"); 125 boolean c heck= s == null || s.equals("0") || s.startsWith("off") || s.startsWith("false") || s.startsWith("no");126 current.add(new Check(a.getValue("key"), a.getValue(" label"), check));148 boolean clear = s == null || s.equals("0") || s.startsWith("off") || s.startsWith("false") || s.startsWith("no"); 149 current.add(new Check(a.getValue("key"), a.getValue("text"), !clear)); 127 150 } else if (qname.equals("label")) 128 current.add(new Label(a.getValue("label"))); 129 else if (qname.equals("key")) 151 current.add(new Label(a.getValue("text"))); 152 else if (qname.equals("combo")) { 153 String[] values = a.getValue("values").split(","); 154 String s = a.getValue("readonly"); 155 boolean editable = s == null || s.equals("0") || s.startsWith("off") || s.startsWith("false") || s.startsWith("no"); 156 current.add(new Combo(a.getValue("key"), a.getValue("text"), a.getValue("default"), values, editable)); 157 } else if (qname.equals("key")) 130 158 current.add(new Key(a.getValue("key"), a.getValue("value"))); 131 159 else … … 176 204 return p; 177 205 } 178 206 179 207 @Override public String toString() { 180 208 return name; … … 191 219 else 192 220 return new SequenceCommand(tr("Change Properties"), cmds); 193 221 } 194 222 } -
src/org/openstreetmap/josm/tools/GBC.java
r71 r117 20 20 */ 21 21 private GBC() {} 22 22 23 23 /** 24 24 * Create a standard constraint (which is not the last). … … 30 30 return c; 31 31 } 32 32 33 33 /** 34 34 * Create the constraint for the last elements on a line. … … 40 40 return c; 41 41 } 42 42 43 43 /** 44 44 * Create the constraint for the last elements on a line and on a paragraph. … … 71 71 return this; 72 72 } 73 73 74 74 /** 75 75 * Set the anchor of this GBC to a. … … 94 94 return this; 95 95 } 96 96 97 97 /** 98 98 * This is a helper to easily create a glue with a minimum default value.
Note:
See TracChangeset
for help on using the changeset viewer.