};
modeController.execute(actor, node.getMap());
}
public void setShape(final NodeModel node, final String shape) {
final ModeController modeController = Controller.getCurrentModeController();
final String oldShape = NodeStyleModel.getShape(node);
final IActor actor = new IActor() {
public void act() {
NodeStyleModel.setShape(node, shape);
modeController.getMapController().nodeChanged(node);
childShapeRefresh(node);
}
public String getDescription() {
return "setShape";
}
private void childShapeRefresh(final NodeModel node) {
for (final NodeModel child : modeController.getMapController().childrenFolded(node)) {
if(child.getViewers().isEmpty())
continue;
final String childShape = NodeStyleModel.getShape(child);
if (childShape == null || NodeStyleModel.SHAPE_AS_PARENT.equals(childShape)) {
modeController.getMapController().nodeRefresh(child);
childShapeRefresh(child);
}
}
}
public void undo() {
NodeStyleModel.setShape(node, oldShape);
modeController.getMapController().nodeChanged(node);
childShapeRefresh(node);
}
};
modeController.execute(actor, node.getMap());
}