code: public void setRootComponent(Component component) throws IllegalRootComponentException {
          if (component != null && component.getParent() != null) {
              throw new IllegalRootComponentException("A component with parent cannot be set as a graph's root component. Make sure the component doesn't parent.");
          }
          this.rootComponent = component;
      }
docs: Add {@link Component} to the graph.
  
  @param component The root {@link Component} of this graph.