Packagecom.yworks.graph.model
Classpublic class RotatingEdgeLabelModel
InheritanceRotatingEdgeLabelModel Inheritance Object
Implements ILabelModel, ILabelModelParameterProvider
Deprecated: Please Use RotatedSliderEdgeLabelModel

A label model for edge labels that uses a ratio on the edge's path to determine the position of the label.

This model allows for specifying the angle between the edge's path and the label's baseline.



Public Properties
 PropertyDefined By
  angle : Number
Gets or sets the angle of the label relative to the edge's path.
RotatingEdgeLabelModel
  distance : Number
Gets or sets a property that determines the distance between the label's center and the anchor point on the edge's path.
RotatingEdgeLabelModel
  edgeRelativeDistance : Boolean
Gets or sets a property that determines how the distance value should be interpreted.
RotatingEdgeLabelModel
Public Methods
 MethodDefined By
  
RotatingEdgeLabelModel(distance:Number = 0, angle:Number = 0, edgeRelativeDistance:Boolean = true)
Creates a new instance of RotatingEdgeLabelModel.
RotatingEdgeLabelModel
  
Creates a default parameter that can be used for this model.
RotatingEdgeLabelModel
  
Creates a parameter for this model using a ratio value between 0.0 and 1.0.
RotatingEdgeLabelModel
  
Provides a lookup context for the given combination of label and parameter.
RotatingEdgeLabelModel
  
Calculates the geometry in form of an IOrientedRectangle for a given label using the given model parameter.
RotatingEdgeLabelModel
  
Returns an iterator over a set of possible ILabelModelParameter instances that can be used for the given label and model.
RotatingEdgeLabelModel
  
lookup(type:Class):Object
Returns an instance that implements the given type or null.
RotatingEdgeLabelModel
Property Detail
angleproperty
angle:Number

Gets or sets the angle of the label relative to the edge's path.


Implementation
    public function get angle():Number
    public function set angle(value:Number):void
distanceproperty 
distance:Number

Gets or sets a property that determines the distance between the label's center and the anchor point on the edge's path.

A distance of 0 makes the label appear centered on the edge's path. Depending on the value of the edgeRelativeDistance property, the distance is interpreted differently: If the distance is interpreted relatively, a positive distance makes the label appear at the left hand of the edge. If the distance is interpreted absolutely, positive values make the label appear on top of the edge's path, while negative values make it appear below the path.


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

See also

edgeRelativeDistanceproperty 
edgeRelativeDistance:Boolean

Gets or sets a property that determines how the distance value should be interpreted.

If the distance is interpreted relatively, a positive distance makes the label appear at the left hand of the edge. If the distance is interpreted absolutely, positive values make the label appear on top of the edge's path, while negative values make it appear below the path.


Implementation
    public function get edgeRelativeDistance():Boolean
    public function set edgeRelativeDistance(value:Boolean):void

See also

Constructor Detail
RotatingEdgeLabelModel()Constructor
public function RotatingEdgeLabelModel(distance:Number = 0, angle:Number = 0, edgeRelativeDistance:Boolean = true)

Creates a new instance of RotatingEdgeLabelModel.

Parameters
distance:Number (default = 0) — The distance between the label's center and the anchor point on the edge's path.
 
angle:Number (default = 0) — The angle of the label relative to the edge's path.
 
edgeRelativeDistance:Boolean (default = true) — A property that determines how the distance value should be interpreted.

See also

Method Detail
createDefaultParameter()method
public function createDefaultParameter():ILabelModelParameter

Creates a default parameter that can be used for this model.

Returns
ILabelModelParameter — A parameter for this model instance.
createRatio()method 
public function createRatio(ratio:Number):ILabelModelParameter

Creates a parameter for this model using a ratio value between 0.0 and 1.0.

Parameters

ratio:Number — The ratio where the label should be placed along the edge's path.

Returns
ILabelModelParameter — The newly created parameter.
getContext()method 
public function getContext(label:ILabel, parameter:ILabelModelParameter):ILookup

Provides a lookup context for the given combination of label and parameter.

Parameters

label:ILabel — The label to use in the context.
 
parameter:ILabelModelParameter — The parameter to use for the label in the context.

Returns
ILookup — An implementation of the ILookup interface that can be used to query additional aspects of the label/parameter combination.
getGeometry()method 
public function getGeometry(modelParameter:ILabelModelParameter, label:ILabel):IOrientedRectangle

Calculates the geometry in form of an IOrientedRectangle for a given label using the given model parameter.

Parameters

modelParameter:ILabelModelParameter — A parameter that has been created by this model. This is typically the parameter that yielded this instance through its ILabelModelParameter.model property.
 
label:ILabel — The label to calculate the geometry for

Returns
IOrientedRectangle — An instance that describes the geometry. This is typically an instance designed as a flyweight, so clients should not cache the instance but store the values if they need a snapshot for later use
getParameters()method 
public function getParameters(label:ILabel, model:ILabelModel):Iterator

Returns an iterator over a set of possible ILabelModelParameter instances that can be used for the given label and model.

Parameters

label:ILabel — The label instance to use.
 
model:ILabelModel — The model to provide parameters for.

Returns
Iterator — A possibly empty iterator over a set of label model parameters.
lookup()method 
public function lookup(type:Class):Object

Returns an instance that implements the given type or null.

Typically, this method will be called in order to obtain a different view or aspect of the current instance. This is quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or compile time constraints. An instance implementing this method is not required to return non-null implementations for the types, nor does it have to return the same instance any time. Also it depends on the type and context whether the instance returned stays up to date or needs to be reobtained for subsequent use.

Parameters

type:Class — the type for which an instance shall be returned

Returns
Object — an instance that is assignable to type or null