use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.
the class CopyAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
final Controller controller = Controller.getCurrentController();
final ModeController modeController = Controller.getCurrentModeController();
final IMapSelection selection = controller.getSelection();
if (selection != null) {
final ClipboardController clipboardController = (ClipboardController) modeController.getExtension(ClipboardController.class);
final Transferable copy = clipboardController.copy(selection);
if (copy != null) {
clipboardController.setClipboardContents(copy);
}
}
}
use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.
the class MClipboardController method createActions.
/**
* @param modeController
*/
private void createActions() {
final ModeController modeController = Controller.getCurrentModeController();
modeController.addAction(new CutAction());
modeController.addAction(new PasteAction());
modeController.addAction(new SelectedPasteAction());
modeController.addAction(new CloneAction());
modeController.addAction(new MoveAction());
}
use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.
the class CloudShapeAction method actionPerformed.
@Override
public void actionPerformed(final ActionEvent e) {
ModeController controller;
{
controller = Controller.getCurrentModeController();
final NodeModel selected = controller.getMapController().getSelectedNode();
final MCloudController cloudController = (MCloudController) CloudController.getController();
cloudController.setCloud(selected, true);
}
super.actionPerformed(e);
}
use of org.freeplane.features.mode.ModeController in project freeplane by freeplane.
the class MCloudController method setColor.
public void setColor(final NodeModel node, final Color color) {
setCloud(node, true);
final ModeController modeController = Controller.getCurrentModeController();
final Color oldColor = CloudModel.getModel(node).getColor();
if (color == oldColor || color != null && color.equals(oldColor)) {
return;
}
final IActor actor = new IActor() {
public void act() {
CloudModel.getModel(node).setColor(color);
modeController.getMapController().nodeChanged(node);
}
public String getDescription() {
return "setColor";
}
public void undo() {
CloudModel.getModel(node).setColor(oldColor);
modeController.getMapController().nodeChanged(node);
}
};
modeController.execute(actor, node.getMap());
}
use of org.freeplane.features.mode.ModeController 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());
}
Aggregations