public void insert(MutableTreeNode mutableTreeNode, int param) {
   if (mutableTreeNode != null) {
     ChildTags.add(param, mutableTreeNode);
     mutableTreeNode.setParent(this);
     ChildrenCount++;
     fireTagAdded(new XMLPath());
   }
 }
예제 #2
0
 public void insert(MutableTreeNode child, int index) {
   if (index < 0) { // add to the end (used in xml load) (PN)
     index = getChildCount();
     children.add(index, child);
   } else { // mind preferred child :-)
     children.add(index, child);
     preferredChild = (MindMapNode) child;
   }
   child.setParent(this);
 }
예제 #3
0
 public void remove(MutableTreeNode node) {
   if (node == this.preferredChild) { // mind preferred child :-) (PN)
     int index = children.indexOf(node);
     if (children.size() > index + 1) {
       this.preferredChild = (MindMapNode) (children.get(index + 1));
     } else {
       this.preferredChild = (index > 0) ? (MindMapNode) (children.get(index - 1)) : null;
     }
   }
   node.setParent(null);
   children.remove(node);
 }
예제 #4
0
 public void remove(final MutableTreeNode node) {
   if (node == preferredChild) {
     final int index = children.indexOf(node);
     if (children.size() > index + 1) {
       preferredChild = (children.get(index + 1));
     } else {
       preferredChild = (index > 0) ? (NodeModel) (children.get(index - 1)) : null;
     }
   }
   final int index = getIndex(node);
   node.setParent(null);
   children.remove(node);
   fireNodeRemoved((NodeModel) node, index);
 }
예제 #5
0
 public void insert(final MutableTreeNode child, int index) {
   if (!isAccessible()) {
     throw new IllegalArgumentException("Trying to insert nodes into a ciphered node.");
   }
   final NodeModel childNode = (NodeModel) child;
   if (index < 0) {
     index = getChildCount();
     children.add(index, (NodeModel) child);
   } else {
     children.add(index, (NodeModel) child);
     preferredChild = childNode;
   }
   child.setParent(this);
   fireNodeInserted(childNode, getIndex(child));
 }