modeController.addAction(new CloudShapeAction(shape));
}
}
public void setCloud(final NodeModel node, final boolean enable) {
final CloudModel cloud = CloudModel.getModel(node);
if ((cloud != null) == enable) {
return;
}
final Color color = cloud != null ? cloud.getColor() : CloudController.getStandardColor();
final ModeController modeController = Controller.getCurrentModeController();
final IActor actor = new IActor() {
public void act() {
if (enable) {
enable();
}
else {
disable();
}
}
private void disable() {
final MapController mapController = modeController.getMapController();
CloudModel.setModel(node, null);
mapController.nodeChanged(node);
}
private void enable() {
final CloudModel cloud = new CloudModel();
cloud.setColor(color);
final MapController mapController = modeController.getMapController();
CloudModel.setModel(node, cloud);
mapController.nodeChanged(node);
}