Class RagMessagePanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jdesktop.swingx.JXPanel
org.jdesktop.swingx.JXTitledPanel
uno.anahata.asi.swing.components.CollapsibleTitledPanel
uno.anahata.asi.swing.agi.message.AbstractMessagePanel<AbstractMessage>
uno.anahata.asi.swing.agi.message.RagMessagePanel
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable
A specialized message panel for rendering messages in non-history UI components.
It suppresses pruning and removal controls by default and supports scrolling.
- Author:
- anahata
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class JPanel
JPanel.AccessibleJPanelNested classes/interfaces inherited from class JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final booleanWhether to render pruning controls.private final booleanWhether to render remove controls.Fields inherited from class AbstractMessagePanel
agiConfig, agiPanel, footerContainer, messageFields inherited from class org.jdesktop.swingx.JXTitledPanel
LEFT_DECORATION, RIGHT_DECORATION, uiClassIDFields inherited from class JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionRagMessagePanel(@NonNull AgiPanel agiPanel, @NonNull AbstractMessage message, boolean renderPruneButtons, boolean renderRemoveButtons) Constructs a new RagMessagePanel. -
Method Summary
Modifier and TypeMethodDescriptionprotected ColorGets the end color for the header gradient.protected ColorGets the foreground color for the header text.protected ColorGets the start color for the header gradient.protected StringGets the suffix for the header, typically metadata like depth.protected BorderGets the border for the message panel.intgetScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) booleanbooleanintgetScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) booleanIf true, the pruning toggle button is rendered in the header.booleanIf true, the remove button is rendered in the header.Methods inherited from class AbstractMessagePanel
addNotify, createPartPanel, getHeaderPrefix, getHeaderSender, getHeaderTimestamp, refreshMetadata, render, renderContentParts, renderFooter, setForceExpanded, toggleExpanded, updateBackgroundColors, updateHeaderButtons, updateHeaderInfoText, updateUI, updateVisibilityMethods inherited from class CollapsibleTitledPanel
getHeaderComponentMethods inherited from class org.jdesktop.swingx.JXTitledPanel
getContentContainer, getLeftDecoration, getRightDecoration, getTitle, getTitleFont, getTitleForeground, getTitlePainter, getUI, getUIClassID, setContentContainer, setLeftDecoration, setRightDecoration, setTitle, setTitleFont, setTitleForeground, setTitlePainter, setUIMethods inherited from class org.jdesktop.swingx.JXPanel
getAlpha, getBackgroundPainter, getEffectiveAlpha, getPainterChangeListener, getScrollableHeightHint, getScrollableWidthHint, isAlpha, isInheritAlpha, isOpaque, isOpaquePatch, isPaintBorderInsets, isPaintingBackground, isPaintingOrigin, isPatch, isTransparentBackground, paint, paintComponent, paintComponentPatch, setAlpha, setBackgroundPainter, setInheritAlpha, setOpaque, setOpaquePatch, setPaintBorderInsets, setScrollableHeightHint, setScrollableTracksViewportHeight, setScrollableTracksViewportWidth, setScrollableWidthHintMethods inherited from class JPanel
getAccessibleContext, paramString, setUIMethods inherited from class JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, updateMethods inherited from class Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
renderPruneButtons
private final boolean renderPruneButtonsWhether to render pruning controls. -
renderRemoveButtons
private final boolean renderRemoveButtonsWhether to render remove controls.
-
-
Constructor Details
-
RagMessagePanel
public RagMessagePanel(@NonNull @NonNull AgiPanel agiPanel, @NonNull @NonNull AbstractMessage message, boolean renderPruneButtons, boolean renderRemoveButtons) Constructs a new RagMessagePanel.- Parameters:
agiPanel- The parent agi panel.message- The message to render.renderPruneButtons- Whether to render pruning controls.renderRemoveButtons- Whether to render remove controls.
-
-
Method Details
-
isRenderPruneButtons
public boolean isRenderPruneButtons()If true, the pruning toggle button is rendered in the header.Returns whether pruning buttons should be rendered.
- Overrides:
isRenderPruneButtonsin classAbstractMessagePanel<AbstractMessage>- Returns:
- true by default.
-
isRenderRemoveButtons
public boolean isRenderRemoveButtons()If true, the remove button is rendered in the header.Returns whether remove buttons should be rendered.
- Overrides:
isRenderRemoveButtonsin classAbstractMessagePanel<AbstractMessage>- Returns:
- true by default.
-
getPreferredScrollableViewportSize
Returns the preferred size for the scrollable viewport.
- Specified by:
getPreferredScrollableViewportSizein interfaceScrollable- Overrides:
getPreferredScrollableViewportSizein classorg.jdesktop.swingx.JXPanel
-
getScrollableUnitIncrement
Returns the unit increment for scrolling.
- Specified by:
getScrollableUnitIncrementin interfaceScrollable- Overrides:
getScrollableUnitIncrementin classorg.jdesktop.swingx.JXPanel
-
getScrollableBlockIncrement
Returns the block increment for scrolling.
- Specified by:
getScrollableBlockIncrementin interfaceScrollable- Overrides:
getScrollableBlockIncrementin classorg.jdesktop.swingx.JXPanel
-
getScrollableTracksViewportWidth
public boolean getScrollableTracksViewportWidth()Returns whether the scrollable tracks viewport width.
- Specified by:
getScrollableTracksViewportWidthin interfaceScrollable- Overrides:
getScrollableTracksViewportWidthin classorg.jdesktop.swingx.JXPanel
-
getScrollableTracksViewportHeight
public boolean getScrollableTracksViewportHeight()Returns whether the scrollable tracks viewport height.
- Specified by:
getScrollableTracksViewportHeightin interfaceScrollable- Overrides:
getScrollableTracksViewportHeightin classorg.jdesktop.swingx.JXPanel
-
getHeaderSuffix
Gets the suffix for the header, typically metadata like depth.Returns an empty string for the header suffix, as RAG messages are not part of the tracked history depth.
- Overrides:
getHeaderSuffixin classAbstractMessagePanel<AbstractMessage>- Returns:
- The header suffix HTML.
-
getHeaderStartColor
Gets the start color for the header gradient.Returns the header start color from the theme.
- Specified by:
getHeaderStartColorin classAbstractMessagePanel<AbstractMessage>- Returns:
- The start color.
-
getHeaderEndColor
Gets the end color for the header gradient.Returns the header end color from the theme.
- Specified by:
getHeaderEndColorin classAbstractMessagePanel<AbstractMessage>- Returns:
- The end color.
-
getHeaderForegroundColor
Gets the foreground color for the header text.Returns the header foreground color from the theme.
- Specified by:
getHeaderForegroundColorin classAbstractMessagePanel<AbstractMessage>- Returns:
- The foreground color.
-
getMessageBorder
Gets the border for the message panel.Returns the message border from the theme.
- Specified by:
getMessageBorderin classAbstractMessagePanel<AbstractMessage>- Returns:
- The border.
-

