@Override public void addChild(FXGNode child){
  if (child instanceof GraphicContentNode) {
    if (child instanceof TextGraphicNode)     textCount++;
    if (children == null)     children=new ArrayList<GraphicContentNode>();
    children.add((GraphicContentNode)child);
    if (child instanceof GroupNode) {
      if (definesScaleGrid()) {
        throw new FXGException(child.getStartLine(),child.getStartColumn(),"InvalidScaleGridGroupChild");
      }
    }
  }
 else {
    super.addChild(child);
  }
}

@ Override public void addChild ( FXGNode child ) { if ( child instanceof GraphicContentNode ) { if ( child instanceof TextGraphicNode ) textCount ++ ; if ( children == null ) children = new ArrayList < GraphicContentNode > ( ) ; children . add ( ( GraphicContentNode ) child ) ; if ( child instanceof GroupNode ) { if ( definesScaleGrid ( ) ) { throw new FXGException ( child . getStartLine ( ) , child . getStartColumn ( ) , "InvalidScaleGridGroupChild" ) ; } } } else { super . addChild ( child ) ; } }
add a child node . an exception is thrown if the child node is not a graphiccontentnode or a child is a group and the current group has scale grid defined .
