Search in sources :

Example 26 with NodeModel

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

the class NodeLinkModel method clones.

public Collection<NodeLinkModel> clones() {
    final Clones sourceNodeClones = getSource().subtreeClones();
    if (sourceNodeClones.size() == 1)
        return Arrays.<NodeLinkModel>asList(this);
    ArrayList<NodeLinkModel> clones = new ArrayList<NodeLinkModel>(sourceNodeClones.size());
    for (NodeModel sourceClone : sourceNodeClones) {
        final NodeLinkModel cloneForSource = cloneForSource(sourceClone);
        if (cloneForSource != null)
            clones.add(cloneForSource);
    }
    return clones;
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) ArrayList(java.util.ArrayList) Clones(org.freeplane.features.map.Clones)

Example 27 with NodeModel

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

the class NodeLinks method removeArrowlink.

public void removeArrowlink(final NodeLinkModel link) {
    final NodeModel node = link.getSource();
    for (final NodeLinkModel i : NodeLinks.getLinkExtension(node).links) {
        if (link.equals(i.cloneForSource(link.getSource()))) {
            links.remove(i);
            final MapModel map = link.getSource().getMap();
            removeLinkFromMap(map, i);
            return;
        }
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) MapModel(org.freeplane.features.map.MapModel)

Example 28 with NodeModel

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

the class AddExecutionLinkAction method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    final NodeModel selectedNode = Controller.getCurrentModeController().getMapController().getSelectedNode();
    String linkAsString;
    final URI link = NodeLinks.getLink(selectedNode);
    if (link != null && LinkController.isSpecialLink(LinkController.EXECUTE_APP_SCHEME, link))
        linkAsString = LinkController.parseSpecialLink(link);
    else
        linkAsString = "";
    final String content = UITools.showInputDialog(Controller.getCurrentController().getSelection().getSelected(), TextUtils.getText("enter_command"), linkAsString);
    final MLinkController linkController = (MLinkController) LinkController.getController();
    if (content != null) {
        final URI newLink = content.isEmpty() ? null : LinkController.createItemLink(LinkController.EXECUTE_APP_SCHEME, content);
        linkController.setLink(selectedNode, newLink, LinkController.LINK_ABSOLUTE);
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) URI(java.net.URI)

Example 29 with NodeModel

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

the class AddLocalLinkAction method actionPerformed.

public void actionPerformed(final ActionEvent e) {
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    final List<NodeModel> selecteds = selection.getOrderedSelection();
    final int size = selecteds.size();
    if (size < 2) {
        Controller.getCurrentController();
        UITools.errorMessage(TextUtils.getText("less_than_two_selected_nodes"));
        return;
    }
    final NodeModel target = selecteds.get(size - 1);
    final String targetId = (target).createID();
    for (NodeModel source : selecteds) {
        if (source != target)
            ((MLinkController) LinkController.getController()).setLink(source, ("#" + targetId), LinkController.LINK_ABSOLUTE);
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) IMapSelection(org.freeplane.features.map.IMapSelection)

Example 30 with NodeModel

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

the class HierarchicalIcons2 method nodeChanged.

public void nodeChanged(final NodeChangeEvent event) {
    final NodeModel node = event.getNode();
    if (!isActive(node)) {
        return;
    }
    setStyleRecursive(node);
}
Also used : NodeModel(org.freeplane.features.map.NodeModel)

Aggregations

NodeModel (org.freeplane.features.map.NodeModel)408 ModeController (org.freeplane.features.mode.ModeController)89 MapModel (org.freeplane.features.map.MapModel)47 Controller (org.freeplane.features.mode.Controller)44 MapStyleModel (org.freeplane.features.styles.MapStyleModel)39 IMapSelection (org.freeplane.features.map.IMapSelection)34 MapController (org.freeplane.features.map.MapController)33 Point (java.awt.Point)32 MMapController (org.freeplane.features.map.mindmapmode.MMapController)31 IStyle (org.freeplane.features.styles.IStyle)31 IActor (org.freeplane.core.undo.IActor)30 NodeView (org.freeplane.view.swing.map.NodeView)22 ArrayList (java.util.ArrayList)20 Color (java.awt.Color)16 URI (java.net.URI)16 ResourceController (org.freeplane.core.resources.ResourceController)16 Component (java.awt.Component)15 MModeController (org.freeplane.features.mode.mindmapmode.MModeController)15 MTextController (org.freeplane.features.text.mindmapmode.MTextController)15 File (java.io.File)14