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.lang.String |
getName()
Returns the command name used in description text.
|
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, getOrigprivate 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 nullname - 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()
CommandThe layer should be invalidated after execution so that it can be re-painted.
executeCommand in class Commandpublic Command getLastCommand()
null if the sequence is empty.protected final void undoCommands(int start)
public void undoCommand()
CommandundoCommand in class Commandpublic void fillModifiedData(java.util.Collection<OsmPrimitive> modified, java.util.Collection<OsmPrimitive> deleted, java.util.Collection<OsmPrimitive> added)
CommandfillModifiedData in class Commandmodified - The modified primitivesdeleted - The deleted primitivesadded - The added primitivespublic java.lang.String getDescriptionText()
PseudoCommandpublic final java.lang.String getName()
public javax.swing.Icon getDescriptionIcon()
PseudoCommandpublic java.util.Collection<PseudoCommand> getChildren()
PseudoCommandpublic java.util.Collection<? extends OsmPrimitive> getParticipatingPrimitives()
CommandgetParticipatingPrimitives in interface PseudoCommandgetParticipatingPrimitives in class Commandprotected final void setSequence(Command... sequence)
protected final void setSequenceComplete(boolean sequenceComplete)