Search this API

y.layout
Interface NodeLabelLayout

All Superinterfaces:
LabelLayout
All Known Implementing Classes:
DefaultNodeLabelLayout, NodeLabel, NodeLabelLayoutImpl

public interface NodeLabelLayout
extends LabelLayout

NodeLabelLayout defines the properties of one node 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, nodeLayout);

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

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

 

Method Summary
 NodeLabelModel getLabelModel()
          Returns the label model that describes the valid locations for this label.
 
Methods inherited from interface y.layout.LabelLayout
getBox, getModelParameter, getOrientedBox, setModelParameter
 

Method Detail

getLabelModel

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

Returns:
the NodeLabelModel associated with this NodeLabelLayout

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