public class CommandMove extends StreetsideCommand
Modifier and Type | Field and Description |
---|---|
private double |
x |
private double |
y |
images
Constructor and Description |
---|
CommandMove(Set<StreetsideAbstractImage> images,
double x,
double y)
Main constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public CommandMove(Set<StreetsideAbstractImage> images, double x, double y)
images
- Set of images that are going to be moved.x
- How much the x coordinate increases.y
- How much the y coordinate increases.public void undo()
StreetsideCommand
undo
in class StreetsideCommand
public void redo()
StreetsideCommand
redo
in class StreetsideCommand
public String toString()
toString
in class StreetsideCommand
public void sum(StreetsideCommand command)
StreetsideCommand
sum
in class StreetsideCommand
command
- The command to be summed to last command.