当前位置: 首页>>代码示例>>Java>>正文


Java GridPane.setVgrow方法代码示例

本文整理汇总了Java中javafx.scene.layout.GridPane.setVgrow方法的典型用法代码示例。如果您正苦于以下问题:Java GridPane.setVgrow方法的具体用法?Java GridPane.setVgrow怎么用?Java GridPane.setVgrow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.scene.layout.GridPane的用法示例。


在下文中一共展示了GridPane.setVgrow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createExpandableContent

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
private static GridPane createExpandableContent(String content) {
	Label label = new Label("Exception stacktrace");

	TextArea textArea = new TextArea(content);
	textArea.setEditable(false);
	textArea.setWrapText(true);

	textArea.setMaxWidth(Double.MAX_VALUE);
	textArea.setMaxHeight(Double.MAX_VALUE);
	GridPane.setVgrow(textArea, Priority.ALWAYS);
	GridPane.setHgrow(textArea, Priority.ALWAYS);

	GridPane expContent = new GridPane();
	expContent.setMaxWidth(Double.MAX_VALUE);
	expContent.add(label, 0, 0);
	expContent.add(textArea, 0, 1);

	return expContent;
}
 
开发者ID:vibridi,项目名称:fxutils,代码行数:20,代码来源:FXDialog.java

示例2: createExceptionTextArea

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
protected static GridPane createExceptionTextArea(Throwable errorToDisplay) {
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    errorToDisplay.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("The exception stacktrace was:");

    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);
    return expContent;
}
 
开发者ID:ciphertechsolutions,项目名称:IO,代码行数:24,代码来源:BaseController.java

示例3: createAlert

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
/**
 * Create an alert with a given type, title, desciption, content text and expandable content.
 *
 * @param type The type of the alert
 * @param title The title of the alert
 * @param description The description in the alert
 * @param contentText The content text for the alert
 * @param expandableContent The expandable content in the alert. This parameter may be null
 * @return The created alert
 */
public static Alert createAlert(Alert.AlertType type, String title, String description,
    String contentText, String expandableContent) {
  Alert alert = new Alert(type);
  alert.setTitle(title);
  alert.setHeaderText(description);
  alert.setContentText(contentText);

  TextArea textArea = new TextArea(expandableContent);
  textArea.setEditable(false);
  textArea.setWrapText(true);

  textArea.setMaxWidth(Double.MAX_VALUE);
  textArea.setMaxHeight(Double.MAX_VALUE);
  GridPane.setVgrow(textArea, Priority.ALWAYS);
  GridPane.setHgrow(textArea, Priority.ALWAYS);
  
  if (expandableContent != null && expandableContent.length() > 0) {
    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    if (type.equals(Alert.AlertType.ERROR)) {
      Label label = new Label("Stack trace:");
      expContent.add(label, 0, 0);
    }
    expContent.add(textArea, 0, 1);
    alert.getDialogPane().setExpandableContent(expContent);
  }

  if (type.equals(Alert.AlertType.ERROR) && expandableContent != null) {
    System.err.println(contentText);
    System.err.println(expandableContent);
  }

  alert.getDialogPane().setId("AlertDialogPane_" + type.toString());

  return alert;
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:47,代码来源:AlertFactory.java

示例4: ExceptionMessage

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public ExceptionMessage(String message, Exception ex) {
      super(AlertType.ERROR);
      setTitle("Exception");
      setHeaderText("Encountered an Exception");
      setContentText(message);

      StringWriter sw = new StringWriter();
      PrintWriter pw = new PrintWriter(sw);
      ex.printStackTrace(pw);
      String exceptionText = sw.toString();

      Label label = new Label("The exception stacktrace was:");

      TextArea textArea = new TextArea(exceptionText);
      textArea.setEditable(false);
      textArea.setWrapText(true);

      textArea.setMaxWidth(Double.MAX_VALUE);
      textArea.setMaxHeight(Double.MAX_VALUE);
      GridPane.setVgrow(textArea, Priority.ALWAYS);
      GridPane.setHgrow(textArea, Priority.ALWAYS);

      GridPane expContent = new GridPane();
      expContent.setMaxWidth(Double.MAX_VALUE);
      expContent.add(label, 0, 0);
      expContent.add(textArea, 0, 1);

      getDialogPane().setExpandableContent(expContent);
}
 
开发者ID:nshusa,项目名称:rsam-gui,代码行数:30,代码来源:Dialogue.java

示例5: showDetailedErrorAlert

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public static void showDetailedErrorAlert(String title, String content, String detaildescription, String details) {
    Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setTitle(title);
    alert.setHeaderText(null);
    alert.setContentText(content);

    TextArea textArea = new TextArea(details);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    Label label = new Label(detaildescription);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    // Set expandable Exception into the dialog pane.
    alert.getDialogPane().setExpandableContent(expContent);

    alert.showAndWait();
}
 
开发者ID:rumangerst,项目名称:CSLMusicModStationCreator,代码行数:28,代码来源:DialogHelper.java

示例6: showErrorDialog

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
static void showErrorDialog(Throwable ex) {
    Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setTitle("Error!");
    alert.setHeaderText(ex.getMessage());

    // Create expandable Exception.
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    ex.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("The exception stacktrace was:");

    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(false);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    // Set expandable Exception into the dialog pane.
    alert.getDialogPane().setContent(expContent);
    alert.showAndWait();

    ex.printStackTrace();
}
 
开发者ID:dizitart,项目名称:nitrite-database,代码行数:34,代码来源:ErrorDialog.java

示例7: setupView

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
private void setupView() {
    setHgap(10);
    setVgap(10);

    forecastOnePane = new ForecastDisplayPane(stage, forecastOne);
    GridPane.setHalignment(forecastOnePane, HPos.CENTER);
    GridPane.setHgrow(forecastOnePane, Priority.ALWAYS);
    GridPane.setVgrow(forecastOnePane, Priority.ALWAYS);

    forecastTwoPane = new ForecastDisplayPane(stage, forecastTwo);
    GridPane.setHalignment(forecastTwoPane, HPos.CENTER);
    GridPane.setHgrow(forecastTwoPane, Priority.ALWAYS);
    GridPane.setVgrow(forecastTwoPane, Priority.ALWAYS);

    forecastThreePane = new ForecastDisplayPane(stage, forecastThree);
    GridPane.setHalignment(forecastThreePane, HPos.CENTER);
    GridPane.setHgrow(forecastThreePane, Priority.ALWAYS);
    GridPane.setVgrow(forecastThreePane, Priority.ALWAYS);

    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            getChildren().clear();
            add(forecastOnePane, 0, 0);
            add(forecastTwoPane, 1, 0);
            add(forecastThreePane, 2, 0);
        }
    });
}
 
开发者ID:ykarim,项目名称:WeatherWatch,代码行数:30,代码来源:ForecastsPane.java

示例8: createAlertDialog

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
private void createAlertDialog(DialogObject dialog) {
    Alert alert = new Alert(dialog.getType());
    alert.setTitle(dialog.getTitle());
    alert.setHeaderText(dialog.getHeader());
    alert.setContentText(dialog.getContent());

    if (dialog.getexception() == null) {
        alert.showAndWait();
    } else {
        StringWriter sw = new StringWriter();
        PrintWriter pw = new PrintWriter(sw);
        dialog.getexception().printStackTrace(pw);
        String exceptionText = sw.toString();

        Label label = new Label("The exception stacktrace was:");

        TextArea textArea = new TextArea(exceptionText);
        textArea.setEditable(false);
        textArea.setWrapText(true);

        textArea.setMaxWidth(Double.MAX_VALUE);
        textArea.setMaxHeight(Double.MAX_VALUE);
        GridPane.setVgrow(textArea, Priority.ALWAYS);
        GridPane.setHgrow(textArea, Priority.ALWAYS);

        GridPane expContent = new GridPane();
        expContent.setMaxWidth(Double.MAX_VALUE);
        expContent.add(label, 0, 0);
        expContent.add(textArea, 0, 1);

        alert.getDialogPane().setExpandableContent(expContent);

        alert.showAndWait();
    }
}
 
开发者ID:PanagiotisDrakatos,项目名称:EasyDragDrop,代码行数:36,代码来源:JFxBuilder.java

示例9: showException

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public static Alert showException(String message, Exception ex) {
	Alert alert = new Alert(AlertType.ERROR);
	
	alert.setTitle("Exception");
       alert.setHeaderText("Encountered an Exception");
       alert.setContentText(message);

       StringWriter sw = new StringWriter();
       PrintWriter pw = new PrintWriter(sw);
       ex.printStackTrace(pw);
       String exceptionText = sw.toString();

       Label label = new Label("The exception stacktrace was:");

       TextArea textArea = new TextArea(exceptionText);
       textArea.setEditable(false);
       textArea.setWrapText(true);

       textArea.setMaxWidth(Double.MAX_VALUE);
       textArea.setMaxHeight(Double.MAX_VALUE);
       GridPane.setVgrow(textArea, Priority.ALWAYS);
       GridPane.setHgrow(textArea, Priority.ALWAYS);

       GridPane expContent = new GridPane();
       expContent.setMaxWidth(Double.MAX_VALUE);
       expContent.add(label, 0, 0);
       expContent.add(textArea, 0, 1);

       alert.getDialogPane().setExpandableContent(expContent);        
       return alert;
}
 
开发者ID:nshusa,项目名称:osrs-data-converter,代码行数:32,代码来源:Dialogue.java

示例10: updateBackgrounds

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
private void updateBackgrounds() {
    // the day views

    pane.getChildren().clear();
    List<ColumnConstraints> constraints = new ArrayList<>();

    int numberOfDays = getSkinnable().getNumberOfDays();
    for (int i = 0; i < numberOfDays; i++) {
        ColumnConstraints con = new ColumnConstraints();
        con.setPercentWidth((double) 100 / (double) numberOfDays);
        constraints.add(con);
        Region region = new Region();
        region.setMaxWidth(Double.MAX_VALUE);
        region.getStyleClass().add(ALL_DAY_BACKGROUND_REGION);
        GridPane.setHgrow(region, Priority.ALWAYS);
        GridPane.setVgrow(region, Priority.ALWAYS);
        GridPane.setFillHeight(region, true);
        GridPane.setFillWidth(region, true);

        final int day = i;
        getSkinnable().dateProperty().addListener(evt -> updateRegion(region, day));
        updateRegion(region, day);

        pane.add(region, i, 0);
    }

    pane.getColumnConstraints().setAll(constraints);

    getSkinnable().requestLayout();
}
 
开发者ID:dlemmermann,项目名称:CalendarFX,代码行数:31,代码来源:AllDayViewSkin.java

示例11: showExceptionDialog

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public static void showExceptionDialog (String title, String content, Throwable e) {
    //Source: http://code.makery.ch/blog/javafx-dialogs-official/

    Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setTitle(title);
    alert.setHeaderText(null);
    alert.setContentText(content);

    // Create expandable Exception.
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    e.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("The exception stacktrace was:");

    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    //set expandable Exception into the dialog pane.
    alert.getDialogPane().setExpandableContent(expContent);

    alert.showAndWait();
}
 
开发者ID:open-erp-systems,项目名称:erp-frontend,代码行数:36,代码来源:JavaFXUtils.java

示例12: show

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
/**
 * Shows the alert
 */
public void show(){
    alert.initStyle(style);
    alert.setTitle("Exception Caught!");
    alert.setHeaderText("Exception encountered");
    alert.setContentText(error.getMessage());

    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    error.printStackTrace(pw);
    String exceptionText = sw.toString();

    Label label = new Label("The exception stacktrace was:");
    TextArea textArea = new TextArea(exceptionText);
    textArea.setEditable(false);
    textArea.setWrapText(true);

    textArea.setMaxWidth(Double.MAX_VALUE);
    textArea.setMaxHeight(Double.MAX_VALUE);
    GridPane.setVgrow(textArea, Priority.ALWAYS);
    GridPane.setHgrow(textArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(textArea, 0, 1);

    // Set expandable Exception into the dialog pane.
    alert.getDialogPane().setExpandableContent(expContent);

    alert.showAndWait();

}
 
开发者ID:cbrnrd,项目名称:AlertFX,代码行数:36,代码来源:ErrorBox.java

示例13: renderTo

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
@Override
public void renderTo(GridPane contentPane, int rowIndex) {
    GridPane.setHgrow(textArea, Priority.ALWAYS);
    if (vGrow) {
        GridPane.setVgrow(textArea, Priority.ALWAYS);
    } else {
        this.textArea.setPrefRowCount(rowCount);
    }

    contentPane.add(getLabel(), 0, rowIndex);
    contentPane.add(textArea, 1, rowIndex);

}
 
开发者ID:yiding-he,项目名称:redisfx,代码行数:14,代码来源:TextAreaFormField.java

示例14: ExceptionAlert

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
public ExceptionAlert(T throwable) {
    super(AlertType.ERROR);
    this.throwable = throwable;

    this.setTitle(throwable.getClass().getSimpleName());
    this.setHeaderText(throwable.getMessage());

    // Content Setter
    // REF http://code.makery.ch/blog/javafx-dialogs-official/
    Label label = new Label("Error details:");

    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    throwable.printStackTrace(pw);
    this.stackTraceString = sw.toString();

    TextArea exceptionTextArea = new TextArea(this.stackTraceString);
    exceptionTextArea.setEditable(false);
    exceptionTextArea.setWrapText(true);

    exceptionTextArea.setPrefSize(this.getDialogPane().getWidth()-20, this.getDialogPane().getHeight());
    GridPane.setVgrow(exceptionTextArea, Priority.ALWAYS);
    GridPane.setHgrow(exceptionTextArea, Priority.ALWAYS);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(exceptionTextArea, 0, 1);

    this.getDialogPane().setExpandableContent(expContent);
    this.getDialogPane().setMinHeight(300);
}
 
开发者ID:erayerdin,项目名称:primitivefxmvc,代码行数:33,代码来源:ExceptionAlert.java

示例15: addGuiElements

import javafx.scene.layout.GridPane; //导入方法依赖的package包/类
private void addGuiElements() {
    if (controller.getWeatherBackgroundClass() != null) {
        gridPane.setId(controller.getWeatherBackgroundClass());
    }

    weatherIconView = new ImageView(controller.getWeatherIcon() != null ?
            controller.getWeatherIcon() : fileLoad.loadImageFile(NO_IMAGE_LOCATION));
    weatherIconView.fitWidthProperty().bind(stage.widthProperty().divide(3));
    weatherIconView.fitHeightProperty().bind(stage.heightProperty().divide(2));
    GridPane.setHgrow(weatherIconView, Priority.ALWAYS);
    GridPane.setHalignment(weatherIconView, HPos.CENTER);
    GridPane.setVgrow(weatherIconView, Priority.ALWAYS);
    GridPane.setValignment(weatherIconView, VPos.CENTER);
    gridPane.add(weatherIconView, 0, 0);

    GridPane gridPane_conditions = new GridPane();
    gridPane_conditions.setHgap(10);
    gridPane_conditions.setVgap(10);
    GridPane.setHgrow(gridPane_conditions, Priority.ALWAYS);
    GridPane.setHalignment(gridPane_conditions, HPos.CENTER);
    GridPane.setVgrow(gridPane_conditions, Priority.ALWAYS);
    GridPane.setValignment(gridPane_conditions, VPos.TOP);
    gridPane.add(gridPane_conditions, 1, 0);

    txt_temperature = new Text();
    txt_temperature.setText(controller.getCurrentWeatherTemperatureText());
    txt_temperature.setFont(new Font(48));
    txt_temperature.setStyle("-fx-font-weight: bold");
    GridPane.setHgrow(txt_temperature, Priority.ALWAYS);
    GridPane.setHalignment(txt_temperature, HPos.LEFT);
    GridPane.setVgrow(txt_temperature, Priority.ALWAYS);
    GridPane.setValignment(txt_temperature, VPos.TOP);
    gridPane_conditions.add(txt_temperature, 0, 0);

    txt_condition = new Text();
    txt_condition.setText(controller.getCurrentWeatherConditionText());
    txt_condition.setFont(new Font(24));
    GridPane.setHgrow(txt_condition, Priority.ALWAYS);
    GridPane.setHalignment(txt_condition, HPos.LEFT);
    GridPane.setVgrow(txt_condition, Priority.ALWAYS);
    GridPane.setValignment(txt_condition, VPos.TOP);
    gridPane_conditions.add(txt_condition, 0, 1);

    btn_edit_settings = new Button();
    ImageView imgView = new ImageView(fileLoad.loadImageFile(EDIT_ICON_LOCATION));
    btn_edit_settings.setGraphic(imgView);
    GridPane.setHgrow(btn_edit_settings, Priority.ALWAYS);
    GridPane.setHalignment(btn_edit_settings, HPos.RIGHT);
    GridPane.setVgrow(btn_edit_settings, Priority.ALWAYS);
    GridPane.setValignment(btn_edit_settings, VPos.TOP);
    gridPane.add(btn_edit_settings, 2, 0);

    btn_edit_settings.setOnAction(new EventHandler<ActionEvent>() {
        @Override
        public void handle(ActionEvent e) {
            SettingsPage settingsPage = new SettingsPage(gridPane, stage);
            stage.getScene().setRoot(settingsPage.getRootPane());
        }
    });

    ForecastsPane gridPane_forecasts = new ForecastsPane(stage);
    GridPane.setHgrow(gridPane_forecasts, Priority.ALWAYS);
    GridPane.setHalignment(gridPane_forecasts, HPos.CENTER);
    gridPane.add(gridPane_forecasts, 0, 1, 3, 1);
}
 
开发者ID:ykarim,项目名称:WeatherWatch,代码行数:66,代码来源:WeatherPage.java


注:本文中的javafx.scene.layout.GridPane.setVgrow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。