public class SequenceCommand extends Command
Command.OldNodeState
Modifier and Type | Field and Description |
---|---|
boolean |
continueOnError
Determines if the sequence execution should continue after one of its commands fails.
|
private java.lang.String |
name |
private Command[] |
sequence
The command sequence to be executed.
|
private boolean |
sequenceComplete |
Constructor and Description |
---|
SequenceCommand(java.lang.String name,
java.util.Collection<Command> sequenz)
Create the command by specifying the list of commands to execute.
|
SequenceCommand(java.lang.String name,
Command... sequenz)
Convenient constructor, if the commands are known at compile time.
|
Modifier and Type | Method and Description |
---|---|
boolean |
executeCommand()
Executes the command on the dataset.
|
void |
fillModifiedData(java.util.Collection<OsmPrimitive> modified,
java.util.Collection<OsmPrimitive> deleted,
java.util.Collection<OsmPrimitive> added)
Fill in the changed data this command operates on.
|
java.util.Collection<PseudoCommand> |
getChildren()
Returns the subcommands of this command.
|
javax.swing.Icon |
getDescriptionIcon()
Provides a descriptive icon of this command.
|
java.lang.String |
getDescriptionText()
Provides a description text representing this command.
|
Command |
getLastCommand()
Returns the last command.
|
java.util.Collection<? extends OsmPrimitive> |
getParticipatingPrimitives()
Return the primitives that take part in this command.
|
protected void |
setSequence(Command[] sequence) |
protected void |
setSequenceComplete(boolean sequenceComplete) |
void |
undoCommand()
Undoes the command.
|
protected void |
undoCommands(int start) |
checkAndConfirmOutlyingOperation, getLayer, getOrig, invalidBecauselayerRemoved
private boolean sequenceComplete
private final java.lang.String name
public boolean continueOnError
public SequenceCommand(java.lang.String name, java.util.Collection<Command> sequenz)
name
- The description textsequenz
- The sequence that should be executed.public SequenceCommand(java.lang.String name, Command... sequenz)
name
- The description textsequenz
- The sequence that should be executed.public boolean executeCommand()
Command
executeCommand
in class Command
public Command getLastCommand()
null
if the sequence is empty.protected final void undoCommands(int start)
public void undoCommand()
Command
undoCommand
in class Command
public void fillModifiedData(java.util.Collection<OsmPrimitive> modified, java.util.Collection<OsmPrimitive> deleted, java.util.Collection<OsmPrimitive> added)
Command
fillModifiedData
in class Command
modified
- The modified primitivesdeleted
- The deleted primitivesadded
- The added primitivespublic java.lang.String getDescriptionText()
PseudoCommand
getDescriptionText
in class PseudoCommand
public javax.swing.Icon getDescriptionIcon()
PseudoCommand
getDescriptionIcon
in class PseudoCommand
public java.util.Collection<PseudoCommand> getChildren()
PseudoCommand
getChildren
in class PseudoCommand
public java.util.Collection<? extends OsmPrimitive> getParticipatingPrimitives()
Command
getParticipatingPrimitives
in class Command
protected final void setSequence(Command[] sequence)
protected final void setSequenceComplete(boolean sequenceComplete)