javafx.scene.control.ListView.setPrefHeight()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(216)

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

ListView.setPrefHeight介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

private void updateListHeight() {
  final double height = Math.min(suggestionList.getItems().size(), getSkinnable().getCellLimit()) * suggestionList.getFixedCellSize();
  suggestionList.setPrefHeight(height + suggestionList.getFixedCellSize() / 2);
}

代码示例来源:origin: speedment/speedment

@Override
protected Node createUndecoratedEditor() {
  final VBox container = new VBox();
  
  final ListView<String> listView = new ListView<>(strings);
  listView.setCellFactory(view -> new EnumCell(strings));
  listView.setEditable(true);
  listView.setMaxHeight(USE_PREF_SIZE);
  listView.setPrefHeight(LIST_HEIGHT);
  final HBox controls = new HBox(SPACING);
  controls.setAlignment(Pos.CENTER);
  controls.getChildren().addAll(
    addButton(listView),
    removeButton(listView),
    populateButton(listView)
  );
  container.setSpacing(SPACING);
  container.getChildren().addAll(listView, controls);
  hideShowBehaviour(container);
  
  return container;
}

代码示例来源:origin: jfoenixadmin/JFoenix

getListView().setPrefHeight(getListView().getHeight() + newAnimatedHeight + animatedHeight);
expandAnimation.setOnFinished((finish) -> {
  updateClipHeight(newHeight);
  getListView().setPrefHeight(getListView().getHeight() + newAnimatedHeight);
  animatedHeight = 0;
});

代码示例来源:origin: torakiki/pdfsam

@Inject
public OpenWithDialog(StylesConfig styles, List<Module> modules) {
  initModality(Modality.WINDOW_MODAL);
  initStyle(StageStyle.UTILITY);
  setResizable(false);
  setTitle(DefaultI18nContext.getInstance().i18n("Open with"));
  this.modules = modules.stream().sorted(comparing(m -> m.descriptor().getName())).collect(toList());
  messageTitle.getStyleClass().add("-pdfsam-open-with-dialog-title");
  BorderPane containerPane = new BorderPane();
  containerPane.getStyleClass().addAll(Style.CONTAINER.css());
  containerPane.getStyleClass().addAll("-pdfsam-open-with-dialog", "-pdfsam-open-with-container");
  containerPane.setTop(messageTitle);
  BorderPane.setAlignment(messageTitle, Pos.TOP_CENTER);
  filesList.setPrefHeight(150);
  containerPane.setCenter(filesList);
  buttons.getStyleClass().addAll(Style.CONTAINER.css());
  containerPane.setBottom(buttons);
  BorderPane.setAlignment(buttons, Pos.CENTER);
  Scene scene = new Scene(containerPane);
  scene.getStylesheets().addAll(styles.styles());
  scene.setOnKeyReleased(new HideOnEscapeHandler(this));
  setScene(scene);
  eventStudio().addAnnotatedListeners(this);
}

代码示例来源:origin: com.jfoenix/jfoenix

private void updateListHeight() {
  final double height = Math.min(suggestionList.getItems().size(), getSkinnable().getCellLimit()) * suggestionList.getFixedCellSize();
  suggestionList.setPrefHeight(height + suggestionList.getFixedCellSize() / 2);
}

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.dialogs

v.getSelectionModel().select(this.font.get().getFamily());
v.scrollTo(this.font.get().getFamily());
v.setPrefHeight(250);
v.scrollTo(posture);
v.setPrefWidth(120);
v.setPrefHeight(250);
    .values()));
container.getChildren().add(v);
v.setPrefHeight(250);
v.setPrefWidth(120);
v.getSelectionModel().select(Double.valueOf(this.font.get().getSize()));
v.setPrefWidth(80);
v.setPrefHeight(250);
container.getChildren().add(v);

代码示例来源:origin: com.aquafx-project/aquafx

list.setItems(listItems);
list.setPrefWidth(150);
list.setPrefHeight(70);
listContainer.getChildren().add(list);
TableView<Person> listTable = new TableView<Person>();
horizontalList.setItems(listItems);
horizontalList.setPrefWidth(250);
horizontalList.setPrefHeight(50);
horizontalList.setOrientation(Orientation.HORIZONTAL);
listContainer.getChildren().add(horizontalList);

代码示例来源:origin: com.dlsc.formsfx/formsfx-core

/**
 * {@inheritDoc}
 */
@Override
public void layoutParts() {
  super.layoutParts();
  int columns = field.getSpan();
  listView.setPrefHeight(200);
  Node labelDescription = field.getLabelDescription();
  Node valueDescription = field.getValueDescription();
  add(fieldLabel, 0, 0, 2, 1);
  if (labelDescription != null) {
    GridPane.setValignment(labelDescription, VPos.TOP);
    add(labelDescription, 0, 1, 2, 1);
  }
  add(listView, 2, 0, columns - 2, 1);
  if (valueDescription != null) {
    GridPane.setValignment(valueDescription, VPos.TOP);
    add(valueDescription, 2, 1, columns - 2, 1);
  }
}

代码示例来源:origin: com.aquafx-project/aquafx

static ListView<String> createListView(int numOfItems, boolean multipleSelection, boolean disable, boolean horiz) {
  ListView<String> listView = new ListView<String>();
  if (horiz) listView.setOrientation(Orientation.HORIZONTAL);
  listView.setPrefHeight((24*7)+4);
  listView.setPrefWidth(horiz ? 200 : 140);
  listView.getItems().addAll(sampleItems(numOfItems));
  listView.setDisable(disable);
  if (multipleSelection) {
    listView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
    listView.getSelectionModel().selectRange(1, 5);
  } else {
    listView.getSelectionModel().select(1);
  }
  return listView;
}

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

this.repositoryListView.setPrefHeight(0);
this.repositoryListView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);
this.repositoryListView.setEditable(true);

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

container.setPrefHeight(0);

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

container.setPrefHeight(0);

代码示例来源:origin: com.aquafx-project/aquafx

list.setItems(listItems);
list.setPrefWidth(150);
list.setPrefHeight(70);
listContainer.getChildren().add(list);
TableView<Person> listTable = new TableView<Person>();
horizontalList.setItems(listItems);
horizontalList.setPrefWidth(150);
horizontalList.setPrefHeight(50);
horizontalList.setOrientation(Orientation.HORIZONTAL);
listContainer.getChildren().add(horizontalList);

代码示例来源:origin: com.jfoenix/jfoenix

getListView().setPrefHeight(getListView().getHeight() + newAnimatedHeight + animatedHeight);
expandAnimation.setOnFinished((finish) -> {
  updateClipHeight(newHeight);
  getListView().setPrefHeight(getListView().getHeight() + newAnimatedHeight);
  animatedHeight = 0;
});

相关文章