|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwaver.core.network.BaseUI<T>
twaver.network.ElementUI<Link>
twaver.network.LinkUI
public class LinkUI
连线UI元素,用于绘制连线,主体使用图形元素(ShapeUI)
Link
Field Summary | |
---|---|
protected ShapeUI |
body
连线主体元素 |
protected LabelUI |
linkBundleLabel
连线绑定时,显示文本标签 |
Fields inherited from class twaver.network.ElementUI |
---|
alarm, isLayouting, label, network |
Fields inherited from class twaver.core.network.BaseUI |
---|
anchorPoint, bodyOffsetX, bodyOffsetY, bounds, data, invalidateAnchorPointFlag, invalidateLocationFlag, invalidateRenderFlag, invalidateSizeFlag, location, stateOutline, stateOutlineColor, visible |
Constructor Summary | |
---|---|
LinkUI(Link link,
Network network)
连线UI元素,用于绘制连线,主体使用图形元素(ShapeUI) |
Method Summary | |
---|---|
protected void |
calculatePath(java.util.List<PathSegment> pathSegments)
生成线段图形数据,该函数会计算连线的路径,包括节点边缘对齐,连线展开分布,自环等多种样式,具体的计算操作交由#drawLink(Rect, Rect, List)和#drawLoopedLink(Rect, List)处理 生成的结果将存放在传入的pathSegments参数中 |
void |
checkPoints()
检查连线,是否需要重新生成路径和图形 |
protected void |
createChildren()
创建孩子元素,比如文本标签,告警标签等等 |
protected boolean |
doValidate()
执行生效动作,比如孩子元素的位置布局,范围大小的确定等等 |
protected void |
drawLink(Rect fromBounds,
Rect toBounds,
java.util.List<PathSegment> pathSegments)
绘制连线,仅用于非自环的情况,计算连线的路径,存放在pathSegments参数中 |
protected void |
drawLoopedLink(Rect agentBounds,
java.util.List<PathSegment> pathSegments)
计算自环时连线的走向,结果存放在参数pathSegments中 |
float |
getLength()
路径长度 |
float |
getLineWidth()
路径线条宽度 |
Point |
getLinkBundleOffset()
获取连线绑定偏移量 如果该连线不参与捆绑,或者连线没有展开,则返回null |
java.util.List<PathSegment> |
getPathSegments()
获取路径 |
void |
invalidateLinkBundle()
无效连线绑定状态 |
void |
invalidatePoints()
无效连线路径,调用此方法后,连线会在需要的时候重新生成路径和图形 |
boolean |
isDrawBackground()
|
boolean |
isDrawOutline()
|
boolean |
isInvalidatePoints()
连线是否无效 |
boolean |
isLayoutByAnchorPoint()
|
boolean |
isLayoutByPath()
是否沿线布局 |
boolean |
isRelativeLocation()
|
protected boolean |
onElementPropertyChange(java.lang.String propertyName,
PropertyChangeEvent evt)
网元属性变化时,调用此函数 |
protected boolean |
onLinkPropertyChange(java.lang.String propertyName,
PropertyChangeEvent evt)
连线属性变化处理函数 |
protected void |
resetShape()
|
protected void |
resetStyles()
重新加载网元UI的所有样式 |
protected void |
validateLinkBundle()
生效连线绑定 |
protected void |
validatePoints()
生成连线图形数据,生成Path图形 |
Methods inherited from class twaver.core.network.BaseUI |
---|
checkBackground, checkOutline, draw, drawBackgroundAndBorder, drawBody, drawStateOutline, drawStateOutline, getAnchorPoint, getAnchorPosition, getAngle, getBackgroundColor, getBounds, getCornerRadius, getData, getLocation, getMeasuredHeight, getMeasuredWidth, getOffset, getOutlineColor, getOutlineWidth, getRenderColor, getSelectionBorder, getSelectionBorderColor, getStateOutline, getStateOutlineColor, intersect, intersectPointer, invalidateAnchorPoint, invalidateLocation, invalidatePointer, invalidateRender, invalidateSize, isDrawStateOutline, isInvalidate, isInvalidateAnchorPoint, isInvalidateLocation, isInvalidateSize, isRotatable, isSelected, isShowOnTop, measureAnchorPosition, onDrawBackgroundAndBorder, perLocation, resetPaint, setAnchorPosition, setBackgroundColor, setBackgroundShader, setBounds, setBounds, setCornerRadius, setData, setLocation, setLocation, setMeasuredSize, setOffset, setOutline, setOutlineColor, setPadding, setPointerVisible, setPointerWidth, setRotatable, setShowOnTop, setStateOutline, setStateOutlineColor, setVisible, styleSelectionPaint, toAbsoluteRect, toLocalPoint, toLocalRect, validateLocation, validatePointer, validateRender |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ShapeUI body
protected LabelUI linkBundleLabel
Constructor Detail |
---|
public LinkUI(Link link, Network network)
link
- 连线元素network
- 拓扑图Method Detail |
---|
public void invalidateLinkBundle()
validateLinkBundle()
protected void validateLinkBundle()
invalidateLinkBundle()
protected void resetStyles()
ElementUI
resetStyles
in class ElementUI<Link>
public boolean isDrawBackground()
isDrawBackground
in class twaver.core.network.BaseUI<Link>
public boolean isDrawOutline()
isDrawOutline
in class twaver.core.network.BaseUI<Link>
protected void createChildren()
ElementUI
createChildren
in class ElementUI<Link>
ElementUI.initialize()
protected void validatePoints()
calculatePath(List)
protected void calculatePath(java.util.List<PathSegment> pathSegments)
pathSegments
- 计算结果存放在此集合中validatePoints()
,
drawLink(Rect, Rect, List)
,
drawLoopedLink(Rect, List)
protected void drawLink(Rect fromBounds, Rect toBounds, java.util.List<PathSegment> pathSegments)
fromBounds
- 起始端节点大小toBounds
- 终端节点大小pathSegments
- calculatePath(List)
protected void drawLoopedLink(Rect agentBounds, java.util.List<PathSegment> pathSegments)
agentBounds
- pathSegments
- public Point getLinkBundleOffset()
protected boolean onElementPropertyChange(java.lang.String propertyName, PropertyChangeEvent evt)
ElementUI
onElementPropertyChange
in class ElementUI<Link>
propertyName
- 属性名evt
- 属性变化事件
ElementUI.onElementPropertyChange(PropertyChangeEvent)
protected boolean onLinkPropertyChange(java.lang.String propertyName, PropertyChangeEvent evt)
propertyName
- 属性名称evt
- 属性变化事件
public boolean isLayoutByAnchorPoint()
isLayoutByAnchorPoint
in class twaver.core.network.BaseUI<Link>
protected boolean doValidate()
ElementUI
doValidate
in class ElementUI<Link>
ElementUI.layout()
,
ElementUI.measure()
public void checkPoints()
invalidatePoints()
,
validatePoints()
public void invalidatePoints()
checkPoints()
,
isInvalidatePoints()
,
validatePoints()
public boolean isInvalidatePoints()
invalidatePoints()
,
checkPoints()
,
validatePoints()
public java.util.List<PathSegment> getPathSegments()
IPathUI
getPathSegments
in interface IPathUI
public boolean isLayoutByPath()
IPathUI
isLayoutByPath
in interface IPathUI
public float getLength()
IPathUI
getLength
in interface IPathUI
public float getLineWidth()
IPathUI
getLineWidth
in interface IPathUI
protected void resetShape()
resetShape
in class twaver.core.network.BaseUI<Link>
public boolean isRelativeLocation()
isRelativeLocation
in class twaver.core.network.BaseUI<Link>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |