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