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;
|
Command permanentCommand = permanent.isEmpty() ? null
|
||||||
if (permanent.size() == 1) {
|
: SequenceCommand.wrapIfNeeded(getRealDescriptionText(), permanent);
|
||||||
permanentCommand = permanent.get(0);
|
Command undoCommand = undoable.isEmpty() ? null
|
||||||
} else if (!permanent.isEmpty()) {
|
: SequenceCommand.wrapIfNeeded(getRealDescriptionText(), undoable);
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Arrays.asList(permanentCommand, undoCommand);
|
return Arrays.asList(permanentCommand, undoCommand);
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class MapWithAIAddCommand extends Command implements Runnable {
|
||||||
final Command movePrimitivesCommand = new MovePrimitiveDataSetCommand(editable, mapWithAI,
|
final Command movePrimitivesCommand = new MovePrimitiveDataSetCommand(editable, mapWithAI,
|
||||||
primitives, primitiveData);
|
primitives, primitiveData);
|
||||||
final Command createConnectionsCommand = createConnections(editable, primitiveData);
|
final Command createConnectionsCommand = createConnections(editable, primitiveData);
|
||||||
command = new SequenceCommand(getDescriptionText(), movePrimitivesCommand,
|
command = SequenceCommand.wrapIfNeeded(getDescriptionText(), movePrimitivesCommand,
|
||||||
createConnectionsCommand);
|
createConnectionsCommand);
|
||||||
}
|
}
|
||||||
GuiHelper.runInEDTAndWait(command::executeCommand);
|
GuiHelper.runInEDTAndWait(command::executeCommand);
|
||||||
|
|
Ładowanie…
Reference in New Issue