Package javatro.display
package javatro.display
Provides the user interface layer for the Javatro application, handling all presentation logic
and user interaction components.
This package contains all classes responsible for:
- Managing screen transitions and UI state
- Rendering game elements using ANSI art and colored text
- Handling user input and menu navigation
- Displaying game state information and statistics
- Implementing complex visual layouts and formatting
Key Components
Core UI Management
UI - Singleton controller managing screen stack, input handling, and
observer notifications. Implements the main display loop and coordinates all visual components.
Screen Implementations
Screen - Abstract base class for all display screens. Concrete
implementations include:
GameScreen- Main gameplay interface showing scores, hands, and jokersDeckViewScreen- Detailed deck composition table viewHelpScreen- Help menu with game rules and instructionsBlindSelectScreen- Blind selection interface with risk/reward visualizationStartScreen- Initial menu with game startup optionsWinGameScreen/LoseScreen- Endgame state displays
Rendering Utilities
Contains specialized components for visual presentation:CardRenderer- Renders individual cards as ASCII artUIformatting methods - Handle complex text layout and borders- ANSI art loading and display functionality
ASCII Art Resources
main.resources.ansi - Contains ASCII text files with ANSI colour formatting. Used for visual elements, such as game logo, cards, and decorative text.Design Patterns
- Singleton pattern (
UI) for centralized display control - Observer pattern for screen state changes
- Template method pattern in
Screenhierarchy - Factory methods for exception creation
Exception Handling
UsesJavatroException for all display-layer errors with colored error
messages.- See Also:
-
ClassDescriptionRenders playing cards as ASCII art with colored symbols.Handles parsing and validation of user input for the Javatro application.The
UIclass is responsible for managing and displaying different screens in the application.