Layout stage that automatically translates label layout information provided by the standard label layout classes IEdgeLabelLayout and INodeLabelLayout to layout data of type LabelLayoutData that is accessible by the keys defined in class LabelLayoutKeys .

Namespace: yWorks.yFiles.Layout
Assembly: yWorks.yFilesSilverlight.Algorithms (in yWorks.yFilesSilverlight.Algorithms.dll) Version: 2.4.0.0

Syntax

C#
public class LabelLayoutTranslator : ILayoutStage, ILayouter
Visual Basic
Public Class LabelLayoutTranslator _ Implements ILayoutStage, ILayouter

Remarks

Layout stage that automatically translates label layout information provided by the standard label layout classes IEdgeLabelLayout and INodeLabelLayout to layout data of type LabelLayoutData that is accessible by the keys defined in class LabelLayoutKeys .

One can use this layout stage as label layouter of a label aware layouter like HierarchicLayouter . This can be done by assigning the stage by an appropriate call to setLabelLayouter .

When writing the LabelLayoutData , the bounds are set relative. In case of a node label the bounds' anchor is relative to the center of the owning node. In case of an edge label the bounds' anchor is relative to the center of the source node of the owning edge.

If writing back node labels and/or writing back edge labels is enabled, the LabelLayoutData is written back to the INodeLabelLayout s and/or IEdgeLabelLayout s.

Per default the bounds are now interpreted absolute but by activating WriteBackRelativeNodeLabelLocation and/or WriteBackRelativeEdgeLabelLocation this can be changed to interpret them relative as explained above.

Note that care must be taken on the choice of label model that is used by the classes IEdgeLabelLayout and INodeLabelLayout . The calculated label positions must be consistent with the label positions allowed by the label model. The best label layout results are achieved by choosing FreeEdgeLabelLayoutModel for edge layouts and FreeNodeLabelLayoutModel for node layouts.

Inheritance Hierarchy

System..::..Object
  yWorks.yFiles.Layout..::..LabelLayoutTranslator

See Also