Interface NetworkSearchTaskFactory

All Superinterfaces:
TaskFactory
All Known Implementing Classes:
AbstractNetworkSearchTaskFactory

public interface NetworkSearchTaskFactory extends TaskFactory
Task Factory that has to be implemented in order to create and register a Network Search provider.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Name of the property that indicates that the provided query or options component changed the query parameters.
    static final String
    Name of the property that indicates that a search action has been requested by the custom query component.
  • Method Summary

    Modifier and Type
    Method
    Description
    An optional short text describing what this search provider does.
    An icon that represents this search provider.
    Returns the unique id of this network search provider.
    A short name to be displayed to the user.
    You can use this method to return a component that contains extra search parameters.
    Use this method to return a component that contains the main or mandatory search fields.
    If this task factory provides its own query component, make sure the returned JComponent fires a PropertyChangeEvent for the property QUERY_PROPERTY whenever its fields change in a way that affects the return of the TaskFactory.isReady() method.
    If you want to be notified when the search task is finished, you should return a TaskObserver here.
    An optional URL the user can use to find more information about this search provider.

    Methods inherited from interface org.cytoscape.work.TaskFactory

    createTaskIterator, isOn, isReady
  • Field Details

  • Method Details

    • getId

      String getId()
      Returns the unique id of this network search provider. Use namespaces to make sure it is unique (e.g. "org.myCompany.mySearch").
      Returns:
      A unique id for this search provider.
    • getName

      String getName()
      A short name to be displayed to the user.
      Returns:
      The name of this search provider.
    • getDescription

      String getDescription()
      An optional short text describing what this search provider does.
      Returns:
      A text that describes this search provider, which can be null.
    • getIcon

      Icon getIcon()
      An icon that represents this search provider.
      Returns:
      If null, Cytoscape may provide a default or random icon for this search provider.
    • getWebsite

      URL getWebsite()
      An optional URL the user can use to find more information about this search provider.
      Returns:
      A URL to a website, which can be null.
    • getTaskObserver

      TaskObserver getTaskObserver()
      If you want to be notified when the search task is finished, you should return a TaskObserver here. For example, you may want to display a dialog with a list of multiple network results, in case the user has to select one of them before the final network is created.
      Returns:
      Optional TaskObserver to be passed to the TaskManager when running the search task(s) created by this TaskFactory.
    • getQueryComponent

      JComponent getQueryComponent()
      Use this method to return a component that contains the main or mandatory search fields.
      If this task factory provides its own query component, make sure the returned JComponent fires a PropertyChangeEvent for the property QUERY_PROPERTY whenever its fields change in a way that affects the return of the TaskFactory.isReady() method. That way, Cytoscape can listen to this property change event and call TaskFactory.isReady() again to update the Network Search widget accordingly (e.g. by enabling or disabling the search button). All the query component needs to do is call firePropertyChange(NetworkSearchTaskFactory.QUERY_PROPERTY, null, null);
      The query component can also fire a PropertyChangeEvent for the property SEARCH_REQUESTED_PROPERTY in order to ask Cytoscape to run the search as soon as possible--for instance, you can do this when the user presses the ENTER key on your custom query fields.
      Returns:
      If null, Cytoscape will create a basic search field for you.
    • getOptionsComponent

      JComponent getOptionsComponent()
      You can use this method to return a component that contains extra search parameters. It's usually a good idea to add only optional parameters to the options component. Mandatory fields should, if possible, be included into the component returned by getQueryComponent().
      If this task factory provides its own options component, make sure the returned JComponent fires a PropertyChangeEvent for the property QUERY_PROPERTY whenever its fields change in a way that affects the return of the TaskFactory.isReady() method. That way, Cytoscape can listen to this property change event and call TaskFactory.isReady() again to update the Network Search widget accordingly (e.g. by enabling or disabling the search button). All the options component needs to do is call firePropertyChange(NetworkSearchTaskFactory.QUERY_PROPERTY, null, null);
      Returns:
      If null, extra search options will not be available to the end user.