Class DFGUI

  • All Implemented Interfaces:
    DFGUIInterface, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

    public class DFGUI
    extends JFrame
    implements DFGUIInterface
    This class implements the GUI of the Directory Facilitator. The gui shows a tabbed pane with three different views of the functions provided by a Directory Facilitator. The three views are:
    • Registrations with this DF shows a table with all the agents registered with the DF.
    • Search Result shows a table with the list of agent descriptions that were returned as a result of the last search operation on a specified df.
    • DF Federation shows the DF federation. The Parents table shows the list of DF's with which this DF is federated, while the Children table shows the list of DF's that are registered with this DF.
    According to the tab selected, the actions allowed have a proper meaning:
      Registrations with this df.
      • View the description of the selected agent from the table.
      • Modify the description of the selected agent.
      • Register an agent with the DF. The user is then requested to fill in an agent description, notice that some values are mandatory for registration,
      • Deregister an agent selected in the table.
      • Search for agent descriptions with this DF. The user must first insert the search constraint: maximum depth the depth of propagation of the search operation to the federate DF's (children); maximum number of results . If no values are inserted then the default one are used :local search on this df and all agents found returned.The the user must provide an agent description. If no value is inserted in the agent description, the search action returns all the active agents currently registered with this DF.
      • Federate allow to federate this DF with another DF. First of all, the user must provide the full name of the DF with which to federate and then the description of this DF that must be registered with the specified DF.
      Search Result
      • View the description of a selected agent on the table of the results.
      • Register a new agent with last DF used for the search operation (indicated in the tab).
      • Modify the agent description of the agent selected in the table (with the appropriate df).
      • Search for agent descriptions with the DF involved in the last search operation. (see above)
      • Federation (see above)
      DF Federation
      • View the description of an agent selected in one of the two tables. If the agent selected is a parent, then the description of this DF used to fedearate is shown. Otherwise if the selected agent is a child,then the description of this child DF is shown.
      • Register a new agent with the DF selected in one of the two tables.
      • Deregister If the selected agent is a parent then this DF is deregistered from the selected one, otherwise, if the agent selected is a child, this child is deregistered from this DF.
      • Search permits to make a search operation with the DF selected in one of the tables.
      • Federate (see above).
    Version:
    $Date$ $Revision$
    Author:
    Giovanni Caire - Tiziana Trucco - CSELT S.p.A.
    See Also:
    Serialized Form
    • Field Detail

      • AGENT_VIEW

        public static int AGENT_VIEW
      • LASTSEARCH_VIEW

        public static int LASTSEARCH_VIEW
      • PARENT_VIEW

        public static int PARENT_VIEW
      • CHILDREN_VIEW

        public static int CHILDREN_VIEW
    • Constructor Detail

      • DFGUI

        public DFGUI()
        Constructor without parameter. Used by the df to avoid reflection, Using this constructor, the method setAdapter must be called (after the constructor) to set the agent with which the gui interacts.
      • DFGUI

        public DFGUI​(DFGUIAdapter a)
        Constructor with arguments.
        Parameters:
        a - the DFGUIAdapter with which the gui interacts.
    • Method Detail

      • showStatusMsg

        public void showStatusMsg​(String msg)
        Use this method to show a message on the DF GUI.
        Specified by:
        showStatusMsg in interface DFGUIInterface
        Parameters:
        msg - the string to show
      • setTab

        public void setTab​(String tab,
                           AID df)
        This method permits to set the tabben pane to show.
      • getSelectedAgentInTable

        public AID getSelectedAgentInTable()
        Returns the AID of an agent selected from one of the tables shown.
      • kindOfOperation

        public int kindOfOperation()
        Returns:
        an integer according to the tab selected.
      • removeSearchResult

        public void removeSearchResult​(AID name)
        Removes an agent from the foundModel and lastSearchResult
        Specified by:
        removeSearchResult in interface DFGUIInterface
      • getLastDF

        public AID getLastDF()
        Returns the AID of the last df on which a search operation was made.
      • addParent

        public void addParent​(AID parentName)
        adds a new parent to parentModel
        Specified by:
        addParent in interface DFGUIInterface
      • addChildren

        public void addChildren​(AID childrenName)
        adds a new child to parentModel
        Specified by:
        addChildren in interface DFGUIInterface
      • addAgentDesc

        public void addAgentDesc​(AID name)
        Adds a new agent to registeredModel.
        Specified by:
        addAgentDesc in interface DFGUIInterface
      • removeAgentDesc

        public void removeAgentDesc​(AID name,
                                    AID df)
        Removes an agent descr from registeredModel and if it was found in a search operation calls removeSearchResult.
        Specified by:
        removeAgentDesc in interface DFGUIInterface
        See Also:
        jade.tools.dfgui#removeSearchResult(AID name)
      • removeChildren

        public void removeChildren​(AID childrenName)
        Removes an agent desc from the childrenModel.
        Specified by:
        removeChildren in interface DFGUIInterface
      • removeParent

        public void removeParent​(AID parentName)
        Removes an agent desc from the parentModel.
        Specified by:
        removeParent in interface DFGUIInterface
      • disposeAsync

        public void disposeAsync()
        Performs asynchronous disposal to avoid nasty InterruptedException printout.
        Specified by:
        disposeAsync in interface DFGUIInterface
      • getDFAgentSearchDsc

        public DFAgentDescription getDFAgentSearchDsc​(AID name)
        This method returns the DFAgentDescription of an agent found in a search operation.
        Parameters:
        name - The AID of the agent.
        See Also:
        DFAgentDescription, AID
      • enableRefreshButton

        public void enableRefreshButton()