|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwaver.model.Data
twaver.model.Element
twaver.model.Node
twaver.model.ShapeNode
public class ShapeNode
多边形节点,继承于Node
,实现了IShape
接口,可以添加路径片段,通过添加路径片段,围成一个多边形,
可以填充颜色或者渐变,如果不填充,则表现为线条样式
默认UI类为ShapeNodeUI
Field Summary | |
---|---|
protected java.util.List<PathSegment> |
pathSegments
路径片段集合 |
Fields inherited from class twaver.model.Node |
---|
anchorPosition, calculateSize, contentType, host, image, invalidateAnchorPointFlag, invalidateImageFlag, invalidateSizeFlag, location, size |
Fields inherited from class twaver.model.Element |
---|
alarmState, attachments, layerId, name, uiClass |
Fields inherited from class twaver.model.Data |
---|
parent |
Constructor Summary | |
---|---|
ShapeNode()
多边形节点,继承于 Node ,实现了IShape 接口,可以添加路径片段,通过添加路径片段,围成一个多边形,
可以填充颜色或者渐变,如果不填充,则表现为线条样式
默认UI类为ShapeNodeUI |
Method Summary | |
---|---|
void |
addPathSegement(PathSegment path)
添加路径片段 |
void |
addPathSegement(PathSegment path,
int index)
添加路径片段 |
void |
addPathSegments(PathSegment[] ps)
添加一组路径片段 |
void |
firePathSegmentsChanged()
派发路径片段变化事件 |
void |
firePathSegmentsChanged(java.util.List<PathSegment> oldValue)
派发路径片段变化事件 |
PathSegment |
getPathSegment(int index)
获取指定序号的路径片段 |
java.util.List<PathSegment> |
getPathSegments()
获取路径片段集合 |
boolean |
hasPathSegments()
是否有路径片段 |
void |
movePathSegment(int index,
float dx,
float dy)
移动路径片段 |
void |
movePathSegments(float dx,
float dy)
移动路径片段 |
void |
removePathSegment(int index)
删除路径片段 |
java.util.List<PathSegment> |
toPathSegments()
克隆所有的路径片段,可以避免对原始集合的修改 |
protected void |
validateSize()
计算网元大小, Node.calculateSize |
Methods inherited from class twaver.model.Element |
---|
addAttachment, clearAttachments, firePropertyChangeEvent, getAlarmState, getAlarmState, getAttachment, getAttachments, getLayerId, getName, getStyle, getStyles, getStyles, getUIClass, hasAlarm, hasAttachment, hasStyle, isVisible, isVisible, removeAttachment, removeStyle, setAlarmState, setLayerId, setName, setStyle, setUIClass, updateAttachment, updateAttachment |
Methods inherited from class twaver.model.Data |
---|
addChild, addChild, beforeEvent, clearChildren, get, getChildAt, getChildIndex, getChildren, getChildrenCount, getId, getParent, getProperties, getProperties, hasChildren, hashCode, isDescendantOf, onChildAdd, onChildRemove, onChildrenClear, onEvent, remove, removeChild, set, setChildIndex, setListener, setParent, setParent, setProperty, toChildren, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.List<PathSegment> pathSegments
Constructor Detail |
---|
public ShapeNode()
Node
,实现了IShape
接口,可以添加路径片段,通过添加路径片段,围成一个多边形,
可以填充颜色或者渐变,如果不填充,则表现为线条样式
默认UI类为ShapeNodeUI
Method Detail |
---|
public void addPathSegement(PathSegment path)
IShape
addPathSegement
in interface IShape
public void addPathSegement(PathSegment path, int index)
IShape
addPathSegement
in interface IShape
public void firePathSegmentsChanged(java.util.List<PathSegment> oldValue)
oldValue
- public void firePathSegmentsChanged()
IShape
firePathSegmentsChanged
in interface IShape
public void addPathSegments(PathSegment[] ps)
IShape
addPathSegments
in interface IShape
ps
- 路径片段数组public void removePathSegment(int index)
IShape
removePathSegment
in interface IShape
public PathSegment getPathSegment(int index)
IShape
getPathSegment
in interface IShape
public void movePathSegment(int index, float dx, float dy)
IShape
movePathSegment
in interface IShape
public java.util.List<PathSegment> toPathSegments()
IShape
toPathSegments
in interface IShape
public void movePathSegments(float dx, float dy)
IShape
movePathSegments
in interface IShape
dx
- 偏移量dy
- 偏移量public boolean hasPathSegments()
IShape
hasPathSegments
in interface IShape
public java.util.List<PathSegment> getPathSegments()
IShape
getPathSegments
in interface IShape
protected void validateSize()
Node
Node.calculateSize
validateSize
in class Node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |