Class GuiUtils
java.lang.Object
gaiasky.util.GuiUtils
Utilities for the Graphical User Interface.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddNoConnectionExit(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage) static voidaddNoConnectionWindow(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage) static voidaddNoConnectionWindow(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Runnable ok) static voidaddNotificationWindow(String title, String message, com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Runnable ok) static voidaddNoVRConnectionExit(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage) static voidaddNoVRDataExit(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage) static voidensureScrollVisible(com.badlogic.gdx.scenes.scene2d.Actor actor) If the given actor has a scroll pane ancestor, this method makes sure that the actor is visible by moving the scroll position if required.static com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> getInputWidgets(com.badlogic.gdx.scenes.scene2d.Actor actor, com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> list) Get all the input widgets in the given container actor by traversing it recursively.static com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> getInputWidgets(com.badlogic.gdx.utils.Array<? extends com.badlogic.gdx.scenes.scene2d.Actor> actors, com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> list) Get all input widgets recursively.static com.badlogic.gdx.scenes.scene2d.ui.ScrollPanegetScrollPaneAncestor(com.badlogic.gdx.scenes.scene2d.Actor actor) Gets the first scroll pane ancestor of the given actor, if any.static com.badlogic.gdx.scenes.scene2d.ui.ScrollPanegetScrollPaneIn(com.badlogic.gdx.scenes.scene2d.Actor actor) Gets the first scroll pane contained in the given actor by traversing it recursively, if it exists.static com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroupgetTooltipHorizontalGroup(com.badlogic.gdx.scenes.scene2d.Actor actor, String tooltipText, float space, com.badlogic.gdx.scenes.scene2d.ui.Skin skin) static booleanisInputWidget(com.badlogic.gdx.scenes.scene2d.Actor actor) Check if the given actor is an input widget.static booleanisNotDisabled(com.badlogic.gdx.scenes.scene2d.Actor actor) Check if the actor is not disabled.static booleanisTooltipWidget(com.badlogic.gdx.scenes.scene2d.Actor actor) Check if the given actor is a tooltip widget.static voidselectBoxMoveSelection(boolean up, boolean jump, com.badlogic.gdx.scenes.scene2d.ui.SelectBox<?> selectBox) Moves the selection of the given select box up or down.static voidsliderMove(boolean up, float percent, com.badlogic.gdx.scenes.scene2d.ui.Slider slider) Moves the slider up or down by the given percentage.static com.badlogic.gdx.scenes.scene2d.ui.HorizontalGrouptooltipHg(com.badlogic.gdx.scenes.scene2d.Actor actor, String key, com.badlogic.gdx.scenes.scene2d.ui.Skin skin)
-
Constructor Details
-
GuiUtils
public GuiUtils()
-
-
Method Details
-
addNotificationWindow
-
addNoConnectionWindow
public static void addNoConnectionWindow(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage) -
addNoConnectionWindow
public static void addNoConnectionWindow(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage, Runnable ok) -
addNoConnectionExit
public static void addNoConnectionExit(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage) -
addNoVRConnectionExit
public static void addNoVRConnectionExit(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage) -
addNoVRDataExit
public static void addNoVRDataExit(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, com.badlogic.gdx.scenes.scene2d.Stage stage) -
getTooltipHorizontalGroup
public static com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup getTooltipHorizontalGroup(com.badlogic.gdx.scenes.scene2d.Actor actor, String tooltipText, float space, com.badlogic.gdx.scenes.scene2d.ui.Skin skin) -
tooltipHg
public static com.badlogic.gdx.scenes.scene2d.ui.HorizontalGroup tooltipHg(com.badlogic.gdx.scenes.scene2d.Actor actor, String key, com.badlogic.gdx.scenes.scene2d.ui.Skin skin) -
sliderMove
public static void sliderMove(boolean up, float percent, com.badlogic.gdx.scenes.scene2d.ui.Slider slider) Moves the slider up or down by the given percentage.- Parameters:
up- Whether to move it up.percent- The percentage in [0,1].slider- The slider to move.
-
selectBoxMoveSelection
public static void selectBoxMoveSelection(boolean up, boolean jump, com.badlogic.gdx.scenes.scene2d.ui.SelectBox<?> selectBox) Moves the selection of the given select box up or down.- Parameters:
up- Whether to move up (true) or down (false).jump- If true, the selection is moved all the way up or down.selectBox- The select box.
-
getScrollPaneIn
public static com.badlogic.gdx.scenes.scene2d.ui.ScrollPane getScrollPaneIn(com.badlogic.gdx.scenes.scene2d.Actor actor) Gets the first scroll pane contained in the given actor by traversing it recursively, if it exists.- Parameters:
actor- The container actor.- Returns:
- The first scroll pane found, or null if none is found.
-
getScrollPaneAncestor
public static com.badlogic.gdx.scenes.scene2d.ui.ScrollPane getScrollPaneAncestor(com.badlogic.gdx.scenes.scene2d.Actor actor) Gets the first scroll pane ancestor of the given actor, if any.- Parameters:
actor- The actor.- Returns:
- The first scroll pane ancestor. Null if it does not exist.
-
ensureScrollVisible
public static void ensureScrollVisible(com.badlogic.gdx.scenes.scene2d.Actor actor) If the given actor has a scroll pane ancestor, this method makes sure that the actor is visible by moving the scroll position if required.- Parameters:
actor- The actor.
-
getInputWidgets
public static com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> getInputWidgets(com.badlogic.gdx.utils.Array<? extends com.badlogic.gdx.scenes.scene2d.Actor> actors, com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> list) Get all input widgets recursively.- Parameters:
actors- The list of actors.list- The output list.- Returns:
- The output list with all the input widgets.
-
getInputWidgets
public static com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> getInputWidgets(com.badlogic.gdx.scenes.scene2d.Actor actor, com.badlogic.gdx.utils.Array<com.badlogic.gdx.scenes.scene2d.Actor> list) Get all the input widgets in the given container actor by traversing it recursively.- Parameters:
actor- The actor.list- The list with all the input widgets in the actor.- Returns:
- The input list.
-
isInputWidget
public static boolean isInputWidget(com.badlogic.gdx.scenes.scene2d.Actor actor) Check if the given actor is an input widget.- Parameters:
actor- The actor.- Returns:
- True if the actor is an input widget.
-
isTooltipWidget
public static boolean isTooltipWidget(com.badlogic.gdx.scenes.scene2d.Actor actor) Check if the given actor is a tooltip widget.- Parameters:
actor- The actor.- Returns:
- True if the actor is a tooltip widget.
-
isNotDisabled
public static boolean isNotDisabled(com.badlogic.gdx.scenes.scene2d.Actor actor) Check if the actor is not disabled.- Parameters:
actor- The actor.- Returns:
- True if the actor is not disabled.
-