Investigation of important elements in biological networks

How to

Other

Integrating the GUI

This section describes the basic steps needed to make use of the GUI in your own tool. You can integrate the GUI as a plugin or an integral part of a tool by implementing the Interfaces CentiLib works with. For details on specific methods and their expected functionalities see the API-Docs.

Needed Interfaces

The following Interfaces have to be implemented to make CentiLib able to access the needed data structures and to interact with the tool it is integrated into. The generic parameters G, V and E are the types for the graphs, nodes and edges used in your tool.

  • Graph<V,E>: Accessing the graph (JUNG2 Interface).
  • DoubleAttribute<V>: Accessing node attributes.
  • DoubleAttribute<E>: Accessing edge attributes.
  • Transformer<Graph<V,E>, String>: Getting graph names.
  • Transformer<V,String>: Getting node labels.
  • CentiLibInteractions: Interacting with the tool.

Getting the GUI

After implementing the Interfaces above, an instance of the class CentiLibPlugin<G,V,E> can be generated. To get the CentiLib GUI you just have to call the method getPanel().

Informing CentiLib About Graph Changes

Since centralities depend on the structure of a graph and it's edge weights, it is very important to delete computed values if a node or edge is added or removed. If not, the centrality values get unreliable and the interpretation of these values may be wrong.

Therefore CentiLib has to be notified if a graph changes. To do so, simply call the functions preGraphChanged(graph) and postGraphChanged(graph) of the CentiLibPlugin instance. You should also inform CentiLib if a graph was opened, closed or focused and nodes were selected. See the available functions in the CentiLibPlugin class to ensure a consistent integration of the CentiLib GUI.

Examples

To get an impression of how to integrate the GUI, download the sources of the available plugins for Vanted and Cytoscape. In Vanted the classes VantedNetworkWrapper and CentiLibTab implement all needed interfaces and methods. Look for the classes CyNetworkWrapper and MyAllroundListener in the sources for the Cytoscape plugin.