Gephi Toolkit Javadoc

Package org.gephi.ranking.spi

Interfaces for creating new rankings and transformer.


Interface Summary
RankingBuilder Ranking builder, creating Ranking instances suitable to the given RankingModel.
TransformerBuilder Transformer builder, creating Transformer instances.
TransformerUI Transformer user interface.

Package org.gephi.ranking.spi Description

Interfaces for creating new rankings and transformer. RankingBuilder feeds the list of available rankings. The default rankings include for instance 'Degree' or numerical attribute columns. Transformers apply for instance color or size transformation to objects.

Create a new Transformer

  1. Create a new module and set RankingAPI, GraphAPI and Lookup as dependencies.
  2. Create a new builder class by implementing TransformerBuilderr, this class is basically a factory that will create the transformer on demand.
  3. Add @ServiceProvider annotation to your builder, that it can be found by the system. Set TransformerBuilder as the annotation parameter. You can also add a position to define the order your transformer should be displayed. Put 1000 to be displayed after the default one.
  4. Implement the isTransformerForElement() method. If your transformer manipulates both nodes and edges, return true when the element type is Ranking.NODE_ELEMENT or Ranking.EDGE_ELEMENT. If it manipulates only one element, restrict in consequences.
  5. Create a new class that implements Transformer. One can add a dependency to the RankingPlugin module and extends the AbstractRanking.
  6. Configure the Target type of you transformer. If your transformer works only with nodes, put NodeData, if it works only with edges, put EdgeData. If it works with both, put Renderable or Attributable. These are interfaces both nodes and edges implement.
  7. Implement the transform() method of the transformer.
  8. If the transformer needs an UI, create a new class that implements the TransformerUI interface. Add @ServiceProvider annotation to your class, that it can be found by the system. Set TransformerUI as the service annotation parameter.
  9. Configure the isUIForTransformer() to return true only when the given transformer is an instance of the Transformer you defined earlier.
  10. Implement a user interface and set the getPanel() method to return it.

Gephi Toolkit Javadoc