def load_into(stage, settings={})
      # Inherit from default settings
      settings = DEFAULT_SETTINGS.merge({root_dir: (self.instance_variable_get("@fxml_root_dir") || fxml_root),
          class_loader: (get_fxml_resource_class_loader),
          filename: self.instance_variable_get("@filename")}).merge settings

      # Custom controls don't always need to be pure java, but oh well...
      become_java!

      # like new, without initialize
      ctrl = allocate

      # Set the stage so we can reference it if needed later
      ctrl.stage = stage

      # load the FXML file
      root = Controller.get_fxml_loader(settings[:filename], ctrl, settings[:root_dir], settings[:class_loader]).load

      # Unless the FXML root node is a scene, wrap that node in a scene
      if root.is_a? Scene
        scene = root
      else
        scene = Scene.new root, settings[:width], settings[:height], settings[:depth_buffer]
        scene.fill = settings[:fill]
      end

      # set the controller and stage scene
      ctrl.scene = stage.scene = scene

      ctrl.finish_initialization *settings[:initialize].to_a
    end
def load_into(stage, settings={})
      # Inherit from default settings
      settings = DEFAULT_SETTINGS.merge({root_dir: (self.instance_variable_get("@fxml_root_dir") || fxml_root),
          class_loader: (get_fxml_resource_class_loader),
          filename: self.instance_variable_get("@filename")}).merge settings

      # Custom controls don't always need to be pure java, but oh well...
      become_java!

      # like new, without initialize
      ctrl = allocate

      # Set the stage so we can reference it if needed later
      ctrl.stage = stage

      # load the FXML file
      root = Controller.get_fxml_loader(settings[:filename], ctrl, settings[:root_dir], settings[:class_loader]).load

      # Unless the FXML root node is a scene, wrap that node in a scene
      if root.is_a? Scene
        scene = root
      else
        scene = Scene.new root, settings[:width], settings[:height], settings[:depth_buffer]
        scene.fill = settings[:fill]
      end

      # set the controller and stage scene
      ctrl.scene = stage.scene = scene

      ctrl.finish_initialization *settings[:initialize].to_a
    end
Load given fxml file onto the given stage. `settings` is an optional hash of:
 * :initialize => [array of arguments to pass to the initialize function]
 * :width => Default width of the Scene
 * :height => Default height of the Scene
 * :fill => Fill color of the Scene's background
 * :depth_buffer => JavaFX Scene DepthBuffer argument (look it up)
 * :root_dir =>  filename search for fxml realtive to this file

 === Examples

   controller = MyFXController.new "Demo.fxml", stage

 === Equivalent Java
   Parent root = FXMLLoader.load(getClass().getResource("Demo.fxml"));
   Scene scene = new Scene(root);
   stage.setScene(scene);
   controller = root.getController();