EdgeLabel label = edge.setLabel("The Label"); EdgeLabel.ParamModel model = label.getParameterModel(); model.setAutoFlip(true); model.setAutoRotate(true);If you don't want to do it for all edges, you can access the default values of these parameters through the DiagramDefaults.
EdgeLabel label = edge.setLabel("The Label"); EdgeLabel.ParamModel model = label.getParameterModel(); model.setPosition(EdgeLabelPosition.POSITION_HEAD);or more simply:
EdgeLabel label = edge.setLabel("The Label"); label.setPosition(EdgeLabelPosition.POSITION_HEAD);On a horizontal edge, you will have the following result:
EdgeLabel label = edge.setLabel("The Label"); EdgeLabel.ParamModel model = label.getParameterModel(); model.setPosition(EdgeLabelPosition.POSITION_TAIL);or more simply:
EdgeLabel label = edge.setLabel("The Label"); label.setPosition(EdgeLabelPosition.POSITION_TAIL);On a horizontal edge, you will have the following result:
EdgeLabel label = edge.setLabel("The Label"); EdgeLabel.ParamModel model = label.getParameterModel(); model.setAutoFlip(true); model.setAutoRotate(true);or more simply:
EdgeLabel label = edge.setLabel("The Label"); label.setAutoFlip(true); label.setAutoRotate(true);or even:
EdgeLabel label = edge.setLabel("The Label"); label.setSmartPosition(EdgeLabelPosition.POSITION_HEAD, true);You will have the following result:
Copyright 2021 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence