Example usage for javafx.fxml FXMLLoader setRoot

List of usage examples for javafx.fxml FXMLLoader setRoot

Introduction

In this page you can find the example usage for javafx.fxml FXMLLoader setRoot.

Prototype

public void setRoot(Object root) 

Source Link

Document

Sets the root of the object hierarchy.

Usage

From source file:ninja.eivind.hotsreplayuploader.window.nodes.BattleLobbyNode.java

public BattleLobbyNode(FXMLLoaderFactory factory) throws IOException {
    URL resource = getClass().getResource("BattleLobbyNode.fxml");
    FXMLLoader loader = factory.get();
    loader.setLocation(resource);//from  ww  w  .jav a2  s  .c o  m
    loader.setRoot(this);
    loader.setController(this);
    loader.load();
}

From source file:ninja.eivind.hotsreplayuploader.window.nodes.UploaderNode.java

@Autowired
public UploaderNode(FXMLLoaderFactory factory) throws IOException {
    super();//from  ww w . ja v  a 2s.  c  om
    URL resource = getClass().getResource("UploaderNode.fxml");
    FXMLLoader loader = factory.get();
    loader.setLocation(resource);
    loader.setRoot(this);
    loader.setController(this);
    loader.load();
}

From source file:ninja.eivind.hotsreplayuploader.window.nodes.HotsLogsNode.java

public HotsLogsNode(FXMLLoaderFactory factory) throws IOException {
    super();/*w ww  . ja  va2s  . c  om*/
    URL resource = getClass().getResource("HotsLogsNode.fxml");
    FXMLLoader loader = factory.get();
    loader.setLocation(resource);
    loader.setRoot(this);
    loader.setController(this);
    loader.load();
}

From source file:com.rvantwisk.cnctools.controls.ToolParametersControl.java

public ToolParametersControl() {
    FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("ToolParameters.fxml"));
    fxmlLoader.setRoot(this);
    fxmlLoader.setController(this);
    try {/* w ww .j  ava  2 s . com*/
        fxmlLoader.load();
    } catch (IOException exception) {
        throw new RuntimeException(exception);
    }
}

From source file:com.fxexperience.previewer.controller.PreviewController.java

public PreviewController() {
    try {//from   w  ww  .j  av a  2  s .co  m
        final FXMLLoader loader = new FXMLLoader();
        loader.setLocation(PreviewController.class.getResource("/fxml/FXMLPreviewPanel.fxml")); //NOI18N
        loader.setController(PreviewController.this);
        loader.setRoot(PreviewController.this);
        loader.load();

    } catch (IOException ex) {
        Logger.getLogger(PreviewController.class.getName()).log(Level.SEVERE, null, ex);
    }

    choiceBox.getSelectionModel().select(0);
    comboBox.getSelectionModel().select(0);

    listView.setItems(FXCollections.observableArrayList("Alpha", "Beta", "Gamma"));
    //           System.out.println(this.getUserAgentStylesheet());
}

From source file:com.exalttech.trex.ui.views.importPcap.ImportedPacketTableView.java

/**
 * Initialize view//from  ww w  . ja  va 2 s .c  om
 */
private void initView() {
    try {
        FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/fxml/ImportedPacketTableView.fxml"));
        fxmlLoader.setRoot(this);
        fxmlLoader.setController(this);
        fxmlLoader.load();

        initTableRowsColumns();
        extractExistingNames();
    } catch (Exception ex) {
        LOG.error("Error setting UI", ex);
    }
}

From source file:org.apache.cayenne.modeler.layout.LayoutSupport.java

default FXMLLoader loadFXML(final String fxmlPath) throws IOException {
    final FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource(fxmlPath));

    fxmlLoader.setRoot(this);
    fxmlLoader.setController(this);
    fxmlLoader.load();//from  w w w  .j a v  a  2s .c  o m

    // Note: Must manually initialize the layout because JavaFX will not
    //       automatically call the "initialize" method when the FXML is
    //       loaded from an interface's default method.  To avoid confusion
    //       with the JavaFX "initialize" name, a different method name is
    //       used for the same purpose.
    initializeLayout();

    return fxmlLoader;
}

From source file:org.sleuthkit.autopsy.imageanalyzer.FXMLConstructor.java

static public void construct(Node n, String fxmlFileName) {
    final String name = "nbres:/" + StringUtils.replace(n.getClass().getPackage().getName(), ".", "/") + "/"
            + fxmlFileName;//w  w  w . j a  v a 2  s  .  c om
    //        System.out.println(name);

    try {
        FXMLLoader fxmlLoader = new FXMLLoader(new URL(name));
        fxmlLoader.setRoot(n);
        fxmlLoader.setController(n);

        try {
            fxmlLoader.load();
        } catch (IOException exception) {
            try {
                fxmlLoader.setClassLoader(FXMLLoader.getDefaultClassLoader());
                fxmlLoader.load();
            } catch (IOException ex) {
                Exceptions.printStackTrace(ex);
            }
        }
    } catch (MalformedURLException ex) {
        Exceptions.printStackTrace(ex);
    }

}

From source file:org.sleuthkit.autopsy.imageanalyzer.gui.MetaDataPane.java

public MetaDataPane(ImageAnalyzerController controller) {
    this.controller = controller;

    FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MetaDataPane.fxml"));
    fxmlLoader.setRoot(this);
    fxmlLoader.setController(this);

    try {/*from   w  w w  .  j  a va2 s  . c  o  m*/
        fxmlLoader.load();
    } catch (IOException exception) {
        throw new RuntimeException(exception);
    }
}

From source file:org.sleuthkit.autopsy.imagegallery.gui.MetaDataPane.java

public MetaDataPane(ImageGalleryController controller) {
    this.controller = controller;

    FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("MetaDataPane.fxml"));
    fxmlLoader.setRoot(this);
    fxmlLoader.setController(this);

    try {/*from  w w  w. j a va 2s  .  c om*/
        fxmlLoader.load();
    } catch (IOException exception) {
        throw new RuntimeException(exception);
    }
}