- Timestamp:
- 2006-02-15T20:05:05+01:00 (19 years ago)
- Location:
- src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/Main.java
r51 r54 9 9 import java.awt.event.WindowAdapter; 10 10 import java.awt.event.WindowEvent; 11 import java.io.File; 11 12 import java.util.Arrays; 12 13 import java.util.Collection; … … 73 74 public final UndoAction undoAction; 74 75 public final RedoAction redoAction; 76 77 /** 78 * This directory is used for all disc IO access as starting directory. Should 79 * be set accordingly after the IO action. 80 */ 81 public File currentDirectory = new File("."); 75 82 76 83 /** -
src/org/openstreetmap/josm/actions/OpenAction.java
r51 r54 43 43 44 44 public void actionPerformed(ActionEvent e) { 45 JFileChooser fc = new JFileChooser( "data");45 JFileChooser fc = new JFileChooser(Main.main.currentDirectory); 46 46 for (int i = 0; i < ExtensionFileFilter.filters.length; ++i) 47 47 fc.addChoosableFileFilter(ExtensionFileFilter.filters[i]); … … 50 50 if (fc.showOpenDialog(Main.main) != JFileChooser.APPROVE_OPTION) 51 51 return; 52 53 Main.main.currentDirectory = fc.getCurrentDirectory(); 52 54 53 55 File filename = fc.getSelectedFile(); -
src/org/openstreetmap/josm/actions/SaveAction.java
r52 r54 42 42 return; 43 43 44 JFileChooser fc = new JFileChooser( "data");44 JFileChooser fc = new JFileChooser(Main.main.currentDirectory); 45 45 for (int i = 0; i < ExtensionFileFilter.filters.length; ++i) 46 46 fc.addChoosableFileFilter(ExtensionFileFilter.filters[i]); … … 49 49 File file = fc.getSelectedFile(); 50 50 if (file == null) 51 return; 52 Main.main.currentDirectory = fc.getCurrentDirectory(); 53 if (file.exists() && JOptionPane.YES_OPTION != 54 JOptionPane.showConfirmDialog(Main.main, "File exists. Overwrite?", "Overwrite", JOptionPane.YES_NO_OPTION)) 51 55 return; 52 56 -
src/org/openstreetmap/josm/io/OsmWriter.java
r53 r54 83 83 * Create a properties element. 84 84 */ 85 private Element parseProperty(OsmPrimitive osm, Entry<Key, String> entry) {85 private Element parseProperty(OsmPrimitive osm, long id, Entry<Key, String> entry) { 86 86 Element e = new Element("property"); 87 87 Key key = entry.getKey(); 88 e.setAttribute("uid", ""+ osm.id);88 e.setAttribute("uid", ""+id); 89 89 e.setAttribute("key", key.name); 90 90 e.setAttribute("value", entry.getValue()); … … 104 104 if (osm.keys != null) 105 105 for (Entry<Key, String> entry : osm.keys.entrySet()) 106 properties.add(parseProperty(osm, entry));106 properties.add(parseProperty(osm, id, entry)); 107 107 if (osm.isDeleted()) 108 108 e.setAttribute("action", "delete");
Note:
See TracChangeset
for help on using the changeset viewer.