Gephi Toolkit Javadoc

org.gephi.ranking.api
Interface RankingController

All Known Implementing Classes:
RankingControllerImpl

public interface RankingController

Controller that maintains the ranking models, one per workspace.

This controller is a service and can therefore be found in Lookup:

RankingController rc = Lookup.getDefault().lookup(RankingController.class);

Use transform() to apply transformers on ranking's elements. Transform is a one shot action. For continuous transformation, start an auto transformer using startAutoTransform().

Author:
Mathieu Bastian
See Also:
RankingModel

Method Summary
 RankingModel getModel()
          Returns the ranking model of the current workspace.
 RankingModel getModel(Workspace workspace)
          Returns the ranking model of workspace.
 void setInterpolator(Interpolator interpolator)
          Sets the interpolator to be used when transforming values.
 void setUseLocalScale(boolean useLocalScale)
          Sets whether rankings use a local or a global scale.
 void startAutoTransform(Ranking ranking, Transformer transformer)
          Starts an auto transformation using ranking and transformer.
 void stopAutoTransform(Transformer transformer)
          Stops the auto transformation of transfromer.
 void transform(Ranking ranking, Transformer transformer)
          Apply the transformation of transformer on ranking.
 

Method Detail

getModel

RankingModel getModel()
Returns the ranking model of the current workspace.

Returns:
the ranking model of the current workspace

getModel

RankingModel getModel(Workspace workspace)
Returns the ranking model of workspace. If it doesn't exists, it creates one and put it in the workspace.

Parameters:
workspace - the workspace containing the model
Returns:
the ranking model of this workspace

setInterpolator

void setInterpolator(Interpolator interpolator)
Sets the interpolator to be used when transforming values. This is set to the current model only. If the model is changed (i.e. switch workspace), call this again.

Default interpolator implementations can be found in the Interpolator class.

Parameters:
interpolator - the interpolator to use for transformation.

setUseLocalScale

void setUseLocalScale(boolean useLocalScale)
Sets whether rankings use a local or a global scale. When calculating the minimum and maximum value (i.e. the scale) rankings can use the complete graph or only the currently visible graph. When using the visible graph it is called the local scale.

Parameters:
useLocalScale - true for local, false for global

transform

void transform(Ranking ranking,
               Transformer transformer)
Apply the transformation of transformer on ranking. The transformer will modify element's color or size according to the values returned by the ranking. Before passing values to the transformer, they may be transformer by the current interpolator.

Parameters:
ranking - the ranking to give to the transformer
transformer - the transformer to apply on the ranking's elements

startAutoTransform

void startAutoTransform(Ranking ranking,
                        Transformer transformer)
Starts an auto transformation using ranking and transformer. The transformation is continuously applied to the current graph. The operation is the same as transform(), except it is applied in a loop until stopAutoTransform() is called.

Note that auto transformation work only in the current workspace and are paused when the workspace is not current.

Parameters:
ranking - the ranking to give to the transformer
transformer - the transformer to apply on the ranking's elements

stopAutoTransform

void stopAutoTransform(Transformer transformer)
Stops the auto transformation of transfromer.

Parameters:
transformer - the transformer to stop auto transformation

Gephi Toolkit Javadoc