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.SingleChoiceListPane
- All Implemented Interfaces:
Toggleable
,KeyEventListener
public class SingleChoiceListPane extends ActiveItem
-
Field Summary
Fields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
activeItems, id, parent, passiveItems
-
Constructor Summary
Constructors Constructor Description SingleChoiceListPane(WindowItem parent, CursorPosition initCoord, int width, int height, java.util.List<java.lang.String> options, java.lang.String id)
Custom constructor -
Method Summary
Modifier and Type Method Description protected CLI
getCli()
cli gettervoid
onArrowDown()
Selects the next ActiveItem on the Dialogvoid
onArrowLeft()
Selects the previous ActiveItem on the Dialogvoid
onArrowRight()
Selects the next ActiveItem on the Dialogvoid
onArrowUp()
Selects the previous ActiveItem on the Dialogvoid
onCarriageReturn()
Performs an action based on the currently selected ActiveItemvoid
onRelease()
Defines the object behaviour when releasedvoid
onSelect()
Defines the object behaviour when selectedvoid
onTab()
Selects the next ActiveItem on the Dialogvoid
show()
Draws itselfMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.ActiveItem
enable, getBackgroundColor, onDisable
Methods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
addActiveItem, addPassiveItem, currentActiveItem, drawShadows, 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
-
Constructor Details
-
SingleChoiceListPane
public SingleChoiceListPane(WindowItem parent, CursorPosition initCoord, int width, int height, java.util.List<java.lang.String> options, java.lang.String id)Custom constructorCreates an item using custom settings
The initial coordinates are relative to the object's parent- Parameters:
parent
- the Dialog containing thisinitCoord
- the item coordinateswidth
- the object widthheight
- the object heightid
- the object id
-
-
Method Details
-
getCli
cli getter- Overrides:
getCli
in classWindowItem
- Returns:
- the parent's CLI attribute
-
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
-
show
public void show()Draws itself- Overrides:
show
in classWindowItem
-
onArrowRight
public void onArrowRight()Selects the next ActiveItem on the Dialog -
onArrowLeft
public void onArrowLeft()Selects the previous ActiveItem on the Dialog -
onCarriageReturn
public void onCarriageReturn()Performs an action based on the currently selected ActiveItem -
onTab
public void onTab()Selects the next ActiveItem on the Dialog -
onArrowUp
public void onArrowUp()Selects the previous ActiveItem on the Dialog -
onArrowDown
public void onArrowDown()Selects the next ActiveItem on the Dialog
-