Class AbstractAsiContainerPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
uno.anahata.asi.swing.AbstractAsiContainerPanel
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
- Direct Known Subclasses:
AsiCardsContainerPanel, AsiTableContainerPanel
A base abstract class for panels that manage a collection of AI agi sessions.
It provides a standard toolbar with common actions (New, Close, Dispose) and
a background refresh mechanism.
- 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 TypeFieldDescriptionprotected final AbstractSwingAsiContainerThe application-wide ASI container.protected final JButtonButton to close the selected session's window.protected final JButtonButton to permanently dispose of the selected session.private final TimerTimer for periodic UI refreshes.protected final JToolBarThe toolbar containing session actions.protected final JLabelA global warning label indicating if the DNA template loaded cleanly.Fields 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
ConstructorsConstructorDescriptionAbstractAsiContainerPanel(@NonNull AbstractSwingAsiContainer container) Constructs a new container panel. -
Method Summary
Modifier and TypeMethodDescriptionvoidAuthoritatively requests the closure of the given agi session via the container.voidAuthoritatively creates a new agi session via the container.voidAuthoritatively requests the disposal of the given agi session via the container.voidAuthoritatively requests focus for the given agi session via the container.protected abstract AgiGets the currently selected agi session in the view.voidInvokes the shared Swing import UI from the container.protected abstract voidRefreshes the specific view implementation (e.g., table or cards).voidsetToolBarVisible(boolean visible) Sets whether the toolbar is visible.voidDisplays the global ASI preferences dashboard in a modal dialog.voidshowPreferences(int initialTabIndex) Displays the global ASI preferences dashboard with a specific tab selected.voidStarts the background refresh timer.voidStops the background refresh timer.protected voidUpdates the enabled state of toolbar buttons based on the current selection.Methods inherited from class JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class JComponent
addAncestorListener, addNotify, 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, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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, setOpaque, 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
-
asiContainer
The application-wide ASI container. -
toolBar
The toolbar containing session actions. -
closeButton
Button to close the selected session's window. -
disposeButton
Button to permanently dispose of the selected session. -
warningLabel
A global warning label indicating if the DNA template loaded cleanly. -
refreshTimer
Timer for periodic UI refreshes.
-
-
Constructor Details
-
AbstractAsiContainerPanel
Constructs a new container panel.- Parameters:
container- The ASI container.
-
-
Method Details
-
focus
Authoritatively requests focus for the given agi session via the container.- Parameters:
agi- The agi session to focus.
-
close
Authoritatively requests the closure of the given agi session via the container.- Parameters:
agi- The agi session to close.
-
dispose
Authoritatively requests the disposal of the given agi session via the container.- Parameters:
agi- The agi session to dispose.
-
createNew
public void createNew()Authoritatively creates a new agi session via the container.Operational Guard: If no API keys are configured, this method alerts the user and opens the Preferences dashboard instead of spawning a non-functional session.
-
importSession
public void importSession()Invokes the shared Swing import UI from the container. -
showPreferences
public void showPreferences()Displays the global ASI preferences dashboard in a modal dialog. -
showPreferences
public void showPreferences(int initialTabIndex) Displays the global ASI preferences dashboard with a specific tab selected.Implementation details: Switches from modal JDialog to a non-modal JFrame to support full OS window management (maximization). Implements a single-instance pattern to reuse the existing frame if already open.
- Parameters:
initialTabIndex- The index of the tab to open.
-
setToolBarVisible
public void setToolBarVisible(boolean visible) Sets whether the toolbar is visible.- Parameters:
visible- true to show the toolbar, false to hide it.
-
startRefresh
public void startRefresh()Starts the background refresh timer. -
stopRefresh
public void stopRefresh()Stops the background refresh timer. -
updateButtonState
protected void updateButtonState()Updates the enabled state of toolbar buttons based on the current selection. -
refreshView
protected abstract void refreshView()Refreshes the specific view implementation (e.g., table or cards). -
getSelectedAgi
Gets the currently selected agi session in the view.- Returns:
- The selected agi, or null if none.
-

