/** * Raise the specified child node within the Z-order of this to the top. * * @since 3.0 * @param child child node to raise to the top */ public void raiseToTop(final PNode child) { if (children != null && children.contains(child) && this.equals(child.getParent())) { child.raiseToTop(); } }
/** * Lower the specified child node within the Z-order of this. * * @since 3.0 * @param child child node to lower */ public void lower(final PNode child) { if (children != null && children.contains(child) && this.equals(child.getParent())) { child.lower(); } }
/** * Raise the specified child node within the Z-order of this. * * @since 3.0 * @param child child node to raise */ public void raise(final PNode child) { if (children != null && children.contains(child) && this.equals(child.getParent())) { child.raise(); } }
/** * Lower the specified child node within the Z-order of this to the bottom. * * @since 3.0 * @param child child node to lower to the bottom */ public void lowerToBottom(final PNode child) { if (children != null && children.contains(child) && this.equals(child.getParent())) { child.lowerToBottom(); } }
/** * Raise this node within the Z-order of its parent above the specified sibling node. * * @since 3.0 * @param sibling sibling node to raise this node above */ public void raiseAbove(final PNode sibling) { final PNode p = parent; if (p != null && p == sibling.getParent()) { p.removeChild(this); final int index = p.indexOfChild(sibling); p.addChild(index + 1, this); } }
/** * Lower this node within the Z-order of its parent below the specified sibling node. * * @since 3.0 * @param sibling sibling node to lower this node below */ public void lowerBelow(final PNode sibling) { final PNode p = parent; if (p != null && p == sibling.getParent()) { p.removeChild(this); final int index = p.indexOfChild(sibling); p.addChild(index, this); } }
/** * Add a node to be a new child of this node at the specified index. If * child was previously a child of another node, it is removed from that * node first. * * @param index where in the children list to insert the child * @param child the new child to add to this node */ public void addChild(final int index, final PNode child) { final PNode oldParent = child.getParent(); if (oldParent != null) { oldParent.removeChild(child); } child.setParent(this); getChildrenReference().add(index, child); child.invalidatePaint(); invalidateFullBounds(); firePropertyChange(PROPERTY_CODE_CHILDREN, PROPERTY_CHILDREN, null, children); }