Package | com.yworks.graph.model |
Class | public class RotatedSliderEdgeLabelModel |
Inheritance | RotatedSliderEdgeLabelModel Object |
Implements | ILabelModel, ILabelModelParameterProvider, ILabelModelParameterFinder, IMarkupExtensionFactory |
The set of positions can be influenced by specifying the density value that controls the spacing between adjacent label positions. Furthermore, it's possible to specify distance values that control the distance between label and edge and between label and nodes.
Property | Defined By | ||
---|---|---|---|
angle : Number
The angle of the label model. | RotatedSliderEdgeLabelModel | ||
autoRotationEnabled : Boolean
Specifies whether or not edge labels are automatically rotated according to
the angle of the corresponding reference edge segment. | RotatedSliderEdgeLabelModel | ||
distance : Number
The distance between the label's box and the edge's path. | RotatedSliderEdgeLabelModel | ||
distanceRelativeToEdge : Boolean
A value indicating whether the distance to the edge is interpreted
relatively to the edge's path. | RotatedSliderEdgeLabelModel |
Method | Defined By | ||
---|---|---|---|
RotatedSliderEdgeLabelModel(distance:Number = 0, angle:Number = 0, distanceRelativeToEdge:Boolean = true, autoRotationEnabled:Boolean = true)
Initializes a new instance of the RotatedSliderEdgeLabelModel class. | RotatedSliderEdgeLabelModel | ||
calcPoints(rect:IOrientedRectangle):Array [static]
Calculates the corner points of an oriented rectangle
| RotatedSliderEdgeLabelModel | ||
[static]
Calculates the angle between two vectors in radians
| RotatedSliderEdgeLabelModel | ||
A model parameter that encodes the default position of this model's
allowed edge label positions. | RotatedSliderEdgeLabelModel | ||
Creates a markup extension that can be used instead of the original class. | RotatedSliderEdgeLabelModel | ||
createParameterFromSource(segmentIndex:int, segmentRatio:Number):ILabelModelParameter
Creates a parameter that measures the provided segment index from the source side of the edge path. | RotatedSliderEdgeLabelModel | ||
createParameterFromTarget(segmentIndex:int, segmentRatio:Number):ILabelModelParameter
Creates a parameter that measures the provided segment index from the target side of the edge path. | RotatedSliderEdgeLabelModel | ||
findBestParameter(label:ILabel, model:ILabelModel, labelLayout:IOrientedRectangle):ILabelModelParameter
Tries to find a parameter that best matches the given layout for the
provided label instance. | RotatedSliderEdgeLabelModel | ||
[static]
Finds the intersection point between two infinite straight lines, one defined by two points, one defined
by an anchor point and a direction vector. | RotatedSliderEdgeLabelModel | ||
Provides a lookup context for the given combination of label and parameter. | RotatedSliderEdgeLabelModel | ||
Calculates the geometry in form of an IOrientedRectangle
for a given label using the given model parameter. | RotatedSliderEdgeLabelModel | ||
Returns an iterator over a set of possible ILabelModelParameter
instances that can be used for the given label and model. | RotatedSliderEdgeLabelModel | ||
lookup(type:Class):Object
Returns an instance that implements the given type or null. | RotatedSliderEdgeLabelModel |
angle | property |
angle:Number
The angle of the label model.
The default value is 0
.
public function get angle():Number
public function set angle(value:Number):void
autoRotationEnabled | property |
autoRotationEnabled:Boolean
Specifies whether or not edge labels are automatically rotated according to the angle of the corresponding reference edge segment.
By default, this feature is enabled.
The default value is
.true
public function get autoRotationEnabled():Boolean
public function set autoRotationEnabled(value:Boolean):void
distance | property |
distance:Number
The distance between the label's box and the edge's path.
The interpretation of positive/negative values depends on property
distanceRelativeToEdge
.
public function get distance():Number
public function set distance(value:Number):void
See also
distanceRelativeToEdge | property |
distanceRelativeToEdge:Boolean
A value indicating whether the distance to the edge is interpreted relatively to the edge's path.
If this value is set, the label is placed to the left of the edge segment
(relative to the segment direction) if
distance
is less than 0
and to the right of the
edge segment if distance
is greater than 0
.
If this value is not set, the label is placed below the edge segment (in
geometric sense) if distance
is less than 0
and
above the edge segment if distance
is greater than
0
.
The default value is
.true
public function get distanceRelativeToEdge():Boolean
public function set distanceRelativeToEdge(value:Boolean):void
See also
RotatedSliderEdgeLabelModel | () | Constructor |
public function RotatedSliderEdgeLabelModel(distance:Number = 0, angle:Number = 0, distanceRelativeToEdge:Boolean = true, autoRotationEnabled:Boolean = true)
Initializes a new instance of the RotatedSliderEdgeLabelModel
class.
distance:Number (default = 0 ) — The distance to the edge. Set to 0 to create a centered model.
| |
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.
|
See also
calcPoints | () | method |
public static function calcPoints(rect:IOrientedRectangle):Array
Calculates the corner points of an oriented rectangle
Parameters
rect:IOrientedRectangle |
Array |
calculateAngle | () | method |
public static function calculateAngle(v1:IPoint, v2:IPoint):Number
Calculates the angle between two vectors in radians
Parameters
v1:IPoint | |
v2:IPoint |
Number |
createDefaultParameter | () | method |
public function createDefaultParameter():ILabelModelParameter
A model parameter that encodes the default position of this model's allowed edge label positions.
ReturnsILabelModelParameter |
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.
|
MarkupExtension |
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. 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.
|
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. 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.
|
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.
|
ILabelModelParameter — A non-null parameter that can be used for the label to approximate the provided layout.
|
findRayIntersection | () | method |
public static function findRayIntersection(l1:IPoint, l2:IPoint, anchor:IPoint, rayDirection:IPoint):IPoint
Finds the intersection point between two infinite straight lines, one defined by two points, one defined by an anchor point and a direction vector.
Parameters
l1:IPoint — The first point of the first line.
| |
l2:IPoint — The second point of the first line.
| |
anchor:IPoint — The anchor point of the second line.
| |
rayDirection:IPoint — The direction vector of the second line.
|
IPoint — The intersection point if an intersection has been found, or null otherwise.
|
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.
|
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
|
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.
|
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
|
Object — an instance that is assignable to type or null
|