Search this API

y.layout
Interface EdgeLabelLayout

All Superinterfaces:
LabelLayout, LabelLayoutConstants
All Known Implementing Classes:
EdgeLabel, EdgeLabelLayoutImpl

public interface EdgeLabelLayout
extends LabelLayout, LabelLayoutConstants

EdgeLabelLayout defines the properties of one edge label from the perspective of a labeling algorithm.

Note: To avoid inconsistencies, changing the model parameter should always be combined with updating the corresponding oriented box.

 // label box for which we set the model parameter
 OrientedRectangle newLabelBox = ...

 // calculate the model parameter for the label box
 Object param = labelLayout.getLabelModel().createModelParameter(newLabelBox, edgeLayout, sourceLayout, targetLayout);

 // calculate the label box for the model parameter. Note that it may differ from newLabelBox!
 OrientedRectangle labelPlacement = labelLayout.getLabelModel().getLabelPlacement(newLabelBox.getSize(), edgeLayout, sourceLayout, targetLayout, param);

 // update the oriented box
 labelLayout.getOrientedBox().adoptValues(labelPlacement);
 

 

Field Summary
 
Fields inherited from interface y.layout.LabelLayoutConstants
PLACE_ANYWHERE, PLACE_AT_CENTER, PLACE_AT_SOURCE, PLACE_AT_SOURCE_PORT, PLACE_AT_TARGET, PLACE_AT_TARGET_PORT, PLACE_LEFT_OF_EDGE, PLACE_ON_EDGE, PLACE_RIGHT_OF_EDGE, PLACEMENT_ALONG_EDGE_MASK, PLACEMENT_ON_SIDE_OF_EDGE_MASK
 
Method Summary
 EdgeLabelModel getLabelModel()
          Returns the label model that describes the valid locations for this label.
 PreferredPlacementDescriptor getPreferredPlacementDescriptor()
          Returns the preferred placement for this edge label, which can be considered by layout algorithms.
 
Methods inherited from interface y.layout.LabelLayout
getBox, getModelParameter, getOrientedBox, setModelParameter
 

Method Detail

getLabelModel

EdgeLabelModel getLabelModel()
Returns the label model that describes the valid locations for this label.

Returns:
the EdgeLabelModel associated with this EdgeLabelLayout

getPreferredPlacementDescriptor

PreferredPlacementDescriptor getPreferredPlacementDescriptor()
Returns the preferred placement for this edge label, which can be considered by layout algorithms.

Returns:
the PreferredPlacementDescriptor for this EdgeLabelLayout

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