Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javafx.fxml;
import com.sun.javafx.fxml.BeanAdapter;
import com.sun.javafx.fxml.builder.JavaFXFontBuilder;
import com.sun.javafx.fxml.builder.JavaFXImageBuilder;
import com.sun.javafx.fxml.builder.JavaFXSceneBuilder;
import com.sun.javafx.fxml.builder.TriangleMeshBuilder;
import com.sun.javafx.fxml.builder.URLBuilder;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.URL;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javafx.application.ConditionalFeature;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.ObservableMap;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.shape.TriangleMesh;
import javafx.scene.text.Font;
import javafx.util.Builder;
import javafx.util.BuilderFactory;
import sun.reflect.misc.ConstructorUtil;
import sun.reflect.misc.MethodUtil;
/**
* JavaFX builder factory.
* @since JavaFX 2.0
*/
public final class JavaFXBuilderFactory implements BuilderFactory {
private final JavaFXBuilder NO_BUILDER = new JavaFXBuilder();
private final Map, JavaFXBuilder> builders = new HashMap, JavaFXBuilder>();
private final ClassLoader classLoader;
private final boolean alwaysUseBuilders;
private final boolean webSupported;
/**
* Default constructor.
*/
public JavaFXBuilderFactory() {
this(FXMLLoader.getDefaultClassLoader(), false);
}
/**
* @treatAsPrivate
* This constructor is for internal use only.
*
* @deprecated
*/
public JavaFXBuilderFactory(boolean alwaysUseBuilders) {
// SB-dependency: RT-21230 has been filed to track this
this(FXMLLoader.getDefaultClassLoader(), alwaysUseBuilders);
}
/**
* Constructor that takes a class loader.
*
* @param classLoader
* @since JavaFX 2.1
*/
public JavaFXBuilderFactory(ClassLoader classLoader) {
this(classLoader, false);
}
/**
* @treatAsPrivate
* This constructor is for internal use only.
*
* @deprecated
* @since JavaFX 2.1
*/
public JavaFXBuilderFactory(ClassLoader classLoader, boolean alwaysUseBuilders) {
// SB-dependency: RT-21230 has been filed to track this
if (classLoader == null) {
throw new NullPointerException();
}
this.classLoader = classLoader;
this.alwaysUseBuilders = alwaysUseBuilders;
this.webSupported = Platform.isSupported(ConditionalFeature.WEB);
}
@Override
public Builder> getBuilder(Class> type) {
Builder> builder;
if (type == Scene.class) {
builder = new JavaFXSceneBuilder();
} else if (type == Font.class) {
builder = new JavaFXFontBuilder();
} else if (type == Image.class) {
builder = new JavaFXImageBuilder();
} else if (type == URL.class) {
builder = new URLBuilder(classLoader);
} else if (type == TriangleMesh.class) {
builder = new TriangleMeshBuilder();
} else {
Builder