Package com.simsilica.lemur
Class OptionPanelState
java.lang.Object
com.jme3.app.state.BaseAppState
com.simsilica.lemur.OptionPanelState
- All Implemented Interfaces:
AppState
Provides modal option panel support where the option
panel is the only thing that can receive mouse/touch input
until closed.
Note: requires PopupState to have also been attached, which
is done by GuiGlobals by default. This class is now just a thin
wrapper around the standard PopupState.
-
Constructor Summary
ConstructorsConstructorDescriptionOptionPanelState
(Node guiNode) OptionPanelState
(ElementId defaultElementId, String style) OptionPanelState
(String style) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
cleanup
(Application app) Called after the app state is detached or during application shutdown if the state is still attached.void
close()
Closes an open OptionPanel if one is currently open.Returns the currently displayed OptionPanel or null if no option panel is visible.Returns the GUI node that will be used to display the option panel.protected String
getStyle()
Returns the style that will be used for created OptionPanels.protected void
initialize
(Application app) Called during initialization once the app state is attached and before onEnable() is called.protected void
Called when the state was previously enabled but is now disabled either because setEnabled(false) was called or the state is being cleaned up.protected void
onEnable()
Called when the state is fully enabled, ie: is attached and isEnabled() is true or when the setEnabled() status changes after the state is attached.void
setGuiNode
(Node guiNode) Sets the GUI node that will be used to display the option panel.void
Sets the style that will be used for created OptionPanels.void
show
(OptionPanel panel) Modally shows the specified OptionPanel in the guiNode as defined by getGuiNode().void
Creates and displays a modal OptionPanel with the specified settings.void
Creates and displays a modal OptionPanel with the specified settings.void
Creates and displays a model OptionPanel with the specified error information.void
Creates and displays a model OptionPanel with the specified error information.void
update
(float tpf) Called to update theAppState
.Methods inherited from class com.jme3.app.state.BaseAppState
cleanup, getApplication, getId, getState, getState, getState, getState, getStateManager, initialize, isEnabled, isInitialized, postRender, render, setEnabled, setId, stateAttached, stateDetached
-
Constructor Details
-
OptionPanelState
public OptionPanelState() -
OptionPanelState
-
OptionPanelState
-
OptionPanelState
-
-
Method Details
-
show
Creates and displays a modal OptionPanel with the specified settings. The option panel will be visible until the user clicks a response or until close() is called. -
show
Creates and displays a modal OptionPanel with the specified settings. The option panel will be visible until the user clicks a response or until close() is called. -
getName
-
showError
Creates and displays a model OptionPanel with the specified error information. An attempt is made to construct a useful message for the specified Throwable. The option panel will be visible until the user clicks a response or until close() is called. -
showError
Creates and displays a model OptionPanel with the specified error information. An attempt is made to construct a useful message for the specified Throwable. The option panel will be visible until the user clicks a response or until close() is called. -
show
Modally shows the specified OptionPanel in the guiNode as defined by getGuiNode(). An invisible blocker geometry is placed behind it to catch all mouse events until the panel is closed. The option panel will be visible until the user clicks a response or until close() is called. -
close
public void close()Closes an open OptionPanel if one is currently open. Does nothing otherwise. -
getCurrent
Returns the currently displayed OptionPanel or null if no option panel is visible. -
setStyle
Sets the style that will be used for created OptionPanels. -
getStyle
Returns the style that will be used for created OptionPanels. -
setGuiNode
Sets the GUI node that will be used to display the option panel. By default, this is SimpleApplication.getGuiNode(). -
getGuiNode
Returns the GUI node that will be used to display the option panel. This is now always PopupState.getGuiNode() -
initialize
Description copied from class:BaseAppState
Called during initialization once the app state is attached and before onEnable() is called.- Specified by:
initialize
in classBaseAppState
- Parameters:
app
- the application
-
cleanup
Description copied from class:BaseAppState
Called after the app state is detached or during application shutdown if the state is still attached. onDisable() is called before this cleanup() method if the state is enabled at the time of cleanup.- Specified by:
cleanup
in classBaseAppState
- Parameters:
app
- the application
-
onEnable
protected void onEnable()Description copied from class:BaseAppState
Called when the state is fully enabled, ie: is attached and isEnabled() is true or when the setEnabled() status changes after the state is attached.- Specified by:
onEnable
in classBaseAppState
-
update
public void update(float tpf) Description copied from interface:AppState
Called to update theAppState
. This method will be called every render pass if theAppState
is both attached and enabled.- Specified by:
update
in interfaceAppState
- Overrides:
update
in classBaseAppState
- Parameters:
tpf
- Time since the last call to update(), in seconds.
-
onDisable
protected void onDisable()Description copied from class:BaseAppState
Called when the state was previously enabled but is now disabled either because setEnabled(false) was called or the state is being cleaned up.- Specified by:
onDisable
in classBaseAppState
-