documentationfor yFiles for HTML 3.0.0.3

ILabelDefaults

Interface used by IGraph and the like to declare and obtain the defaults for labels.

Inheritance Hierarchy
ILabelDefaults

Remarks

Note that changing these defaults does not change properties of already created model items. Rather, only items created after the change are affected.

Examples

Setting defaults for labels
// Labels on nodes, edges, and ports have different ILabelDefaults instances.
// These can be retrieved from their owner type's defaults

// the defaults for node labels can be set on the ILabelDefaults instance
// found at the Labels property of the node defaults
graph.nodeDefaults.labels.layoutParameter = InteriorNodeLabelModel.CENTER
graph.nodeDefaults.labels.style = new LabelStyle()

// the defaults for edge labels can be set on the ILabelDefaults instance
// found at the Labels property of the edge defaults
graph.edgeDefaults.labels.layoutParameter =
  new EdgeSegmentLabelModel().createParameterFromCenter()
graph.edgeDefaults.labels.style = new LabelStyle()

// defaults for port labels can be set on the ILabelDefaults instance
// found at the Labels property of their owner type's defaults
graph.nodeDefaults.ports.labels.layoutParameter =
  new InsideOutsidePortLabelModel().createInsideParameter()
graph.edgeDefaults.ports.labels.layoutParameter =
  FreePortLabelModel.CENTER

Type Details

yFiles module
view

See Also

Properties

Methods