Class SwingAgiConfig
java.lang.Object
uno.anahata.asi.agi.event.BasicPropertyChangeSource
uno.anahata.asi.agi.AgiConfig
uno.anahata.asi.swing.agi.SwingAgiConfig
- All Implemented Interfaces:
PropertyChangeSource, Rebindable
- Direct Known Subclasses:
AsiDesktopAgiConfig, IntellijAgiConfig, NetBeansAgiConfig
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA collection of color and font definitions that define the visual identity of the Anahata Swing UI, dynamically adjusting between light and dark aesthetics based on the active Look and Feel. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanIf true, sound notifications will be played on status changes.private IconProviderThe provider for context-related icons, used to visually distinguish between different types of resources and tools.private booleanIf true, parts and messages that are effectively pruned will still be rendered in the UI (e.g., in a collapsed state) to allow the user to inspect and un-prune them.Fields inherited from class BasicPropertyChangeSource
propertyChangeSupport -
Constructor Summary
ConstructorsConstructorDescriptionSwingAgiConfig(AbstractAsiContainer aiConfig) Constructs a new SwingAgiConfig with a randomly generated session ID.SwingAgiConfig(AbstractAsiContainer aiConfig, String sessionId) Constructs a new SwingAgiConfig with a specific session ID. -
Method Summary
Modifier and TypeMethodDescriptionstatic ColorRetrieves the thematic color associated with a specific agi status.static ColorgetColor(ToolExecutionStatus status) Retrieves the color associated with a specific tool execution status.static ColorgetColor(ToolPermission permission) Retrieves the color associated with a specific tool permission level.static ColorgetColorForContextUsage(double percentage) Calculates a color representing context window usage, shifting from green to red as the usage approaches the threshold.getTheme()Returns a new theme object containing the color and font definitions for the UI.static ColorGets a theme-adaptive warning color for truncated resource token counts.static booleanLook-and-Feel-agnostic relative luminance check to determine if the active theme is a dark mode variant.voidsetShowPruned(boolean showPruned) Sets whether pruned parts and messages should be shown in the UI.Methods inherited from class AgiConfig
createResourceHandle, getHostApplicationId, getTokenThreshold, setApiInitialDelayMillis, setApiMaxDelayMillis, setApiMaxRetries, setAutoReplyTools, setDefaultBlobPartMaxDepth, setDefaultModelCodeExecutionMaxDepth, setDefaultTextPartMaxDepth, setDefaultThoughtPartMaxDepth, setDefaultToolMaxDepth, setDefaultWebSearchMaxDepth, setExpandThoughts, setExpandTools, setHostedToolsEnabled, setIncludeThoughts, setLocalToolsEnabled, setSelectedModelId, setSelectedProviderUuid, setStreaming, setTokenThresholdMethods inherited from class BasicPropertyChangeSource
addPropertyChangeListener, addPropertyChangeListener, rebind, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PropertyChangeSource
getPropertyChangeSupport
-
Field Details
-
iconProvider
The provider for context-related icons, used to visually distinguish between different types of resources and tools. -
showPruned
private boolean showPrunedIf true, parts and messages that are effectively pruned will still be rendered in the UI (e.g., in a collapsed state) to allow the user to inspect and un-prune them. -
audioFeedbackEnabled
private boolean audioFeedbackEnabledIf true, sound notifications will be played on status changes.
-
-
Constructor Details
-
SwingAgiConfig
Constructs a new SwingAgiConfig with a randomly generated session ID.- Parameters:
aiConfig- The global AI container instance.
-
SwingAgiConfig
Constructs a new SwingAgiConfig with a specific session ID.- Parameters:
aiConfig- The global AI container instance.sessionId- The unique session ID.
-
-
Method Details
-
setShowPruned
public void setShowPruned(boolean showPruned) Sets whether pruned parts and messages should be shown in the UI. Fires a property change event for reactive UI updates.- Parameters:
showPruned- true to show pruned content.
-
isDarkLaf
public static boolean isDarkLaf()Look-and-Feel-agnostic relative luminance check to determine if the active theme is a dark mode variant.- Returns:
- true if the active Look and Feel is dark, false otherwise.
-
getColor
-
getColor
Retrieves the color associated with a specific tool execution status.- Parameters:
status- The status to look up.- Returns:
- The color representing that execution state.
-
getColor
Retrieves the color associated with a specific tool permission level.- Parameters:
permission- The permission level.- Returns:
- The color representing that permission.
-
getColorForContextUsage
Calculates a color representing context window usage, shifting from green to red as the usage approaches the threshold.- Parameters:
percentage- The usage percentage (0.0 to 1.0+).- Returns:
- The appropriate color for the usage bar.
-
getTruncatedTokenColor
Gets a theme-adaptive warning color for truncated resource token counts. High-contrast in both dark and light Look and Feels.- Returns:
- The adaptive warning/orange color.
-
getTheme
Returns a new theme object containing the color and font definitions for the UI.- Returns:
- The UI theme.
-

