Search in sources :

Example 26 with MapController

use of org.freeplane.features.map.MapController in project freeplane by freeplane.

the class MNodeStyleController method setBorderColorMatchesEdgeColor.

public void setBorderColorMatchesEdgeColor(final NodeModel node, final Boolean borderColorMatchesEdgeColor) {
    final Boolean oldBorderColorMatchesEdgeColor = NodeBorderModel.getBorderColorMatchesEdgeColor(node);
    final IActor actor = new IActor() {

        public void act() {
            NodeBorderModel.setBorderColorMatchesEdgeColor(node, borderColorMatchesEdgeColor);
            final MapController mapController = getModeController().getMapController();
            mapController.nodeChanged(node);
        }

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

        public void undo() {
            NodeBorderModel.setBorderColorMatchesEdgeColor(node, oldBorderColorMatchesEdgeColor);
            final MapController mapController = getModeController().getMapController();
            mapController.nodeChanged(node);
        }
    };
    getModeController().execute(actor, node.getMap());
}
Also used : IActor(org.freeplane.core.undo.IActor) MapController(org.freeplane.features.map.MapController)

Example 27 with MapController

use of org.freeplane.features.map.MapController in project freeplane by freeplane.

the class MNodeStyleController method setMaxNodeWidth.

public void setMaxNodeWidth(final NodeModel node, final Quantity<LengthUnits> maxNodeWidth) {
    Quantity.assertNonNegativeOrNull(maxNodeWidth);
    final NodeSizeModel sizeModel = createOwnSizeModel(node);
    final Quantity<LengthUnits> oldValue = NodeSizeModel.getMaxNodeWidth(node);
    final IActor actor = new IActor() {

        public void act() {
            sizeModel.setMaxNodeWidth(maxNodeWidth);
            final MapController mapController = getModeController().getMapController();
            mapController.nodeChanged(node);
        }

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

        public void undo() {
            sizeModel.setMaxNodeWidth(oldValue);
            final MapController mapController = getModeController().getMapController();
            mapController.nodeChanged(node);
        }
    };
    getModeController().execute(actor, node.getMap());
    final Quantity<LengthUnits> minNodeWidth = getMinWidth(node);
    if (maxNodeWidth != null && minNodeWidth != null && maxNodeWidth.toBaseUnitsRounded() < minNodeWidth.toBaseUnitsRounded()) {
        setMinNodeWidth(node, maxNodeWidth);
    }
}
Also used : LengthUnits(org.freeplane.core.ui.LengthUnits) NodeSizeModel(org.freeplane.features.nodestyle.NodeSizeModel) IActor(org.freeplane.core.undo.IActor) MapController(org.freeplane.features.map.MapController)

Example 28 with MapController

use of org.freeplane.features.map.MapController in project freeplane by freeplane.

the class MNodeStyleController method setBorderDashMatchesEdgeDash.

public void setBorderDashMatchesEdgeDash(final NodeModel node, final Boolean borderDashMatchesEdgeDash) {
    final Boolean oldBorderDashMatchesEdgeDash = NodeBorderModel.getBorderDashMatchesEdgeDash(node);
    final IActor actor = new IActor() {

        public void act() {
            NodeBorderModel.setBorderDashMatchesEdgeDash(node, borderDashMatchesEdgeDash);
            final MapController mapController = getModeController().getMapController();
            mapController.nodeChanged(node);
        }

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

        public void undo() {
            NodeBorderModel.setBorderDashMatchesEdgeDash(node, oldBorderDashMatchesEdgeDash);
            final MapController mapController = getModeController().getMapController();
            mapController.nodeChanged(node);
        }
    };
    getModeController().execute(actor, node.getMap());
}
Also used : IActor(org.freeplane.core.undo.IActor) MapController(org.freeplane.features.map.MapController)

Example 29 with MapController

use of org.freeplane.features.map.MapController in project freeplane by freeplane.

the class MNodeStyleController method setBorderDash.

public void setBorderDash(final NodeModel node, final DashVariant borderDash) {
    final DashVariant oldBorderDash = NodeBorderModel.getBorderDash(node);
    final IActor actor = new IActor() {

        public void act() {
            NodeBorderModel.setBorderDash(node, borderDash);
            final MapController mapController = getModeController().getMapController();
            mapController.nodeChanged(node);
        }

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

        public void undo() {
            NodeBorderModel.setBorderDash(node, oldBorderDash);
            final MapController mapController = getModeController().getMapController();
            mapController.nodeChanged(node);
        }
    };
    getModeController().execute(actor, node.getMap());
}
Also used : DashVariant(org.freeplane.features.DashVariant) IActor(org.freeplane.core.undo.IActor) MapController(org.freeplane.features.map.MapController)

Example 30 with MapController

use of org.freeplane.features.map.MapController in project freeplane by freeplane.

the class MNodeStyleController method setMinNodeWidth.

public void setMinNodeWidth(final NodeModel node, final Quantity<LengthUnits> minNodeWidth) {
    Quantity.assertNonNegativeOrNull(minNodeWidth);
    final NodeSizeModel sizeModel = createOwnSizeModel(node);
    final Quantity<LengthUnits> oldValue = NodeSizeModel.getMinNodeWidth(node);
    final IActor actor = new IActor() {

        public void act() {
            sizeModel.setMinNodeWidth(minNodeWidth);
            final MapController mapController = getModeController().getMapController();
            mapController.nodeChanged(node);
        }

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

        public void undo() {
            sizeModel.setMinNodeWidth(oldValue);
            final MapController mapController = getModeController().getMapController();
            mapController.nodeChanged(node);
        }
    };
    getModeController().execute(actor, node.getMap());
    final Quantity<LengthUnits> maxNodeWidth = getMaxWidth(node);
    if (maxNodeWidth != null && minNodeWidth != null && maxNodeWidth.toBaseUnits() < minNodeWidth.toBaseUnits()) {
        setMaxNodeWidth(node, minNodeWidth);
    }
}
Also used : LengthUnits(org.freeplane.core.ui.LengthUnits) NodeSizeModel(org.freeplane.features.nodestyle.NodeSizeModel) IActor(org.freeplane.core.undo.IActor) MapController(org.freeplane.features.map.MapController)

Aggregations

MapController (org.freeplane.features.map.MapController)60 NodeModel (org.freeplane.features.map.NodeModel)30 ModeController (org.freeplane.features.mode.ModeController)22 Controller (org.freeplane.features.mode.Controller)16 IActor (org.freeplane.core.undo.IActor)13 MapModel (org.freeplane.features.map.MapModel)10 LinkController (org.freeplane.features.link.LinkController)9 TextController (org.freeplane.features.text.TextController)9 MMapController (org.freeplane.features.map.mindmapmode.MMapController)8 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)8 NodeStyleController (org.freeplane.features.nodestyle.NodeStyleController)8 ResourceController (org.freeplane.core.resources.ResourceController)7 IconController (org.freeplane.features.icon.IconController)7 INodeSelectionListener (org.freeplane.features.map.INodeSelectionListener)7 ViewController (org.freeplane.features.ui.ViewController)7 URI (java.net.URI)6 MLinkController (org.freeplane.features.link.mindmapmode.MLinkController)6 MNodeStyleController (org.freeplane.features.nodestyle.mindmapmode.MNodeStyleController)6 JPopupMenu (javax.swing.JPopupMenu)5 CloudController (org.freeplane.features.cloud.CloudController)5