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.ActiveItem
it.polimi.ingsw.view.cli.console.graphics.ListPane
- All Implemented Interfaces:
Toggleable,KeyEventListener
public class ListPane extends ActiveItem implements KeyEventListener
A pane showing a list of elements; when the enter key is pressed, the currently selected item is triggered, causing
it to return its value to the inputManager and this to be hidden by the container
-
Field Summary
Fields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
activeItems, id, parent, passiveItems -
Constructor Summary
Constructors Constructor Description ListPane(Window caller, CursorPosition initCoord, int width, int height, java.util.Map<java.lang.String,java.util.List<java.lang.String>> options, java.lang.String id)Custom constructor -
Method Summary
Modifier and Type Method Description voidenable()Enables the componentvoidonArrowDown()Selects the next ActiveItem on the Dialog and refreshes the detailsvoidonArrowLeft()Selects the previous ActiveItem on the Dialog and refreshes the detailsvoidonArrowRight()Selects the next ActiveItem on the Dialog and refreshes the detailsvoidonArrowUp()Selects the previous ActiveItem on the Dialog and refreshes the detailsvoidonCarriageReturn()Defines the listener behavior when theEnterkey is pressedvoidonRelease()Defines the object behaviour when releasedvoidonSelect()Defines the object behaviour when selectedvoidshow()Draws itself and the details paneMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.ActiveItem
getBackgroundColor, onDisableMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
addActiveItem, addPassiveItem, currentActiveItem, drawShadows, getCli, getID, getParent, hideShadows, maxStringLength, nextActiveItem, previousActiveItem, removeMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.Rectangle
drawBackground, drawBorders, findCenter, getColor, getHeight, getInitCoord, getTextColor, 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, onTab
-
Constructor Details
-
ListPane
public ListPane(Window caller, CursorPosition initCoord, int width, int height, java.util.Map<java.lang.String,java.util.List<java.lang.String>> options, java.lang.String id)Custom constructorCreates a SimpleListChoiceDialog, using custom values for its width and height
- Parameters:
caller- the window which invoked thisinitCoord- the initial coordinateswidth- the pane widthheight- the pane heightoptions- the options to showid- the item id
-
-
Method Details
-
show
public void show()Draws itself and the details pane- Overrides:
showin classWindowItem
-
onArrowRight
public void onArrowRight()Selects the next ActiveItem on the Dialog and refreshes the details- Specified by:
onArrowRightin interfaceKeyEventListener
-
onArrowLeft
public void onArrowLeft()Selects the previous ActiveItem on the Dialog and refreshes the details- Specified by:
onArrowLeftin interfaceKeyEventListener
-
onArrowUp
public void onArrowUp()Selects the previous ActiveItem on the Dialog and refreshes the details- Specified by:
onArrowUpin interfaceKeyEventListener
-
onArrowDown
public void onArrowDown()Selects the next ActiveItem on the Dialog and refreshes the details- Specified by:
onArrowDownin interfaceKeyEventListener
-
onCarriageReturn
public void onCarriageReturn()Defines the listener behavior when theEnterkey is pressed- Specified by:
onCarriageReturnin interfaceKeyEventListener
-
onSelect
public void onSelect()Defines the object behaviour when selected- Specified by:
onSelectin classActiveItem
-
onRelease
public void onRelease()Defines the object behaviour when released- Specified by:
onReleasein classActiveItem
-
enable
public void enable()Enables the component- Specified by:
enablein interfaceToggleable- Overrides:
enablein classActiveItem
-