Version: 1.1.1

ca.ucalgary.seahawk.gui
Class MobyServicesGUI

java.lang.Object
  extended by ca.ucalgary.seahawk.gui.MobyServicesGUI
All Implemented Interfaces:
ServiceChoiceListener, ActionListener, Comparator<MobyService>, EventListener, PopupMenuListener

public class MobyServicesGUI
extends Object
implements ActionListener, Comparator<MobyService>, PopupMenuListener, ServiceChoiceListener

Implementation of the actually popup menu that lists services available, and invokes them.


Field Summary
static String CLIPBOARD_CMD
           
static String CLIPBOARD_LABEL
           
static int MAX_ID_LEN
           
static int MAX_SERVICE_DESC_LEN
           
static int MAX_SERVICES_PER_SUBMENU
           
static String SEARCH_LABEL
           
static String SERVICE_SUBMENU_NAME
           
static String SERVICESEARCH_CMD
           
static int USE_DEFAULT_HANDLER_MASK
          Always spring MOBY response in a new window if this modifier is present for a click
static int USE_DEFAULT_SECONDARIES_MASK
           
 
Constructor Summary
MobyServicesGUI()
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void addClipboardItem(JMenu menu, MobyDataInstance mobyData)
           
 JMenu addNameDivSubMenu(JMenu parentMenu, MobyService[] services)
           
 JMenu addOutputTypeSubMenu(JMenu parentMenu, MobyDataType type)
           
 void addPopupOptions(MobyDataInstance mobyData, JPopupMenu popupList, boolean asynchronous)
          Same as three arg addPopupOptions, but uses default response handler
 void addPopupOptions(MobyDataInstance mobyData, JPopupMenu popupList, boolean asynchronous, MobyRequestEventHandler handler)
          Find the list of available services querying MobyCentral directly with a piece of data.
 void addPopupOptions(Node targetNode, JPopupMenu popupList, boolean asynchronous)
          Uses default handler for response callback
 void addPopupOptions(Node targetNode, JPopupMenu popupList, boolean asynchronous, MobyRequestEventHandler handler)
          Find the list of available services based on the XML->moby datatype mapping utility in mobyClient.
 void addPopupOptions(Object mobyData, JPopupMenu popupList, boolean asynchronous, MobyRequestEventHandler handler, MobyPayloadRequestListener payloadCreator, String extraMenuText)
          Find the list of available services querying MobyCentral directly with a piece of data.
 void addPopupOptions(String textData, JPopupMenu popupList, boolean asynchronous)
           
 void addPopupOptions(String textData, JPopupMenu popupList, boolean asynchronous, MobyRequestEventHandler handler)
           
 void addRegexMapping(String xpath, String[] mobyDataTypes)
           
 void addRegexMapping(String xpath, String desc_xpath, String[] mobyDataTypes)
           
 void addSearchItem(JMenu menu, int location)
           
 JMenu addServiceTypeSubMenu(JMenu parentMenu, MobyServiceType type)
           
 void addXPathMapping(String xpath, String[] mobyDataTypes)
           
 void addXPathMapping(String xpath, String desc_xpath, String[] mobyDataTypes)
           
 int compare(MobyService o1, MobyService o2)
           
 JMenu createObjectSubMenu(Object templateObject, String extraMenuText)
          Template object may be one of MobyPrimaryData, or in case of deferred content loading a MobyNamespace, MobyDataType, or MobyPrimaryDataSet.
 boolean equals(Object obj)
           
 CentralImpl getMobyCentralImpl()
           
 MobyClient getMobyClient()
           
 boolean isSecondaryParamDialogNew()
           
 void popupMenuCanceled(PopupMenuEvent e)
          If the popup is canceled, we want to remove any data we've stored, and kill any requests to MOBYCentral.
 void popupMenuWillBecomeInvisible(PopupMenuEvent e)
           
 void popupMenuWillBecomeVisible(PopupMenuEvent e)
           
 void removePopupOptions()
           
 void removePopupOptions(Object source)
           
 void selectionCanceled(ServiceSearchDialog dialog)
           
 void serviceSelected(ServiceSearchDialog dialog, JMenuItem selectedServiceItem)
           
 void setClipboard(MobyContentClipboard clip)
           
 void setDataDescMax(int cutoff)
           
 void setResponseHandler(MobyRequestEventHandler mreh)
          If a service is invoked by this class, the event handler registered here will get a callback when the response is ready for display (MobyServicesGUI does not display service results, this is its way of delegating that responsibility).
 void setupService(MobyService mobyService, MobyDataInstance mdi, MobyRequestEventHandler mreh)
          Call the service given, or first launch a GUI to get missing input data if not provided in the MobyDataInstance.
 void setupServiceSecondaryData(MobyRequestEventHandler handler)
          Called when the 'Execute Service' button in the secondary input dialog in pushed.
 void sortServicesByName(MobyService[] services)
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ID_LEN

public static final int MAX_ID_LEN
See Also:
Constant Field Values

SERVICE_SUBMENU_NAME

public static final String SERVICE_SUBMENU_NAME
See Also:
Constant Field Values

MAX_SERVICES_PER_SUBMENU

public static final int MAX_SERVICES_PER_SUBMENU
See Also:
Constant Field Values

MAX_SERVICE_DESC_LEN

public static final int MAX_SERVICE_DESC_LEN
See Also:
Constant Field Values

CLIPBOARD_CMD

public static final String CLIPBOARD_CMD
See Also:
Constant Field Values

SERVICESEARCH_CMD

public static final String SERVICESEARCH_CMD
See Also:
Constant Field Values

SEARCH_LABEL

public static final String SEARCH_LABEL
See Also:
Constant Field Values

CLIPBOARD_LABEL

public static final String CLIPBOARD_LABEL
See Also:
Constant Field Values

USE_DEFAULT_HANDLER_MASK

public static final int USE_DEFAULT_HANDLER_MASK
Always spring MOBY response in a new window if this modifier is present for a click

See Also:
Constant Field Values

USE_DEFAULT_SECONDARIES_MASK

public static final int USE_DEFAULT_SECONDARIES_MASK
See Also:
Constant Field Values
Constructor Detail

MobyServicesGUI

public MobyServicesGUI()
                throws Exception
Throws:
Exception
Method Detail

getMobyCentralImpl

public CentralImpl getMobyCentralImpl()

getMobyClient

public MobyClient getMobyClient()

setClipboard

public void setClipboard(MobyContentClipboard clip)

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

setupServiceSecondaryData

public void setupServiceSecondaryData(MobyRequestEventHandler handler)
Called when the 'Execute Service' button in the secondary input dialog in pushed. Section synchronized so simultaneous requests don't get their input data mixed up


setupService

public void setupService(MobyService mobyService,
                         MobyDataInstance mdi,
                         MobyRequestEventHandler mreh)
Call the service given, or first launch a GUI to get missing input data if not provided in the MobyDataInstance.


popupMenuCanceled

public void popupMenuCanceled(PopupMenuEvent e)
If the popup is canceled, we want to remove any data we've stored, and kill any requests to MOBYCentral.

Specified by:
popupMenuCanceled in interface PopupMenuListener

popupMenuWillBecomeInvisible

public void popupMenuWillBecomeInvisible(PopupMenuEvent e)
Specified by:
popupMenuWillBecomeInvisible in interface PopupMenuListener

popupMenuWillBecomeVisible

public void popupMenuWillBecomeVisible(PopupMenuEvent e)
Specified by:
popupMenuWillBecomeVisible in interface PopupMenuListener

isSecondaryParamDialogNew

public boolean isSecondaryParamDialogNew()

setResponseHandler

public void setResponseHandler(MobyRequestEventHandler mreh)
If a service is invoked by this class, the event handler registered here will get a callback when the response is ready for display (MobyServicesGUI does not display service results, this is its way of delegating that responsibility).


addXPathMapping

public void addXPathMapping(String xpath,
                            String[] mobyDataTypes)

addXPathMapping

public void addXPathMapping(String xpath,
                            String desc_xpath,
                            String[] mobyDataTypes)

addRegexMapping

public void addRegexMapping(String xpath,
                            String[] mobyDataTypes)

addRegexMapping

public void addRegexMapping(String xpath,
                            String desc_xpath,
                            String[] mobyDataTypes)

setDataDescMax

public void setDataDescMax(int cutoff)

addPopupOptions

public void addPopupOptions(Node targetNode,
                            JPopupMenu popupList,
                            boolean asynchronous)
Uses default handler for response callback


addPopupOptions

public void addPopupOptions(Node targetNode,
                            JPopupMenu popupList,
                            boolean asynchronous,
                            MobyRequestEventHandler handler)
Find the list of available services based on the XML->moby datatype mapping utility in mobyClient. This method can be called asynchronously, to allow the user to interact with the program while the list is being created.


removePopupOptions

public void removePopupOptions(Object source)

removePopupOptions

public void removePopupOptions()

addPopupOptions

public void addPopupOptions(String textData,
                            JPopupMenu popupList,
                            boolean asynchronous)

addPopupOptions

public void addPopupOptions(String textData,
                            JPopupMenu popupList,
                            boolean asynchronous,
                            MobyRequestEventHandler handler)

addPopupOptions

public void addPopupOptions(MobyDataInstance mobyData,
                            JPopupMenu popupList,
                            boolean asynchronous)
Same as three arg addPopupOptions, but uses default response handler


addPopupOptions

public void addPopupOptions(MobyDataInstance mobyData,
                            JPopupMenu popupList,
                            boolean asynchronous,
                            MobyRequestEventHandler handler)
Find the list of available services querying MobyCentral directly with a piece of data.


addPopupOptions

public void addPopupOptions(Object mobyData,
                            JPopupMenu popupList,
                            boolean asynchronous,
                            MobyRequestEventHandler handler,
                            MobyPayloadRequestListener payloadCreator,
                            String extraMenuText)
Find the list of available services querying MobyCentral directly with a piece of data.

Parameters:
mobyData - a MobyDataInstance, or in the case of deferred data to be created by payloadCreator, a MobyDataType, MobyNamespace, or MobyPrimaryDataSet

addServiceTypeSubMenu

public JMenu addServiceTypeSubMenu(JMenu parentMenu,
                                   MobyServiceType type)

addNameDivSubMenu

public JMenu addNameDivSubMenu(JMenu parentMenu,
                               MobyService[] services)

addOutputTypeSubMenu

public JMenu addOutputTypeSubMenu(JMenu parentMenu,
                                  MobyDataType type)

createObjectSubMenu

public JMenu createObjectSubMenu(Object templateObject,
                                 String extraMenuText)
Template object may be one of MobyPrimaryData, or in case of deferred content loading a MobyNamespace, MobyDataType, or MobyPrimaryDataSet.


serviceSelected

public void serviceSelected(ServiceSearchDialog dialog,
                            JMenuItem selectedServiceItem)
Specified by:
serviceSelected in interface ServiceChoiceListener

selectionCanceled

public void selectionCanceled(ServiceSearchDialog dialog)
Specified by:
selectionCanceled in interface ServiceChoiceListener

addSearchItem

public void addSearchItem(JMenu menu,
                          int location)

addClipboardItem

public void addClipboardItem(JMenu menu,
                             MobyDataInstance mobyData)

sortServicesByName

public void sortServicesByName(MobyService[] services)

compare

public int compare(MobyService o1,
                   MobyService o2)
Specified by:
compare in interface Comparator<MobyService>

equals

public boolean equals(Object obj)
Specified by:
equals in interface Comparator<MobyService>
Overrides:
equals in class Object

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010