javafx.scene.Parent.getScene()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(195)

本文整理了Java中javafx.scene.Parent.getScene()方法的一些代码示例,展示了Parent.getScene()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parent.getScene()方法的具体详情如下:
包路径:javafx.scene.Parent
类名称:Parent
方法名:getScene

Parent.getScene介绍

暂无

代码示例

代码示例来源:origin: eu.mihosoft.vrl.workflow/vworkflows-fx

scene = p.getScene();

代码示例来源:origin: org.tentackle/tentackle-fx

@Override
public Stage getStage() {
 Stage stage = null;
 Scene scene = getView().getScene();
 if (scene != null && scene.getRoot() == getView()) {
  Window window = scene.getWindow();
  if (window instanceof Stage) {
   stage = (Stage) window;
  }
 }
 return stage;
}

代码示例来源:origin: de.roskenet/springboot-javafx-test

@Override
public void start(Stage stage) throws Exception {
  Preconditions.checkNotNull(viewBean, "No view to set up! Have you called init() before?");
  
  Scene scene = viewBean.getView().getScene();
  
  if (scene == null) {
    Scene x = new Scene(viewBean.getView());
    stage.setScene(x);
  }
  else {
    stage.setScene(scene);
  }
  stage.show();
}

代码示例来源:origin: de.roskenet/springboot-javafx-support

/**
 * @param window The FxmlView derived class that should be shown.
 * @param mode   See {@code javafx.stage.Modality}.
 */
public static void showView(final Class<? extends AbstractFxmlView> window, final Modality mode) {
  final AbstractFxmlView view = applicationContext.getBean(window);
  Stage newStage = new Stage();
  Scene newScene;
  if (view.getView().getScene() != null) {
    // This view was already shown so
    // we have a scene for it and use this one.
    newScene = view.getView().getScene();
  } else {
    newScene = new Scene(view.getView());
  }
  newStage.setScene(newScene);
  newStage.initModality(mode);
  newStage.initOwner(getStage());
  newStage.setTitle(view.getDefaultTitle());
  newStage.initStyle(view.getDefaultStyle());
  newStage.showAndWait();
}

代码示例来源:origin: PhoenicisOrg/phoenicis

this.addButton.setOnAction((ActionEvent event) -> {
  AddRepositoryDialog dialog = new AddRepositoryDialog();
  dialog.initOwner(this.getParent().getScene().getWindow());

代码示例来源:origin: PhoenicisOrg/phoenicis

.withTitle(tr("Restored default repositories"))
.withMessage(tr("Please restart such that the changes can take effect."))
.withOwner(getParent().getScene().getWindow())
.withResizable(true)
.build();

相关文章