public class CommandJoin extends StreetsideExecutableCommand
Modifier and Type | Field and Description |
---|---|
private StreetsideAbstractImage |
a |
private StreetsideAbstractImage |
b |
images
Constructor and Description |
---|
CommandJoin(StreetsideAbstractImage a,
StreetsideAbstractImage b)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
execute()
Executes the command.
|
void |
redo()
Redoes the action.
|
void |
sum(StreetsideCommand command)
If two equal commands are applied consecutively to the same set of images,
they are summed in order to reduce them to just one command.
|
String |
toString() |
void |
undo()
Undoes the action.
|
private final StreetsideAbstractImage a
private final StreetsideAbstractImage b
public CommandJoin(StreetsideAbstractImage a, StreetsideAbstractImage b)
a
- the first image, that is joined with the second oneb
- the second image, that is joined with the first oneIllegalArgumentException
- if the images are already in the same sequenceNullPointerException
- if a
or b
is nullpublic void execute()
StreetsideExecutableCommand
execute
in class StreetsideExecutableCommand
public void undo()
StreetsideCommand
undo
in class StreetsideCommand
public void redo()
StreetsideCommand
redo
in class StreetsideCommand
public void sum(StreetsideCommand command)
StreetsideCommand
sum
in class StreetsideCommand
command
- The command to be summed to last command.public String toString()
toString
in class StreetsideCommand