java.lang.Object
it.polimi.ingsw.view.cli.console.graphics.components.Rectangle
it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
it.polimi.ingsw.view.cli.console.graphics.components.Window
it.polimi.ingsw.view.cli.console.graphics.components.Dialog
it.polimi.ingsw.view.cli.console.graphics.components.InputDialog
it.polimi.ingsw.view.cli.console.graphics.TextInputDialog
- All Implemented Interfaces:
KeyEventListener
public final class TextInputDialog extends InputDialog
-
Field Summary
Fields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.Dialog
message, titleFields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.Window
background, cli, enableInputOnReturn, returnToFields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
activeItems, id, parent, passiveItems -
Constructor Summary
Constructors Constructor Description TextInputDialog(java.lang.String title, java.lang.String message, Window caller, int width, int height, java.lang.String... fields)Default constructor -
Method Summary
Modifier and Type Method Description voidonCarriageReturn()If the currently selected item is a TextBox does nothing, otherwise tries to evaluate the input (seeClosingButton.onCarriageReturn();
Pressing ENTER on a textBox causes the first character to be hidden (it does not get removed from the actual input string) due to a conflict with the RawConsoleInput input method.Methods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.InputDialog
canBeClosed, getInputs, getTextColor, onArrowDown, onArrowLeft, onArrowRight, onArrowUp, onQuit, onTab, showMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.Dialog
drawBackground, drawMessage, drawShadows, drawTitle, getBackgroundColor, removeMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.Window
addToBackground, getCli, getReturnToMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
addActiveItem, addPassiveItem, currentActiveItem, getID, getParent, hideShadows, maxStringLength, nextActiveItem, previousActiveItemMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.Rectangle
drawBorders, findCenter, getColor, getHeight, getInitCoord, getWidth, hideBorders, loadPropertiesFileMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface it.polimi.ingsw.view.cli.console.KeyEventListener
onBackspace, onPrintableKey
-
Constructor Details
-
TextInputDialog
public TextInputDialog(java.lang.String title, java.lang.String message, Window caller, int width, int height, java.lang.String... fields)Default constructorCreates a standard size textInputDialog window, using the properties file, without printing it; if other dialogs are already showing, the new dialog is created at an offset from the already existing one.
- Parameters:
title- the dialog titlemessage- the dialog messagecaller- the window which invoked thisfields- the input fields required
-
-
Method Details
-
onCarriageReturn
public void onCarriageReturn()If the currently selected item is a TextBox does nothing, otherwise tries to evaluate the input (seeClosingButton.onCarriageReturn();
Pressing ENTER on a textBox causes the first character to be hidden (it does not get removed from the actual input string) due to a conflict with the RawConsoleInput input method. This issue will not be fixed anytime soon.- Specified by:
onCarriageReturnin interfaceKeyEventListener- Overrides:
onCarriageReturnin classInputDialog
-