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 CLIgetCli()cli gettervoidonArrowDown()Selects the next ActiveItem on the DialogvoidonArrowLeft()Selects the previous ActiveItem on the DialogvoidonArrowRight()Selects the next ActiveItem on the DialogvoidonArrowUp()Selects the previous ActiveItem on the DialogvoidonCarriageReturn()Performs an action based on the currently selected ActiveItemvoidonRelease()Defines the object behaviour when releasedvoidonSelect()Defines the object behaviour when selectedvoidonTab()Selects the next ActiveItem on the Dialogvoidshow()Draws itselfMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.ActiveItem
enable, getBackgroundColor, onDisableMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
addActiveItem, addPassiveItem, currentActiveItem, drawShadows, 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
-
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:
getCliin classWindowItem- Returns:
- the parent's CLI attribute
-
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
-
show
public void show()Draws itself- Overrides:
showin 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
-