public interface OrientationHelper
Helper class to avoid as much as possible if/else statements to check
the VirtualFlow orientation.
-
嵌套类概要
嵌套类修饰符和类型接口说明static classImplementation ofOrientationHelperforOrientation.HORIZONTAL.static classImplementation ofOrientationHelperforOrientation.VERTICAL. -
方法概要
修饰符和类型方法说明static doubleboundHeight(Node node) static doubleboundSize(double pref, double min, double max) Computes size of a Node between its pref, min and max sizes.static doubleboundWidth(Node node) intdoublecomputeEstimatedHeight(double cellHeight) Computes the estimated height of the flow.doublecomputeEstimatedWidth(double cellWidth) Computes the estimated width of the flow.voiddispose()Removes and clears any listener.intdoubledoubleintvoidLays out the given node.voidresizeRelocate(Node node, double pos, double w, double h) Resizes and relocates the given node with the given parameters.voidscrollBy(double pixels) Scrolls the flow by the given amount of pixels.voidscrollTo(int index) Scrolls the flow to the given cell index.voidScrolls the flow to the first cell.voidScrolls the flow to the last cell.voidscrollToPixel(double pixel) Scrolls the flow to the given pixel value.
-
方法详细资料
-
firstVisible
int firstVisible()- 返回:
- the index of the first visible cell in the viewport
-
lastVisible
int lastVisible()- 返回:
- the index of the last visible cell in the viewport
-
computeCellsNumber
int computeCellsNumber()- 返回:
- the number of cells to show
-
computeEstimatedHeight
double computeEstimatedHeight(double cellHeight) Computes the estimated height of the flow. -
computeEstimatedWidth
double computeEstimatedWidth(double cellWidth) Computes the estimated width of the flow. -
getHeight
- 返回:
- the height of the given node
-
getWidth
- 返回:
- the width of the given node
-
resizeRelocate
Resizes and relocates the given node with the given parameters. -
layout
Lays out the given node. -
boundSize
static double boundSize(double pref, double min, double max) Computes size of a Node between its pref, min and max sizes. The formula is:double a = Math.max(pref, min); double b = Math.max(min, max); return Math.min(a, b); -
boundWidth
-
boundHeight
-
scrollBy
void scrollBy(double pixels) Scrolls the flow by the given amount of pixels. -
scrollTo
void scrollTo(int index) Scrolls the flow to the given cell index. -
scrollToFirst
void scrollToFirst()Scrolls the flow to the first cell. -
scrollToLast
void scrollToLast()Scrolls the flow to the last cell. -
scrollToPixel
void scrollToPixel(double pixel) Scrolls the flow to the given pixel value. -
dispose
void dispose()Removes and clears any listener.This must be called every time the OrientationHelper of the VirtualFlow is changed (typically occurs when the orientation changes).
-