Changeset 35627 in osm for applications/editors/josm/plugins/comfort0/src
- Timestamp:
- 2020-10-29T00:14:19+01:00 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/comfort0/src/net/simon04/comfort0/EditLevel0LAction.java
r35622 r35627 107 107 static List<PrimitiveData> readLevel0(Reader reader, final DataSet dataSet) throws ParseException { 108 108 final List<PrimitiveData> primitives = new Level0LParser(reader).primitives(); 109 buildChangeCommands(dataSet, primitives); 109 final SequenceCommand command = buildChangeCommands(dataSet, primitives); 110 GuiHelper.runInEDT(() -> { 111 if (command == null || command.getChildren().isEmpty()) { 112 return; 113 } 114 new Notification(trn( 115 "Comfort0: Changing {0} primitive", 116 "Comfort0: Changing {0} primitives", command.getChildren().size(), command.getChildren().size())).show(); 117 UndoRedoHandler.getInstance().add(command); 118 }); 110 119 return primitives; 111 120 } 112 121 113 static void buildChangeCommands(DataSet dataSet, List<PrimitiveData> primitives) {122 static SequenceCommand buildChangeCommands(DataSet dataSet, List<PrimitiveData> primitives) { 114 123 final List<Command> commands = new ArrayList<>(); 115 124 for (PrimitiveData fromLevel0L : primitives) { … … 132 141 } 133 142 } 134 135 143 if (commands.isEmpty()) { 136 return ;144 return null; 137 145 } 138 final SequenceCommand command = new SequenceCommand("Comfort0", commands); 139 GuiHelper.runInEDT(() -> { 140 new Notification(trn( 141 "Comfort0: Changing {0} primitive", 142 "Comfort0: Changing {0} primitives", commands.size(), commands.size())).show(); 143 UndoRedoHandler.getInstance().add(command); 144 }); 146 return new SequenceCommand("Comfort0", commands); 145 147 } 146 148 }
Note:
See TracChangeset
for help on using the changeset viewer.