Class FocusOrderGroup

java.lang.Object
com.blackrook.gui.group.FocusOrderGroup

public class FocusOrderGroup extends Object
A group that binds a series of actions to a set of focusable objects, in such that if one presses certain buttons or keys, they will go forward or back in focus.

If the object receives a GUIInputConstants.KEY_LEFT or GUIInputConstants.KEY_DOWN key or a positive GAMEPAD_TAP AXIS_POV.

Author:
Matthew Tropiano
  • Field Details

  • Constructor Details

    • FocusOrderGroup

      public FocusOrderGroup(FocusOrderGroup.Direction direction, GUIObject... objects)
      Creates a new FocusOrderGroup and binds the required actions to the objects provided.
      Parameters:
      direction - the directionality of the focus keys.
      objects - the objects to include in the group.
    • FocusOrderGroup

      public FocusOrderGroup(FocusOrderGroup.Direction direction, boolean loopOrder, GUIObject... objects)
      Creates a new FocusOrderGroup and binds the required actions to the objects provided.
      Parameters:
      direction - the directionality of the focus keys.
      loopOrder - if true, the order loops back to the beginning, and not if false.
      objects - the objects to include in the group.
    • FocusOrderGroup

      public FocusOrderGroup(FocusOrderGroup.Direction direction, Iterable<GUIObject> objects)
      Creates a new FocusOrderGroup and binds the required actions to the objects provided.
      Parameters:
      direction - the directionality of the focus keys.
      objects - the objects to include in the group.
    • FocusOrderGroup

      public FocusOrderGroup(FocusOrderGroup.Direction direction, boolean loopOrder, Iterable<GUIObject> objects)
      Creates a new FocusOrderGroup and binds the required actions to the objects provided.
      Parameters:
      direction - the directionality of the focus keys.
      loopOrder - if true, the order loops back to the beginning, and not if false.
      objects - the objects to include in the group.
  • Method Details

    • bind

      protected void bind(boolean loopOrder, GUIObject[] objects)
      Binds the actions in this group to the objects in the group.
      Parameters:
      loopOrder - if true, the end loops back to the beginning.
      objects - the objects in the group.