Package com.tonic.vellum.focus
Interface Navigation
-
public interface NavigationStrategy that moves focus to an adjacent target when the focused section leaves an arrow key unhandled.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Sectionresolve(Section current, Key direction, java.util.List<Section> targets)Chooses the focus target reached by moving in the given direction from the current section.static Navigationspatial()
-
-
-
Method Detail
-
resolve
Section resolve(Section current, Key direction, java.util.List<Section> targets)
Chooses the focus target reached by moving in the given direction from the current section.- Parameters:
current- the currently focused sectiondirection- the arrow key pressedtargets- the candidate focus targets- Returns:
- the target to focus, or
nullto leave focus unchanged
-
spatial
static Navigation spatial()
- Returns:
- an adjacency-based navigation strategy using the targets' on-screen bounds
-
-