19 package org.sleuthkit.autopsy.timeline;
21 import java.io.IOException;
22 import java.net.MalformedURLException;
24 import java.util.logging.Level;
25 import javafx.fxml.FXMLLoader;
26 import javafx.scene.Node;
27 import org.apache.commons.lang3.StringUtils;
61 static public
void construct(Node node, String fxmlFileName) {
62 construct(node, node.getClass(), fxmlFileName);
77 static public
void construct(Node node, Class<? extends Node> clazz, String fxmlFileName) {
78 final String name =
"nbres:/" + StringUtils.replace(clazz.getPackage().getName(),
".",
"/") +
"/" + fxmlFileName;
81 FXMLLoader fxmlLoader =
new FXMLLoader(
new URL(name));
82 fxmlLoader.setRoot(node);
83 fxmlLoader.setController(node);
87 }
catch (IOException exception) {
88 LOGGER.log(Level.SEVERE,
"FXMLConstructor was unable to load FXML, falling back on default Class Loader, and trying again.", exception);
90 fxmlLoader.setClassLoader(FXMLLoader.getDefaultClassLoader());
92 }
catch (IOException ex) {
93 LOGGER.log(Level.SEVERE,
"FXMLConstructor was unable to load FXML, node initialization may not be complete.", ex);
96 }
catch (MalformedURLException ex) {
97 LOGGER.log(Level.SEVERE,
"FXMLConstructor was unable to load FXML, node initialization may not be complete.", ex);
static final Logger LOGGER
synchronized static Logger getLogger(String name)
static void construct(Node node, String fxmlFileName)