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
- All Implemented Interfaces:
Toggleable,KeyEventListener
- Direct Known Subclasses:
Button,GridOverlay,ListPane,SimpleListItem,SingleChoiceListPane,TextBox
public abstract class ActiveItem extends WindowItem implements Toggleable
An abstraction for any object containable in a Window
-
Field Summary
Fields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
activeItems, id, parent, passiveItems -
Constructor Summary
Constructors Modifier Constructor Description protectedActiveItem(WindowItem parent, CursorPosition initCoord, int width, int height, java.lang.String id)Custom constructorprotectedActiveItem(WindowItem parent, CursorPosition initCoord, java.lang.String id)Default constructor -
Method Summary
Modifier and Type Method Description voidenable()Enables the componentjava.lang.StringgetBackgroundColor()background gettervoidonDisable()Disables the componentabstract voidonRelease()Defines the object behaviour when releasedabstract voidonSelect()Defines the object behaviour when selectedMethods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
addActiveItem, addPassiveItem, currentActiveItem, drawShadows, getCli, getID, getParent, hideShadows, maxStringLength, nextActiveItem, previousActiveItem, remove, showMethods 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
-
Constructor Details
-
ActiveItem
Default constructorCreates an active item using its default settings;
The initial coordinates are relative to the object's parent- Parameters:
parent- the Window containing thisinitCoord- the itemid- the object id
-
ActiveItem
protected ActiveItem(WindowItem parent, CursorPosition initCoord, int width, int height, java.lang.String id)Custom constructorCreates an active item using custom settings
The initial coordinates are relative to the object's parent- Parameters:
parent- the Window containing thisinitCoord- the item coordinateswidth- the object widthheight- the object heightid- the object id
-
-
Method Details
-
getBackgroundColor
public java.lang.String getBackgroundColor()background getter- Overrides:
getBackgroundColorin classRectangle- Returns:
- the parent's background color
-
onSelect
public abstract void onSelect()Defines the object behaviour when selected -
onRelease
public abstract void onRelease()Defines the object behaviour when released -
enable
public void enable()Enables the component- Specified by:
enablein interfaceToggleable
-
onDisable
public void onDisable()Disables the component- Specified by:
onDisablein interfaceToggleable
-