modules/graphics/src/main/java/javafx/scene/layout/FlowPane.java
Print this page
@@ -567,11 +567,11 @@
if (child.isManaged()) {
maxPref = Math.max(maxPref, child.prefWidth(-1));
}
}
final Insets insets = getInsets();
- return insets.getLeft() + snapSize(maxPref) + insets.getRight();
+ return insets.getLeft() + snapSizeX(maxPref) + insets.getRight();
}
return computePrefWidth(height);
}
@Override protected double computeMinHeight(double width) {
@@ -583,11 +583,11 @@
if (child.isManaged()) {
maxPref = Math.max(maxPref, child.prefHeight(-1));
}
}
final Insets insets = getInsets();
- return insets.getTop() + snapSize(maxPref) + insets.getBottom();
+ return insets.getTop() + snapSizeY(maxPref) + insets.getBottom();
}
return computePrefHeight(width);
}
@Override protected double computePrefWidth(double forHeight) {
@@ -596,11 +596,11 @@
// horizontal
double maxRunWidth = getPrefWrapLength();
List<Run> hruns = getRuns(maxRunWidth);
double w = computeContentWidth(hruns);
w = getPrefWrapLength() > w ? getPrefWrapLength() : w;
- return insets.getLeft() + snapSize(w) + insets.getRight();
+ return insets.getLeft() + snapSizeX(w) + insets.getRight();
} else {
// vertical
double maxRunHeight = forHeight != -1?
forHeight - insets.getTop() - insets.getBottom() : getPrefWrapLength();
List<Run> vruns = getRuns(maxRunHeight);
@@ -620,11 +620,11 @@
// vertical
double maxRunHeight = getPrefWrapLength();
List<Run> vruns = getRuns(maxRunHeight);
double h = computeContentHeight(vruns);
h = getPrefWrapLength() > h ? getPrefWrapLength() : h;
- return insets.getTop() + snapSize(h) + insets.getBottom();
+ return insets.getTop() + snapSizeY(h) + insets.getBottom();
}
}
@Override public void requestLayout() {
if (!computingRuns) {
@@ -643,12 +643,12 @@
lastMaxRunLength = maxRunLength;
runs = new ArrayList();
double runLength = 0;
double runOffset = 0;
Run run = new Run();
- double vgap = snapSpace(this.getVgap());
- double hgap = snapSpace(this.getHgap());
+ double vgap = snapSpaceY(this.getVgap());
+ double hgap = snapSpaceX(this.getHgap());
final List<Node> children = getChildren();
for (int i=0, size=children.size(); i<size; i++) {
Node child = children.get(i);
if (child.isManaged()) {
@@ -695,11 +695,11 @@
private void normalizeRun(final Run run, double runOffset) {
if (getOrientation() == HORIZONTAL) {
// horizontal
ArrayList<Node> rownodes = new ArrayList();
- run.width = (run.rects.size()-1)*snapSpace(getHgap());
+ run.width = (run.rects.size()-1)*snapSpaceX(getHgap());
for (int i=0, max=run.rects.size(); i<max; i++) {
LayoutRect lrect = run.rects.get(i);
rownodes.add(lrect.node);
run.width += lrect.width;
lrect.y = runOffset;
@@ -708,11 +708,11 @@
run.baselineOffset = getRowValignment() == VPos.BASELINE?
getAreaBaselineOffset(rownodes, marginAccessor, i -> run.rects.get(i).width, run.height, true) : 0;
} else {
// vertical
- run.height = (run.rects.size()-1)*snapSpace(getVgap());
+ run.height = (run.rects.size()-1)*snapSpaceY(getVgap());
double maxw = 0;
for (int i=0, max=run.rects.size(); i<max; i++) {
LayoutRect lrect = run.rects.get(i);
run.height += lrect.height;
lrect.x = runOffset;
@@ -723,11 +723,11 @@
run.baselineOffset = run.height;
}
}
private double computeContentWidth(List<Run> runs) {
- double cwidth = getOrientation() == HORIZONTAL ? 0 : (runs.size()-1)*snapSpace(getHgap());
+ double cwidth = getOrientation() == HORIZONTAL ? 0 : (runs.size()-1)*snapSpaceX(getHgap());
for (int i=0, max=runs.size(); i<max; i++) {
Run run = runs.get(i);
if (getOrientation() == HORIZONTAL) {
cwidth = Math.max(cwidth, run.width);
} else {
@@ -737,11 +737,11 @@
}
return cwidth;
}
private double computeContentHeight(List<Run> runs) {
- double cheight = getOrientation() == VERTICAL ? 0 : (runs.size()-1)*snapSpace(getVgap());
+ double cheight = getOrientation() == VERTICAL ? 0 : (runs.size()-1)*snapSpaceY(getVgap());
for (int i=0, max=runs.size(); i<max; i++) {
Run run = runs.get(i);
if (getOrientation() == VERTICAL) {
cheight = Math.max(cheight, run.height);
} else {