return rankingModelImpl;
}
public void transform(Transformer transformer) {
AbstractTransformer abstractTransformer = (AbstractTransformer) transformer;
Ranking ranking = abstractTransformer.getRanking();
RankingResultImpl rankingResult = new RankingResultImpl();
rankingResult.transformer = transformer;
rankingResult.ranking = ranking;
Graph graph = Lookup.getDefault().lookup(GraphController.class).getModel().getGraphVisible();
DynamicModel dynamicModel = rankingModelImpl.getDynamicModel();
boolean refreshed = RankingFactory.refreshRanking((AbstractRanking) ranking, graph, dynamicModel != null ? dynamicModel.getVisibleInterval() : null);
if (ranking instanceof NodeRanking) {
((AbstractRanking) ranking).setGraph(graph);
for (Node node : graph.getNodes().toArray()) {
Object rank = ranking.getValue(node);
Object result = null;
if (rank != null) {
float normalizedValue = ranking.normalize(rank);
if (transformer.isInBounds(normalizedValue)) {
result = transformer.transform(node, normalizedValue);
}
}
rankingResult.addResult(node, rank, result);
}
} else {
((AbstractRanking) ranking).setGraph(graph);
for (Edge edge : graph.getEdges().toArray()) {
Object rank = ranking.getValue(edge);
Object result = null;
if (rank != null) {
float normalizedValue = ranking.normalize(rank);
if (transformer.isInBounds(normalizedValue)) {
result = transformer.transform(edge, normalizedValue);
}
}
rankingResult.addResult(edge, rank, result);