
    +dY                     R    d dl ZddlmZmZ ddlmZ ddlmZ  G d de          Z	dS )    N   )ICONSBase)CatGUI)	SourceGUIc                        e Zd ZdZd fd	Zd Zed             Zd Zed             Z	ed             Z
ed	             Zd
 Zd Zed             Z xZS )GUIa  
    Top level GUI panel that contains controls and all visible sub-panels

    This class is responsible for coordinating the inputs and outputs
    of various sup-panels and their effects on each other.

    Parameters
    ----------
    cats: list of catalogs
        catalogs used to initalize the cat panel

    Attributes
    ----------
    children: list of panel objects
        children that will be used to populate the panel when visible
    panel: panel layout object
        instance of a panel layout (row or column) that contains children
        when visible
    watchers: list of param watchers
        watchers that are set on children - cleaned up when visible
        is set to false.
    Nc                    t                      | _        t          || j                  | _        t          j        t          j        t          j        t          d                   t          j        | j        j
        j        | j        j        dd          t          j        | j        j
        j        | j        j        dd          | j        j        j        dd          t          j        | j        j        j        | j        j        j        | j        j        j        d          d          | _        t!          t"          |                                            d S )N)catsdone_callbacklogor   max)marginwidth_policy)r   )r   sourcer   r   catpnColumnRowpanelr   selectcontrol_paneldescriptionsearchaddplotsuperr	   __init__)selfr   	__class__s     4lib/python3.11/site-packages/intake/interface/gui.pyr   zGUI.__init__&   s   kkt43EFFFYFv''	$(//1GPQ`efff	$+,2DK4MVWfklll'-"   F48?($(,*<dk>N>Tchiii
 
 

 	c4!!#####    c                 (    || j         j        _        d S N)r   r   r   )r   r   s     r!   r   zGUI.done_callback7   s    "&r"   c                     | j         j        S )z3Cats that have been selected from the cat sub-panel)r   r   r   s    r!   r   zGUI.cats:   s     x}r"   c                 0     | j         j        j        |i |S )zAdd to list of cats)r   r   r   )r   argskwargss      r!   r   zGUI.add?   s    "tx"D3F333r"   c                     | j         j        S )z9Sources that have been selected from the source sub-panel)r   sourcesr&   s    r!   r+   zGUI.sourcesC   s     {""r"   c                     | j         j        S )z@DataSource instance for the current selection and any parameters)r   source_instancer&   s    r!   r-   zGUI.source_instanceH   s     {**r"   c                 P    t          | j                  dk    rdS | j        d         S )zItem that is selectedr   N)lenr+   r&   s    r!   itemzGUI.itemM   s,     t|! 	4|Ar"   c                 t    | j         | j                                        | j                                        dS )z)Serialize the current state of the object)visibler   r   )r2   r   __getstate__r   r&   s    r!   r3   zGUI.__getstate__T   s:     |8((**k..00
 
 	
r"   c                     |                     dd          | _        | j                            |d                    | j                            |d                    | S )zSet the current state of the object from the serialized version.
        Works inplace. See ``__getstate__`` to get serialized version and
        ``from_state`` to create a new object.r2   Tr   r   )getr2   r   __setstate__r   )r   states     r!   r6   zGUI.__setstate__\   sR     yyD11eEl+++  x111r"   c                 @     | g                                |          S )zCreate a new object from a serialized exising object.

        Example
        -------
        original = GUI()
        copy = GUI.from_state(original.__getstate__())
        )r   )r6   )clsr7   s     r!   
from_statezGUI.from_statee   s"     s|||((///r"   r$   )__name__
__module____qualname____doc__r   r   propertyr   r   r+   r-   r0   r3   r6   classmethodr:   __classcell__)r    s   @r!   r	   r	      s
        .$ $ $ $ $ $"' ' '   X4 4 4 # # X# + + X+   X
 
 
   0 0 [0 0 0 0 0r"   r	   )
r   r   baser   r   catalog.guir   
source.guir   r	    r"   r!   <module>rF      s                      ! ! ! ! ! !`0 `0 `0 `0 `0$ `0 `0 `0 `0 `0r"   