// we need to check if this transformation of given shape has executed the
// rule
public boolean executeNext(IProgressMonitor monitor) {
// in the basket always first is our main shape
ShapeModel shape = super.getShapeBasket().get(0).clone();
shape.moveToCenter();
shape.maximize();
// get next state
StateExecution state = this.getNext(monitor, shape);
if (state == null) {
monitor.done();
return false;
}
// we test if the shape has changed
// TODO: this will not work for replace
ShapeModel newShape = this.execute(shape, state, true);
if (newShape == null) {
Debugger.getInstance().addMessage("Restarting process, no change in shape!");
return this.executeNext(monitor);
}
Debugger.getInstance().addMessage("EXECUTED: " + state.toString());