Packagecom.yworks.graph.model
Classpublic class SliderEdgeLabelModel
InheritanceSliderEdgeLabelModel Inheritance Object
Implements ILabelModel, ILabelModelParameterProvider, ILabelModelParameterFinder
Deprecated: Please Use RotatedSliderEdgeLabelModel

An edge label model that can be used for labels along the path of an edge. This model allows for specifying the index of the segment of the edge and the distance from the edge, as well as the angle of the label.



Public Properties
 PropertyDefined By
  angle : Number
The angle the labels are rotated about.
SliderEdgeLabelModel
  distance : Number
Gets or sets the distance between the label and the edge's path.
SliderEdgeLabelModel
  edgeRelativeDistance : Boolean
Whether distance to the edge is interpreted relatively to the edge's path.
SliderEdgeLabelModel
Public Methods
 MethodDefined By
  
SliderEdgeLabelModel(distance:Number = 0, angle:Number = 0, edgeRelativeDistance:Boolean = true)
Creates a new instance of this.
SliderEdgeLabelModel
  
Creates a default parameter that can be used for this model.
SliderEdgeLabelModel
  
createParameterFromSource(segmentIndex:int, segmentRatio:Number):ILabelModelParameter
Creates a parameter that measures the provided segment index from the source side of the edge path.
SliderEdgeLabelModel
  
createParameterFromTarget(segmentIndex:int, segmentRatio:Number):ILabelModelParameter
Creates a parameter that measures the provided segment index from the target side of the edge path.
SliderEdgeLabelModel
  
Tries to find a parameter that best matches the given layout for the provided label instance.
SliderEdgeLabelModel
  
Provides a lookup context for the given combination of label and parameter.
SliderEdgeLabelModel
  
Calculates the geometry in form of an IOrientedRectangle for a given label using the given model parameter.
SliderEdgeLabelModel
  
Returns an iterator over a set of possible ILabelModelParameter instances that can be used for the given label and model.
SliderEdgeLabelModel
  
lookup(type:Class):Object
Returns an instance that implements the given type or null.
SliderEdgeLabelModel
Property Detail
angleproperty
angle:Number

The angle the labels are rotated about. The angle is measured relative to the x-axis. The default value is 0.0.


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

Gets or sets the distance between the label and the edge's path. A positive value will make the label appear above or right of the edge, whereas negative values will make it appear on the opposite side of the edge's path. A value of 0 will make the label's appear centered on the edge's path.


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

Whether distance to the edge is interpreted relatively to the edge's path. If this is set to false, positive distance values will make the label appear above or right the edge. If this is set to true, positive distance values will make the label appear above the edge if the edge is drawn from left to right (and keep the relative position if the edge is rotated).


Implementation
    public function get edgeRelativeDistance():Boolean
    public function set edgeRelativeDistance(value:Boolean):void
Constructor Detail
SliderEdgeLabelModel()Constructor
public function SliderEdgeLabelModel(distance:Number = 0, angle:Number = 0, edgeRelativeDistance:Boolean = true)

Creates a new instance of this.

Parameters
distance:Number (default = 0) — The distance between the label and the edge's path.
 
angle:Number (default = 0) — The angle, the labels are rotated about, relative to the x axis
 
edgeRelativeDistance:Boolean (default = true) — Whether the labels distance is interpreted relatively to the edge's path
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.
createParameterFromSource()method 
public function createParameterFromSource(segmentIndex:int, segmentRatio:Number):ILabelModelParameter

Creates a parameter that measures the provided segment index from the source side of the edge path.

Parameters

segmentIndex:int — The zero-based index of the segment beginning from the source side.
 
segmentRatio:Number — The ratio at which to place the label at the segment.

Returns
ILabelModelParameter — A label parameter that describes the provided parameters for this model instance.
createParameterFromTarget()method 
public function createParameterFromTarget(segmentIndex:int, segmentRatio:Number):ILabelModelParameter

Creates a parameter that measures the provided segment index from the target side of the edge path.

Parameters

segmentIndex:int — The zero-based index of the segment beginning from the target side.
 
segmentRatio:Number — The ratio at which to place the label at the segment.

Returns
ILabelModelParameter — A label parameter that describes the provided parameters for this model instance.
findBestParameter()method 
public function findBestParameter(label:ILabel, model:ILabelModel, labelLayout:IOrientedRectangle):ILabelModelParameter

Tries to find a parameter that best matches the given layout for the provided label instance.

This method may not necessarily find a parameter that matches the provided layout exactly. Implementations may choose to simply return the model's default parameter but may never return null.

Parameters

label:ILabel — The label to find a parameter for.
 
model:ILabelModel — The model instance to use. This should be the instance this instance has been obtained from.
 
labelLayout:IOrientedRectangle — The anticipated layout for the label.

Returns
ILabelModelParameter — A non-null parameter that can be used for the label to approximate the provided layout.
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(parameter:ILabelModelParameter, label:ILabel):IOrientedRectangle

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

Parameters

parameter: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