當前位置: 首頁>>代碼示例>>Java>>正文


Java Dialog.setResizable方法代碼示例

本文整理匯總了Java中javafx.scene.control.Dialog.setResizable方法的典型用法代碼示例。如果您正苦於以下問題:Java Dialog.setResizable方法的具體用法?Java Dialog.setResizable怎麽用?Java Dialog.setResizable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.Dialog的用法示例。


在下文中一共展示了Dialog.setResizable方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setup

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
private void setup() {
	ProjectConfig config = ProjectConfig.getLast();

	Dialog<ProjectConfig> dialog = new Dialog<>();
	//dialog.initModality(Modality.APPLICATION_MODAL);
	dialog.setResizable(true);
	dialog.setTitle("UID Setup");
	dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);

	Node okButton = dialog.getDialogPane().lookupButton(ButtonType.OK);

	UidSetupPane setupPane = new UidSetupPane(config, dialog.getOwner(), okButton);
	dialog.getDialogPane().setContent(setupPane);
	dialog.setResultConverter(button -> button == ButtonType.OK ? config : null);

	dialog.showAndWait().ifPresent(newConfig -> {
		setupPane.updateConfig();

		if (!newConfig.isValid()) return;

		newConfig.saveAsLast();
	});
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:24,代碼來源:UidMenu.java

示例2: initialize

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
@Override
public void initialize(URL location, ResourceBundle resources) {
    
    logoImg.setImage(UIUtils.getImage("logo.png"));

    Dialog diag = new Dialog();
    diag.getDialogPane().setContent(borderPane);
    diag.getDialogPane().setBackground(Background.EMPTY);
    diag.setResizable(true);

    UIUtils.setIcon(diag);

    ButtonType closeButton = new ButtonType("Close", ButtonBar.ButtonData.OK_DONE);

    diag.getDialogPane().getButtonTypes().addAll(closeButton);
    diag.setTitle("About HueSense");

    Optional<ButtonType> opt = diag.showAndWait();
    if (opt.isPresent() && opt.get().getButtonData() == ButtonBar.ButtonData.OK_DONE) {
        // nothing
    }

}
 
開發者ID:dainesch,項目名稱:HueSense,代碼行數:24,代碼來源:AboutPresenter.java

示例3: prepareDialog

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
/**
 * Initialize a dialog by setting its title, header and content
 * and set window style to "utility dialog".
 *
 * @param dialog The dialog to initialize
 * @param keyTitle Key for dialog title in the translation file
 * @param keyHeader Key for dialog header in the translation file
 * @param keyContent Key for dialog content in the translation file
 * @param windowData The position and size of the parent window
 */
protected static void prepareDialog(final Dialog dialog, final String keyTitle,
        final String keyHeader, final String keyContent, final ParentWindowData windowData) {
    dialog.setTitle(TRANSLATIONS.getString(keyTitle));
    dialog.setHeaderText(TRANSLATIONS.getString(keyHeader));
    dialog.setContentText(TRANSLATIONS.getString(keyContent));
    ((Stage) dialog.getDialogPane().getScene().getWindow()).initStyle(StageStyle.UTILITY);
    dialog.setResizable(false);

    /* Handler to place the dialog in the middle of the main window instead of the middle
     * of the screen; the width oh the dialog is fixed. */
    dialog.setOnShown(new EventHandler<DialogEvent>() {
        public void handle(final DialogEvent event) {
            dialog.setWidth(DIALOG_WIDTH);
            dialog.getDialogPane().setMaxWidth(DIALOG_WIDTH);
            dialog.getDialogPane().setMinWidth(DIALOG_WIDTH);
            dialog.setX(windowData.getX() + (windowData.getWidth() / 2) - (dialog.getWidth() / 2));
            dialog.setY(windowData.getY() + 30);
        }
    });
}
 
開發者ID:tortlepp,項目名稱:SimpleTaskList,代碼行數:31,代碼來源:AbstractDialogController.java

示例4: editDocument

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
public Optional<String> editDocument(String formattedJson, int cursorPosition) {
  Dialog<String> dialog = new Dialog<>();
  dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);
  dialog.setTitle("MongoFX - edit document");
  dialog.setResizable(true);
  dialog.getDialogPane().getStylesheets().add(getClass().getResource("/ui/editor.css").toExternalForm());

  CodeArea codeArea = setupEditorArea(formattedJson, dialog, cursorPosition);

  dialog.setResultConverter(bt -> {
    if (ButtonData.OK_DONE == bt.getButtonData()) {
      return codeArea.getText();
    }
    return null;
  });
  return dialog.showAndWait();
}
 
開發者ID:daa84,項目名稱:mongofx,代碼行數:18,代碼來源:UIBuilder.java

示例5: pickStylerToConfigure

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
private void pickStylerToConfigure(final List<Parameterizable> stylers) {
   if (stylers.size() == 1) {
      selectInCombo(stylers.get(0));
      return;
   } else if (stylers.isEmpty()) {
      selectInCombo(null);
      return;
   }
   List<ParameterizableWrapper> pw = new ArrayList<>(stylers.size());
   stylers.stream().forEach((p) -> {
      pw.add(new ParameterizableWrapper(p));
   });
   Dialog<ParameterizableWrapper> dialog = new ChoiceDialog<>(pw.get(0), pw);
   ButtonType bt = new ButtonType("choose", ButtonBar.ButtonData.OK_DONE);
   dialog.getDialogPane().getButtonTypes().clear();
   dialog.getDialogPane().getButtonTypes().add(bt);
   dialog.setTitle("Please choose");
   dialog.setHeaderText(null);
   dialog.setResizable(true);
   dialog.setContentText("choose the styler or condition you want to configure");
   Optional<ParameterizableWrapper> choice = dialog.showAndWait();
   if (choice.isPresent()) {
      selectInCombo(choice.get().p);
   }
}
 
開發者ID:eduarddrenth,項目名稱:iText-GUI,代碼行數:26,代碼來源:Controller.java

示例6: deploy

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
@FXML
protected void deploy() {
  eventBus.post(new WarningEvent(
      "Deploy has been deprecated",
      "The deploy tool has been deprecated and is no longer supported. "
          + "It will be removed in a future release.\n\n"
          + "Instead, use code generation to create a Java, C++, or Python class that handles all"
          + " the OpenCV code and can be easily integrated into a WPILib robot program."));

  ImageView graphic = new ImageView(new Image("/edu/wpi/grip/ui/icons/settings.png"));
  graphic.setFitWidth(DPIUtility.SMALL_ICON_SIZE);
  graphic.setFitHeight(DPIUtility.SMALL_ICON_SIZE);

  deployPane.requestFocus();

  Dialog<ButtonType> dialog = new Dialog<>();
  dialog.setTitle("Deploy");
  dialog.setHeaderText("Deploy");
  dialog.setGraphic(graphic);
  dialog.getDialogPane().getButtonTypes().setAll(ButtonType.CLOSE);
  dialog.getDialogPane().styleProperty().bind(root.styleProperty());
  dialog.getDialogPane().getStylesheets().setAll(root.getStylesheets());
  dialog.getDialogPane().setContent(deployPane);
  dialog.setResizable(true);
  dialog.showAndWait();
}
 
開發者ID:WPIRoboticsProjects,項目名稱:GRIP,代碼行數:27,代碼來源:MainWindowController.java

示例7: newProject

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
private void newProject() {
	ProjectConfig config = ProjectConfig.getLast();

	Dialog<ProjectConfig> dialog = new Dialog<>();
	//dialog.initModality(Modality.APPLICATION_MODAL);
	dialog.setResizable(true);
	dialog.setTitle("Project configuration");
	dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);

	Node okButton = dialog.getDialogPane().lookupButton(ButtonType.OK);

	dialog.getDialogPane().setContent(new NewProjectPane(config, dialog.getOwner(), okButton));
	dialog.setResultConverter(button -> button == ButtonType.OK ? config : null);

	dialog.showAndWait().ifPresent(newConfig -> {
		if (!newConfig.isValid()) return;

		newConfig.saveAsLast();

		gui.getMatcher().reset();
		gui.onProjectChange();

		gui.runProgressTask("Initializing files...",
				progressReceiver -> gui.getMatcher().init(newConfig, progressReceiver),
				() -> gui.onProjectChange(),
				Throwable::printStackTrace);
	});
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:29,代碼來源:FileMenu.java

示例8: loadProject

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
private void loadProject() {
	Path file = Gui.requestFile("Select matches file", gui.getScene().getWindow(), getMatchesLoadExtensionFilters(), true);
	if (file == null) return;

	List<Path> paths = new ArrayList<>();

	Dialog<List<Path>> dialog = new Dialog<>();
	//dialog.initModality(Modality.APPLICATION_MODAL);
	dialog.setResizable(true);
	dialog.setTitle("Project paths");
	dialog.getDialogPane().getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);

	Node okButton = dialog.getDialogPane().lookupButton(ButtonType.OK);

	dialog.getDialogPane().setContent(new LoadProjectPane(paths, dialog.getOwner(), okButton));
	dialog.setResultConverter(button -> button == ButtonType.OK ? paths : null);

	dialog.showAndWait().ifPresent(newConfig -> {
		if (paths.isEmpty()) return;

		gui.getMatcher().reset();
		gui.onProjectChange();

		gui.runProgressTask("Initializing files...",
				progressReceiver -> gui.getMatcher().readMatches(file, paths, progressReceiver),
				() -> gui.onProjectChange(),
				Throwable::printStackTrace);
	});
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:30,代碼來源:FileMenu.java

示例9: entitySearchDialog

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
public static <T extends Entity<T>> Optional<List<T>> entitySearchDialog(Query<T> query, boolean multiSelect) {
    try {
        FXMLLoader loader = new FXMLLoader(EntityGuiController.class.getResource("/fxml/Collection.fxml"));
        AnchorPane content = (AnchorPane) loader.load();
        final ControllerCollection<T> controller = loader.<ControllerCollection<T>>getController();
        controller.setQuery(query, false, false, false, multiSelect);

        Dialog<List<T>> dialog = new Dialog<>();
        dialog.setHeight(800);
        if (multiSelect) {
            dialog.setTitle("Choose one or more " + EntityType.singleForClass(query.getEntityType().getType()).getName());
        } else {
            dialog.setTitle("Choose a " + EntityType.singleForClass(query.getEntityType().getType()).getName());
        }
        dialog.setResizable(true);
        dialog.getDialogPane().setContent(content);
        ButtonType buttonTypeOk = new ButtonType("Set", ButtonBar.ButtonData.OK_DONE);
        dialog.getDialogPane().getButtonTypes().add(buttonTypeOk);
        ButtonType buttonTypeCancel = new ButtonType("Cancel", ButtonBar.ButtonData.CANCEL_CLOSE);
        dialog.getDialogPane().getButtonTypes().add(buttonTypeCancel);
        dialog.setResultConverter((ButtonType button) -> {
            if (button == buttonTypeOk) {
                if (multiSelect) {
                    return controller.getSelectedEntities();
                }
                List<T> list = new ArrayList<>();
                list.add(controller.getSelectedEntity());
                return list;
            }
            return null;
        });
        return dialog.showAndWait();

    } catch (IOException ex) {
        LoggerFactory.getLogger(EntityGuiController.class).error("Failed to load Tab.", ex);
        return Optional.empty();
    }
}
 
開發者ID:hylkevds,項目名稱:SensorThingsManager,代碼行數:39,代碼來源:EntityGuiController.java

示例10: showPrefsDialog

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
/**
 * Shows a dialog for editing the properties of this tab.
 */
public void showPrefsDialog() {
  // Use a flushable property here to prevent a call to populate() on every keystroke in the editor (!)
  FlushableProperty<String> flushableSourcePrefix = new FlushableProperty<>(sourcePrefix);
  FlushableProperty<Number> flushableTileSize = new FlushableProperty<>(getWidgetPane().tileSizeProperty());
  ExtendedPropertySheet propertySheet = new ExtendedPropertySheet(
      Arrays.asList(
          this.title,
          this.autoPopulate,
          flushableSourcePrefix,
          flushableTileSize,
          getWidgetPane().showGridProperty()
      ));
  propertySheet.getItems().addAll(
      new ExtendedPropertySheet.PropertyItem<>(getWidgetPane().hgapProperty(), "Horizontal spacing"),
      new ExtendedPropertySheet.PropertyItem<>(getWidgetPane().vgapProperty(), "Vertical spacing")
  );
  Dialog<ButtonType> dialog = new Dialog<>();
  dialog.getDialogPane().getStylesheets().setAll(AppPreferences.getInstance().getTheme().getStyleSheets());
  dialog.setResizable(true);
  dialog.titleProperty().bind(EasyBind.map(this.title, t -> t + " Preferences"));
  dialog.getDialogPane().setContent(new BorderPane(propertySheet));
  dialog.getDialogPane().getButtonTypes().addAll(ButtonType.CLOSE);
  dialog.setOnCloseRequest(__ -> {
    flushableSourcePrefix.flush();
    flushableTileSize.flush();
  });
  dialog.showAndWait();
}
 
開發者ID:wpilibsuite,項目名稱:shuffleboard,代碼行數:32,代碼來源:DashboardTab.java

示例11: showDailySectionChooserDialog

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
public static final DailySectionModel showDailySectionChooserDialog() {
       LoggerFacade.INSTANCE.debug(DialogProvider.class, "Show DailySection chooser dialog"); // NOI18N
       LoggerFacade.INSTANCE.trace(DialogProvider.class, "TODO add size to the dialog"); // NOI18N
       LoggerFacade.INSTANCE.trace(DialogProvider.class, "TODO use properties"); // NOI18N
       
       final Dialog<DailySectionModel> dialog = new Dialog<>();
       dialog.setTitle("Daily Section Chooser"); // NOI18N
       dialog.setHeaderText("Select the Daily Section to which the Project should be added!"); // NOI18N
       dialog.setResizable(false);
       
       final DailySectionChooserDialogView view = new DailySectionChooserDialogView();
       dialog.getDialogPane().setContent(view.getView());
       
       final ButtonType buttonTypeOk = new ButtonType("Okay", ButtonData.OK_DONE); // NOI18N
       final ButtonType buttonTypeCancel = new ButtonType("Cancel", ButtonData.CANCEL_CLOSE); // NOI18N
dialog.getDialogPane().getButtonTypes().addAll(buttonTypeOk, buttonTypeCancel);
       
dialog.setResultConverter((ButtonType buttonType) -> {
           if (
                   buttonType != null
                   && buttonType.equals(buttonTypeOk)
           ) {
               return view.getRealPresenter().getDailySection();
           }
           
           return null;
       });
       
       final Optional<DailySectionModel> result = dialog.showAndWait();
       if (!result.isPresent()) {
           return null;
       }
       
       return result.get();
   }
 
開發者ID:Naoghuman,項目名稱:Incubator,代碼行數:36,代碼來源:DialogProvider.java

示例12: showDeleteProjectDialog

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
public static final void showDeleteProjectDialog(long idToDelete, String projectTitle) {
       LoggerFacade.INSTANCE.debug(DialogProvider.class, "Show delete Project dialog"); // NOI18N

       final Dialog<Boolean> dialog = new Dialog<>();
       dialog.setTitle("Delete " + projectTitle); // NOI18N
       dialog.setHeaderText("Do you really want to delete this project?"); // NOI18N
       dialog.setResizable(false);
       
       final ButtonType buttonTypeOk = new ButtonType("Okay", ButtonData.OK_DONE); // NOI18N
       final ButtonType buttonTypeCancel = new ButtonType("Cancel", ButtonData.CANCEL_CLOSE); // NOI18N
dialog.getDialogPane().getButtonTypes().addAll(buttonTypeOk, buttonTypeCancel);
       
       dialog.setResultConverter((ButtonType buttonType) -> {
           final boolean shouldProjectDelete = buttonType != null && buttonType.equals(buttonTypeOk);
           return shouldProjectDelete;
       });
       
       final Optional<Boolean> result = dialog.showAndWait();
       if (
               !result.isPresent()
               || !result.get()
       ) {
           return;
       }
       
       // Delete the project
       SqlFacade.INSTANCE.getProjectSqlProvider().delete(idToDelete);
       
       // Cleanup
       ActionFacade.INSTANCE.handle(INavigationOverviewConfiguration.ON_ACTION__UPDATE_PROJECTS);
   }
 
開發者ID:Naoghuman,項目名稱:Incubator,代碼行數:32,代碼來源:DialogProvider.java

示例13: showNewDailySectionDialog

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
public static final DailySectionModel showNewDailySectionDialog() {
       LoggerFacade.INSTANCE.debug(DialogProvider.class, "Show new DailySection dialog"); // NOI18N
       LoggerFacade.INSTANCE.trace(DialogProvider.class, "TODO add size to the dialog"); // NOI18N
       LoggerFacade.INSTANCE.trace(DialogProvider.class, "TODO use properties"); // NOI18N
       
       final Dialog<DailySectionModel> dialog = new Dialog<>();
       dialog.setTitle("New Daily Section"); // NOI18N
       dialog.setHeaderText("Creates a new Daily Section."); // NOI18N
       dialog.setResizable(false);
       
       final DailySectionDialogView view = new DailySectionDialogView();
       dialog.getDialogPane().setContent(view.getView());
       
       final ButtonType buttonTypeOk = new ButtonType("Create", ButtonData.OK_DONE); // NOI18N
       final ButtonType buttonTypeCancel = new ButtonType("Cancel", ButtonData.CANCEL_CLOSE); // NOI18N
dialog.getDialogPane().getButtonTypes().addAll(buttonTypeOk, buttonTypeCancel);
       
dialog.setResultConverter((ButtonType buttonType) -> {
           if (
                   buttonType != null
                   && buttonType.equals(buttonTypeOk)
           ) {
               return view.getRealPresenter().getDailySection();
           }
           
           return null;
       });
       
       final Optional<DailySectionModel> result = dialog.showAndWait();
       if (!result.isPresent()) {
           return null;
       }
       
       return result.get();
   }
 
開發者ID:Naoghuman,項目名稱:Incubator,代碼行數:36,代碼來源:DialogProvider.java

示例14: createDiffDialog

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
public void createDiffDialog(MergeDiffInfo<?> mergeDiff, String title, Window owner) {
    final FactoryDiffWidget factoryDiffWidget = new FactoryDiffWidget(uniformDesign,attributeEditorBuilder);
    factoryDiffWidget.updateMergeDiff(mergeDiff);


    Dialog<Void> dialog = new Dialog<>();
    dialog.initOwner(owner);
    dialog.setTitle(title);
    dialog.setHeaderText(title);

    ButtonType loginButtonType = new ButtonType("OK", ButtonBar.ButtonData.OK_DONE);
    dialog.getDialogPane().getButtonTypes().addAll(loginButtonType/*, ButtonType.CANCEL*/);

    final BorderPane pane = new BorderPane();
    final Node diffWidgetContent = factoryDiffWidget.createContent();

    pane.setCenter(diffWidgetContent);
    pane.setPrefWidth(1000);
    pane.setPrefHeight(750);
    dialog.getDialogPane().setContent(pane);
    dialog.setResizable(true);

    dialog.getDialogPane().getStylesheets().add(getClass().getResource("/de/factoryfx/javafx/css/app.css").toExternalForm());

    if (!mergeDiff.hasNoConflicts()){
        dialog.setTitle("Konflikte");
        dialog.setHeaderText("Konflikte");
        diffWidgetContent.getStyleClass().add("error");
    }



    dialog.showAndWait();
}
 
開發者ID:factoryfx,項目名稱:factoryfx,代碼行數:35,代碼來源:DiffDialogBuilder.java

示例15: showDialog

import javafx.scene.control.Dialog; //導入方法依賴的package包/類
/**
 * Show dialog
 *
 * @param selectedText
 * @return
 */
private String showDialog(String selectedText) {
    Dialog dialog = new Dialog();
    dialog.setTitle("Edit Hex");
    dialog.setResizable(false);
    TextField text1 = new TextField();
    text1.addEventFilter(KeyEvent.KEY_TYPED, hex_Validation(2));
    text1.setText(selectedText);
    StackPane dialogPane = new StackPane();
    dialogPane.setPrefSize(150, 50);
    dialogPane.getChildren().add(text1);
    dialog.getDialogPane().setContent(dialogPane);
    ButtonType buttonTypeOk = new ButtonType("Save", ButtonData.OK_DONE);
    dialog.getDialogPane().getButtonTypes().add(buttonTypeOk);
    dialog.setResultConverter(new Callback<ButtonType, String>() {
        @Override
        public String call(ButtonType b) {
            
            if (b == buttonTypeOk) {
                switch (text1.getText().length()) {
                    case 0:
                        return null;
                    case 1:
                        return "0".concat(text1.getText());
                    default:
                        return text1.getText();
                }
            }
            return null;
        }
    });
    
    Optional<String> result = dialog.showAndWait();
    if (result.isPresent()) {
        return result.get();
    }
    return null;
}
 
開發者ID:exalt-tech,項目名稱:trex-stateless-gui,代碼行數:44,代碼來源:PacketHex.java


注:本文中的javafx.scene.control.Dialog.setResizable方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。