|
||||||||||
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<Node>
twaver.network.NodeUI
public class NodeUI
节点图形元素,用于绘制网元节点
Field Summary | |
---|---|
protected ImageUI |
imageUI
图片元素 节点主体可以是图片,也可以是图形,可以使用 Node.setContentType(int) 进行切换
默认使用imageUI作为主体,imageUI不只支持图片,还包括其他数据,如gif动画,以及任意android.graphics.drawable.Drawable 类型,更多可参考ImageUI |
protected ShapeUI |
shapeUI
图形元素 节点主体可以是图片,也可以是图形,可以使用 Node.setContentType(int) 进行切换
如果使用多边形或者线段作为主体,则用shapeUI作为body,此外ShapeNodeUI也使用shapeUI作为body |
Fields inherited from class twaver.network.ElementUI |
---|
alarm, body, 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 | |
---|---|
NodeUI(Node node,
Network network)
节点图形元素,用于绘制网元节点 |
Method Summary | |
---|---|
protected boolean |
byShape()
是否使用shapeUI作为网元主体,如果网元是ShapeNode类型,或者contentType属性为Consts.CONTENT_TYPE_SHAPE,则返回true |
protected boolean |
checkBody()
检查主体类型,以确定使用imageUI还是shapeUI作为网元主体 |
protected boolean |
checkNodeStyle(java.lang.String propertyName,
PropertyChangeEvent evt)
|
protected void |
createChildren()
创建孩子元素,比如文本标签,告警标签等等 |
protected boolean |
doValidate()
执行生效动作,比如孩子元素的位置布局,范围大小的确定等等 |
void |
invalidateLinks()
|
void |
invalidateLocation()
|
protected void |
onBodyChange()
主体UI元素更改时,回调此函数,比如网元内容类型从image改为shape时,主体元素会从ImageUI换成ShapeUI |
protected boolean |
onElementPropertyChange(java.lang.String propertyName,
PropertyChangeEvent evt)
网元属性变化时,调用此函数 |
protected void |
resetNodeProperties()
重设节点相关样式 |
protected void |
resetShapeData()
重新设置图形类型,默认取样式Styles.SHAPE_TYPE属性,只在网元主体为shapeUI是起作用 |
protected void |
resetStyles()
重新加载网元UI的所有样式 |
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, invalidatePointer, invalidateRender, invalidateSize, isDrawBackground, isDrawOutline, isDrawStateOutline, isInvalidate, isInvalidateAnchorPoint, isInvalidateLocation, isInvalidateSize, isLayoutByAnchorPoint, isRelativeLocation, isRotatable, isSelected, isShowOnTop, measureAnchorPosition, onDrawBackgroundAndBorder, perLocation, resetPaint, resetShape, 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 shapeUI
Node.setContentType(int)
进行切换
如果使用多边形或者线段作为主体,则用shapeUI作为body,此外ShapeNodeUI也使用shapeUI作为body
Node.setContentType(int)
,
Consts.CONTENT_TYPE_SHAPE
protected ImageUI imageUI
Node.setContentType(int)
进行切换
默认使用imageUI作为主体,imageUI不只支持图片,还包括其他数据,如gif动画,以及任意android.graphics.drawable.Drawable
类型,更多可参考ImageUI
ImageUI
,
IImage
,
twaver.Utils#registerImage(...)
,
Node.setContentType(int)
,
Consts.CONTENT_TYPE_SHAPE
Constructor Detail |
---|
public NodeUI(Node node, Network network)
node
- 节点network
- 拓扑图Method Detail |
---|
protected boolean checkBody()
Node.setContentType(int)
protected boolean byShape()
Node.setContentType(int)
protected void createChildren()
ElementUI
createChildren
in class ElementUI<Node>
ElementUI.initialize()
protected void resetStyles()
ElementUI
resetStyles
in class ElementUI<Node>
protected void resetNodeProperties()
protected void onBodyChange()
ElementUI
onBodyChange
in class ElementUI<Node>
Node.setContentType(int)
protected void resetShapeData()
Styles.SHAPE_TYPE
protected boolean doValidate()
ElementUI
doValidate
in class ElementUI<Node>
ElementUI.layout()
,
ElementUI.measure()
protected boolean onElementPropertyChange(java.lang.String propertyName, PropertyChangeEvent evt)
ElementUI
onElementPropertyChange
in class ElementUI<Node>
propertyName
- 属性名evt
- 属性变化事件
ElementUI.onElementPropertyChange(PropertyChangeEvent)
protected boolean checkNodeStyle(java.lang.String propertyName, PropertyChangeEvent evt)
public void invalidateLinks()
public void invalidateLocation()
invalidateLocation
in class twaver.core.network.BaseUI<Node>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |