@Override public void addChild(FXGNode child){
  if (child instanceof MaskPropertyNode) {
    if (children != null) {
      throw new FXGException(child.getStartLine(),child.getStartColumn(),"InvalidMaskElement");
    }
    if (mask == null) {
      mask=((MaskPropertyNode)child).mask;
    }
 else {
      throw new FXGException(child.getStartLine(),child.getStartColumn(),"MultipleMaskElements");
    }
  }
 else   if (child instanceof LibraryNode) {
    if (mask != null || children != null) {
      throw new FXGException(child.getStartLine(),child.getStartColumn(),"InvalidLibraryElement");
    }
    if (library == null) {
      library=(LibraryNode)child;
    }
 else {
      throw new FXGException(child.getStartLine(),child.getStartColumn(),"MultipleLibraryElements");
    }
  }
 else   if (child instanceof GraphicContentNode) {
    if (children == null)     children=new ArrayList<GraphicContentNode>();
    if (child instanceof GroupNode) {
      GroupNode group=(GroupNode)child;
      if (definesScaleGrid) {
        group.setInsideScaleGrid(true);
      }
    }
    children.add((GraphicContentNode)child);
  }
 else {
    super.addChild(child);
  }
}

@ Override public void addChild ( FXGNode child ) { if ( child instanceof MaskPropertyNode ) { if ( children != null ) { throw new FXGException ( child . getStartLine ( ) , child . getStartColumn ( ) , "InvalidMaskElement" ) ; } if ( mask == null ) { mask = ( ( MaskPropertyNode ) child ) . mask ; } else { throw new FXGException ( child . getStartLine ( ) , child . getStartColumn ( ) , "MultipleMaskElements" ) ; } } else if ( child instanceof LibraryNode ) { if ( mask != null || children != null ) { throw new FXGException ( child . getStartLine ( ) , child . getStartColumn ( ) , "InvalidLibraryElement" ) ; } if ( library == null ) { library = ( LibraryNode ) child ; } else { throw new FXGException ( child . getStartLine ( ) , child . getStartColumn ( ) , "MultipleLibraryElements" ) ; } } else if ( child instanceof GraphicContentNode ) { if ( children == null ) children = new ArrayList < GraphicContentNode > ( ) ; if ( child instanceof GroupNode ) { GroupNode group = ( GroupNode ) child ; if ( definesScaleGrid ) { group . setInsideScaleGrid ( true ) ; } } children . add ( ( GraphicContentNode ) child ) ; } else { super . addChild ( child ) ; } }
adds an fxg child node to this graphic node . supported child nodes include graphic content nodes ( e . g . group , bitmapgraphic , ellipse , line , path , rect , textgraphic ) , control nodes ( e . g . library , private ) , or property nodes ( e . g . mask ) .
