{"id":27140358,"url":"https://github.com/gotoss08/jwterm","last_synced_at":"2025-10-07T15:43:48.512Z","repository":{"id":286346884,"uuid":"961137661","full_name":"gotoss08/JWTerm","owner":"gotoss08","description":"Virtual Terminal Screen Emulator","archived":false,"fork":false,"pushed_at":"2025-04-05T21:08:12.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T21:28:35.906Z","etag":null,"topics":["awt","game-development","java","roguelike","swing","terminal-game"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gotoss08.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-04-05T20:46:30.000Z","updated_at":"2025-04-05T21:08:15.000Z","dependencies_parsed_at":"2025-04-05T21:39:24.471Z","dependency_job_id":null,"html_url":"https://github.com/gotoss08/JWTerm","commit_stats":null,"previous_names":["gotoss08/jwterm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotoss08%2FJWTerm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotoss08%2FJWTerm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotoss08%2FJWTerm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gotoss08%2FJWTerm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gotoss08","download_url":"https://codeload.github.com/gotoss08/JWTerm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247785943,"owners_count":20995644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["awt","game-development","java","roguelike","swing","terminal-game"],"created_at":"2025-04-08T05:51:54.419Z","updated_at":"2025-10-07T15:43:48.423Z","avatar_url":"https://github.com/gotoss08.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JWTerm - Terminal Emulator Framework\n\n## Description\n\n**JWTerm** is a Java-based terminal emulator framework designed for text-based/ASCII graphical applications, with a focus on roguelike game development. Built with **Java 21**, the project provides a professional game loop system, hardware-accelerated rendering, and a grid-based character display system.\n\nJWTerm is built on standard Java libraries (**Swing** and **AWT**) without external dependencies, making it lightweight and easy to integrate into any Java project requiring terminal-like interfaces.\n\n\u003e **Note:** While JWTerm is functional, it's still under active development with more features planned, and current functionality is limited to basic character rendering.\n\u003e \n\u003e The project is in its early stages, and contributions are welcome!\n\nOne of the inspirations for JWTerm comes from the **AsciiPanel** project, which provides a simple, efficient way to render text-based panels for roguelike games. You can find more about AsciiPanel [here](https://github.com/trystan/AsciiPanel).\n\n## Features\n\n- **Terminal Screen Emulation**: Grid-based character display with configurable foreground and background colors\n- **Professional Game Loop System**: Fixed-timing game loop targeting 60 FPS with proper delta time calculation\n- **Hardware-accelerated Rendering**: Double-buffered rendering using Java2D with OpenGL support (maybe added in the future)\n- **Customizable Font System**: Support for loading and caching custom monospace fonts\n- **Input Handling**: Keyboard input processing with modifier key support (Ctrl, Shift combinations)\n- **Debug Overlay**: Togglable performance metrics display (FPS, frame time, update/render timing)\n- **Window Management**: Proper window creation with resize handling and DPI scaling awareness\n- **Logging System**: Comprehensive Java logging with both console and file output\n- **Grid Navigation**: API for positioning and manipulating characters on the screen (planned for future versions)\n- **Performance Optimization**: Sleep timing to maintain target framerate while minimizing CPU usage\n- **Fixedsys Font**: Uses the **Fixedsys** font for retro-style text rendering, enhancing the terminal-like experience.\n- **Open Source**: JWTerm is free and open-source under the **MIT License**, allowing modification and redistribution.\n\n## Utility Classes\n\n- **Size**: Width and height management\n- **Dimension**: Column and row management for grid systems\n- **Padding**: Horizontal and vertical padding management\n- **Timer**: High-precision timing utilities for performance measurement\n- **LoggingUtility**: Configurable logging with custom formatting\n\n## Planned Features\n\n- Mouse input support\n- Camera system for larger virtual spaces\n- Enhanced API for text and screen manipulation\n- Animation system\n- Simplified integration API for any project\n- More predefined glyphs and color schemes\n\n## Installation\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/gotoss08/JWTerm.git\n   ```\n\n2. **Open the project in IntelliJ IDEA**:\n   - Launch **IntelliJ IDEA**\n   - Select **Open** and navigate to the cloned repository\n\n3. **Set up the JDK**:\n   - Ensure **Java 21 SDK** is selected for the project\n   - Go to **File** \u003e **Project Structure** \u003e **Project** and select **Java 21**\n\n4. **Build and run**:\n   - Build the project using **Build** \u003e **Build Project**\n   - Run the application using the green **Run** button or `Shift + F10`\n\n## Usage Example\n\nRefer to the [TerminalAppDemo](./src/com/jwterm/demo/TerminalAppDemo.java) class in the `com.jwterm.demo` package for a simple example of how to create a terminal application using JWTerm.\n\n### Example Code\n\nJWTerm provides an abstract base class that you can extend to create your own terminal-based applications:\n\n```java\npackage com.jwterm.demo;\n\nimport com.jwterm.JWTerm;\nimport com.jwterm.TermScreen;\nimport com.jwterm.utils.LoggingUtility;\n\nimport java.awt.*;\nimport java.awt.event.KeyEvent;\nimport java.util.logging.Logger;\n\npublic class TerminalAppDemo extends JWTerm {\n\n    private static final Logger LOGGER = LoggingUtility.getLogger(TerminalAppDemo.class.getName());\n\n    public TerminalAppDemo() {\n        super(\"JWTerm Demo\", 1280, 720);\n    }\n\n    public void start() {\n        // Initialize your application here\n        LOGGER.info(\"Starting terminal application\");\n        runGameLoop();\n    }\n\n    @Override\n    protected void update(double deltaTime) {\n        // Update your application logic here\n    }\n\n    @Override\n    protected void render(Graphics2D g, double deltaTime) {\n        // Add custom rendering here if needed\n        // But for now there is no API for custom rendering\n        // It will be added in the future\n    }\n\n    @Override\n    public void keyTyped(KeyEvent e) {\n        // Not used in this implementation\n        // But you can handle character input here if needed\n    }\n\n    @Override\n    public void keyPressed(KeyEvent e) {\n\n        // Handle general key events here\n\n        int modifiers = e.getModifiersEx();\n        int keyCode = e.getKeyCode();\n\n        if (keyCode == KeyEvent.VK_ESCAPE) {\n            LOGGER.info(\"ESC pressed, exiting application\");\n            this.running = false;\n        }\n\n        // Example: check for modifier keys and specific key combinations\n\n        if (isCtrlDown(modifiers) \u0026\u0026 isShiftDown(modifiers) \u0026\u0026 keyCode == KeyEvent.VK_A) {\n            LOGGER.info(\"Ctrl+Shift+A: Clearing screen\");\n            termScreen.fill(null);\n        }\n\n        if (isCtrlDown(modifiers) \u0026\u0026 isShiftDown(modifiers) \u0026\u0026 keyCode == KeyEvent.VK_B) {\n            LOGGER.info(\"Ctrl+Shift+B: Filling screen with walls\");\n            termScreen.fill(TermScreen.Glyph.WALL);\n        }\n\n    }\n\n    @Override\n    public void keyReleased(KeyEvent e) {\n        // Not used in this implementation\n        // But you can handle key release events here if needed\n    }\n\n    public static void main(String[] args) {\n        TerminalAppDemo app = new TerminalAppDemo();\n        app.start();\n    }\n\n}\n```\n\n## Default Controls\n\n- **F1**: Toggle debug overlay\n- **ESC**: Exit application (in demo)\n- **Ctrl+Shift+A**: Clear screen (in demo)\n- **Ctrl+Shift+B**: Fill screen with wall characters (in demo)\n\n## License\n\nJWTerm is released under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n## Contributing\n\nContributions are welcome! Feel free to fork the repository, submit issues, and open pull requests.\n\n\u003e Important: Since this project is still in early development, contributions that help improve stability, features, or documentation are particularly appreciated.\n\nPlease refer to the [TODO list](./TODO.md) for tasks that need to be completed or improved.\n\n## Acknowledgments\n\n- Fixedsys font by [Kika](https://github.com/kika/fixedsys).\n- Inspiration from the **AsciiPanel** project by [Trystan](https://github.com/trystan/AsciiPanel).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgotoss08%2Fjwterm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgotoss08%2Fjwterm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgotoss08%2Fjwterm/lists"}