Gephi Toolkit Javadoc

org.gephi.ranking
Class RankingModelImpl

java.lang.Object
  extended by org.gephi.ranking.RankingModelImpl
All Implemented Interfaces:
java.util.EventListener, AttributeListener, RankingModel

public class RankingModelImpl
extends java.lang.Object
implements RankingModel, AttributeListener

Implementation of the RankingModel interface.

Author:
Mathieu Bastian

Nested Class Summary
 class RankingModelImpl.AutoRanking
           
 
Constructor Summary
RankingModelImpl(Workspace workspace)
           
 
Method Summary
 void addAutoRanking(Ranking ranking, Transformer transformer)
           
 void addRankingListener(RankingListener listener)
          Add listener as a ranking listener of this model
 void attributesChanged(AttributeEvent event)
           
 void fireRankingListener(RankingEvent rankingEvent)
           
 java.util.List<RankingModelImpl.AutoRanking> getAutoRankings()
           
 Ranking getAutoTransformerRanking(Transformer transformer)
          If transformer is an auto transformer, returns the ranking associated to it.
 Ranking[] getEdgeRankings()
          Get all rankings for edge elements.
 Interpolator getInterpolator()
          Returns the current interpolator.
 Ranking[] getNodeRankings()
          Get all rankings for node elements.
 Ranking getRanking(java.lang.String elementType, java.lang.String name)
          Return the specific ranking for elementType and with the given name.
 Ranking[] getRankings(java.lang.String elementType)
          Get all rankings for elementType elements.
 Transformer getTransformer(java.lang.String elementType, java.lang.String name)
          Returns the specific transformer for elementType and with the given name.
 Transformer[] getTransformers(java.lang.String elementType)
          Return all transformers specific to elementType.
 Workspace getWorkspace()
          Return the workspace this model is associated with
 void removeAutoRanking(Transformer transformer)
           
 void removeRankingListener(RankingListener listener)
          Remove listener as a ranking listener of this model
 void select()
           
 void setInterpolator(Interpolator interpolator)
           
 void setLocalScale(boolean localScale)
           
 void unselect()
           
 boolean useLocalScale()
          Returns true if rankings are using the currently visible graph as a scale.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RankingModelImpl

public RankingModelImpl(Workspace workspace)
Method Detail

select

public void select()

unselect

public void unselect()

attributesChanged

public void attributesChanged(AttributeEvent event)
Specified by:
attributesChanged in interface AttributeListener

getWorkspace

public Workspace getWorkspace()
Description copied from interface: RankingModel
Return the workspace this model is associated with

Specified by:
getWorkspace in interface RankingModel
Returns:
the workspace of this model

getNodeRankings

public Ranking[] getNodeRankings()
Description copied from interface: RankingModel
Get all rankings for node elements. Rankings are classified with the type of element they are manipulating. Rankings specific to node elements are defined by the Ranking.NODE_ELEMENT.

Specified by:
getNodeRankings in interface RankingModel
Returns:
All rankings for node elements

getEdgeRankings

public Ranking[] getEdgeRankings()
Description copied from interface: RankingModel
Get all rankings for edge elements. Rankings are classified with the type of element they are manipulating. Rankings specific to edge elements are defined by the Ranking.EDGE_ELEMENT.

Specified by:
getEdgeRankings in interface RankingModel
Returns:
All rankings for edge elements

getRankings

public Ranking[] getRankings(java.lang.String elementType)
Description copied from interface: RankingModel
Get all rankings for elementType elements. Rankings are classified with the type of element they are manipulating. If elementType equals Ranking.NODE_ELEMENT this is equivalent to RankingModel.getNodeRankings() method

Specified by:
getRankings in interface RankingModel
Parameters:
elementType - the element type of the rankings
Returns:
All rankings for elementType

getRanking

public Ranking getRanking(java.lang.String elementType,
                          java.lang.String name)
Description copied from interface: RankingModel
Return the specific ranking for elementType and with the given name. Returns null if not found.

Default ranking names can be found in the Ranking interface. For attribute rankings, simply use the column identifier.

Specified by:
getRanking in interface RankingModel
Parameters:
elementType - the element type of the ranking
name - the name of the ranking
Returns:
the found ranking or null if not found

getTransformer

public Transformer getTransformer(java.lang.String elementType,
                                  java.lang.String name)
Description copied from interface: RankingModel
Returns the specific transformer for elementType and with the given name. Returns null if not found.

Default transformers name can be found in the Transformer interface.

Specified by:
getTransformer in interface RankingModel
Parameters:
elementType - the element type of the transformer
name - the name of the transformer
Returns:
the transformer defined as name and elementType or null if not found

getTransformers

public Transformer[] getTransformers(java.lang.String elementType)
Description copied from interface: RankingModel
Return all transformers specific to elementType. A transformer defines his ability to transformer different element types.

Specified by:
getTransformers in interface RankingModel
Parameters:
elementType - the element type of the transformers
Returns:
all transformers working with elementType

getInterpolator

public Interpolator getInterpolator()
Description copied from interface: RankingModel
Returns the current interpolator. The default interpolator is a simple linear interpolation.

Specified by:
getInterpolator in interface RankingModel
Returns:
the current interpolator

setInterpolator

public void setInterpolator(Interpolator interpolator)

addAutoRanking

public void addAutoRanking(Ranking ranking,
                           Transformer transformer)

removeAutoRanking

public void removeAutoRanking(Transformer transformer)

getAutoTransformerRanking

public Ranking getAutoTransformerRanking(Transformer transformer)
Description copied from interface: RankingModel
If transformer is an auto transformer, returns the ranking associated to it.

Specified by:
getAutoTransformerRanking in interface RankingModel
Parameters:
transformer - the transformer to obtain the ranking from
Returns:
the ranking associated to transformer or null

getAutoRankings

public java.util.List<RankingModelImpl.AutoRanking> getAutoRankings()

useLocalScale

public boolean useLocalScale()
Description copied from interface: RankingModel
Returns true if rankings are using the currently visible graph as a scale. If false the complete graph is used to determine minimum and maximum values, the ranking scale.

Specified by:
useLocalScale in interface RankingModel
Returns:
true if using a local scale, false if global scale

setLocalScale

public void setLocalScale(boolean localScale)

addRankingListener

public void addRankingListener(RankingListener listener)
Description copied from interface: RankingModel
Add listener as a ranking listener of this model

Specified by:
addRankingListener in interface RankingModel
Parameters:
listener - the listener to add

removeRankingListener

public void removeRankingListener(RankingListener listener)
Description copied from interface: RankingModel
Remove listener as a ranking listener of this model

Specified by:
removeRankingListener in interface RankingModel
Parameters:
listener - the listener to remove

fireRankingListener

public void fireRankingListener(RankingEvent rankingEvent)

Gephi Toolkit Javadoc