Class ServicePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, TreeSelectionListener

public class ServicePanel extends JPanel implements TreeSelectionListener
The main panel for the GUI client. This contains the top-two sub-panels: the tree and the text area to show the details of the selected node.
Author:
Neil Taylor
See Also:
  • Constructor Details

    • ServicePanel

      public ServicePanel()
      Create a new instance of the panel.
  • Method Details

    • setServiceSelectedListener

      public void setServiceSelectedListener(ServiceSelectedListener listener)
      Set the service selected listener. This listener will be notified when there is a selection change in the tree.
      Parameters:
      listener - The listener.
    • processServiceDocument

      public void processServiceDocument(String url, ServiceDocument doc)
      Process the specified service document. Add the details as a new child of the root of the tree.
      Parameters:
      url - The url used to access the service document.
      doc - The service document.
    • valueChanged

      public void valueChanged(TreeSelectionEvent evt)
      Respond to a changed tree selection event. Update the details panel to show an appropriate message for the newly selected node. Also, alert the selection listener for this panel. The listener will receive a path, if a collection has been selected. Otherwise, the listener will receive null.
      Specified by:
      valueChanged in interface TreeSelectionListener
    • processDepositResponse

      public void processDepositResponse(String url, DepositResponse response)
      Process the deposit response and insert the details into the tree. If the url matches one of the collections in the tree, the deposit is added as a child node. Otherwise, the node is added as a child of the root.
      Parameters:
      url - The url of the collection that the file was posted to.
      response - The details of the deposit.
    • getCollectionLocations

      public String[] getCollectionLocations()
      Get a list of all current collections displayed in the tree.
      Returns:
      An array of the URLs for the collections.