Package javatro.display.screens
Class Screen
java.lang.Object
javatro.display.screens.Screen
- Direct Known Subclasses:
BlindSelectScreen,CardSelectScreen,DeckSelectScreen,DeckViewScreen,GameScreen,HelpScreen,LoseScreen,PokerHandScreen,RunListScreen,RunSelectScreen,StartScreen,WinGameScreen,WinRoundScreen
Abstract base class representing a display screen in the Javatro application.
Provides common functionality for:
- Managing screen options/commands
- Displaying formatted menus
- Handling user command selection
Subclasses must implement displayScreen() to define specific screen content.
-
Field Summary
FieldsModifier and TypeFieldDescriptionList of available commands/options for this screen -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidDisplays formatted options menu with title and border decoration.abstract voidDisplays the main content of the screen.getCommand(int index) Retrieves a command by its index position.intGets the current number of available options.void
-
Field Details
-
commandMap
List of available commands/options for this screen
-
-
Constructor Details
-
Screen
Constructs a screen with specified options menu title.- Parameters:
optionsTitle- Descriptive title for the options section (1-3 words recommended)- Throws:
JavatroException- if optionsTitle is null or empty
-
-
Method Details
-
displayScreen
public abstract void displayScreen()Displays the main content of the screen.Must be implemented by concrete subclasses to define:
- Screen-specific header/content
- Any additional visual elements
- Dynamic content updates
-
displayOptions
public void displayOptions()Displays formatted options menu with title and border decoration.Output includes:
- Styled title header
- Numbered list of options
- Option descriptions with consistent formatting
- Visual border elements
-
getCommandMap
-
clearCommandMap
public void clearCommandMap() -
getOptionsSize
public int getOptionsSize()Gets the current number of available options.- Returns:
- Number of registered commands/options (always ≥ 0)
-
getCommand
Retrieves a command by its index position.- Parameters:
index- Zero-based index of the command- Returns:
- Selected Option object
- Throws:
JavatroException- if index is out of valid range
-
getOutput
public void getOutput()
-