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.components.SimpleListItem
it.polimi.ingsw.view.cli.console.graphics.components.ListItem
- All Implemented Interfaces:
Toggleable
,KeyEventListener
- Direct Known Subclasses:
ReturningListItem
public class ListItem extends SimpleListItem
A single list item, returning a value when clicked
-
Field Summary
Fields Modifier and Type Field Description protected int
retVal
The item index in the parent's listFields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.SimpleListItem
item, selected
Fields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
activeItems, id, parent, passiveItems
-
Constructor Summary
Constructors Constructor Description ListItem(WindowItem parent, CursorPosition initCoord, java.lang.String item, int retVal)
Default constructor -
Method Summary
Modifier and Type Method Description void
onCarriageReturn()
Adds or removes this to the parent's inputsMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.SimpleListItem
deselect, getItem, highlight, onRelease, onSelect, show
Methods 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, 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
onArrowDown, onArrowLeft, onArrowRight, onArrowUp, onBackspace, onPrintableKey, onTab
-
Field Details
-
retVal
protected final int retValThe item index in the parent's list
-
-
Constructor Details
-
ListItem
Default constructor- Parameters:
parent
- the item containerinitCoord
- the initial coordinatesitem
- the item's string
-
-
Method Details
-
onCarriageReturn
public void onCarriageReturn()Adds or removes this to the parent's inputs
-