public class SequenceCommand extends Command
Command.OldNodeState
Modifier and Type | Field and Description |
---|---|
protected 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 |
IS_INCOMPLETE, IS_OK, IS_OUTSIDE
Constructor and Description |
---|
SequenceCommand(DataSet ds,
java.lang.String name,
java.util.Collection<Command> sequenz,
boolean continueOnError)
Create the command by specifying the list of commands to execute.
|
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,
java.util.Collection<Command> sequenz,
boolean continueOnError)
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 |
equals(java.lang.Object obj) |
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.
|
int |
hashCode() |
protected void |
setSequence(Command... sequence) |
protected void |
setSequenceComplete(boolean sequenceComplete) |
void |
undoCommand()
Undoes the command.
|
protected void |
undoCommands(int start) |
checkOutlyingOrIncompleteOperation, ensurePrimitivesAreInDataset, getAffectedDataSet, getOrig
private boolean sequenceComplete
private final java.lang.String name
protected final boolean continueOnError
public SequenceCommand(DataSet ds, java.lang.String name, java.util.Collection<Command> sequenz, boolean continueOnError)
ds
- The target data set. Must not be null
name
- The description textsequenz
- The sequence that should be executedcontinueOnError
- Determines if the sequence execution should continue after one of its commands failspublic SequenceCommand(java.lang.String name, java.util.Collection<Command> sequenz, boolean continueOnError)
name
- The description textsequenz
- The sequence that should be executed. Must not be null or emptycontinueOnError
- Determines if the sequence execution should continue after one of its commands failspublic 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
The layer should be invalidated after execution so that it can be re-painted.
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
public javax.swing.Icon getDescriptionIcon()
PseudoCommand
public java.util.Collection<PseudoCommand> getChildren()
PseudoCommand
public java.util.Collection<? extends OsmPrimitive> getParticipatingPrimitives()
Command
getParticipatingPrimitives
in interface PseudoCommand
getParticipatingPrimitives
in class Command
protected final void setSequence(Command... sequence)
protected final void setSequenceComplete(boolean sequenceComplete)