Changeset 119 in josm for src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
- Timestamp:
- 2006-07-21T00:31:54+02:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
r116 r119 7 7 import java.awt.BorderLayout; 8 8 import java.awt.Component; 9 import java.awt.Dimension;10 9 import java.awt.Font; 11 10 import java.awt.GridLayout; … … 209 208 */ 210 209 public PropertiesDialog(MapFrame mapFrame) { 211 super(tr("Properties"), "propertiesdialog", tr("Property for selected objects."), KeyEvent.VK_P); 212 setPreferredSize(new Dimension(320,150)); 213 210 super(tr("Properties"), "propertiesdialog", tr("Property for selected objects."), KeyEvent.VK_P, 150); 211 214 212 Vector<AnnotationPreset> allPresets = new Vector<AnnotationPreset>(); 215 213 String allAnnotations = Main.pref.get("annotation.sources"); … … 219 217 String source = st.nextToken(); 220 218 try { 221 if (source.startsWith("http") || source.startsWith("ftp") || source.startsWith("file"))222 in = new URL(source).openStream();223 else if (source.startsWith("resource://"))224 in = Main.class.getResourceAsStream(source.substring("resource:/".length()));225 else226 in = new FileInputStream(source);227 allPresets.addAll(AnnotationPreset.readAll(in));228 } catch (IOException e) {229 e.printStackTrace();230 JOptionPane.showMessageDialog(Main.parent, tr("Could not read annotation preset source: {0}",source));231 } catch (SAXException e) {232 e.printStackTrace();233 JOptionPane.showMessageDialog(Main.parent, tr("Error parsing {0}: ", source)+e.getMessage());234 }219 if (source.startsWith("http") || source.startsWith("ftp") || source.startsWith("file")) 220 in = new URL(source).openStream(); 221 else if (source.startsWith("resource://")) 222 in = Main.class.getResourceAsStream(source.substring("resource:/".length())); 223 else 224 in = new FileInputStream(source); 225 allPresets.addAll(AnnotationPreset.readAll(in)); 226 } catch (IOException e) { 227 e.printStackTrace(); 228 JOptionPane.showMessageDialog(Main.parent, tr("Could not read annotation preset source: {0}",source)); 229 } catch (SAXException e) { 230 e.printStackTrace(); 231 JOptionPane.showMessageDialog(Main.parent, tr("Error parsing {0}: ", source)+e.getMessage()); 232 } 235 233 } 236 234 if (allPresets.size() > 0) { … … 256 254 } 257 255 annotationPresets.setSelectedIndex(0); 258 }256 } 259 257 }); 260 258
Note:
See TracChangeset
for help on using the changeset viewer.
