Package uno.anahata.ai.swing
package uno.anahata.ai.swing
Provides a comprehensive and well-structured Swing-based user interface for the AI assistant.
This package is highly modular, with a clear separation of concerns between different UI components, data models, and rendering logic.
Key Architectural Concepts:
- Main Entry Point:
Mainis the application's entry point, responsible for setting up the mainJFrameand initializing the coreChatPanel. - Core UI Component:
ChatPanelis the central UI container, bringing together all the other panels (conversation, status, input, etc.) into a cohesive user experience. - Conversation Display:
ConversationPanelis responsible for displaying the chat history. It uses a sophisticated rendering system to handle different types of message parts (text, code, function calls, etc.). - Part Rendering: The
uno.anahata.ai.swing.renderpackage provides a flexible and extensible rendering framework.ContentRendereriterates through the parts of aChatMessageand delegates the rendering of each part to a specializedPartRenderer(e.g.,TextPartRenderer,CodeBlockRenderer,FunctionCallPartRenderer). This allows for easy addition of new part types without modifying the core rendering logic. - Configuration and Settings: The
uno.anahata.ai.swing.configpackage provides UI panels for configuring the application, such asGeminiKeysPanelfor managing API keys. - Context Visualization:
ContextHeatmapPanelandContextUsageBarprovide visual representations of the context window's state, helping the user understand the conversation's memory usage. - Tool Integration:
ToolsPanelallows the user to manage the permissions for each available tool, whileSwingFunctionPrompterprovides a UI for confirming tool executions. - Status and Feedback:
StatusPaneldisplays the real-time status of the application, providing feedback on API calls, tool executions, and other background processes. - Utilities: The
uno.anahata.ai.swing.utilpackage contains various helper classes for Swing-related tasks, such asSwingUtilsfor common UI operations.
-
ClassesClassDescriptionJPanel for attachmentsWrapper for attached filesA JPanel that holds a single rendered ChatMessage.A custom JPanel that renders a progress bar for context window usage.A utility class for handling icons.A simple, programmatically drawn Icon that shows a microphone.A simple, programmatically drawn Icon that shows a filled red circle to indicate that a recording is in progress.A flexible JPanel that implements the Scrollable interface, allowing for configurable scrolling behavior.A reusable utility class to display a scrollable JTextArea inside a JPopupMenu when hovering over a target component.A simple, concrete ChatConfig for standalone Swing applications.A combined JDialog and FunctionPrompter implementation for Swing.Utility class for time-related formatting.A modified version of FlowLayout that allows components to wrap to the next line.
