Packagecom.yworks.graph.model
Classpublic class RotatedSideSliderEdgeLabelModel
InheritanceRotatedSideSliderEdgeLabelModel Inheritance Object
Implements ILabelModel, ILabelModelParameterProvider, ILabelModelParameterFinder, IMarkupExtensionFactory

An edge label model that allows placement of labels at a set of continuous positions along both sides of an edge path.

Furthermore, it's possible to specify distance values that control the distance between label and edge and between label and nodes.



Public Properties
 PropertyDefined By
  angle : Number
RotatedSideSliderEdgeLabelModel
  autoRotationEnabled : Boolean
RotatedSideSliderEdgeLabelModel
  distance : Number
RotatedSideSliderEdgeLabelModel
  distanceRelativeToEdge : Boolean
RotatedSideSliderEdgeLabelModel
Public Methods
 MethodDefined By
  
RotatedSideSliderEdgeLabelModel(distance:Number = 0, angle:Number = 0, distanceRelativeToEdge:Boolean = true, autoRotationEnabled:Boolean = true)
Initializes a new instance of the RotatedSideSliderEdgeLabelModel class.
RotatedSideSliderEdgeLabelModel
  
Creates a default parameter that can be used for this model.
RotatedSideSliderEdgeLabelModel
  
Creates a markup extension that can be used instead of the original class.
RotatedSideSliderEdgeLabelModel
  
createParameterFromSource(segmentIndex:int, segmentRatio:Number, rightOfEdge:Boolean):ILabelModelParameter
Creates a parameter that measures the provided segment index from the source side of the edge path.
RotatedSideSliderEdgeLabelModel
  
createParameterFromTarget(segmentIndex:int, segmentRatio:Number, rightOfEdge:Boolean):ILabelModelParameter
Creates a parameter that measures the provided segment index from the target side of the edge path.
RotatedSideSliderEdgeLabelModel
  
Tries to find a parameter that best matches the given layout for the provided label instance.
RotatedSideSliderEdgeLabelModel
  
Provides a lookup context for the given combination of label and parameter.
RotatedSideSliderEdgeLabelModel
  
Calculates the geometry in form of an IOrientedRectangle for a given label using the given model parameter.
RotatedSideSliderEdgeLabelModel
  
Returns an iterator over a set of possible ILabelModelParameter instances that can be used for the given label and model.
RotatedSideSliderEdgeLabelModel
  
lookup(type:Class):Object
Returns an instance that implements the given type or null.
RotatedSideSliderEdgeLabelModel
Property Detail
angleproperty
angle:Number


Implementation
    public function get angle():Number
    public function set angle(value:Number):void
autoRotationEnabledproperty 
autoRotationEnabled:Boolean


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


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


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

Initializes a new instance of the RotatedSideSliderEdgeLabelModel class.

Parameters
distance:Number (default = 0) — The distance to the edge.
 
angle:Number (default = 0) — The angle of the label's rotation in radians.
 
distanceRelativeToEdge:Boolean (default = true) — If set to true distance is interpreted relative to edge.
 
autoRotationEnabled:Boolean (default = true) — If set to true auto rotation is enabled.
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.
createMarkupExtension()method 
public function createMarkupExtension(context:ILookup):MarkupExtension

Creates a markup extension that can be used instead of the original class.

Parameters

context:ILookup — The context that shall be considered when creating the markup extension.

Returns
MarkupExtension
createParameterFromSource()method 
public function createParameterFromSource(segmentIndex:int, segmentRatio:Number, rightOfEdge:Boolean):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. A ratio of 0.0 will place the label at the source side of the segment, a ratio of 1.0 at the target side. Ratios < 0.0 or > 1.0 will be interpreted as absolute values in world coordinates.
 
rightOfEdge:Boolean — Determines whether the label should be placed right or left of the edge.

Returns
ILabelModelParameter — A label parameter that describes the provided parameters for this model instance.
createParameterFromTarget()method 
public function createParameterFromTarget(segmentIndex:int, segmentRatio:Number, rightOfEdge:Boolean):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. A ratio of 0.0 will place the label at the target side of the segment, a ratio of 1.0 at the source side. Ratios < 0.0 or > 1.0 will be interpreted as absolute values in world coordinates.
 
rightOfEdge:Boolean — Determines whether the label should be placed right or left of the edge.

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(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