Packagecom.yworks.yfiles.layout
Interfacepublic interface NodeLabelModel
Implementors DiscreteNodeLabelLayoutModel, EdgeOppositeNodeLabelLayoutModel, FreeNodeLabelLayoutModel

This interface defines the properties of the model associated with a node label layout.

A node label model provides a set of possible candidates for the placement of a node label.



Public Properties
 PropertyDefined By
  defaultParameter : Object
[read-only] Returns a model parameter that encodes the default position of this model's allowed node label positions.
NodeLabelModel
Public Methods
 MethodDefined By
  
createModelParameter(labelBounds:YOrientedRectangle, nodeLayout:NodeLayout):Object
Creates a model parameter that represents the given node label context best within this model.
NodeLabelModel
  
Returns a list of com.yworks.yfiles.layout.NodeLabelCandidate objects each of which describes a valid label position within this model.
NodeLabelModel
  
getLabelPlacement(labelSize:YDimension, nodeLayout:NodeLayout, param:Object):YOrientedRectangle
Returns the oriented label position and bounds encoded by the given model parameter.
NodeLabelModel
Property Detail
defaultParameterproperty
defaultParameter:Object  [read-only]

Returns a model parameter that encodes the default position of this model's allowed node label positions.


Implementation
    public function get defaultParameter():Object

See also

Method Detail
createModelParameter()method
public function createModelParameter(labelBounds:YOrientedRectangle, nodeLayout:NodeLayout):Object

Creates a model parameter that represents the given node label context best within this model. The created model parameter represents the closest parameter representation of the given oriented label bounds that can be achieved within this model.

Parameters

labelBounds:YOrientedRectangle — The bounds of the label for which a parameter representation is sought.
 
nodeLayout:NodeLayout — The layout of the node to which the label belongs.

Returns
Object — A model parameter that can be passed to the getLabelPlacement() method.

See also

getLabelCandidates()method 
public function getLabelCandidates(nl:NodeLabelLayout, nodeLayout:NodeLayout):YList

Returns a list of com.yworks.yfiles.layout.NodeLabelCandidate objects each of which describes a valid label position within this model.

Parameters

nl:NodeLabelLayout — The label layout for which candidates should be generated.
 
nodeLayout:NodeLayout — The layout of the node to which the label belongs.

Returns
YList — A list of com.yworks.yfiles.layout.NodeLabelCandidate objects.

See also

getLabelPlacement()method 
public function getLabelPlacement(labelSize:YDimension, nodeLayout:NodeLayout, param:Object):YOrientedRectangle

Returns the oriented label position and bounds encoded by the given model parameter.

Parameters

labelSize:YDimension — The size of the label that should be placed.
 
nodeLayout:NodeLayout — The layout of the node to which the label belongs.
 
param:Object — The model parameter that describes the abstract position of the label within this model. The parameter must have been generated by this model.

Returns
YOrientedRectangle — the oriented label position and bounds.