Search this API

Class LabelRanking

  extended by y.layout.LabelRanking
All Implemented Interfaces:

public class LabelRanking
extends java.lang.Object
implements ProfitModel

LabelRanking implements the ranking for edge and node labels.

In this implementation node label positions have no ranking, the profit for all candidates is 1.

The ranking of edge label positions depends on the locations described in the PreferredPlacementDescriptor associated with an edge.


Constructor Summary
          Creates a new instance of LabelRanking.
Method Summary
 double getProfit(LabelCandidate candidate)
          Returns the profit for placing a label using the given LabelCandidate.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public LabelRanking()
Creates a new instance of LabelRanking.

Method Detail


public double getProfit(LabelCandidate candidate)
Description copied from interface: ProfitModel
Returns the profit for placing a label using the given LabelCandidate.

Higher profit means better candidates. Hence, there is a higher probability that the candidate is chosen by a labeling algorithm.

Profits need to have a value between 0 and 1.

Specified by:
getProfit in interface ProfitModel
candidate - the candidate
the profit of the candidate

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.