Top Description Fields Constructors Methods
com.sun.javafx.scene.control

public Class ResizeHelper

extends Object
Class Inheritance
Imports
java.util.BitSet, .List, javafx.scene.control.ResizeFeaturesBase, .TableColumnBase, javafx.scene.layout.Region

Helper class for Tree/TableView constrained column resize policies.

Field Summary

Modifier and TypeField and Description
private final List<? extends TableColumnBase<?, ?>>
private final int
private static final double
private final double[]
private final double[]
private final ConstrainedColumnResize.ResizeMode
private final double[]
private final ResizeFeaturesBase<S>
private final double[]
private final BitSet
private static final int
private final Region
private final double

Constructor Summary

AccessConstructor and Description
public
ResizeHelper(ResizeFeaturesBase<S> rf, double target, List<? extends TableColumnBase<?, ?>> columns, ConstrainedColumnResize.ResizeMode mode)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if sum of columns equals or greater than the target width
applySizes
()

Applies computed column widths to the tree/table columns, snapping coordinates if required.

protected static double
clip(double v, double min, double max)

protected double
computeAllowedDelta(boolean expanding)

returns the allowable delta for all of the opposite columns

protected boolean
distributeDelta(int ix, double delta)

protected double
protected double
protected void
protected void
distributeSmallDelta(double delta)

for small deltas, we use a simpler, but more expensive algorithm to distribute space in small steps, each time favoring a column that is further away from its preferred width.

protected double

Returns:

unused portion of delta, or Double.NaN if it did not find a good candidate
expandSmall
(double delta)

Finds the best column to shrink, then reduces its width.

protected double
getAllowedDelta(int ix, boolean expanding)

non-negative

protected boolean
isCornerCase(double delta, int ix)

protected static boolean
isZero(double x)

protected int
markOppositeColumns(int ix)

updates skip bitset with columns that might be resized, and returns the number of the opposite columns

protected void
protected double
resize(int ix, double delta)

public boolean
public void
protected void
setSkip(int from, int toExclusive)

range set with limit check

protected double

Returns:

unused portion of delta, or Double.NaN if it did not find a good candidate
shrinkSmall
(double delta)

Finds the best column to shrink, then reduces its width.

protected double
snap(double x)

protected double
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

columnsback to summary
private final List<? extends TableColumnBase<?, ?>> columns
countback to summary
private final int count
EPSILONback to summary
private static final double EPSILON
maxback to summary
private final double[] max
minback to summary
private final double[] min
modeback to summary
private final ConstrainedColumnResize.ResizeMode mode
prefback to summary
private final double[] pref
rfback to summary
private final ResizeFeaturesBase<S> rf
sizeback to summary
private final double[] size
skipback to summary
private final BitSet skip
SMALL_DELTAback to summary
private static final int SMALL_DELTA
snapback to summary
private final Region snap
targetback to summary
private final double target

Constructor Detail

ResizeHelperback to summary
public ResizeHelper(ResizeFeaturesBase<S> rf, double target, List<? extends TableColumnBase<?, ?>> columns, ConstrainedColumnResize.ResizeMode mode)

Method Detail

applySizesback to summary
public boolean applySizes()

Applies computed column widths to the tree/table columns, snapping coordinates if required.

Returns:boolean

true if sum of columns equals or greater than the target width

clipback to summary
protected static double clip(double v, double min, double max)
computeAllowedDeltaback to summary
protected double computeAllowedDelta(boolean expanding)

returns the allowable delta for all of the opposite columns

distributeDeltaback to summary
protected boolean distributeDelta(int ix, double delta)
distributeDeltaFlexHeadback to summary
protected double distributeDeltaFlexHead(double delta)
distributeDeltaFlexTailback to summary
protected double distributeDeltaFlexTail(double delta)
distributeDeltaRemainingColumnsback to summary
protected void distributeDeltaRemainingColumns(double delta)
distributeSmallDeltaback to summary
protected void distributeSmallDelta(double delta)

for small deltas, we use a simpler, but more expensive algorithm to distribute space in small steps, each time favoring a column that is further away from its preferred width.

expandSmallback to summary
protected double expandSmall(double delta)

Finds the best column to shrink, then reduces its width. Adds the column to skip list if the column width hits a constraint after adjustement.

Returns:double

unused portion of delta, or Double.NaN if it did not find a good candidate

getAllowedDeltaback to summary
protected double getAllowedDelta(int ix, boolean expanding)

non-negative

isCornerCaseback to summary
protected boolean isCornerCase(double delta, int ix)
isZeroback to summary
protected static boolean isZero(double x)
markOppositeColumnsback to summary
protected int markOppositeColumns(int ix)

updates skip bitset with columns that might be resized, and returns the number of the opposite columns

resetSizeChangesback to summary
protected void resetSizeChanges()
resizeback to summary
protected double resize(int ix, double delta)
resizeColumnback to summary
public boolean resizeColumn(TableColumnBase<?, ?> column)
resizeToContentWidthback to summary
public void resizeToContentWidth()
setSkipback to summary
protected void setSkip(int from, int toExclusive)

range set with limit check

shrinkSmallback to summary
protected double shrinkSmall(double delta)

Finds the best column to shrink, then reduces its width. Adds the column to skip list if the column width hits a constraint after adjustement.

Returns:double

unused portion of delta, or Double.NaN if it did not find a good candidate

snapback to summary
protected double snap(double x)
sumSizesback to summary
protected double sumSizes()