Package gaiasky.interafce
Class GuiRegistry
java.lang.Object
gaiasky.interafce.GuiRegistry
- All Implemented Interfaces:
IObserver
Manages the Graphical User Interfaces of Gaia Sky
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic IGuiCurrent GUI objectstatic ObjectRender lock objectcom.badlogic.gdx.scenes.scene2d.ui.TableMode change info popupstatic IGuiPrevious GUI object, if anyprotected ISceneGraph -
Constructor Summary
ConstructorsConstructorDescriptionGuiRegistry(com.badlogic.gdx.scenes.scene2d.ui.Skin skin, ISceneGraph sg)One object to handle observer pattern -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddProcessor(IGui gui)Adds the stage of the given GUI to the processors in the input multiplexerstatic voidSwitches the current GUI with the given one, updating the processorsstatic voidSwitches the current GUI with the given one, updating the processors.voiddispose()static com.badlogic.gdx.InputMultiplexervoidstatic voidregisterGui(IGui gui)Registers a new GUIbooleanbooleanstatic voidremoveProcessor(IGui gui)static voidrender(int rw, int rh)Renders the registered GUIsstatic voidSets the given GUI as currentstatic voidsetInputMultiplexer(com.badlogic.gdx.InputMultiplexer im)static voidsetPrevious(IGui gui)Sets the given GUI as previousstatic booleanUnregisters all GUIsstatic booleanunregisterGui(IGui gui)Unregisters a GUIstatic voidunset()Unsets the current GUI and sets it as previousstatic voidUnsets the given GUI and sets it as previousstatic voidupdate(double dt)Updates the registered GUIs
-
Field Details
-
guirenderlock
Render lock object -
current
Current GUI object -
previous
Previous GUI object, if any -
modeChangeTable
public com.badlogic.gdx.scenes.scene2d.ui.Table modeChangeTableMode change info popup -
sg
-
-
Constructor Details
-
GuiRegistry
One object to handle observer pattern
-
-
Method Details
-
setInputMultiplexer
public static void setInputMultiplexer(com.badlogic.gdx.InputMultiplexer im) -
getInputMultiplexer
public static com.badlogic.gdx.InputMultiplexer getInputMultiplexer() -
change
Switches the current GUI with the given one, updating the processors. It also sets the previous GUI to the given value.- Parameters:
gui- The new GUIprevious- The new previous GUI
-
change
Switches the current GUI with the given one, updating the processors- Parameters:
gui- The new gui
-
unset
public static void unset()Unsets the current GUI and sets it as previous -
unset
Unsets the given GUI and sets it as previous- Parameters:
gui- The GUI
-
set
Sets the given GUI as current- Parameters:
gui- The new GUI
-
setPrevious
Sets the given GUI as previous- Parameters:
gui- The new previous GUI
-
registerGui
Registers a new GUI- Parameters:
gui- The GUI to register
-
unregisterGui
Unregisters a GUI- Parameters:
gui- The GUI to unregister- Returns:
- True if the GUI was unregistered
-
unregisterAll
public static boolean unregisterAll()Unregisters all GUIs- Returns:
- True if operation succeeded
-
render
public static void render(int rw, int rh)Renders the registered GUIs- Parameters:
rw- The render widthrh- The render height
-
addProcessor
Adds the stage of the given GUI to the processors in the input multiplexer- Parameters:
gui- The gui
-
removeProcessor
-
update
public static void update(double dt)Updates the registered GUIs- Parameters:
dt- The delta time in seconds
-
dispose
public void dispose() -
notify
-
removeControllerGui
public boolean removeControllerGui() -
removeModeChangePopup
public boolean removeModeChangePopup()
-