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 intretValThe item index in the parent's listFields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.SimpleListItem
item, selectedFields 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 voidonCarriageReturn()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, showMethods 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, 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
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
-