Skip to content

Commit

Permalink
GuiScreenController: rename a private field
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Apr 12, 2017
1 parent 815e4aa commit 55e45b2
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions nifty/src/main/java/jme3utilities/nifty/GuiScreenController.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ public class GuiScreenController extends BasicScreenController {
*/
private static Element dialogElement = null;
/**
* this screen's suspended input mode (while a popup is active) TODO rename
* this screen's suspended input mode (while a popup is active)
*/
private static InputMode savedMode;
private static InputMode suspendedMode;
/**
* active popup menu (null means none are active)
*/
Expand Down Expand Up @@ -119,9 +119,9 @@ static void closeActiveDialog() {
*/
InputMode dialogMode = InputMode.getActiveMode();
dialogMode.setEnabled(false);
if (savedMode != null) {
savedMode.resume();
savedMode = null;
if (suspendedMode != null) {
suspendedMode.resume();
suspendedMode = null;
}

assert !hasActiveDialog();
Expand Down Expand Up @@ -151,9 +151,9 @@ public static synchronized void closeActivePopupMenu() {
*/
InputMode menuMode = InputMode.getActiveMode();
menuMode.setEnabled(false);
if (savedMode != null) {
savedMode.resume();
savedMode = null;
if (suspendedMode != null) {
suspendedMode.resume();
suspendedMode = null;
}
}
}
Expand Down Expand Up @@ -194,9 +194,9 @@ static synchronized void closePopupMenu(PopupMenu popupMenu) {
*/
InputMode menuMode = InputMode.getActiveMode();
menuMode.setEnabled(false);
if (savedMode != null) {
savedMode.resume();
savedMode = null;
if (suspendedMode != null) {
suspendedMode.resume();
suspendedMode = null;
}
}

Expand Down Expand Up @@ -332,10 +332,10 @@ public static void showDialog(String promptMessage, String defaultValue,
* Save and suspend the screen's input mode (if any) and
* activate the input mode for modal dialogs.
*/
assert savedMode == null : savedMode;
savedMode = InputMode.getActiveMode();
if (savedMode != null) {
savedMode.suspend();
assert suspendedMode == null : suspendedMode;
suspendedMode = InputMode.getActiveMode();
if (suspendedMode != null) {
suspendedMode.suspend();
}
InputMode dialogMode = InputMode.findMode(DialogInputMode.name);
dialogMode.setEnabled(true);
Expand Down Expand Up @@ -416,10 +416,10 @@ public static synchronized void showPopup(String actionPrefix,
* Save and suspend the screen's input mode (if any) and
* activate the input mode for popup menus.
*/
assert savedMode == null : savedMode;
savedMode = InputMode.getActiveMode();
if (savedMode != null) {
savedMode.suspend();
assert suspendedMode == null : suspendedMode;
suspendedMode = InputMode.getActiveMode();
if (suspendedMode != null) {
suspendedMode.suspend();
}
InputMode menuMode = InputMode.findMode(MenuInputMode.name);
menuMode.setEnabled(true);
Expand Down Expand Up @@ -482,7 +482,7 @@ protected CheckBox getCheckBox(String idPrefix) {
* @return the pre-existing mode, or null if none or not suspended
*/
protected InputMode getSuspendedMode() {
return savedMode;
return suspendedMode;
}

/**
Expand Down

0 comments on commit 55e45b2

Please sign in to comment.