Example #1
0
 public void detachChild(UIContainer child) {
   if (child == null) return;
   if (!children.contains(child)) return;
   getDisplayNode().detachChild(child.getDisplayNode());
   children.remove(child);
   child.setParent(null);
 }
Example #2
0
  /**
   * Adds a child container, which will be processed whenever this container is. Does nothing if the
   * child parameter is null. Does nothing if the supplied parameter is already in the child list.
   */
  public void attachChild(UIContainer child) {
    if (child == null) return;
    if (children.contains(child)) return;

    child.removeFromParent();
    if (child.isActive()) {
      getDisplayNode().attachChild(child.getDisplayNode());
    }
    children.add(child);
    child.setParent(this);
    // child.updatePosition(true);	// Removed as setParent does an updatePosition.
  }