twaver.model
Class ShapeNode

java.lang.Object
  extended by twaver.model.Data
      extended by twaver.model.Element
          extended by twaver.model.Node
              extended by twaver.model.ShapeNode
All Implemented Interfaces:
IChildList, IData, IHandler<PropertyChangeEvent>, IListener<PropertyChangeEvent>, Identifiable, IShape
Direct Known Subclasses:
ShapeSubnetwork

public class ShapeNode
extends Node
implements IShape

多边形节点,继承于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.Node
addFollower, calculateBounds, checkLinkAgent, clearFollowers, getAgentLinks, getAnchorPoint, getAnchorPosition, getCalculateSize, getContentType, getFollowerCount, getFollowerIndex, getFollowers, getFollowers, getFromAgentLinks, getFromLinks, getHost, getImage, getLinks, getLocation, getLoopedLinks, getSize, getSize, getToAgentLinks, getToLinks, getX, getY, hasAgentLinks, hasFollowers, invalidateVisibility, onParentChanged, removeFollower, setAnchorPosition, setContentType, setFollowerIndex, setHost, setImage, setLocation, setLocation, setSize, setSize, toFollowers
 
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

pathSegments

protected java.util.List<PathSegment> pathSegments
路径片段集合

Constructor Detail

ShapeNode

public ShapeNode()
多边形节点,继承于Node,实现了IShape接口,可以添加路径片段,通过添加路径片段,围成一个多边形, 可以填充颜色或者渐变,如果不填充,则表现为线条样式 默认UI类为ShapeNodeUI

Method Detail

addPathSegement

public void addPathSegement(PathSegment path)
Description copied from interface: IShape
添加路径片段

Specified by:
addPathSegement in interface IShape

addPathSegement

public void addPathSegement(PathSegment path,
                            int index)
Description copied from interface: IShape
添加路径片段

Specified by:
addPathSegement in interface IShape

firePathSegmentsChanged

public void firePathSegmentsChanged(java.util.List<PathSegment> oldValue)
派发路径片段变化事件

Parameters:
oldValue -

firePathSegmentsChanged

public void firePathSegmentsChanged()
Description copied from interface: IShape
派发路径片段变化事件

Specified by:
firePathSegmentsChanged in interface IShape

addPathSegments

public void addPathSegments(PathSegment[] ps)
Description copied from interface: IShape
添加一组路径片段

Specified by:
addPathSegments in interface IShape
Parameters:
ps - 路径片段数组

removePathSegment

public void removePathSegment(int index)
Description copied from interface: IShape
删除路径片段

Specified by:
removePathSegment in interface IShape

getPathSegment

public PathSegment getPathSegment(int index)
Description copied from interface: IShape
获取指定序号的路径片段

Specified by:
getPathSegment in interface IShape
Returns:
该序号的路径片段

movePathSegment

public void movePathSegment(int index,
                            float dx,
                            float dy)
Description copied from interface: IShape
移动路径片段

Specified by:
movePathSegment in interface IShape

toPathSegments

public java.util.List<PathSegment> toPathSegments()
Description copied from interface: IShape
克隆所有的路径片段,可以避免对原始集合的修改

Specified by:
toPathSegments in interface IShape
Returns:
克隆路径片段的集合

movePathSegments

public void movePathSegments(float dx,
                             float dy)
Description copied from interface: IShape
移动路径片段

Specified by:
movePathSegments in interface IShape
Parameters:
dx - 偏移量
dy - 偏移量

hasPathSegments

public boolean hasPathSegments()
Description copied from interface: IShape
是否有路径片段

Specified by:
hasPathSegments in interface IShape
Returns:
是否存在路径片段

getPathSegments

public java.util.List<PathSegment> getPathSegments()
Description copied from interface: IShape
获取路径片段集合

Specified by:
getPathSegments in interface IShape
Returns:
路径片段集合

validateSize

protected void validateSize()
Description copied from class: Node
计算网元大小, Node.calculateSize

Overrides:
validateSize in class Node