javafx.scene.Node.prefHeight()方法的使用及代码示例

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

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

Node.prefHeight介绍

暂无

代码示例

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

  1. @Override
  2. protected double computePrefHeight(double width) {
  3. return control.prefHeight(width);
  4. }
  5. };

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

  1. @Override
  2. protected double computePrefHeight(double width) {
  3. double height = 0.0F;
  4. for (Node child : getChildren()) {
  5. if (child instanceof TabHeaderContainer) {
  6. height = Math.max(height, child.prefHeight(width));
  7. }
  8. }
  9. return snapSize(height) + snappedTopInset() + snappedBottomInset();
  10. }

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

  1. @Override
  2. protected double computePrefHeight(double width) {
  3. if (!getChildren().isEmpty()) {
  4. return getChildren().get(0).prefHeight(width);
  5. }
  6. return super.computePrefHeight(width);
  7. }

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

  1. double newAnimatedHeight = newNode.prefHeight(-1) * (expandedProperty.get() ? 1 : -1);
  2. double newHeight = expandedProperty.get() ? this.getHeight() + newAnimatedHeight : this.prefHeight(
  3. -1);
  4. ((Region) cellContent).setMaxHeight(cellContent.prefHeight(-1));
  5. setGraphic(cellContent);

代码示例来源:origin: org.controlsfx/controlsfx

  1. @Override
  2. protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
  3. return content == null ? 0 : content.prefHeight(width);
  4. };

代码示例来源:origin: org.controlsfx/controlsfx

  1. @Override protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
  2. double insets = topInset + bottomInset;
  3. return insets + (content == null ? 0 : content.prefHeight(width));
  4. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. @Override
  2. protected double computePrefHeight(double width) {
  3. return content.prefHeight(width);
  4. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. @Override
  2. public double prefBreadth(Node node) {
  3. return node.prefHeight(-1);
  4. }

代码示例来源:origin: org.fxmisc.flowless/flowless

  1. @Override
  2. public double prefLength(Node node, double breadth) {
  3. return node.prefHeight(breadth);
  4. }

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

  1. @Override
  2. protected double computePrefHeight(double width) {
  3. return control.prefHeight(width);
  4. }
  5. };

代码示例来源:origin: org.jfxtras/jfxtras-common

  1. private double calculateNodeHeight(Node n, MinPrefMax size) {
  2. if (size == MinPrefMax.MIN) {
  3. return n.minHeight(-1);
  4. }
  5. if (size == MinPrefMax.MAX) {
  6. return n.maxHeight(-1);
  7. }
  8. return n.prefHeight(-1);
  9. }

代码示例来源:origin: no.tornado/tornadofx-controls

  1. protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
  2. double prefHeight;
  3. if (getSkinnable().getOrientation() == Orientation.VERTICAL)
  4. prefHeight = acc(n -> n.prefHeight(width)) + topInset + bottomInset;
  5. else
  6. prefHeight = biggest(n -> n.prefHeight(width)) + topInset + bottomInset;
  7. return Math.max(prefHeight, getSkinnable().getPrefHeight());
  8. }

代码示例来源:origin: no.tornado/tornadofx-controls

  1. private double getPrefRowHeight() {
  2. double editorHeight = getSkinnable().getEditor().prefHeight(-1);
  3. if (getChildren().isEmpty())
  4. return editorHeight;
  5. else
  6. return Math.max(editorHeight, getChildren().get(0).prefHeight(-1));
  7. }

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

  1. @Override
  2. protected double computePrefHeight(double width) {
  3. double height = 0.0F;
  4. for (Node child : getChildren()) {
  5. if (child instanceof TabHeaderContainer) {
  6. height = Math.max(height, child.prefHeight(width));
  7. }
  8. }
  9. return snapSize(height) + snappedTopInset() + snappedBottomInset();
  10. }

代码示例来源:origin: no.tornado/tornadofx-controls

  1. /**
  2. * Add the preferred height of the expanded Node whenever the expanded flag is true.
  3. *
  4. * @return The preferred height of the TableRow, appended with the preferred height of the expanded node
  5. * if this row is currently expanded.
  6. */
  7. @Override
  8. protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
  9. tableRowPrefHeight = super.computePrefHeight(width, topInset, rightInset, bottomInset, leftInset);
  10. return isExpanded() ? tableRowPrefHeight + getContent().prefHeight(width) : tableRowPrefHeight;
  11. }

代码示例来源:origin: org.controlsfx/controlsfx

  1. /**
  2. * Add the preferred height of the expanded Node whenever the expanded flag is true.
  3. *
  4. * @return The preferred height of the TableRow, appended with the preferred height of the expanded node
  5. * if this row is currently expanded.
  6. */
  7. @Override
  8. protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
  9. tableRowPrefHeight = super.computePrefHeight(width, topInset, rightInset, bottomInset, leftInset);
  10. return isExpanded() ? tableRowPrefHeight + getContent().prefHeight(width) : tableRowPrefHeight;
  11. }

代码示例来源:origin: org.controlsfx/controlsfx

  1. @Override
  2. protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
  3. if (getSkinnable().getOrientation().equals(Orientation.HORIZONTAL)) {
  4. OptionalDouble maxHeight = getChildren().stream().mapToDouble(node -> node.prefHeight(-1)).max();
  5. if (maxHeight.isPresent()) {
  6. return maxHeight.getAsDouble();
  7. }
  8. }
  9. return getSkinnable().getPrefHeight();
  10. }

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

  1. @Override
  2. protected double computePrefHeight(double width) {
  3. if (!getChildren().isEmpty()) {
  4. return getChildren().get(0).prefHeight(width);
  5. }
  6. return super.computePrefHeight(width);
  7. }

代码示例来源:origin: no.tornado/tornadofx-controls

  1. protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) {
  2. double h = text.prefHeight(width);
  3. if (getSkinnable().getGraphic() != null && iconPosition().isHorizontal())
  4. h += Math.max(getSkinnable().getGraphic().prefHeight(-1), graphicFixedSize());
  5. return h + topInset + bottomInset;
  6. }

代码示例来源:origin: org.eclipse.fx/org.eclipse.fx.ui.panes

  1. private static Size computeSize(@NonNull Node control, boolean flushCache) {
  2. int wHint = FX_DEFAULT, hHint = FX_DEFAULT;
  3. RowData data = getConstraint(control);
  4. if (data != null) {
  5. wHint = data.getWidth();
  6. hHint = data.getHeight();
  7. }
  8. return new Size(control.prefWidth(wHint), control.prefHeight(hHint));
  9. }

相关文章

Node类方法