Modify some sequence commands to use a new function in JOSM

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head
Taylor Smock 2020-06-22 11:44:20 -06:00
rodzic a7c0a67999
commit b3ddb241db
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
2 zmienionych plików z 5 dodań i 14 usunięć

Wyświetl plik

@ -124,19 +124,10 @@ public class CreateConnectionsCommand extends Command {
}
}
Command permanentCommand = null;
if (permanent.size() == 1) {
permanentCommand = permanent.get(0);
} else if (!permanent.isEmpty()) {
permanentCommand = new SequenceCommand(getRealDescriptionText(), permanent);
}
Command undoCommand = null;
if (undoable.size() == 1) {
undoCommand = undoable.get(0);
} else if (!undoable.isEmpty()) {
undoCommand = new SequenceCommand(getRealDescriptionText(), undoable);
}
Command permanentCommand = permanent.isEmpty() ? null
: SequenceCommand.wrapIfNeeded(getRealDescriptionText(), permanent);
Command undoCommand = undoable.isEmpty() ? null
: SequenceCommand.wrapIfNeeded(getRealDescriptionText(), undoable);
return Arrays.asList(permanentCommand, undoCommand);
}

Wyświetl plik

@ -99,7 +99,7 @@ public class MapWithAIAddCommand extends Command implements Runnable {
final Command movePrimitivesCommand = new MovePrimitiveDataSetCommand(editable, mapWithAI,
primitives, primitiveData);
final Command createConnectionsCommand = createConnections(editable, primitiveData);
command = new SequenceCommand(getDescriptionText(), movePrimitivesCommand,
command = SequenceCommand.wrapIfNeeded(getDescriptionText(), movePrimitivesCommand,
createConnectionsCommand);
}
GuiHelper.runInEDTAndWait(command::executeCommand);