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 void
enable()
Enables the componentvoid
onArrowDown()
Selects the next ActiveItem on the Dialog and refreshes the detailsvoid
onArrowLeft()
Selects the previous ActiveItem on the Dialog and refreshes the detailsvoid
onArrowRight()
Selects the next ActiveItem on the Dialog and refreshes the detailsvoid
onArrowUp()
Selects the previous ActiveItem on the Dialog and refreshes the detailsvoid
onCarriageReturn()
Defines the listener behavior when theEnter
key is pressedvoid
onRelease()
Defines the object behaviour when releasedvoid
onSelect()
Defines the object behaviour when selectedvoid
show()
Draws itself and the details paneMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.ActiveItem
getBackgroundColor, onDisable
Methods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
addActiveItem, addPassiveItem, currentActiveItem, drawShadows, getCli, getID, getParent, hideShadows, maxStringLength, nextActiveItem, previousActiveItem, remove
Methods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.Rectangle
drawBackground, drawBorders, findCenter, getColor, getHeight, getInitCoord, getTextColor, getWidth, hideBorders, loadPropertiesFile
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
show
in classWindowItem
-
onArrowRight
public void onArrowRight()Selects the next ActiveItem on the Dialog and refreshes the details- Specified by:
onArrowRight
in interfaceKeyEventListener
-
onArrowLeft
public void onArrowLeft()Selects the previous ActiveItem on the Dialog and refreshes the details- Specified by:
onArrowLeft
in interfaceKeyEventListener
-
onArrowUp
public void onArrowUp()Selects the previous ActiveItem on the Dialog and refreshes the details- Specified by:
onArrowUp
in interfaceKeyEventListener
-
onArrowDown
public void onArrowDown()Selects the next ActiveItem on the Dialog and refreshes the details- Specified by:
onArrowDown
in interfaceKeyEventListener
-
onCarriageReturn
public void onCarriageReturn()Defines the listener behavior when theEnter
key is pressed- Specified by:
onCarriageReturn
in interfaceKeyEventListener
-
onSelect
public void onSelect()Defines the object behaviour when selected- Specified by:
onSelect
in classActiveItem
-
onRelease
public void onRelease()Defines the object behaviour when released- Specified by:
onRelease
in classActiveItem
-
enable
public void enable()Enables the component- Specified by:
enable
in interfaceToggleable
- Overrides:
enable
in classActiveItem
-