javafx.scene.layout.Region.getPrefHeight()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(141)

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

Region.getPrefHeight介绍

暂无

代码示例

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

protected double getBLockHeight(Region region) {
  if (region.getMinHeight() != -1) {
    return region.getMinHeight();
  }
  if (region.getPrefHeight() != USE_COMPUTED_SIZE) {
    return region.getPrefHeight();
  } else {
    return region.prefHeight(getBLockWidth(region));
  }
}

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

protected boolean validHeight(BoundingBox box, Region region, double cellH, double gutterX, double gutterY) {
  boolean valid = false;
  if (region.getMinHeight() != -1 && box.getHeight() * cellH + (box.getHeight() - 1) * 2 * gutterY < region.getMinHeight()) {
    return false;
  }
  if (region.getPrefHeight() == USE_COMPUTED_SIZE && box.getHeight() * cellH + (box.getHeight() - 1) * 2 * gutterY >= region
    .prefHeight(region.prefWidth(-1))) {
    valid = true;
  }
  if (region.getPrefHeight() != USE_COMPUTED_SIZE && box.getHeight() * cellH + (box.getHeight() - 1) * 2 * gutterY >= region
    .getPrefHeight()) {
    valid = true;
  }
  return valid;
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

@Override
protected double computePrefHeight(double d) {
 return clientArea.getPrefHeight() + SHADOW_WIDTH * 2 + RESIZE_PADDING * 2;
}

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

protected double getBLockHeight(Region region) {
  if (region.getMinHeight() != -1) {
    return region.getMinHeight();
  }
  if (region.getPrefHeight() != USE_COMPUTED_SIZE) {
    return region.getPrefHeight();
  } else {
    return region.prefHeight(getBLockWidth(region));
  }
}

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

protected boolean validHeight(BoundingBox box, Region region, double cellH, double gutterX, double gutterY) {
  boolean valid = false;
  if (region.getMinHeight() != -1 && box.getHeight() * cellH + (box.getHeight() - 1) * 2 * gutterY < region.getMinHeight()) {
    return false;
  }
  if (region.getPrefHeight() == USE_COMPUTED_SIZE && box.getHeight() * cellH + (box.getHeight() - 1) * 2 * gutterY >= region
    .prefHeight(region.prefWidth(-1))) {
    valid = true;
  }
  if (region.getPrefHeight() != USE_COMPUTED_SIZE && box.getHeight() * cellH + (box.getHeight() - 1) * 2 * gutterY >= region
    .getPrefHeight()) {
    valid = true;
  }
  return valid;
}

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

@Override
protected void layoutChildren() {
  getParent().requestLayout();
  super.layoutChildren();
  for (Node n : getManagedChildren()) {
    if (n instanceof Region) {
      Region p = (Region) n;
      double width = Math.max(p.getMinWidth(), p.getPrefWidth());
      double height = Math.max(p.getMinHeight(), p.getPrefHeight());
      n.resize(width, height);
      double nX = Math.min(0, n.getLayoutX());
      double nY = Math.min(0, n.getLayoutY());
      n.relocate(nX, nY);
    }
  }
}

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

/**
 * @param node
 */
protected void rememberResetValues(Node node)
{
  if (node instanceof javafx.scene.layout.Region)
  {
    javafx.scene.layout.Region lRegion = (javafx.scene.layout.Region)node;
    
    // setup the reset values on the first apply
    if (minWidthReset == UNKNOWN) minWidthReset = lRegion.getMinWidth();
    if (prefWidthReset == UNKNOWN) prefWidthReset = lRegion.getPrefWidth();
    if (maxWidthReset == UNKNOWN) maxWidthReset = lRegion.getMaxWidth();
    if (minHeightReset == UNKNOWN) minHeightReset = lRegion.getMinHeight();
    if (prefHeightReset == UNKNOWN) prefHeightReset = lRegion.getPrefHeight();
    if (maxHeightReset == UNKNOWN) maxHeightReset = lRegion.getMaxHeight();
  }
}

代码示例来源:origin: org.gillius/jfxutils

w = region.getPrefWidth();
if ( override || region.getPrefHeight() == Region.USE_COMPUTED_SIZE )
  region.setPrefHeight( h );
else
  h = region.getPrefHeight();

代码示例来源:origin: stackoverflow.com

double subHeight = (bounds.getPrefHeight() / 2);
double x = bounds.getLayoutX();
double y = bounds.getLayoutY();
double horizontalMidpoint = bounds.getLayoutY() + (bounds.getPrefHeight() / 2);
double spriteMaxX = (s.getNode().getTranslateX() + s.getWidth());
double spriteMaxY = (s.getNode().getTranslateY() + s.getHeight());
double maxY = bounds.getLayoutY() + bounds.getPrefHeight();

代码示例来源:origin: org.refcodes/refcodes-graphical-ext-javafx

theHeight = ((Region) _content).getPrefHeight();

代码示例来源:origin: org.beryx.viewreka/viewreka-fxui

double width = settings.getProperty(widthKey, region.getPrefWidth(), false);
String heightKey = prefix + ".dialog.height";
double height = settings.getProperty(heightKey, region.getPrefHeight(), false);
Scene scene = new Scene(region, width, height);
scene.widthProperty().addListener((obs, oldVal, newVal) -> settings.setProperty(widthKey, newVal));

相关文章

微信公众号

最新文章

更多