本文整理了Java中net.miginfocom.layout.LC.getPackHeightAlign()
方法的一些代码示例,展示了LC.getPackHeightAlign()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LC.getPackHeightAlign()
方法的具体详情如下:
包路径:net.miginfocom.layout.LC
类名称:LC
方法名:getPackHeightAlign
[英]If there is a resize of the window due to packing (see #setPackHeight(BoundSize) this value, which is between 0f and 1f, decides where the extra/superfluous size is placed. 0f means that the window will resize so that the upper part moves up and the lower side stays in the same place. 0.5f will expand/reduce the window equally upwards and downwards. 1f will do the opposite of 0f of course.
[中]如果由于打包(请参见#setPackHeight(BoundSize))而调整了窗口的大小,该值介于0f和1f之间,决定了额外/多余大小的放置位置。0f表示窗口将调整大小,以便上部向上移动,下部保持在同一位置。0.5f将均匀地向上和向下扩展/缩小车窗。1f当然与0f相反。
代码示例来源:origin: com.miglayout/miglayout-ideutil
if (lc.getPackWidthAlign() != 0.5f || lc.getPackHeightAlign() != 1f) {
if (asAPI) {
sb.append(".packAlign(").append(floatToString(lc.getPackWidthAlign(), asAPI)).append(", ").append(floatToString(lc.getPackHeightAlign(), asAPI)).append(')');
} else {
sb.append(",packalign ").append(floatToString(lc.getPackWidthAlign(), asAPI)).append(' ').append(floatToString(lc.getPackHeightAlign(), asAPI));
代码示例来源:origin: com.miglayout/miglayout-swing
int y = Math.round(p.y - ((targH - packable.getHeight()) * (1 - lc.getPackHeightAlign())));
代码示例来源:origin: com.miglayout/miglayout-javafx
/** Checks the parent window/popup if its size is within parameters as set by the LC.
*/
private void adjustWindowSize()
{
BoundSize wBounds = layoutConstraints.getPackWidth();
BoundSize hBounds = layoutConstraints.getPackHeight();
Scene scene = getScene();
Window window = scene != null ? scene.getWindow() : null;
if (window == null || wBounds == BoundSize.NULL_SIZE && hBounds == BoundSize.NULL_SIZE)
return;
Parent root = scene.getRoot();
double winWidth = window.getWidth();
double winHeight = window.getHeight();
double prefWidth = root.prefWidth(-1);
double prefHeight = root.prefHeight(-1);
FXContainerWrapper container = new FXContainerWrapper(root);
double horIns = winWidth - scene.getWidth();
double verIns = winHeight - scene.getHeight();
double targetW = constrain(container, winWidth, prefWidth, wBounds) + horIns;
double targetH = constrain(container, winHeight, prefHeight, hBounds) + verIns;
double x = window.getX() - ((targetW - winWidth) * (1 - layoutConstraints.getPackWidthAlign()));
double y = window.getY() - ((targetH - winHeight) * (1 - layoutConstraints.getPackHeightAlign()));
window.setX(x);
window.setY(y);
window.setWidth(targetW);
window.setHeight(targetH);
}
内容来源于网络,如有侵权,请联系作者删除!