- All Known Implementing Classes:
OrientationHelper.HorizontalHelper
,OrientationHelper.VerticalHelper
public interface OrientationHelper
Helper class to avoid as much as possible if/else statements to check
the VirtualFlow orientation.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
Implementation ofOrientationHelper
forOrientation.HORIZONTAL
.static class
Implementation ofOrientationHelper
forOrientation.VERTICAL
. -
Method Summary
Modifier and TypeMethodDescriptionstatic double
boundHeight
(Node node) static double
boundSize
(double pref, double min, double max) Computes size of a Node between its pref, min and max sizes.static double
boundWidth
(Node node) int
double
computeEstimatedHeight
(double cellHeight) Computes the estimated height of the flow.double
computeEstimatedWidth
(double cellWidth) Computes the estimated width of the flow.void
dispose()
Removes and clears any listener.int
double
double
int
void
Lays out the given node.void
resizeRelocate
(Node node, double pos, double w, double h) Resizes and relocates the given node with the given parameters.void
scrollBy
(double pixels) Scrolls the flow by the given amount of pixels.void
scrollTo
(int index) Scrolls the flow to the given cell index.void
Scrolls the flow to the first cell.void
Scrolls the flow to the last cell.void
scrollToPixel
(double pixel) Scrolls the flow to the given pixel value.
-
Method Details
-
firstVisible
int firstVisible()- Returns:
- the index of the first visible cell in the viewport
-
lastVisible
int lastVisible()- Returns:
- the index of the last visible cell in the viewport
-
computeCellsNumber
int computeCellsNumber()- Returns:
- 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
- Returns:
- the height of the given node
-
getWidth
- Returns:
- 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).
-