/** * Creates a node.<br> * Nodes should not be created via the builder factory and not * the tradional way by invoking a constructor. * Only the builder factory guarantees TT-compliant instances. * * @param <T> the requested FX standard node type * @param <R> the expected type of the returned node * @param clazz the node's class * @return the node instance */ @SuppressWarnings("unchecked") public static <T, R extends T> R createNode(Class<T> clazz) { return (R) FxFactory.getInstance().getBuilderFactory().getBuilder(clazz).build(); }