Interface LayoutPixelIndexMap
- All Known Implementing Classes:
VerticalLayoutPixelIndexMap
public interface LayoutPixelIndexMap
A mapping from pixel coordinate to layout index
At the moment, the only implementation provides a map from vertical position to layout. While this does not have to be the case, the documentation will presume the y coordinate.
-
Method Summary
Modifier and TypeMethodDescriptiongetIndex
(int pixel) Get the index of the layout at the given positionint
getPixel
(BigInteger index) Get the top of the layout with the given index
-
Method Details
-
getPixel
Get the top of the layout with the given indexGets the minimum y coordinate of any pixel occupied by the layout having the given index. In essence, this maps from layout index to vertical position, relative to the main panel's viewport. This accounts for scrolling and non-uniform height among the layouts.
- Parameters:
index
- the index of the layout- Returns:
- the top of the layout, relative to the main panel's viewport
-
getIndex
Get the index of the layout at the given positionGet the index of the layout occupying the line of pixels in the main panel having the given y coordinate. In essence, this maps from vertical position, relative to the main panel's viewport, to layout index. This accounts for scrolling and non-uniform height among the layouts.
- Parameters:
pixel
- the vertical position of the pixel, relative to the main panel's viewport- Returns:
- the index of the layout
-