Search this API

y.layout
Class SliderEdgeLabelModel.ModelParameter

java.lang.Object
  extended by y.layout.SliderEdgeLabelModel.ModelParameter
Enclosing class:
SliderEdgeLabelModel

public static class SliderEdgeLabelModel.ModelParameter
extends Object

Encodes the model parameters for the two slider edge label models specified by SliderEdgeLabelModel.CENTER_SLIDER and SliderEdgeLabelModel.SIDE_SLIDER.


Constructor Summary
SliderEdgeLabelModel.ModelParameter(int s, double r, YVector v, byte p, double aRatio)
          Returns a new instance of ModelParameter that has the given characteristics.
 
Method Summary
 double getAbsRatio()
          Returns the label's absolute ratio with respect to the entire length of the edge path.
 byte getLabelPosition()
          Returns the label's symbolic ratio specifier, i.e., one of SliderEdgeLabelModel.CENTER_RATIO, SliderEdgeLabelModel.LEFT_RATIO, or SliderEdgeLabelModel.RIGHT_RATIO.
 YVector getOffsetVector()
          Returns the offset vector between the label and the edge segment relative to which it is placed.
 double getRatio()
          Returns the label's ratio with respect to the length of the edge segment relative to which it is placed.
 int getSegmentNumber()
          Returns the index of the edge segment relative to which the label is placed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SliderEdgeLabelModel.ModelParameter

public SliderEdgeLabelModel.ModelParameter(int s,
                                           double r,
                                           YVector v,
                                           byte p,
                                           double aRatio)
Returns a new instance of ModelParameter that has the given characteristics.

Parameters:
s - The index of the edge segment relative to which the label should be placed.
r - The label's ratio with respect to the length of the edge segment relative to which it should be placed.
v - The offset vector between the label and the edge segment relative to which it should be placed.
p - One of the symbolic ratio specifiers SliderEdgeLabelModel.CENTER_RATIO, SliderEdgeLabelModel.LEFT_RATIO, or SliderEdgeLabelModel.RIGHT_RATIO.
aRatio - The label's absolute ratio with respect to the entire length of the edge path.
Note that this value is derived from the ratio value.
Method Detail

getSegmentNumber

public int getSegmentNumber()
Returns the index of the edge segment relative to which the label is placed.

The index is zero-based and starts at the edge's source end. Let s denote the number of edge segments. Then, a negative index value i denotes the segment with index s + i.


getRatio

public double getRatio()
Returns the label's ratio with respect to the length of the edge segment relative to which it is placed.


getOffsetVector

public YVector getOffsetVector()
Returns the offset vector between the label and the edge segment relative to which it is placed.

The offset vector describes the distance between the edge segment and the label's upper-left corner.


getLabelPosition

public byte getLabelPosition()
Returns the label's symbolic ratio specifier, i.e., one of SliderEdgeLabelModel.CENTER_RATIO, SliderEdgeLabelModel.LEFT_RATIO, or SliderEdgeLabelModel.RIGHT_RATIO.


getAbsRatio

public double getAbsRatio()
Returns the label's absolute ratio with respect to the entire length of the edge path.


© Copyright 2000-2013,
yWorks GmbH.
All rights reserved.