public class EdgeLabel extends AbstractLabel
Modifier and Type | Class and Description |
---|---|
static class |
EdgeLabel.ParamModel
The parameter model for the edge label.
|
CENTER, HORIZONTALPOS_CENTER, HORIZONTALPOS_LEFT, HORIZONTALPOS_RIGHT, LEFT, RIGHT, STYLE_BOLD, STYLE_ITALIC, STYLE_PLAIN, VERTICALPOS_BOTTOM, VERTICALPOS_CENTER, VERTICALPOS_TOP
Constructor and Description |
---|
EdgeLabel() |
Modifier and Type | Method and Description |
---|---|
EdgeLabel.ParamModel |
applyOnFirstSegment()
Apply the label on the first segment.
|
EdgeLabel.ParamModel |
applyOnLastSegment()
Apply the label on the last segment.
|
EdgeLabel.ParamModel |
applyOnSegment(int segment)
Set the segment on which the label is applied.
|
EdgeLabel |
clone() |
float |
getAnchorX()
Return the label X anchor.
|
float |
getAnchorY()
Return the label Y anchor.
|
java.lang.String |
getBackgroundColor()
Return the text background color.
|
java.lang.String |
getBorderColor()
Return the text border color.
|
java.awt.Insets |
getInsets()
Return the insets.
|
EdgeLabel.ParamModel |
getOrCreateParameterModel()
Return the parameter model, creating it if it does not exist.
|
EdgeLabel.ParamModel |
getParameterModel()
Return the parameter model.
|
boolean |
hasParameterModel()
Return true if there is a rotation model.
|
void |
setAnchorX(float anchorX)
Set the label X anchor.
|
void |
setAnchorY(float anchorY)
Set the label Y anchor.
|
EdgeLabel.ParamModel |
setAutoFlip(boolean autoFlip)
Set the auto-flip property of the model.
|
EdgeLabel.ParamModel |
setAutoRotate(boolean autoRotate)
Set the auto-rotate property of the model.
|
boolean |
setBackgroundColor(java.awt.Color backgroundColor)
Set the text background color.
|
boolean |
setBackgroundColor(java.lang.String backgroundColor)
Set the text background color.
|
boolean |
setBorderColor(java.awt.Color borderColor)
Set the text border color.
|
boolean |
setBorderColor(java.lang.String borderColor)
Set the text border color.
|
EdgeLabel.ParamModel |
setDistance(float distance)
Set the label distance from the edge.
|
void |
setInsets(java.awt.Insets insets)
Set the insets.
|
EdgeLabel.ParamModel |
setOnSegmentAutomatic(boolean isAutomatic)
Set if the label is applied automatically on the best segment depending on the ratio.
|
void |
setParameterModel(EdgeLabel.ParamModel paramModel)
Set the parameter model.
|
EdgeLabel.ParamModel |
setPosition(short position)
Set the label position.
|
EdgeLabel.ParamModel |
setRatio(float ratio)
Set the label ratio on the edge.
|
void |
setRotationModel(EdgeLabel.ParamModel rotationModel)
Deprecated.
|
EdgeLabel.ParamModel |
setSmartPosition(short position,
boolean onEdge)
Set the label smart position.
|
createLabelPlacement, createLabelPlacement, getAlignment, getFontFamily, getFontSize, getFontStyle, getHorizontalTextPosition, getLabel, getLabeledElement, getLabelPlacement, getLabelPlacementType, getMinimumHeight, getMinimumSize, getMinimumWidth, getTextColor, getVerticalTextPosition, isEmpty, setAlignment, setFontFamily, setFontSize, setFontStyle, setHorizontalTextPosition, setLabel, setLabeledElement, setTextColor, setTextColor, setVerticalTextPosition
public EdgeLabel clone()
clone
in class AbstractLabel
public EdgeLabel.ParamModel applyOnFirstSegment()
public EdgeLabel.ParamModel applyOnLastSegment()
public EdgeLabel.ParamModel applyOnSegment(int segment)
segment
- the segmentpublic EdgeLabel.ParamModel setOnSegmentAutomatic(boolean isAutomatic)
isAutomatic
- true if the label is applied automatically on the best segment depending on the ratiopublic EdgeLabel.ParamModel setRatio(float ratio)
ratio
- the ratiopublic boolean setBackgroundColor(java.awt.Color backgroundColor)
backgroundColor
- the colorpublic boolean setBackgroundColor(java.lang.String backgroundColor)
backgroundColor
- the colorpublic java.lang.String getBackgroundColor()
public boolean setBorderColor(java.awt.Color borderColor)
borderColor
- the colorpublic boolean setBorderColor(java.lang.String borderColor)
borderColor
- the colorpublic java.lang.String getBorderColor()
public void setInsets(java.awt.Insets insets)
insets
- the insetspublic java.awt.Insets getInsets()
public void setParameterModel(EdgeLabel.ParamModel paramModel)
paramModel
- the parameter modelpublic void setRotationModel(EdgeLabel.ParamModel rotationModel)
setParameterModel(org.girod.jgraphml.model.EdgeLabel.ParamModel)
rotationModel
- the rotation modelpublic EdgeLabel.ParamModel getParameterModel()
public EdgeLabel.ParamModel getOrCreateParameterModel()
public EdgeLabel.ParamModel setPosition(short position)
position
- the positionEdgeLabelPosition
public EdgeLabel.ParamModel setDistance(float distance)
distance
- the distancepublic EdgeLabel.ParamModel setAutoRotate(boolean autoRotate)
autoRotate
- true if the label auto-rotatespublic EdgeLabel.ParamModel setAutoFlip(boolean autoFlip)
autoFlip
- true if the label auto-flipspublic EdgeLabel.ParamModel setSmartPosition(short position, boolean onEdge)
position
- the positiononEdge
- true if the label must be alongside the edgeEdgeLabel.ParamModel.setSmartPosition(short, boolean)
public boolean hasParameterModel()
public void setAnchorX(float anchorX)
anchorX
- the anchorXpublic float getAnchorX()
public void setAnchorY(float anchorY)
anchorY
- the anchorpublic float getAnchorY()
Copyright © 2021, 2022 Herve Girod. All Rights Reserved. Documentation and source under the BSD 3-Clause licence