Module VirtualizedFX
Class ColumnsLayoutCache.LayoutInfo
java.lang.Object
io.github.palexdev.virtualizedfx.table.ColumnsLayoutCache.LayoutInfo
- All Implemented Interfaces:
Comparable<ColumnsLayoutCache<T>.LayoutInfo>
- Enclosing class:
ColumnsLayoutCache<T>
public class ColumnsLayoutCache.LayoutInfo
extends Object
implements Comparable<ColumnsLayoutCache<T>.LayoutInfo>
Wrapper class for layout data related to a specific
VFXTableColumn
.
This stores: its index [init:-1], its width as a DoubleBinding
, its x position [default:-1.0],
and its visibility [default:null].
Width handling
For better performance, the column's width is stored as a binding, so the value is computed lazily (only upon request).
Invalidation is handled "manually". Check createWidthBinding()
for more details.
This uses null
as a possible visibility value, to indicate that it is invalid and thus must be computed.
-
Constructor Details
-
LayoutInfo
-
-
Method Details
-
getColumn
- Returns:
- the column instance the layout data refers to
-
getIndex
public int getIndex()- Returns:
- the column's index retrieved the first time by
VFXTable.indexOf(VFXTableColumn)
(then cached)
-
getWidth
public double getWidth()CallsDoubleBinding.get()
on the column's width binding. -
isWidthValid
public boolean isWidthValid()- Returns:
- whether
DoubleBinding.isValid()
is true
-
getPos
public double getPos()- Returns:
- the stored column's x position
-
isVisible
- Returns:
- whether the column is visible in the viewport. Beware, this can also return
null
to indicate that the value is invalid and should be re-computed by the cache
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ColumnsLayoutCache<T>.LayoutInfo>
-
equals
-
hashCode
public int hashCode()
-