Package org.freeplane.features.map

Examples of org.freeplane.features.map.NodeRelativePath


      if(sourceClone == source)
        return this;
      String targetID = getTargetID();
      final NodeModel target = getTarget();
      if(target != null && target.getParentNode() != null && source.getParentNode() != null){
        final NodeRelativePath nodeRelativePath = new NodeRelativePath(source, target);
        final NodeModel commonAncestor = nodeRelativePath.commonAncestor();
        final NodeModel ancestorClone = nodeRelativePath.ancestorForBegin(sourceClone);
        if(commonAncestor.isCloneOf(ancestorClone)) {
              final NodeRelativePath pathAncestorToSource = new NodeRelativePath(commonAncestor, source);
        final NodeRelativePath clonePath = new NodeRelativePath(ancestorClone, sourceClone);
        if (pathAncestorToSource.equalPathsTo(clonePath)) {
                final NodeModel targetClone = nodeRelativePath.pathEnd(ancestorClone);
                targetID = targetClone.createID();
              }
            }
View Full Code Here


    final int oldIndex = oldParent.getChildPosition(child);
    if (oldParent != newParent || oldIndex != newIndex || changeSide != false) {
      final Set<NodeModel> oldParentClones = new HashSet<NodeModel>(oldParent.clones().toCollection());
      final Set<NodeModel> newParentClones = new HashSet<NodeModel>(newParent.clones().toCollection());

      final NodeRelativePath nodeRelativePath = new NodeRelativePath(oldParent, newParent);

      final NodeModel commonAncestor = nodeRelativePath.commonAncestor();
      for (NodeModel commonAncestorClone: commonAncestor.clones()){
          NodeModel oldParentClone = nodeRelativePath.pathBegin(commonAncestorClone);
          NodeModel newParentClone = nodeRelativePath.pathEnd(commonAncestorClone);
          moveSingleNode(oldParentClone.getChildAt(oldIndex), newParentClone, newIndex, isLeft, changeSide);
          oldParentClones.remove(oldParentClone);
          newParentClones.remove(newParentClone);
      }
View Full Code Here

TOP

Related Classes of org.freeplane.features.map.NodeRelativePath

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.