de.ipk_gatersleben.ag_nw.centilib.plugin
Class CentiLibPlugin<G,V,E>

java.lang.Object
  extended by de.ipk_gatersleben.ag_nw.centilib.plugin.CentiLibPlugin<G,V,E>
Type Parameters:
G - Type of the graphs
V - Type of the nodes
E - Type of the edges

public class CentiLibPlugin<G,V,E>
extends Object

This class represents a complete instance of CentiLib and it's GUI. To create it, you need to implement the Interface CentiLibInteractions which enables CentiLib to access your data structures. Furthermore two Transformers for the graph names and node labels are needed. Furthermore you have to inform CentiLib if a graph changes. That is, if he was changed or closed or a new graph was opened or focused. Use the appropriate methods to do so. The GUI (a JTabbedPane) can be accessed with getPanel().

Author:
Johannes Graessler

Constructor Summary
CentiLibPlugin(CentiLibInteractions<G,V,E> plugin, org.apache.commons.collections15.Transformer<G,String> graphNameTransformer, org.apache.commons.collections15.Transformer<V,String> nodeLabelTransformer)
           
 
Method Summary
 Component getPanel()
          Returns the CentiLib GUI (JTabbedPane).
 void graphClosed()
          Deletes the current graph and all its values within CentiLib.
 void graphClosed(G graph)
          Deletes the given graph and all its values within CentiLib.
 void graphFocused(G graph)
          Sets the given graph in the panel.
 void nodesSelected(Collection<V> nodes)
          Marks the appropriate entries for the given nodes in the list of centrality values if they exist (Result panel).
 void postGraphChanged()
          Deletes all computed values of the current graph within CentiLib and removes existing centrality attributes from the nodes, because the values get unreliable.
 void postGraphChanged(G graph)
          Deletes all computed values of the given graph within CentiLib and removes existing centrality attributes from the nodes, because the values get unreliable.
 void preGraphChanged()
          Marks the current graph as modified.
 void preGraphChanged(G graph)
          Marks the given graph as modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CentiLibPlugin

public CentiLibPlugin(CentiLibInteractions<G,V,E> plugin,
                      org.apache.commons.collections15.Transformer<G,String> graphNameTransformer,
                      org.apache.commons.collections15.Transformer<V,String> nodeLabelTransformer)
Method Detail

getPanel

public Component getPanel()
Returns the CentiLib GUI (JTabbedPane).

Returns:
the CentiLib GUI

graphFocused

public void graphFocused(G graph)
Sets the given graph in the panel.

Parameters:
graph - the selected graph

graphClosed

public void graphClosed()
Deletes the current graph and all its values within CentiLib.


graphClosed

public void graphClosed(G graph)
Deletes the given graph and all its values within CentiLib.

Parameters:
graph - The graph to delete from the cache.

preGraphChanged

public void preGraphChanged()
Marks the current graph as modified. Computed values and existing centrality attributes will be deleted, when the changes are finished. This is done afterwards because the graph will be already modified.


preGraphChanged

public void preGraphChanged(G graph)
Marks the given graph as modified. Computed values and existing centrality attributes will be deleted, when the changes are finished. This is done afterwards because the graph will be already modified.

Parameters:
graph - The graph that will be changed

postGraphChanged

public void postGraphChanged()
Deletes all computed values of the current graph within CentiLib and removes existing centrality attributes from the nodes, because the values get unreliable.


postGraphChanged

public void postGraphChanged(G graph)
Deletes all computed values of the given graph within CentiLib and removes existing centrality attributes from the nodes, because the values get unreliable.

Parameters:
graph - the graph that was changed

nodesSelected

public void nodesSelected(Collection<V> nodes)
Marks the appropriate entries for the given nodes in the list of centrality values if they exist (Result panel).

Parameters:
nodes - the nodes that were selected