public abstract class DiagramNode extends DiagramItem
DiagramNode
is an abstract base class from which the ShapeNode
,
TableNode
and ContainerNode
classes derive. DiagramNode instances can
represent graph vertices, nodes in organizational or flow diagrams, entities in
ER diagrams, and so on.
Use the setBounds(java.awt.geom.Rectangle2D, boolean, boolean)
method to set the location and size of a node. To
move a node without changing its size, call the moveTo(float, float)
method. To
change only the size of a node, invoke the resize(float, float)
method.
Constraints upon how users are allowed to modify a node can be set via the
setConstraints(com.mindfusion.diagramming.NodeConstraints)
and setEnabledHandles(java.util.EnumSet<com.mindfusion.diagramming.NodeHandleType>)
methods. The former
specifies constraints on the allowed move direction and node size. The latter
enables or disables specific manipulation handles of a node.
Relations between nodes are indicated by linking the nodes with DiagramLink
objects. Links are directional links, so each node has two collections
referring to links, which can be accessed via getIncomingLinks()
and
getOutgoingLinks()
. setAnchorPattern(com.mindfusion.diagramming.AnchorPattern)
lets you define to which
points of a node incoming or outgoing links can be connected. You can specify
whether a node accepts incoming links via the setAllowIncomingLinks(boolean)
method, and outgoing links via the setAllowOutgoingLinks(boolean)
method.
A user is allowed to expand or collapse the tree branch that starts from a
node if setExpandable(boolean)
is called for that node. Use getExpanded()
to find out whether the branch starting from a node is expanded or not.
Nodes can be attached to other items, and be used as simple labels,
image-holders or other kinds of UI elements. The attachTo(com.mindfusion.diagramming.DiagramLink, com.mindfusion.diagramming.AttachToLink, int)
method
creates a Group
instance if necessary, and calls the group's
appropriate attachTo* method.
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowIncomingLinks |
protected boolean |
allowOutgoingLinks |
protected AnchorPattern |
anchorPattern |
protected com.mindfusion.diagramming.VisitorMethod |
AV_Cancel |
protected com.mindfusion.diagramming.VisitorMethod |
AV_EndModIncoming |
protected com.mindfusion.diagramming.VisitorMethod |
AV_EndModOutgoing |
protected com.mindfusion.diagramming.VisitorMethod |
AV_StartModIncoming |
protected com.mindfusion.diagramming.VisitorMethod |
AV_StartModOutgoing |
protected com.mindfusion.diagramming.VisitorMethod |
AV_UpdateIncoming |
protected com.mindfusion.diagramming.VisitorMethod |
AV_UpdateOutgoing |
protected com.mindfusion.diagramming.VisitorMethod |
AV_UpdIntscIncoming |
protected com.mindfusion.diagramming.VisitorMethod |
AV_UpdIntscOutgoing |
protected com.mindfusion.diagramming.VisitorMethod |
AV_UpdPosIncoming |
protected com.mindfusion.diagramming.VisitorMethod |
AV_UpdPosOutgoing |
protected java.awt.geom.Rectangle2D |
bounds |
protected java.util.EnumSet<NodeHandleType> |
enabledHandles |
protected HandlesStyle |
handlesStyle |
protected DiagramLinkList |
incomingLinks |
protected Group |
masterGroup |
protected boolean |
obstacle |
protected DiagramLinkList |
outgoingLinks |
protected java.awt.geom.Rectangle2D |
savedBounds |
brush, cycleDetected, cycleProtect, modifyDX, modifyDY, modifyHandle, modifying, pen, ptEnd, ptMdfLast, ptOrg, ptSavedEnd, ptSavedOrg, subordinateGroup
Constructor and Description |
---|
DiagramNode()
Initializes a new instance of the DiagramNode class.
|
DiagramNode(Diagram parent)
Initializes a new DiagramNode instance by setting its properties to the default
values defined in the specified Diagram.
|
DiagramNode(DiagramNode prototype)
Initializes a new DiagramNode instance by copying its properties
from the specified prototype node.
|
Modifier and Type | Method and Description |
---|---|
void |
addLabel(NodeLabel label)
Adds a new label to this node.
|
NodeLabel |
addLabel(java.lang.String text)
Adds a new label to this node.
|
protected boolean |
allowCreate(java.awt.geom.Point2D current,
InteractionState ist)
|
protected boolean |
allowModify(java.awt.geom.Point2D current,
InteractionState ist)
Invoked during interactive modification of items
to test whether the operation can be completed in
the current context.
|
protected boolean |
allowModifyImpl(java.awt.geom.Point2D current,
InteractionState ist) |
void |
attachTo(DiagramLink link,
AttachToLink attType,
int index)
Attaches a node to a segment or point of the specified link.
|
void |
attachTo(DiagramNode node,
AttachToNode attType)
Attaches a node to a corner or side of another node.
|
void |
attachTo(DiagramNode node,
float percentX1,
float percentY1,
float percentX2,
float percentY2)
Attaches a node to another node, so that the attached node will always
cover a proportional part of the master node, specified in percents.
|
protected void |
cancelModify(InteractionState ist)
|
protected void |
completeCreate(java.awt.geom.Point2D end)
|
protected void |
completeModify(java.awt.geom.Point2D end,
InteractionState ist)
Invoked when the item modification has been completed.
|
protected boolean |
constraintsInfringed() |
boolean |
containsPoint(java.awt.geom.Point2D point)
DiagramItem.containsPoint(Point2D) override. |
boolean |
containsPoint(java.awt.geom.Point2D point,
float threshold)
|
protected ConnectionPoint |
createConnectionPoint(DiagramLink link,
java.awt.geom.Point2D pt,
boolean incoming) |
protected DiagramItemProperties |
createProperties()
DiagramItem.createProperties() override. |
protected DiagramItemState |
createState()
DiagramItem.createState() override. |
void |
detach()
Detaches a node from its master group.
|
protected void |
draw(java.awt.Graphics2D g,
RenderOptions options)
|
protected void |
drawLocal(java.awt.Graphics2D g,
RenderOptions options)
Override in a derived class to provide implementation specific drawing for the node.
|
protected void |
drawShadow(java.awt.Graphics2D g,
RenderOptions options)
|
protected void |
drawShadowLocal(java.awt.Graphics2D graphics,
RenderOptions options)
Override in a derived class to provide implementation specific drawing for the shadow of the node.
|
DiagramLinkList |
getAllIncomingLinks()
Gets a collection of all links entering this node.
|
DiagramLinkList |
getAllLinks()
Gets all links connected to this node.
|
DiagramLinkList |
getAllOutgoingLinks()
Gets a collection of all links going out of this node.
|
boolean |
getAllowIncomingLinks()
Gets a value indicating whether users are allowed to draw
links to this node.
|
boolean |
getAllowOutgoingLinks()
Gets a value indicating whether users are allowed to draw links
from this node.
|
AnchorPattern |
getAnchorPattern()
Gets the anchor points to which link end points are aligned when
links connect to this node.
|
java.awt.geom.Rectangle2D.Float |
getBounds()
Gets the node location and size.
|
java.awt.geom.Point2D |
getCenter() |
NodeConstraints |
getConstraints()
Gets the movement and size constraints applied to a node.
|
ContainerNode |
getContainer()
Gets the parent ContainerNode containing this node.
|
java.util.List<NodeEffect> |
getEffects()
Gets a collection with all effects applied to this node.
|
java.util.EnumSet<NodeHandleType> |
getEnabledHandles()
Gets a combination of
NodeHandleType members identifying which manipulation
handles are enabled for a node. |
boolean |
getExpandable()
Gets a value indicating whether users are allowed to expand or collapse
the tree branch that starts from this node.
|
boolean |
getExpanded()
Gets a value indicating whether the tree branch that starts from a node is
expanded or collapsed.
|
HandlesStyle |
getHandlesStyle()
Gets a value indicating how the node adjustment handles behave and what do they look like.
|
DiagramLinkList |
getIncomingLinks()
Gets the links coming into a node.
|
java.util.ArrayList<NodeLabel> |
getLabels()
Returns the list of all labels displayed by this node.
|
protected java.awt.geom.Rectangle2D.Float |
getLocalBounds() |
protected java.awt.geom.Rectangle2D.Double |
getLocalBoundsD() |
java.awt.geom.Point2D |
getLocalCenter() |
Group |
getMasterGroup()
Gets the hierarchical group in which this node is a subordinate item.
|
DiagramItem |
getMasterItem()
Returns the node's Container or main item of MasterGroup.
|
java.awt.geom.Point2D |
getNearestBorderPoint(java.awt.geom.Point2D point)
Returns a point that lies on the outline of this node,
at the shortest distance from the specified point.
|
boolean |
getObstacle()
Gets a value indicating whether the link routing algorithm
should consider this node an obstacle.
|
DiagramLinkList |
getOutgoingLinks()
Gets the links going out from a node.
|
protected java.awt.geom.Rectangle2D |
getRepaintRect(boolean includeConnected)
Gets the repaint region for this item, taking into account
factors such as pen, selection handles and shadow.
|
static java.awt.geom.Rectangle2D |
getRotatedBounds(java.awt.geom.Rectangle2D rect,
java.awt.geom.Point2D center,
double angle)
Gets the bounding rectangle of this node, when it is
rotated at the specified angle around the specified pivot.
|
float |
getRotationAngle()
Gets the rotation angle of this node.
|
protected boolean |
groupContains(DiagramNode node) |
AdjustmentHandle |
hitTestHandle(java.awt.geom.Point2D point)
|
ItemLabel |
labelFromPoint(java.awt.geom.Point2D point)
Returns the label whose layout rectangle contains the specified point.
|
protected void |
loadFromJson(com.mindfusion.common.JsonObject obj,
JsonPersistContext context)
Loads the node from a JSON object.
|
protected void |
loadFromXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
Loads the item content from an XML element.
|
protected void |
move(double x,
double y) |
void |
moveTo(float x,
float y)
Moves a node to the specified location.
|
static boolean |
nodesIntersect(DiagramNode node1,
DiagramNode node2)
Determines whether two nodes intersect.
|
void |
onDragOut(DiagramItem item)
Invoked when a diagram item is being dragged out of this node.
|
boolean |
onDragOver(DiagramItem item)
Invoked when a diagram item is being dragged over this node.
|
boolean |
onDropOver(DiagramItem item)
Invoked when a diagram item is dropped over this node.
|
protected void |
onModify(java.awt.geom.Point2D mousePosition,
NodeHandleType adjustmentHandle)
Called when an item is modified
|
protected void |
onRemove()
Called when an item is removed from a Diagram, either by
the user, programmatically or via undo / redo.
|
protected void |
onRotationAngleChanged() |
protected void |
onUpdateBounds()
Invoked when the bounding rectangle of this node has changed.
|
protected boolean |
parentConstraintsInfringed() |
protected void |
putExpandable(boolean exp) |
void |
readExternal(java.io.ObjectInput in)
Implements Externalizable.
|
protected void |
rectFromPoints() |
void |
removeLabel(NodeLabel label)
Removes the specified label from this node.
|
void |
resize(float width,
float height)
Sets the size of a node.
|
protected void |
resizeToFitImage(java.awt.Image image) |
protected void |
restoreProperties(DiagramItemProperties props)
|
protected void |
restoreState(DiagramItemState state)
|
protected void |
saveProperties(DiagramItemProperties props)
|
protected void |
saveState(DiagramItemState state)
|
protected void |
saveToJson(com.mindfusion.common.JsonObject obj,
JsonPersistContext context)
Saves the node as a JSON object.
|
protected void |
saveToXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
Saves the item content into an XML element.
|
protected void |
scaleElements(float scale)
Scales the node's elements by specified amount.
|
void |
setAllowIncomingLinks(boolean value)
Sets a value indicating whether users are allowed to draw links to this node.
|
void |
setAllowOutgoingLinks(boolean value)
Sets a value indicating whether users are allowed to draw links from this node.
|
void |
setAnchorPattern(AnchorPattern value)
Sets the anchor points to which link end points are aligned when
links connect to this node.
|
void |
setBounds(float x,
float y,
float w,
float h)
Sets the node location and size.
|
void |
setBounds(java.awt.geom.Rectangle2D value)
Sets the node location and size.
|
void |
setBounds(java.awt.geom.Rectangle2D rect,
boolean updateGroups,
boolean updateLinks)
Sets the location and size of this node.
|
void |
setBoundsDirect(java.awt.geom.Rectangle2D rc) |
void |
setConstraints(NodeConstraints value)
Sets constraints to the node size and movement direction.
|
void |
setEnabledHandles(java.util.EnumSet<NodeHandleType> value)
Sets a combination of
NodeHandleType members identifying which manipulation
handles are enabled for a node. |
void |
setExpandable(boolean value)
Sets a value indicating whether users are allowed to expand or collapse
the tree branch that starts from this node.
|
void |
setExpanded(boolean value)
Expands or collapses the tree branch that starts from a node.
|
void |
setExpandedFlag(boolean expanded)
Changes the "expanded" flag without actually expanding or collapsing
the tree branch that starts from a node.
|
void |
setHandlesStyle(HandlesStyle value)
Sets a value indicating how the node adjustment handles behave and what do they look like.
|
void |
setObstacle(boolean value)
Sets a value indicating whether the link routing algorithm
should consider this node an obstacle.
|
protected void |
setReflexive(DiagramLink link)
Invoked to let a node set the shape of a reflexive link connected to it.
|
void |
setRotationAngle(float value)
Sets the rotation angle of a node.
|
protected boolean |
shouldRenderAnchors(RenderOptions options)
Determines whether the node should render its anchor points.
|
protected void |
startCreate(java.awt.geom.Point2D org)
|
protected void |
startModify(java.awt.geom.Point2D org,
AdjustmentHandle handle,
InteractionState ist)
|
protected void |
updateCreate(java.awt.geom.Point2D current)
|
protected void |
updateLinkPositions() |
protected void |
updateModify(java.awt.geom.Point2D current,
InteractionState ist)
|
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable.
|
as, clone, getBrush, getEffectiveBrush, getEffectiveFont, getEffectivePen, getEffectiveShadowBrush, getEffectiveTextBrush, getFont, getHyperLink, getId, getIgnoreLayout, getLayerIndex, getLayoutTraits, getLocked, getMeasureUnit, getOpacity, getParent, getPen, getPrintable, getRuntimeIndex, getSelected, getShadowBrush, getShadowOffsetX, getShadowOffsetY, getStyle, getSubordinateGroup, getTag, getTextBrush, getTextPadding, getToolTip, getValue, getVisible, getWeight, getZIndex, hasSubordinates, hitTest, onAdd, onChangeFont, onChangeTextPadding, onChildModified, onClick, onDoubleClick, onLoad, onMeasureUnitChanged, onStyleChanged, onStyleFontChanged, putSelected, query, repaint, repaint, repaint, setBrush, setDiagramDirty, setFont, setHyperLink, setId, setIgnoreLayout, setLayerIndex, setLocked, setOpacity, setPen, setPrintable, setSelected, setShadowBrush, setShadowOffsetX, setShadowOffsetY, setStyle, setTag, setTextBrush, setTextPadding, setToolTip, setVisible, setWeight, setZIndex, shouldRender, zBottom, zLevelDown, zLevelUp, zTop
protected com.mindfusion.diagramming.VisitorMethod AV_UpdateOutgoing
protected com.mindfusion.diagramming.VisitorMethod AV_UpdateIncoming
protected com.mindfusion.diagramming.VisitorMethod AV_UpdPosOutgoing
protected com.mindfusion.diagramming.VisitorMethod AV_UpdPosIncoming
protected com.mindfusion.diagramming.VisitorMethod AV_UpdIntscOutgoing
protected com.mindfusion.diagramming.VisitorMethod AV_UpdIntscIncoming
protected com.mindfusion.diagramming.VisitorMethod AV_StartModOutgoing
protected com.mindfusion.diagramming.VisitorMethod AV_StartModIncoming
protected com.mindfusion.diagramming.VisitorMethod AV_EndModOutgoing
protected com.mindfusion.diagramming.VisitorMethod AV_EndModIncoming
protected com.mindfusion.diagramming.VisitorMethod AV_Cancel
protected DiagramLinkList incomingLinks
protected DiagramLinkList outgoingLinks
protected Group masterGroup
protected boolean obstacle
protected boolean allowIncomingLinks
protected boolean allowOutgoingLinks
protected java.awt.geom.Rectangle2D bounds
protected java.awt.geom.Rectangle2D savedBounds
protected AnchorPattern anchorPattern
protected java.util.EnumSet<NodeHandleType> enabledHandles
protected HandlesStyle handlesStyle
public DiagramNode()
public DiagramNode(Diagram parent)
parent
- A Diagram
instance whose default node
attributes are copied to this node.public DiagramNode(DiagramNode prototype)
prototype
- A DiagramNode
instance whose attributes are
copied to this node.protected void onRemove()
onRemove
in class DiagramItem
protected ConnectionPoint createConnectionPoint(DiagramLink link, java.awt.geom.Point2D pt, boolean incoming)
public NodeConstraints getConstraints()
NodeConstraints
object.public void setConstraints(NodeConstraints value)
value
- A NodeConstraints
object.protected void updateLinkPositions()
public DiagramLinkList getAllOutgoingLinks()
DiagramLinkList
containing all outgoing links.public DiagramLinkList getAllIncomingLinks()
DiagramLinkList
containing all incoming links.public DiagramLinkList getAllLinks()
DiagramLinkList
containing the links connected to this node.public DiagramLinkList getIncomingLinks()
DiagramLinkList
containing the incoming links.public DiagramLinkList getOutgoingLinks()
DiagramLinkList
containing the outgoing links.protected void setReflexive(DiagramLink link)
link
- Reference to the link.public java.awt.geom.Point2D getNearestBorderPoint(java.awt.geom.Point2D point)
point
- A Point2D
instance.Point2D
instance representing the border point
at shortest distance from the specified point.protected boolean groupContains(DiagramNode node)
public Group getMasterGroup()
getMasterGroup
in class DiagramItem
Group
to which this node is attached.public ContainerNode getContainer()
public DiagramItem getMasterItem()
public void attachTo(DiagramLink link, AttachToLink attType, int index)
link
- An DiagramLink
to which to attach this node.attType
- A member of the AttachToLink
enumeration.index
- Index of a point or segment to which to attach the node.public void attachTo(DiagramNode node, AttachToNode attType)
node
- A DiagramNode
to which to attach this node.attType
- A member of the AttachToNode
enumeration.public void attachTo(DiagramNode node, float percentX1, float percentY1, float percentX2, float percentY2)
node
- A DiagramNode
to which to attach this node.percentX1
- A float percent value specifying to what X position in the
master node to attach the left side of this node.percentY1
- A float percent value specifying to what Y position in the
master node to attach the top side of this node.percentX2
- A float percent value specifying to what X position in the
master node to attach the right side of this node.percentY2
- A float percent value specifying to what Y position in the
master node to attach the bottom side of this node.public void detach()
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
writeExternal
in class DiagramItem
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class DiagramItem
java.io.IOException
java.lang.ClassNotFoundException
protected void saveToXml(org.w3c.dom.Element xmlElement, XmlPersistContext context)
DiagramItem
saveToXml
in class DiagramItem
xmlElement
- An Element
the item's data should be stored into.context
- An XmlPersistContext
object providing contextual information about the serialization process and some helper serialization methods.protected void loadFromXml(org.w3c.dom.Element xmlElement, XmlPersistContext context) throws javax.xml.transform.TransformerException, XmlException
DiagramItem
loadFromXml
in class DiagramItem
xmlElement
- An XmlElement containing the item's data.context
- An XmlPersistContext
object providing contextual
information about the serialization process and some helper serialization methodsjavax.xml.transform.TransformerException
XmlException
protected void saveToJson(com.mindfusion.common.JsonObject obj, JsonPersistContext context)
saveToJson
in class DiagramItem
obj
- A JsonObject instance to contain the serialized data.context
- A JsonPersistContext object providing contextual information
about the serialization process and helper serialization methods.protected void loadFromJson(com.mindfusion.common.JsonObject obj, JsonPersistContext context)
loadFromJson
in class DiagramItem
obj
- A JsonObject containing the node's data.context
- A JsonPersistContext object providing contextual information about
the serialization process and helper serialization methods.public boolean getObstacle()
true
if auto-routed links should go around
this node, otherwise false
.public void setObstacle(boolean value)
value
- true
if auto-routed links should go around
this node, otherwise false
.public void setBounds(java.awt.geom.Rectangle2D rect, boolean updateGroups, boolean updateLinks)
rect
- A Rectangle2D specifying the node position.updateGroups
- Specifies whether the position of child nodes attached to this one should be updated too.updateLinks
- Specifies whether the position of links connected to this node should be updated too.public void setBoundsDirect(java.awt.geom.Rectangle2D rc)
public java.awt.geom.Rectangle2D.Float getBounds()
getBounds
in class DiagramItem
Rectangle2D.Float
object
representing the node bounds.protected java.awt.geom.Rectangle2D.Float getLocalBounds()
protected java.awt.geom.Rectangle2D.Double getLocalBoundsD()
public void setBounds(java.awt.geom.Rectangle2D value)
value
- A Rectangle2D.Float
object
representing the node bounds.public void setBounds(float x, float y, float w, float h)
x
- The new horizontal position of the node.y
- The new vertical position of the node.w
- The new width of the node.h
- The new height of the node.public void moveTo(float x, float y)
x
- The new horizontal position of the node.y
- The new vertical position of the node.protected void move(double x, double y)
public void resize(float width, float height)
width
- The new width of this node.height
- The new height of this node.public boolean containsPoint(java.awt.geom.Point2D point)
DiagramItem.containsPoint(Point2D)
override. Checks whether this node
contains the specified point. This method is called during hit-testing to determine
if the mouse pointer is over the node.containsPoint
in class DiagramItem
point
- The point to check.public boolean containsPoint(java.awt.geom.Point2D point, float threshold)
DiagramItem.containsPoint(Point2D, float)
override. Checks whether this node
contains the specified point. This method is called during hit-testing to determine
if the mouse pointer is over the node.containsPoint
in class DiagramItem
point
- The point to check.threshold
- Specifies the size of the area around the node outlines where the point is still considered inside.public AdjustmentHandle hitTestHandle(java.awt.geom.Point2D point)
DiagramItem.hitTestHandle(java.awt.geom.Point2D)
override. Determines whether a selection handle of this node is located at the specified point.hitTestHandle
in class DiagramItem
point
- A Point2D instance specifying the location where to look for adjustment handles.NodeAdjustmentHandle
instance representing the adjustment
handle found at the specified location, or null if there is none.public float getRotationAngle()
public void setRotationAngle(float value)
value
- A float value specifying the node rotation angle.protected void onRotationAngleChanged()
public static java.awt.geom.Rectangle2D getRotatedBounds(java.awt.geom.Rectangle2D rect, java.awt.geom.Point2D center, double angle)
public java.awt.geom.Point2D getCenter()
public java.awt.geom.Point2D getLocalCenter()
protected void rectFromPoints()
protected void draw(java.awt.Graphics2D g, RenderOptions options)
DiagramItem.draw(java.awt.Graphics2D, com.mindfusion.diagramming.RenderOptions)
override. Draws this node on the specified Graphics2D surface.draw
in class DiagramItem
g
- A java.awt.Graphics2D instance.options
- Provides options for the drawing operation.protected void drawLocal(java.awt.Graphics2D g, RenderOptions options)
g
- The Graphics2D surface to draw the node on.options
- Provides options for the drawing operation.protected void drawShadow(java.awt.Graphics2D g, RenderOptions options)
DiagramItem.drawShadow(java.awt.Graphics2D, com.mindfusion.diagramming.RenderOptions)
override. Draws the node's shadow on the specified Graphics2D surface.drawShadow
in class DiagramItem
g
- A java.awt.Graphics2D instance.options
- Provides options for the drawing operation.protected void drawShadowLocal(java.awt.Graphics2D graphics, RenderOptions options)
graphics
- The Graphics2D object where the shadow should be rendered.options
- Provides options for the drawing operation.protected java.awt.geom.Rectangle2D getRepaintRect(boolean includeConnected)
DiagramItem
getRepaintRect
in class DiagramItem
includeConnected
- true if related items should be considered too; otherwise, false.protected boolean shouldRenderAnchors(RenderOptions options)
protected void startCreate(java.awt.geom.Point2D org)
startCreate
in class DiagramItem
org
- The initial position of the mouse pointer.protected void updateCreate(java.awt.geom.Point2D current)
updateCreate
in class DiagramItem
current
- The current position of the mouse pointer.protected boolean allowCreate(java.awt.geom.Point2D current, InteractionState ist)
DiagramItem.allowCreate(java.awt.geom.Point2D, com.mindfusion.diagramming.InteractionState)
override.allowCreate
in class DiagramItem
current
- The current mouse pointer position.ist
- An InteractionState
object containing more information about the current state of the operation.protected void completeCreate(java.awt.geom.Point2D end)
completeCreate
in class DiagramItem
end
- The mouse pointer position.protected void startModify(java.awt.geom.Point2D org, AdjustmentHandle handle, InteractionState ist)
DiagramItem.startModify(java.awt.geom.Point2D, com.mindfusion.diagramming.AdjustmentHandle, com.mindfusion.diagramming.InteractionState)
override. Invoked when the user starts modifying this node interactively.startModify
in class DiagramItem
org
- The initial position of the mouse pointer.handle
- The adjustment handle used to modify this item.ist
- An InteractionState
object containing more information about the current state of the operation.protected boolean constraintsInfringed()
protected boolean parentConstraintsInfringed()
protected void updateModify(java.awt.geom.Point2D current, InteractionState ist)
DiagramItem.updateModify(java.awt.geom.Point2D, com.mindfusion.diagramming.InteractionState)
override. Invoked during interactive modification of this node.updateModify
in class DiagramItem
current
- The current position of the mouse pointer.ist
- An InteractionState
object containing more information about the current state of the operation.protected boolean allowModify(java.awt.geom.Point2D current, InteractionState ist)
DiagramItem
allowModify
in class DiagramItem
current
- The current mouse pointer position.ist
- An InteractionState object containing more information about the current state of the operation.protected boolean allowModifyImpl(java.awt.geom.Point2D current, InteractionState ist)
protected void onModify(java.awt.geom.Point2D mousePosition, NodeHandleType adjustmentHandle)
mousePosition
- Specifies the mouse position.adjustmentHandle
- The adjustment handle used to modify the node.protected void completeModify(java.awt.geom.Point2D end, InteractionState ist)
DiagramItem
completeModify
in class DiagramItem
end
- The mouse pointer position.ist
- An InteractionState
object containing more information about the current state of the operation.protected void cancelModify(InteractionState ist)
DiagramItem.cancelModify(com.mindfusion.diagramming.InteractionState)
override. Invoked when the interactive modification of this node has been canceled.cancelModify
in class DiagramItem
ist
- An InteractionState
object containing more information about the current state of the operation.protected void onUpdateBounds()
protected void scaleElements(float scale)
scale
- The value by which to multiply node elements' sizes.public java.util.EnumSet<NodeHandleType> getEnabledHandles()
NodeHandleType
members identifying which manipulation
handles are enabled for a node. This effectively controls what kind of
modifications users are allowed to perform on this node.NodeHandleType
members.public void setEnabledHandles(java.util.EnumSet<NodeHandleType> value)
NodeHandleType
members identifying which manipulation
handles are enabled for a node. This effectively controls what kind of
modifications users are allowed to perform on this node.value
- A set of NodeHandleType
members.public AnchorPattern getAnchorPattern()
AnchorPattern
object that defines
the anchor points for this node.public void setAnchorPattern(AnchorPattern value)
value
- An AnchorPattern
object that defines
the anchor points for this node.public static boolean nodesIntersect(DiagramNode node1, DiagramNode node2)
node1
- The first node.node2
- The second node.true
if the nodes intersect, otherwise false
.public boolean onDragOver(DiagramItem item)
item
- The DiagramItem that is dragged over the node.public void onDragOut(DiagramItem item)
item
- The DiagramItem that is dragged out of the node.public boolean onDropOver(DiagramItem item)
item
- The DiagramItem that is dropped over the node.protected void resizeToFitImage(java.awt.Image image)
public void setExpandedFlag(boolean expanded)
expanded
- The new value of the flag.protected void putExpandable(boolean exp)
public boolean getExpandable()
true
if the tree branch that starts from this node
can be expanded or collapsed by users, otherwise false
.public void setExpandable(boolean value)
value
- true
if the tree branch that starts from this node
can be expanded or collapsed by users, otherwise false
.public boolean getExpanded()
true
if the tree branch that starts from this node
is currently expanded, otherwise false
.public void setExpanded(boolean value)
value
- true
if the tree branch that starts from
this node should be expanded, otherwise false
.public boolean getAllowIncomingLinks()
true
if incoming links can be drawn to this node,
otherwise false
.public void setAllowIncomingLinks(boolean value)
value
- true
if incoming links can be drawn to this node,
otherwise false
.public boolean getAllowOutgoingLinks()
true
if outgoing links can be drawn from this node,
otherwise false
.public void setAllowOutgoingLinks(boolean value)
value
- true
if outgoing links can be drawn from
this node, otherwise false
.public NodeLabel addLabel(java.lang.String text)
text
- The label's text.NodeLabel
instance.public void addLabel(NodeLabel label)
label
- A NodeLabel
instance.public void removeLabel(NodeLabel label)
label
- A NodeLabel
instance.public ItemLabel labelFromPoint(java.awt.geom.Point2D point)
labelFromPoint
in class DiagramItem
point
- A Point2D
instance.NodeLabel
that contains the specified point.public java.util.ArrayList<NodeLabel> getLabels()
public HandlesStyle getHandlesStyle()
HandlesStyle
enumeration.public void setHandlesStyle(HandlesStyle value)
value
- A member of the HandlesStyle
enumeration.protected DiagramItemState createState()
DiagramItem.createState()
override.createState
in class DiagramItem
protected void saveState(DiagramItemState state)
saveState
in class DiagramItem
protected void restoreState(DiagramItemState state)
restoreState
in class DiagramItem
protected DiagramItemProperties createProperties()
DiagramItem.createProperties()
override.createProperties
in class DiagramItem
protected void saveProperties(DiagramItemProperties props)
saveProperties
in class DiagramItem
props
- A DiagramItemProperties-derived object where
the item's properties should be saved.protected void restoreProperties(DiagramItemProperties props)
restoreProperties
in class DiagramItem
props
- A DiagramItemProperties -derived object containing a
snapshot of the item's properties.public java.util.List<NodeEffect> getEffects()