com.yworks.yfiles.server.graphml.flexio.data
Class RotatedSideSliderEdgeLabelModel

java.lang.Object
  extended bycom.yworks.yfiles.server.graphml.flexio.data.RotatedSideSliderEdgeLabelModel
All Implemented Interfaces:
ILabelModel, IMarkupExtensionFactory

public class RotatedSideSliderEdgeLabelModel
extends java.lang.Object
implements ILabelModel, IMarkupExtensionFactory

A yFiles FLEX client rotated side slider edge label model data object


Nested Class Summary
static class RotatedSideSliderEdgeLabelModel.ModelParameter
          Model parameter for the rotated side slider edge label model.
 
Constructor Summary
RotatedSideSliderEdgeLabelModel()
           
RotatedSideSliderEdgeLabelModel(double distance, double angle, boolean distanceRelativeToEdge, boolean autoRotationEnabled)
           
 
Method Summary
 ILabelModelParameter createDefaultParameter()
          Creates a default parameter that can be used for this model.
 MarkupExtension createMarkupExtension(Lookup lookup)
          Creates a markup extension that can be used instead of the original class.
 ILabelModelParameter createParameterFromSource(int segmentIndex, double segmentRatio, boolean rightOfEdge)
          Creates a parameter that measures the provided segment index from the source side of the edge path.
 ILabelModelParameter createParameterFromTarget(int segmentIndex, double segmentRatio, boolean rightOfEdge)
          Creates a parameter that measures the provided segment index from the target side of the edge path.
 double getAngle()
          The angle the labels are rotated about.
 double getDistance()
          The distance between the label and the edge's path.
 boolean isAutoRotationEnabled()
          Whether edge labels are automatically rotated according to the angle of the corresponding reference edge segment.
 boolean isDistanceRelativeToEdge()
          Whether distance to the edge is interpreted relatively to the edge's path.
 void setAngle(double angle)
          The angle the labels are rotated about.
 void setAutoRotationEnabled(boolean autoRotationEnabled)
          Whether edge labels are automatically rotated according to the angle of the corresponding reference edge segment.
 void setDistance(double distance)
          The distance between the label and the edge's path.
 void setDistanceRelativeToEdge(boolean distanceRelativeToEdge)
          Whether distance to the edge is interpreted relatively to the edge's path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RotatedSideSliderEdgeLabelModel

public RotatedSideSliderEdgeLabelModel()

RotatedSideSliderEdgeLabelModel

public RotatedSideSliderEdgeLabelModel(double distance,
                                       double angle,
                                       boolean distanceRelativeToEdge,
                                       boolean autoRotationEnabled)
Method Detail

getAngle

public double getAngle()
The angle the labels are rotated about. The angle is measured relative to the x-axis.


setAngle

public void setAngle(double angle)
The angle the labels are rotated about. The angle is measured relative to the x-axis.


getDistance

public double getDistance()
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.


setDistance

public void setDistance(double distance)
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.


isDistanceRelativeToEdge

public boolean isDistanceRelativeToEdge()
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 the edge, otherwise they will appear left of the edge.


setDistanceRelativeToEdge

public void setDistanceRelativeToEdge(boolean distanceRelativeToEdge)
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 the edge, otherwise they will appear left of the edge.


isAutoRotationEnabled

public boolean isAutoRotationEnabled()
Whether edge labels are automatically rotated according to the angle of the corresponding reference edge segment.


setAutoRotationEnabled

public void setAutoRotationEnabled(boolean autoRotationEnabled)
Whether edge labels are automatically rotated according to the angle of the corresponding reference edge segment.


createDefaultParameter

public ILabelModelParameter createDefaultParameter()
Description copied from interface: ILabelModel
Creates a default parameter that can be used for this model.

Specified by:
createDefaultParameter in interface ILabelModel
Returns:
A parameter for this model instance.

createParameterFromSource

public ILabelModelParameter createParameterFromSource(int segmentIndex,
                                                      double segmentRatio,
                                                      boolean rightOfEdge)
Creates a parameter that measures the provided segment index from the source side of the edge path.

Parameters:
segmentIndex - The zero-based index of the segment beginning from the source side.
segmentRatio - 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 - Determines whether the label should be placed right or left of the edge.
Returns:
A label parameter that describes the provided parameters for this model instance.

createParameterFromTarget

public ILabelModelParameter createParameterFromTarget(int segmentIndex,
                                                      double segmentRatio,
                                                      boolean rightOfEdge)
Creates a parameter that measures the provided segment index from the target side of the edge path.

Parameters:
segmentIndex - The zero-based index of the segment beginning from the target side.
segmentRatio - 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 - Determines whether the label should be placed right or left of the edge.
Returns:
A label parameter that describes the provided parameters for this model instance.

createMarkupExtension

public MarkupExtension createMarkupExtension(Lookup lookup)
Creates a markup extension that can be used instead of the original class.

Specified by:
createMarkupExtension in interface IMarkupExtensionFactory
Parameters:
lookup - The lookup that shall be considered when creating the markup extension.


Copyright © 2000-2013 yWorks GmbH. All rights reserved