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
- All Implemented Interfaces:
Toggleable
,KeyEventListener
- Direct Known Subclasses:
ListItem
public class SimpleListItem extends ActiveItem
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
item
The item stringprotected boolean
selected
Determines if this has been selected in the parentFields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
activeItems, id, parent, passiveItems
-
Constructor Summary
Constructors Constructor Description SimpleListItem(WindowItem parent, CursorPosition initCoord, java.lang.String item)
Default constructor -
Method Summary
Modifier and Type Method Description void
deselect()
Brings the item to its initial state, using the parent's background colorjava.lang.String
getItem()
item getterprotected void
highlight()
Highlights the item, using a light color schemevoid
onRelease()
Brings back the itemvoid
onSelect()
Highlights the item, using a light color schemevoid
show()
Prints the object on the screenMethods 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, onCarriageReturn, onPrintableKey, onTab
-
Field Details
-
Constructor Details
-
SimpleListItem
Default constructorCreates an item using its default settings;
The initial coordinates are relative to the object's parent- Parameters:
parent
- the Window containing thisinitCoord
- the item coordinatesitem
- the object id
-
-
Method Details
-
getItem
public java.lang.String getItem()item getter- Returns:
- the ListItem item
-
highlight
protected void highlight()Highlights the item, using a light color scheme -
deselect
public void deselect()Brings the item to its initial state, using the parent's background color -
show
public void show()Prints the object on the screen- Overrides:
show
in classWindowItem
-
onSelect
public void onSelect()Highlights the item, using a light color scheme- Specified by:
onSelect
in classActiveItem
-
onRelease
public void onRelease()Brings back the item- Specified by:
onRelease
in classActiveItem
-