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.Button
it.polimi.ingsw.view.cli.console.graphics.components.ClosingButton
- All Implemented Interfaces:
Toggleable
,KeyEventListener
- Direct Known Subclasses:
ReturningButton
public class ClosingButton extends Button
A clickable button that closes its container (if possible) when pressed
-
Field Summary
Fields inherited from class it.polimi.ingsw.view.cli.console.graphics.components.WindowItem
activeItems, id, parent, passiveItems
-
Constructor Summary
Constructors Constructor Description ClosingButton(Dialog parent, CursorPosition initCoord, int width, int height, java.lang.String text)
Custom constructorClosingButton(Dialog parent, CursorPosition initCoord, java.lang.String text)
Default constructor -
Method Summary
Modifier and Type Method Description void
onCarriageReturn()
Closes the parent, performing eventual operations defined by the caller's Dialog.onQuit().Methods inherited from class it.polimi.ingsw.view.cli.console.graphics.components.Button
drawText, 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
-
Constructor Details
-
ClosingButton
Default constructorCreates a new Button object, using its default properties
- Parameters:
parent
- the button containerinitCoord
- the initial coordinates, relative to the containertext
- the button text
-
ClosingButton
public ClosingButton(Dialog parent, CursorPosition initCoord, int width, int height, java.lang.String text)Custom constructorCreates a new Button object, using its default properties
- Parameters:
parent
- the button containerinitCoord
- the initial coordinates, relative to the containertext
- the button text
-
-
Method Details
-
onCarriageReturn
public void onCarriageReturn()Closes the parent, performing eventual operations defined by the caller's Dialog.onQuit().
-