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:

Rendering Utilities

Contains specialized components for visual presentation:
  • CardRenderer - Renders individual cards as ASCII art
  • UI formatting 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 Screen hierarchy
  • Factory methods for exception creation

Exception Handling

Uses JavatroException for all display-layer errors with colored error messages.
See Also:
  • Class
    Description
    Renders playing cards as ASCII art with colored symbols.
     
    Handles parsing and validation of user input for the Javatro application.
    The UI class is responsible for managing and displaying different screens in the application.