18
18
You should have received a copy of the GNU Affero General Public License
19
19
along with Gephi. If not, see <http://www.gnu.org/licenses/>.
21
21
package org.gephi.ranking.api;
23
import javax.swing.event.ChangeListener;
24
import org.gephi.data.attributes.api.AttributeColumn;
23
import org.gephi.project.api.Workspace;
26
* Model for ranking data.
28
* That includes the list of rankings currently available,
29
* separated in categories with different element types. It can returns all rankings
30
* for nodes or edges, or any element type.
32
* Rankings are builds thanks to <code>RankingBuilder</code> implementation. Implement
33
* a new <code>RankingBuider</code> service to create new rankings.
35
* The model also hosts the currently defined interpolator.
28
39
* @author Mathieu Bastian
30
41
public interface RankingModel {
32
public NodeRanking getDegreeRanking();
34
public NodeRanking getInDegreeRanking();
36
public NodeRanking getOutDegreeRanking();
38
public NodeRanking getNodeAttributeRanking(AttributeColumn column);
40
public EdgeRanking getEdgeAttributeRanking(AttributeColumn column);
42
public NodeRanking[] getNodeRanking();
44
public EdgeRanking[] getEdgeRanking();
46
public void addChangeListener(ChangeListener changeListener);
48
public void removeChangeListener(ChangeListener changeListener);
44
* Get all rankings for node elements. Rankings are classified with the type
45
* of element they are manipulating. Rankings specific to node elements are
46
* defined by the <code>Ranking.NODE_ELEMENT</code>.
47
* @return All rankings for node elements
49
public Ranking[] getNodeRankings();
52
* Get all rankings for edge elements. Rankings are classified with the type
53
* of element they are manipulating. Rankings specific to edge elements are
54
* defined by the <code>Ranking.EDGE_ELEMENT</code>.
55
* @return All rankings for edge elements
57
public Ranking[] getEdgeRankings();
60
* Get all rankings for <code>elementType</code> elements. Rankings are
61
* classified with the type of element they are manipulating. If
62
* <code>elementType</code> equals <code>Ranking.NODE_ELEMENT</code> this is
63
* equivalent to {@link RankingModel#getNodeRankings() } method
64
* @param elementType the element type of the rankings
65
* @return All rankings for <code>elementType</code>
67
public Ranking[] getRankings(String elementType);
70
* Return the specific ranking for <code>elementType</code> and with
71
* the given <code>name</code>. Returns <code>null</code> if not found.
73
* Default ranking names can be found in the {@link Ranking} interface. For
74
* attribute rankings, simply use the column identifier.
75
* @param elementType the element type of the ranking
76
* @param name the name of the ranking
77
* @return the found ranking or <code>null</code> if not found
79
public Ranking getRanking(String elementType, String name);
82
* Return all transformers specific to <code>elementType</code>. A transformer
83
* defines his ability to transformer different element types.
84
* @param elementType the element type of the transformers
85
* @return all transformers working with <code>elementType</code>
87
public Transformer[] getTransformers(String elementType);
90
* Returns the specific transformer for <code>elementType</code> and with the
91
* given <code>name</code>. Returns <code>null</code> if not found.
93
* Default transformers name can be found in the {@link Transformer} interface.
94
* @param elementType the element type of the transformer
95
* @param name the name of the transformer
96
* @return the transformer defined as <code>name</code> and <code>elementType</code>
97
* or <code>null</code> if not found
99
public Transformer getTransformer(String elementType, String name);
102
* Returns the current interpolator. The default interpolator is a simple
103
* linear interpolation.
104
* @return the current interpolator
106
public Interpolator getInterpolator();
109
* Return the workspace this model is associated with
110
* @return the workspace of this model
112
public Workspace getWorkspace();
115
* If <code>transformer</code> is an auto transformer, returns the ranking
117
* @param transformer the transformer to obtain the ranking from
118
* @return the ranking associated to <code>transformer</code> or <code>null</code>
120
public Ranking getAutoTransformerRanking(Transformer transformer);
123
* Add <code>listener</code> as a ranking listener of this model
124
* @param listener the listener to add
126
public void addRankingListener(RankingListener listener);
129
* Remove <code>listener</code> as a ranking listener of this model
130
* @param listener the listener to remove
132
public void removeRankingListener(RankingListener listener);