Packagecom.yworks.yfiles.layout.labeling
Classpublic class MISLabelingAlgorithm
InheritanceMISLabelingAlgorithm Inheritance AbstractLabelingAlgorithm Inheritance AbstractLayoutStage Inheritance YObject Inheritance Object
Subclasses GreedyMISLabeling, SALabeling

Solving labeling problem by reducing it to the maximum independent set problem.



Public Properties
 PropertyDefined By
 InheritedapplyPostprocessing : Boolean
Getter: Returns true if the postprocessing step is applied.
AbstractLabelingAlgorithm
 InheritedautoFlippingEnabled : Boolean
Determines whether or not edge labels associated with a "free" label model (see for example y.view.SmartEdgeLabelModel) should be automatically flipped if they would be upside-down.
AbstractLabelingAlgorithm
  boxesToNodesInternal : Map
[read-only]
MISLabelingAlgorithm
  conflictGraphInternal : Graph
[read-only]
MISLabelingAlgorithm
 InheritedcoreLayouter : Layouter
Specifies the core layouter.
AbstractLayoutStage
  customProfitModelRatio : Number
Getter: Returns the custom profit model ratio.
MISLabelingAlgorithm
 InheritededgeGroupOverlapAllowed : Boolean
Getter: Returns whether edge labels may overlap with edges belonging to the same edge group.
AbstractLabelingAlgorithm
  graph : LayoutGraph
MISLabelingAlgorithm
 InheritedmoveInternalNodeLabels : Boolean
Specifies true if the labeling algorithm is allowed to move internal node labels.
AbstractLabelingAlgorithm
  nodesToIDInternal : NodeMap
[read-only]
MISLabelingAlgorithm
  optimizationStrategy : int
Specifies the optimization strategy of the labeling algorithm.
MISLabelingAlgorithm
 InheritedplaceEdgeLabels : Boolean
Specifies whether labels assigned to edges in a graph should be placed or ignored.
AbstractLabelingAlgorithm
 InheritedplaceNodeLabels : Boolean
Specifies whether labels assigned to nodes in a graph should be placed or ignored.
AbstractLabelingAlgorithm
 InheritedprofitModel : ProfitModel
Sets the profit model that is used to rank the available positions for each label.
AbstractLabelingAlgorithm
 Inheritedrects : YList
[read-only] Returns the set of all generated candidate rectangles.
AbstractLabelingAlgorithm
 InheritedremoveEdgeOverlaps : Boolean
Specifies how label candidates which overlap with edges are handled.
AbstractLabelingAlgorithm
 InheritedremoveNodeOverlaps : Boolean
Specifies how label candidates which overlap with nodes are handled.
AbstractLabelingAlgorithm
 InheritedselectedLabelsDpKey : Object
Getter: Returns the labeling selection DataProvider key.
AbstractLabelingAlgorithm
 InheritedstoreRects : Boolean
Specifies whether the candidate rectangles should be stored to be retrieved.
AbstractLabelingAlgorithm
 InheriteduseAlternativeSideHandling : Boolean
Getter: Returns true if the preference on which side of an edge a corresponding label should be placed is interpreted by human perception instead of always following the edge from source to target.
AbstractLabelingAlgorithm
Protected Properties
 PropertyDefined By
  boxesToNodes : Map
MISLabelingAlgorithm
  conflictGraph : Graph
the conflict graph
MISLabelingAlgorithm
  nodesToBoxes : NodeMap
holds for each node in the conflictGraph the corresponding LabelCandidate
MISLabelingAlgorithm
  nodesToID : NodeMap
holds for each node in the conflictGraph the corresponding integer index of the Label[]
MISLabelingAlgorithm
Public Methods
 MethodDefined By
  
MISLabelingAlgorithm(init:Boolean = true)
MISLabelingAlgorithm
 Inherited
canLayout(graph:LayoutGraph):Boolean
[override] Returns true.
AbstractLabelingAlgorithm
 Inherited
doLayout(graph:LayoutGraph):void
[override] Place the labels in the graph.
AbstractLabelingAlgorithm
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
MISLabelingAlgorithm
 Inherited
Returns the profit model that is used to rank the available positions for each label.
AbstractLabelingAlgorithm
 Inherited
hashCode():int
YObject
 Inherited
Place the labels in the graph.
AbstractLabelingAlgorithm
 Inherited
labelSome(gl:LayoutGraph, key:Object):void
Place a subset of the labels.
AbstractLabelingAlgorithm
 Inherited
labelSome2(gl:LayoutGraph, nodeLabels:YList, edgeLabels:YList):void
Place some labels in the graph.
AbstractLabelingAlgorithm
Protected Methods
 MethodDefined By
  
Creates a node map which assigns to each node the profit.
MISLabelingAlgorithm
 Inherited
canLayoutCore(graph:LayoutGraph):Boolean
Queries the core layouter whether or not the given graph can be laid out.
AbstractLayoutStage
 Inherited
checkGroupNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given group node object is zero.
AbstractLabelingAlgorithm
 Inherited
checkNodeSize(layout:GraphLayout, node:Object):void
This method throws an com.yworks.bridge.util.IllegalArgumentException if the width/height of the given node object is zero.
AbstractLabelingAlgorithm
  
Creates one edge between two nodes if the corresponding label candidates are intersecting.
MISLabelingAlgorithm
 Inherited
Invokes the layout routine of the core layouter.
AbstractLayoutStage
  
Calculates the overlapping factor between a label candidate and an edge segment.
MISLabelingAlgorithm
  
Calculates the overlapping factor between a label candidate and a node halo.
MISLabelingAlgorithm
  
Calculates the overlapping factor between two label candidates.
MISLabelingAlgorithm
  
Calculates the overlapping factor between a label candidate and a node.
MISLabelingAlgorithm
 Inherited
AbstractLabelingAlgorithm
 Inherited
AbstractLayoutStage
 Inherited
AbstractLayoutStage
  
MISLabelingAlgorithm
Public Constants
 ConstantDefined By
 InheritedLABEL_MODEL_DPKEY : Object = y.layout.labeling.AbstractLabelingAlgorithm.LABEL_MODEL_DPKEY
[static] com.yworks.yfiles.base.DataProvider key to specify for each com.yworks.yfiles.layout.EdgeLabelLayout s and each com.yworks.yfiles.layout.NodeLabelLayout a replacement com.yworks.yfiles.layout.EdgeLabelModel or com.yworks.yfiles.layout.NodeLabelModel, respectively, that is used by the labeling algorithm instead of the original label model.
AbstractLabelingAlgorithm
  OPTIMIZATION_BALANCED : int = 0
[static] Use a balanced optimization strategy.
MISLabelingAlgorithm
  OPTIMIZATION_EDGE_OVERLAP : int = 3
[static] Use an optimization strategy that especially reduces overlaps between labels and edges.
MISLabelingAlgorithm
  OPTIMIZATION_LABEL_OVERLAP : int = 2
[static] Use an optimization strategy that especially reduces overlaps between labels.
MISLabelingAlgorithm
  OPTIMIZATION_NODE_OVERLAP : int = 1
[static] Use an optimization strategy that especially reduces overlaps between labels and nodes as well as labels and node halos.
MISLabelingAlgorithm
  OPTIMIZATION_NONE : int = 4
[static] Use no optimization strategy.
MISLabelingAlgorithm
Property Detail
boxesToNodesproperty
protected var boxesToNodes:Map

boxesToNodesInternalproperty 
boxesToNodesInternal:Map  [read-only]


Implementation
    public function get boxesToNodesInternal():Map
conflictGraphproperty 
protected var conflictGraph:Graph

the conflict graph

conflictGraphInternalproperty 
conflictGraphInternal:Graph  [read-only]


Implementation
    public function get conflictGraphInternal():Graph
customProfitModelRatioproperty 
customProfitModelRatio:Number

Getter: Returns the custom profit model ratio.

Setter: If an optimization strategy is set (see optimizationStrategy) as well as a profit model (see profitModel), the specified ratio (0 <= customProfitModelRatio <= 1) determines the ratio between the internal profit (ip) depending on the used optimization strategy as well as the profit returned by the specified profit model (sp), i.e., overall profit = customProfitModelRatio * sp + (1 - customProfitModelRatio) * ip.


Implementation
    public function get customProfitModelRatio():Number
    public function set customProfitModelRatio(value:Number):void

See also

graphproperty 
public var graph:LayoutGraph

nodesToBoxesproperty 
protected var nodesToBoxes:NodeMap

holds for each node in the conflictGraph the corresponding LabelCandidate

nodesToIDproperty 
protected var nodesToID:NodeMap

holds for each node in the conflictGraph the corresponding integer index of the Label[]

nodesToIDInternalproperty 
nodesToIDInternal:NodeMap  [read-only]


Implementation
    public function get nodesToIDInternal():NodeMap
optimizationStrategyproperty 
optimizationStrategy:int

Specifies the optimization strategy of the labeling algorithm. Possible values are: OPTIMIZATION_NONE, OPTIMIZATION_BALANCED, OPTIMIZATION_NODE_OVERLAP, OPTIMIZATION_EDGE_OVERLAP and OPTIMIZATION_LABEL_OVERLAP.


Implementation
    public function get optimizationStrategy():int
    public function set optimizationStrategy(value:int):void

See also

Constructor Detail
MISLabelingAlgorithm()Constructor
public function MISLabelingAlgorithm(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
assignProfit()method
protected function assignProfit():NodeMap

Creates a node map which assigns to each node the profit.

Returns
NodeMap
createEdges()method 
protected function createEdges():void

Creates one edge between two nodes if the corresponding label candidates are intersecting.

foundEdgeOverlap()method 
protected function foundEdgeOverlap(lc:LabelCandidate, e:Edge, eSegment:LineSegment):void

Calculates the overlapping factor between a label candidate and an edge segment.

Parameters

lc:LabelCandidate
 
e:Edge
 
eSegment:LineSegment

foundHaloOverlap()method 
protected function foundHaloOverlap(lc:LabelCandidate, n:Node, haloRect:YRectangle):void

Calculates the overlapping factor between a label candidate and a node halo.

Parameters

lc:LabelCandidate
 
n:Node
 
haloRect:YRectangle

foundLabelOverlap()method 
protected function foundLabelOverlap(lc1:LabelCandidate, lc2:LabelCandidate, e:Edge):void

Calculates the overlapping factor between two label candidates. Default value is 1.0.

Parameters

lc1:LabelCandidate
 
lc2:LabelCandidate
 
e:Edge

foundNodeOverlap()method 
protected function foundNodeOverlap(lc:LabelCandidate, n:Node, nBox:YRectangle):void

Calculates the overlapping factor between a label candidate and a node.

Parameters

lc:LabelCandidate
 
n:Node
 
nBox:YRectangle

getClass()method 
override public function getClass():Class

Returns
Class
initMISLabelingAlgorithm()method 
protected final function initMISLabelingAlgorithm():void

Constant Detail
OPTIMIZATION_BALANCEDConstant
public static const OPTIMIZATION_BALANCED:int = 0

Use a balanced optimization strategy.

OPTIMIZATION_EDGE_OVERLAPConstant 
public static const OPTIMIZATION_EDGE_OVERLAP:int = 3

Use an optimization strategy that especially reduces overlaps between labels and edges.

OPTIMIZATION_LABEL_OVERLAPConstant 
public static const OPTIMIZATION_LABEL_OVERLAP:int = 2

Use an optimization strategy that especially reduces overlaps between labels.

OPTIMIZATION_NODE_OVERLAPConstant 
public static const OPTIMIZATION_NODE_OVERLAP:int = 1

Use an optimization strategy that especially reduces overlaps between labels and nodes as well as labels and node halos.

OPTIMIZATION_NONEConstant 
public static const OPTIMIZATION_NONE:int = 4

Use no optimization strategy.