Search in sources :

Example 6 with ModeController

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);
        }
    }
}
Also used : IMapSelection(org.freeplane.features.map.IMapSelection) Transferable(java.awt.datatransfer.Transferable) ModeController(org.freeplane.features.mode.ModeController) Controller(org.freeplane.features.mode.Controller) ModeController(org.freeplane.features.mode.ModeController)

Example 7 with ModeController

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());
}
Also used : ModeController(org.freeplane.features.mode.ModeController)

Example 8 with ModeController

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);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) ModeController(org.freeplane.features.mode.ModeController)

Example 9 with ModeController

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());
}
Also used : Color(java.awt.Color) IActor(org.freeplane.core.undo.IActor) ModeController(org.freeplane.features.mode.ModeController)

Example 10 with ModeController

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());
}
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

ModeController (org.freeplane.features.mode.ModeController)185 NodeModel (org.freeplane.features.map.NodeModel)80 Controller (org.freeplane.features.mode.Controller)43 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)36 MapController (org.freeplane.features.map.MapController)31 MapModel (org.freeplane.features.map.MapModel)30 IActor (org.freeplane.core.undo.IActor)28 ResourceController (org.freeplane.core.resources.ResourceController)21 MMapController (org.freeplane.features.map.mindmapmode.MMapController)21 Point (java.awt.Point)16 TextController (org.freeplane.features.text.TextController)16 Component (java.awt.Component)13 MapView (org.freeplane.view.swing.map.MapView)13 LinkController (org.freeplane.features.link.LinkController)12 NodeView (org.freeplane.view.swing.map.NodeView)12 Color (java.awt.Color)11 File (java.io.File)11 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)11 IMapSelection (org.freeplane.features.map.IMapSelection)10 ViewController (org.freeplane.features.ui.ViewController)10