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.StringitemThe item stringprotected booleanselectedDetermines 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 voiddeselect()Brings the item to its initial state, using the parent's background colorjava.lang.StringgetItem()item getterprotected voidhighlight()Highlights the item, using a light color schemevoidonRelease()Brings back the itemvoidonSelect()Highlights the item, using a light color schemevoidshow()Prints the object on the screenMethods 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, 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:
showin classWindowItem
-
onSelect
public void onSelect()Highlights the item, using a light color scheme- Specified by:
onSelectin classActiveItem
-
onRelease
public void onRelease()Brings back the item- Specified by:
onReleasein classActiveItem
-