kopia lustrzana https://github.com/JOSM/MapWithAI
Modify some sequence commands to use a new function in JOSM
Signed-off-by: Taylor Smock <taylor.smock@kaart.com>pull/1/head
rodzic
a7c0a67999
commit
b3ddb241db
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Ładowanie…
Reference in New Issue