Changeset 35622 in osm for applications/editors/josm
- Timestamp:
- 2020-10-26T09:32:12+01:00 (4 years ago)
- Location:
- applications/editors/josm/plugins/comfort0/src/net/simon04/comfort0
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/comfort0/src/net/simon04/comfort0/Comfort0Plugin.java
r35619 r35622 23 23 MainMenu.add(menu.editMenu, new EditLevel0LAction()); 24 24 MainMenu.addAfter(menu.editMenu, new CopyLevel0LAction(), false, menu.copy); 25 MainMenu.addAfter(menu.editMenu, new PasteLevel0LAction(), false, menu.paste); 25 26 26 27 } -
applications/editors/josm/plugins/comfort0/src/net/simon04/comfort0/EditLevel0LAction.java
r35621 r35622 7 7 import java.io.BufferedReader; 8 8 import java.io.IOException; 9 import java.io.Reader; 9 10 import java.nio.charset.Charset; 10 11 import java.nio.file.Files; … … 98 99 99 100 private void readLevel0(Path path, final DataSet dataSet) throws IOException, ParseException { 100 final List<PrimitiveData> primitives;101 101 try (BufferedReader reader = Files.newBufferedReader(path, CHARSET)) { 102 primitives = new Level0LParser(reader).primitives(); 102 final List<PrimitiveData> primitives = readLevel0(reader, dataSet); 103 Logging.info("Comfort0: Reading file {0} yielded {1} primitives", path, primitives.size()); 103 104 } 104 Logging.info("Comfort0: Reading file {0} yielded {1} primitives", path, primitives.size());105 106 buildChangeCommands(dataSet, primitives);107 105 } 108 106 109 private void buildChangeCommands(DataSet dataSet, List<PrimitiveData> primitives) { 107 static List<PrimitiveData> readLevel0(Reader reader, final DataSet dataSet) throws ParseException { 108 final List<PrimitiveData> primitives = new Level0LParser(reader).primitives(); 109 buildChangeCommands(dataSet, primitives); 110 return primitives; 111 } 112 113 static void buildChangeCommands(DataSet dataSet, List<PrimitiveData> primitives) { 110 114 final List<Command> commands = new ArrayList<>(); 111 115 for (PrimitiveData fromLevel0L : primitives) {
Note:
See TracChangeset
for help on using the changeset viewer.