Search in sources :

Example 1 with Shape

use of org.freeplane.features.cloud.CloudModel.Shape in project freeplane by freeplane.

the class MCloudController method setShape.

public void setShape(final NodeModel node, final CloudModel.Shape shape) {
    setCloud(node, true);
    final ModeController modeController = Controller.getCurrentModeController();
    final CloudModel.Shape oldShape = CloudModel.getModel(node).getShape();
    if (shape == oldShape || shape != null && shape.equals(oldShape)) {
        return;
    }
    final IActor actor = new IActor() {

        public void act() {
            CloudModel.getModel(node).setShape(shape);
            modeController.getMapController().nodeChanged(node);
        }

        public String getDescription() {
            return "setShape";
        }

        public void undo() {
            CloudModel.getModel(node).setShape(oldShape);
            modeController.getMapController().nodeChanged(node);
        }
    };
    modeController.execute(actor, node.getMap());
}
Also used : Shape(org.freeplane.features.cloud.CloudModel.Shape) IActor(org.freeplane.core.undo.IActor) ModeController(org.freeplane.features.mode.ModeController) CloudModel(org.freeplane.features.cloud.CloudModel)

Aggregations

IActor (org.freeplane.core.undo.IActor)1 CloudModel (org.freeplane.features.cloud.CloudModel)1 Shape (org.freeplane.features.cloud.CloudModel.Shape)1 ModeController (org.freeplane.features.mode.ModeController)1