public class ShapeNode extends Node
Subclasses can override method createShape to return customized shape.
Modifier and Type | Field and Description |
---|---|
protected boolean |
isAdjusting |
protected java.util.List |
points |
protected java.util.List |
segments |
protected java.awt.Shape |
shape |
protected int |
shapeNodeType |
agentLinksSet, allAgentLinks, allFollowers, allLinks, fromAgentLinks, fromLinks, linksSet, loopLinks, toAgentLinks, toLinks
xLocation, yLocation
alarmState, businessObject, clientProperties, delegate, displayName, elements, iconUrl, id, imageUrl, name, parent, propertyChangeSupport, selected, toolTipText, userObject, userProperties, visible
Constructor and Description |
---|
ShapeNode()
Create a shape node
|
ShapeNode(java.lang.Object id)
Create a shape node by given node id.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(java.awt.geom.Point2D point)
Add a control point into the shape node.
|
void |
clear()
Clear all control points and segments
|
protected java.awt.Shape |
createShape()
Create shape object for this shape node.
|
void |
firePointsChange()
fire points content changed event to all listeners.
|
java.awt.Rectangle |
getBounds()
Gets the current bounds of this element.
|
int |
getHeight()
Gets the current height of this element.
|
java.awt.geom.GeneralPath |
getPath() |
java.awt.geom.Point2D |
getPoint(int index)
Gets the control point at the specified index.
|
java.util.List |
getPoints()
Get all control points
|
java.util.List |
getSegments()
Gets a list contains all segments.
|
java.awt.Shape |
getShape()
Get the cached shape for this node.
|
java.awt.Color |
getShapeNodeFromArrowColor()
Gets the color of the shapeNode's from arrow.
|
java.awt.Color |
getShapeNodeFromArrowOutlineColor()
Gets the outline color of the shapeNode's from arrow.
|
int |
getShapeNodeFromArrowStyle()
Gets the shapeNode from arrow style.
|
int |
getShapeNodeFromArrowXOffset()
Gets the shapeNode from arrow location a horizontal offset.
|
int |
getShapeNodeFromArrowYOffset()
Gets the shapeNode from arrow location a vertical offset.
|
int |
getShapeNodeJointPoint()
Gets the joint point type.
|
java.awt.Color |
getShapeNodeToArrowColor()
Gets the color of the shapeNode's to arrow.
|
java.awt.Color |
getShapeNodeToArrowOutlineColor()
Gets the outline color of the shapeNode's to arrow.
|
int |
getShapeNodeToArrowStyle()
Gets the shapeNode to arrow style.
|
int |
getShapeNodeToArrowXOffset()
Gets the shapeNode to arrow location a horizontal offset.
|
int |
getShapeNodeToArrowYOffset()
Gets the shapeNode to arrow location a vertical offset.
|
int |
getShapeNodeType()
Gets the type of this shape node.
|
java.lang.String |
getSVGUIClassID()
Returns a string that specifies the full qualified name of the ui class
that responsible for converting this element to svg content.
|
java.lang.String |
getUIClassID()
Returns a string that specifies the fully qualified name of
the ui class that renders this element in network canvas.
|
int |
getWidth()
Gets the current width of this element.
|
void |
insertPoint(int index,
java.awt.geom.Point2D point)
Insert control point into the specified index
|
boolean |
isShapeNodeFromArrow()
Gets whether the shapeNode has from arrow.
|
boolean |
isShapeNodeFromArrowCenter() |
boolean |
isShapeNodeFromArrowOutline()
Gets whether draw the outline of the shapeNode's from arrow.
|
boolean |
isShapeNodeShowDashLine()
Determines whether display dash line for this shape node.
|
boolean |
isShapeNodeToArrow()
Gets whether the shapeNode has to arrow.
|
boolean |
isShapeNodeToArrowCenter() |
boolean |
isShapeNodeToArrowOutline()
Gets whether draw the outline of the shapeNode's to arrow.
|
void |
putShapeNodeFromArrow(boolean shapeNodeFromArrow)
Set whether show shapeNode from arrow.
|
void |
putShapeNodeFromArrowCenter(boolean shapeNodeFromArrowCenter) |
void |
putShapeNodeFromArrowColor(java.awt.Color shapeNodeFromArrowColor)
Set the shapeNode from arrow color.
|
void |
putShapeNodeFromArrowOutline(boolean shapeNodeFromArrowOutline)
Set whether draw the shapeNode's from arrow outline.
|
void |
putShapeNodeFromArrowOutlineColor(java.awt.Color shapeNodeFromArrowOutlineColor)
Set the shapeNode from arrow outline color.
|
void |
putShapeNodeFromArrowStyle(int shapeNodeFromArrowStyle)
Set the shapeNode from arrow style.
|
void |
putShapeNodeFromArrowXOffset(int shapeNodeFromArrowXOffset)
Sets the shapeNode from arrow location a horizontal offset.
|
void |
putShapeNodeFromArrowYOffset(int shapeNodeFromArrowYOffset)
Sets the shapeNode from arrow location a vertical offset.
|
void |
putShapeNodeJointPoint(int shapeNodeJointPoint)
Sets the joint point type.
|
void |
putShapeNodeShowDashLine(boolean shapeNodeShowDashLine)
Sets whether display dash line for this shape node.
|
void |
putShapeNodeToArrow(boolean shapeNodeToArrow)
Set whether show shapeNode to arrow.
|
void |
putShapeNodeToArrowCenter(boolean shapeNodeToArrowCenter) |
void |
putShapeNodeToArrowColor(java.awt.Color shapeNodeToArrowColor)
Set the shapeNode to arrow outline color.
|
void |
putShapeNodeToArrowOutline(boolean shapeNodeToArrowOutline)
Set whether draw the shapeNode's to arrow outline.
|
void |
putShapeNodeToArrowOutlineColor(java.awt.Color shapeNodeToArrowOutlineColor)
Set the shapeNode to arrow outline color.
|
void |
putShapeNodeToArrowStyle(int shapeNodeToArrowStyle)
Set the shapeNode to arrow style.
|
void |
putShapeNodeToArrowXOffset(int shapeNodeToArrowXOffset)
Sets the shapeNode from arrow location a horizontal offset.
|
void |
putShapeNodeToArrowYOffset(int shapeNodeToArrowYOffset)
Sets the shapeNode to arrow location a vertical offset.
|
void |
removePoint(int index)
Remove a control point from the specified index
|
void |
setBaseShape(java.awt.Shape baseShape)
Sets the shape for this shape node.
|
void |
setLocation(java.awt.geom.Point2D.Double location)
Set the location of the element.
|
void |
setPoint(int index,
java.awt.geom.Point2D point)
Set control point at the specified index
|
void |
setPoints(java.util.List points)
Set the control points for this shape node
|
void |
setSegments(java.util.List segments)
Sets a list contains all segments.
|
void |
setShapeNodeType(int shapeNodeType)
Sets the type of this shape node.
|
java.awt.geom.Point2D[] |
toPoints()
Get an array of all control points
|
getAllAgentLinks, getAllFollowers, getAllLinks, getFromAgentLinks, getFromLinks, getLoopLinks, getToAgentLinks, getToLinks, hasAgentLinks, isDrawImageShape, putDrawImageShape
getBodyColor, getCenterLocation, getCustomDrawFillColor, getCustomDrawGradientColor, getCustomDrawGradientFactory, getCustomDrawOutlineColor, getCustomDrawOutlineStroke, getCustomDrawShapeFactory, getLocation, getX, getY, isBodyFill, isBodyRaised, isCustomDraw, isCustomDrawAntialias, isCustomDrawDefaultBorder, isCustomDrawFill, isCustomDrawFill3D, isCustomDrawGradient, isCustomDrawOutline, isCustomDrawOutline3D, putBodyColor, putBodyFill, putBodyRaised, putCustomDraw, putCustomDrawAntialias, putCustomDrawDefaultBorder, putCustomDrawFill, putCustomDrawFill3D, putCustomDrawFillColor, putCustomDrawGradient, putCustomDrawGradientColor, putCustomDrawGradientFactory, putCustomDrawOutline, putCustomDrawOutline3D, putCustomDrawOutlineColor, putCustomDrawOutlineStroke, putCustomDrawShapeFactory, setCenterLocation, setCenterLocation, setLocation, setLocation, setLocation
addAttachment, addChartBubble, addChartValue, addChartValue, addChild, addChild, addPropertyChangeListener, addPropertyChangeListener, children, childrenSize, clearChartValues, clearChildren, containsAttachment, copy, copy, copy, copy, createAlarmState, createChildrenList, createChildrenMap, equals, exportValues, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlarmBalloonAlpha, getAlarmBalloonDirection, getAlarmBalloonOutlineColor, getAlarmBalloonPosition, getAlarmBalloonShadowColor, getAlarmBalloonShadowOffset, getAlarmBalloonTextColor, getAlarmBalloonTextFont, getAlarmBalloonXOffset, getAlarmBalloonYOffset, getAlarmState, getAttachmentOrientation, getAttachmentPosition, getAttachmentXGap, getAttachmentXOffset, getAttachmentYGap, getAttachmentYOffset, getBorderAntialias, getBorderColor, getBorderFillColor, getBorderInsets, getBorderShapeFactory, getBorderStroke, getBorderType, getBusinessObject, getChartBubbleShapeBubbleVisible, getChartBubbleShapeLineVisible, getChartBubbleStyle, getChartColor, getChartDialHandLength, getChartDialHandStyle, getChartFormat, getChartInflexionStyle, getChartMarkers, getChartMax, getChartMin, getChartPercentMarkerPostion, getChartPercentSpareColor, getChartPercentSpareCoverColor, getChartPercentSpareFill, getChartPercentStyle, getChartSectorDivisionPosition, getChartSectorStroke, getChartStroke, getChartValue, getChartValues, getChartValueTextPosition, getChildren, getChildrenByID, getClientProperties, getClientProperty, getDisplayName, getElementTreeIcon, getGeoCoordinate, getIcon, getIconURL, getID, getImage, getImageURL, getLabelBackground, getLabelBorderColor, getLabelBorderStroke, getLabelColor, getLabelFont, getLabelHighlightBackground, getLabelHighlightForeground, getLabelIcon, getLabelMaxLength, getLabelOrientation, getLabelPosition, getLabelUnderlineColor, getLabelUnderlineStroke, getLabelXGap, getLabelXOffset, getLabelYGap, getLabelYOffset, getLayerID, getMessageArc, getMessageBackground, getMessageBorderColor, getMessageBorderStroke, getMessageComponent, getMessageContent, getMessageDirection, getMessageFont, getMessageForeground, getMessageGradientColor, getMessageGradientFactory, getMessageHeight, getMessageMinimizedIcon, getMessagePosition, getMessageShadowColor, getMessageStyle, getMessageTail, getMessageWidth, getMessageXGap, getMessageXOffset, getMessageYGap, getMessageYOffset, getName, getParent, getPropertyChangeSupport, getPropertyValue, getRenderAlpha, getRenderColor, getStateOutlineColor, getStateOutlineInsets, getStateOutlineWidth, getTextureFactory, getToolTipText, getUserObject, getUserProperties, getUserProperty, isAdjustToBottom, isAlarmBalloonShownOnTop, isAlarmBalloonTextBlinkable, isAlarmBalloonVisible, isBorderFill, isBorderUnderneath, isBorderVisible, isBorderXormode, isDescendantOf, isDrawIconShape, isEmpty, isEnableAlarmPropagationFromChildren, isLabelBorder, isLabelHighlightable, isLabelSelectable, isLabelUnderline, isLabelVisible, isMessageAutoAdjustDirection, isMessageBorderVisible, isMessageClosable, isMessageGradient, isMessageMinimizable, isMessageMinimized, isMessageOpaque, isMessageShadowVisible, isMessageShownOnTop, isMessageShrinkable, isMessageShrinked, isParentOf, isSelected, isVisible, putAlarmBalloonAlpha, putAlarmBalloonDirection, putAlarmBalloonOutlineColor, putAlarmBalloonPosition, putAlarmBalloonShadowColor, putAlarmBalloonShadowOffset, putAlarmBalloonShownOnTop, putAlarmBalloonTextBlinkable, putAlarmBalloonTextColor, putAlarmBalloonTextFont, putAlarmBalloonVisible, putAlarmBalloonXoffset, putAlarmBalloonYoffset, putAttachmentOrientation, putAttachmentPosition, putAttachmentXGap, putAttachmentXOffset, putAttachmentYGap, putAttachmentYOffset, putBorderAntialias, putBorderColor, putBorderFill, putBorderFillColor, putBorderInsets, putBorderShapeFactory, putBorderStroke, putBorderType, putBorderUnderneath, putBorderVisible, putBorderXormode, putChartBubbleShapeBubbleVisible, putChartBubbleShapeLineVisible, putChartBubbleStyle, putChartColor, putChartDialHandLength, putChartDialHandStyle, putChartFormat, putChartInflexionStyle, putChartMarkers, putChartMax, putChartMin, putChartPercentMarkerPostion, putChartPercentSpareColor, putChartPercentSpareCoverColor, putChartPercentSpareFill, putChartPercentStyle, putChartSectorDivisionPosition, putChartSectorStroke, putChartStroke, putChartValue, putChartValues, putChartValueTextPosition, putClientProperty, putClientProperty, putClientProperty, putClientProperty, putDrawIconShape, putElementTreeIcon, putLabelBackground, putLabelBorder, putLabelBorderColor, putLabelBorderStroke, putLabelColor, putLabelFont, putLabelHighlightable, putLabelHighlightBackground, putLabelHighlightForeground, putLabelIcon, putLabelMaxLength, putLabelOrientation, putLabelPosition, putLabelSelectable, putLabelUnderline, putLabelUnderlineColor, putLabelUnderlineStroke, putLabelVisible, putLabelXGap, putLabelXOffset, putLabelYGap, putLabelYOffset, putMessageArc, putMessageAutoAdjustDirection, putMessageBackground, putMessageBorderColor, putMessageBorderStroke, putMessageBorderVisible, putMessageClosable, putMessageComponent, putMessageContent, putMessageDirection, putMessageFont, putMessageForeground, putMessageGradient, putMessageGradientColor, putMessageGradientFactory, putMessageHeight, putMessageMinimizable, putMessageMinimized, putMessageMinimizedIcon, putMessageOpaque, putMessagePosition, putMessageShadowColor, putMessageShadowVisible, putMessageShownOnTop, putMessageShrinkable, putMessageShrinked, putMessageStyle, putMessageTail, putMessageWidth, putMessageXGap, putMessageXOffset, putMessageYGap, putMessageYOffset, putRenderAlpha, putRenderColor, putStateOutlineColor, putStateOutlineInsets, putStateOutlineWidth, putTextureFactory, putUserProperty, putUserProperty, putUserProperty, removeAttachment, removeChild, removeFromParent, removePropertyChangeListener, removePropertyChangeListener, setAlarmState, setBusinessObject, setChartValues, setDisplayName, setEnableAlarmPropagationFromChildren, setGeoCoordinate, setIcon, setImage, setLayerID, setName, setParent, setPropertyValue, setSelected, setToolTipText, setUserObject, setVisible, toString, updateUI
protected int shapeNodeType
protected java.util.List points
protected java.util.List segments
protected transient java.awt.Shape shape
protected boolean isAdjusting
public ShapeNode()
public ShapeNode(java.lang.Object id)
id
- Object shape node idpublic int getShapeNodeType()
public void setShapeNodeType(int shapeNodeType)
TWaverConst.SHAPENODE_STRAIGHT_LINE
TWaverConst.SHAPENODE_CLOSE_STRAIGHT_LINE
TWaverConst.SHAPENODE_QUADRATIC_CURVE
TWaverConst.SHAPENODE_CLOSE_QUADRATIC_CURVE
TWaverConst.SHAPENODE_BEZIER_CURVE
TWaverConst.SHAPENODE_CLOSE_BEZIER_CURVE
TWaverConst.SHAPENODE_ORTHOGONAL_LINE
TWaverConst.SHAPENODE_ELLIPSE
TWaverConst.SHAPENODE_ROUND
TWaverConst.SHAPENODE_NONE
shapeNodeType
- the type of this shape node.public java.lang.String getUIClassID()
getUIClassID
in interface Element
getUIClassID
in class Node
ElementUI
public java.lang.String getSVGUIClassID()
getSVGUIClassID
in interface Element
getSVGUIClassID
in class Node
ElementSVGUI
,
TSVGNetwork
public java.util.List getPoints()
public java.awt.geom.Point2D getPoint(int index)
index
- the specified position index.public java.awt.geom.Point2D[] toPoints()
public java.util.List getSegments()
Segment
public void setSegments(java.util.List segments)
segments
- a list contains all segments.Segment
public void setBaseShape(java.awt.Shape baseShape)
baseShape
- public void setPoints(java.util.List points)
points
- List a list contain all control points.public void setPoint(int index, java.awt.geom.Point2D point)
index
- int the point indexpoint
- Point the point objectpublic void insertPoint(int index, java.awt.geom.Point2D point)
index
- int the insert indexpoint
- Point the point need to insertpublic void removePoint(int index)
index
- int index locationpublic void addPoint(java.awt.geom.Point2D point)
point
- Point a new point need to addpublic void clear()
public int getWidth()
getWidth
in interface Element
getWidth
in class BaseElement
public int getHeight()
getHeight
in interface Element
getHeight
in class BaseElement
public java.awt.Rectangle getBounds()
getBounds
in interface Element
getBounds
in class BaseElement
public void setLocation(java.awt.geom.Point2D.Double location)
setLocation
in interface Element
setLocation
in class BaseElement
location
- Double the new locationprotected java.awt.Shape createShape()
public void firePointsChange()
public java.awt.Shape getShape()
public java.awt.geom.GeneralPath getPath()
public void putShapeNodeShowDashLine(boolean shapeNodeShowDashLine)
shapeNodeShowDashLine
- True to display dash line, false otherwise.public boolean isShapeNodeShowDashLine()
public void putShapeNodeJointPoint(int shapeNodeJointPoint)
TWaverConst.JOINT_POINT_NEAR
TWaverConst.JOINT_POINT_NORTH
TWaverConst.JOINT_POINT_SOUTH
TWaverConst.JOINT_POINT_WEST
TWaverConst.JOINT_POINT_EAST
shapeNodeJointPoint
- the joint point type.#getShapenodeJointPoint()
public int getShapeNodeJointPoint()
TWaverConst.JOINT_POINT_NEAR
TWaverConst.JOINT_POINT_NORTH
TWaverConst.JOINT_POINT_SOUTH
TWaverConst.JOINT_POINT_WEST
TWaverConst.JOINT_POINT_EAST
putShapeNodeJointPoint(int)
public void putShapeNodeFromArrow(boolean shapeNodeFromArrow)
shapeNodeFromArrow
- boolean true show from arrow, false otherwise.public void putShapeNodeToArrow(boolean shapeNodeToArrow)
shapeNodeToArrow
- boolean true show to arrow, false otherwise.public void putShapeNodeFromArrowXOffset(int shapeNodeFromArrowXOffset)
shapeNodeFromArrowXOffset
- int a new horizontal offset.public void putShapeNodeFromArrowYOffset(int shapeNodeFromArrowYOffset)
shapeNodeFromArrowYOffset
- int a new vertical offset.public void putShapeNodeToArrowXOffset(int shapeNodeToArrowXOffset)
shapeNodeFromArrowXOffset
- int a new horizontal offset.public void putShapeNodeToArrowYOffset(int shapeNodeToArrowYOffset)
shapeNodeToArrowYOffset
- int a new vertical offset.public void putShapeNodeFromArrowCenter(boolean shapeNodeFromArrowCenter)
public void putShapeNodeToArrowCenter(boolean shapeNodeToArrowCenter)
public void putShapeNodeFromArrowStyle(int shapeNodeFromArrowStyle)
shapeNodeFromArrowStyle
- int the new shapeNode from arrow style.public void putShapeNodeToArrowStyle(int shapeNodeToArrowStyle)
shapeNodeToArrowStyle
- int the new shapeNode to arrow style.public void putShapeNodeFromArrowColor(java.awt.Color shapeNodeFromArrowColor)
shapeNodeFromArrowColor
- Color the new shapeNode from arrow color.public void putShapeNodeToArrowColor(java.awt.Color shapeNodeToArrowColor)
shapeNodeToArrowColor
- Color the new shapeNode to arrow color.public void putShapeNodeFromArrowOutline(boolean shapeNodeFromArrowOutline)
shapeNodeFromArrowOutline
- boolean the new shapeNode from arrow outline.public void putShapeNodeToArrowOutline(boolean shapeNodeToArrowOutline)
shapeNodeToArrowOutline
- boolean the new shapeNode to arrow outline.public void putShapeNodeFromArrowOutlineColor(java.awt.Color shapeNodeFromArrowOutlineColor)
shapeNodeFromArrowOutlineColor
- Color the new shapeNode from outline arrow color.public void putShapeNodeToArrowOutlineColor(java.awt.Color shapeNodeToArrowOutlineColor)
shapeNodeToArrowOutlineColor
- Color the new shapeNode to arrow outline color.public boolean isShapeNodeFromArrowCenter()
public boolean isShapeNodeToArrowCenter()
public int getShapeNodeFromArrowStyle()
putShapeNodeFromArrowStyle(int)
public int getShapeNodeToArrowStyle()
putShapeNodeToArrowStyle(int)
public java.awt.Color getShapeNodeFromArrowColor()
putShapeNodeFromArrowColor(Color)
public java.awt.Color getShapeNodeToArrowColor()
putShapeNodeToArrowColor(Color)
public java.awt.Color getShapeNodeFromArrowOutlineColor()
putShapeNodeFromArrowOutlineColor(Color)
public java.awt.Color getShapeNodeToArrowOutlineColor()
putShapeNodeToArrowOutlineColor(Color)
public boolean isShapeNodeFromArrowOutline()
#putShapeNodeFromArrowOutline(Boolean)
public boolean isShapeNodeToArrowOutline()
#putShapeNodeToArrowOutline(Boolean)
public int getShapeNodeFromArrowXOffset()
#putShapenodeFromArrowXOffset(int)
public int getShapeNodeFromArrowYOffset()
putShapeNodeFromArrowYOffset(int)
public int getShapeNodeToArrowXOffset()
putShapeNodeToArrowXOffset(int)
public int getShapeNodeToArrowYOffset()
putShapeNodeToArrowYOffset(int)
public boolean isShapeNodeFromArrow()
putShapeNodeFromArrow(boolean)
public boolean isShapeNodeToArrow()
putShapeNodeToArrow(boolean)
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.