com.mindfusion.diagramming
Class DiagramNode

java.lang.Object
  extended by com.mindfusion.diagramming.DiagramItem
      extended by com.mindfusion.diagramming.DiagramNode
All Implemented Interfaces:
InplaceEditable, java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
ContainerNode, DummyNode, ShapeNode, TableNode, TreeViewNode

public abstract class DiagramNode
extends DiagramItem
implements InplaceEditable

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) 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(long) 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, int, int) method creates a Group instance if necessary, and calls the group's appropriate attachTo* method.

See Also:
Serialized Form

Field Summary
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  long enabledHandles
           
protected  int handlesStyle
           
protected  DiagramLinkList incomingLinks
           
protected  Group masterGroup
           
protected  boolean obstacle
           
protected  DiagramLinkList outgoingLinks
           
protected  java.awt.geom.Rectangle2D savedBounds
           
 
Fields inherited from class com.mindfusion.diagramming.DiagramItem
brush, cycleDetected, cycleProtect, font, hyperLink, ignoreLayout, locked, modifyDX, modifyDY, modifyHandle, modifying, pen, printable, ptEnd, ptMdfLast, ptOrg, ptSavedEnd, ptSavedOrg, selected, shadowColor, shadowOffsetX, shadowOffsetY, subordinateGroup, tag, toolTip, visible, zIndex
 
Constructor Summary
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.
 
Method Summary
protected  boolean allowCreate(java.awt.geom.Point2D current, InteractionState ist)
          Invoked during interactive creation of items to test whether the operation can be completed in the current context.
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.
 void attachTo(DiagramLink link, int attType, int index)
          Attaches a node to a segment or point of the specified link.
 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.
 void attachTo(DiagramNode node, int attType)
          Attaches a node to a corner or side of another node.
protected  void cancelModify(InteractionState ist)
           
protected  void completeCreate(java.awt.geom.Point2D end)
          Invoked when the item creation has been completed.
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 override.
 boolean containsPoint(java.awt.geom.Point2D point, float threshold)
          Tests whether the specified point is inside this node or within the specified distance from its outlines.
protected  com.mindfusion.diagramming.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.
 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.
 NodeConstraints getConstraints()
          Gets the movement and size constraints applied to a node.
 long getEnabledHandles()
          Gets a bit mask specifying 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.
 int getHandlesStyle()
          Gets the style of the box selection handles.
 DiagramLinkList getIncomingLinks()
          Gets the links coming into a node.
 Group getMasterGroup()
          Gets the hierarchical group in which this node is a subordinate item.
 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  boolean groupContains(DiagramNode node)
           
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 onRemove()
          Called when an item is removed from a Diagram, either by the user, programmatically or via undo / redo.
protected  void onUpdateBounds()
          Invoked when the bounding rectangle of the node has changed.
protected  void putExpandable(boolean exp)
           
 void readExternal(java.io.ObjectInput in)
          Implements Externalizable.
protected  void rectFromPoints()
           
 void resize(float width, float height)
          Sets the size of a node.
protected  void resizeToFitImage(java.awt.Image image)
           
protected  void restoreProperties(DiagramItemProperties props)
          DiagramItem.restoreProperties(com.mindfusion.diagramming.DiagramItemProperties) override.
protected  void restoreState(DiagramItemState state)
          DiagramItem.restoreState(com.mindfusion.diagramming.DiagramItemState) override.
protected  void saveProperties(DiagramItemProperties props)
          DiagramItem.saveProperties(com.mindfusion.diagramming.DiagramItemProperties) override.
protected  void saveState(DiagramItemState state)
          DiagramItem.saveState(com.mindfusion.diagramming.DiagramItemState) override.
protected  void saveToXml(org.w3c.dom.Element xmlElement, XmlPersistContext context)
          Saves the item content into an XML element.
 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 setConstraints(NodeConstraints value)
          Sets constraints to the node size and movement direction.
 void setEnabledHandles(long value)
          Sets a bit mask specifying 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(int value)
          Sets the style of the box selection handles.
 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.
protected  boolean shouldRenderAnchors(RenderOptions options)
          Determines whether the node should render its anchor points.
protected  void startCreate(java.awt.geom.Point2D org)
          Invoked once when the user starts creating a new item interactively.
protected  void startModify(java.awt.geom.Point2D org, int handle, InteractionState ist)
          Invoked when the user starts modifying this item interactively.
protected  void updateCreate(java.awt.geom.Point2D current)
          Invoked during interactive creation of this item.
protected  void updateLinkPositions()
           
protected  void updateModify(java.awt.geom.Point2D current, InteractionState ist)
          Invoked during interactive modification of this item.
 void writeExternal(java.io.ObjectOutput out)
          Implements Externalizable.
 
Methods inherited from class com.mindfusion.diagramming.DiagramItem
clone, draw, drawShadow, getBrush, getFont, getHyperLink, getIgnoreLayout, getLayoutTraits, getLocked, getMeasureUnit, getParent, getPen, getPrintable, getSelected, getShadowColor, getShadowOffsetX, getShadowOffsetY, getSubordinateGroup, getTag, getToolTip, getVisible, getWeight, getZIndex, hasSubordinates, onAdd, onChangeFont, onChildModified, onClick, onDoubleClick, onModify, putSelected, repaint, repaint, repaint, setBrush, setDiagramDirty, setFont, setHyperLink, setIgnoreLayout, setLocked, setPen, setPrintable, setSelected, setShadowColor, setShadowOffsetX, setShadowOffsetY, setTag, setToolTip, setVisible, setWeight, setZIndex, shouldRender, zBottom, zLevelDown, zLevelUp, zTop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.mindfusion.diagramming.InplaceEditable
getEditRect, getTextToEdit, setEditedText
 

Field Detail

AV_UpdateOutgoing

protected com.mindfusion.diagramming.VisitorMethod AV_UpdateOutgoing

AV_UpdateIncoming

protected com.mindfusion.diagramming.VisitorMethod AV_UpdateIncoming

AV_UpdPosOutgoing

protected com.mindfusion.diagramming.VisitorMethod AV_UpdPosOutgoing

AV_UpdPosIncoming

protected com.mindfusion.diagramming.VisitorMethod AV_UpdPosIncoming

AV_UpdIntscOutgoing

protected com.mindfusion.diagramming.VisitorMethod AV_UpdIntscOutgoing

AV_UpdIntscIncoming

protected com.mindfusion.diagramming.VisitorMethod AV_UpdIntscIncoming

AV_StartModOutgoing

protected com.mindfusion.diagramming.VisitorMethod AV_StartModOutgoing

AV_StartModIncoming

protected com.mindfusion.diagramming.VisitorMethod AV_StartModIncoming

AV_EndModOutgoing

protected com.mindfusion.diagramming.VisitorMethod AV_EndModOutgoing

AV_EndModIncoming

protected com.mindfusion.diagramming.VisitorMethod AV_EndModIncoming

AV_Cancel

protected com.mindfusion.diagramming.VisitorMethod AV_Cancel

incomingLinks

protected DiagramLinkList incomingLinks

outgoingLinks

protected DiagramLinkList outgoingLinks

masterGroup

protected Group masterGroup

obstacle

protected boolean obstacle

allowIncomingLinks

protected boolean allowIncomingLinks

allowOutgoingLinks

protected boolean allowOutgoingLinks

bounds

protected java.awt.geom.Rectangle2D bounds

savedBounds

protected java.awt.geom.Rectangle2D savedBounds

anchorPattern

protected AnchorPattern anchorPattern

enabledHandles

protected long enabledHandles

handlesStyle

protected int handlesStyle
Constructor Detail

DiagramNode

public DiagramNode()
Initializes a new instance of the DiagramNode class.


DiagramNode

public DiagramNode(Diagram parent)
Initializes a new DiagramNode instance by setting its properties to the default values defined in the specified Diagram.

Parameters:
parent - A Diagram instance whose default node attributes are copied to this node.

DiagramNode

public DiagramNode(DiagramNode prototype)
Initializes a new DiagramNode instance by copying its properties from the specified prototype node.

Parameters:
prototype - A DiagramNode instance whose attributes are copied to this node.
Method Detail

onRemove

protected void onRemove()
Called when an item is removed from a Diagram, either by the user, programmatically or via undo / redo.

Overrides:
onRemove in class DiagramItem

createConnectionPoint

protected com.mindfusion.diagramming.ConnectionPoint createConnectionPoint(DiagramLink link,
                                                                           java.awt.geom.Point2D pt,
                                                                           boolean incoming)

getConstraints

public NodeConstraints getConstraints()
Gets the movement and size constraints applied to a node.

Returns:
A NodeConstraints object.

setConstraints

public void setConstraints(NodeConstraints value)
Sets constraints to the node size and movement direction. The constraints are applied when a user modifies the node interactively. They are not checked when the position of a node is set programmatically.

Parameters:
value - A NodeConstraints object.

updateLinkPositions

protected void updateLinkPositions()

getIncomingLinks

public DiagramLinkList getIncomingLinks()
Gets the links coming into a node.

Returns:
An DiagramLinkList containing the incoming links.

getOutgoingLinks

public DiagramLinkList getOutgoingLinks()
Gets the links going out from a node.

Returns:
An DiagramLinkList containing the outgoing links.

setReflexive

protected void setReflexive(DiagramLink link)
Invoked to let a node set the shape of a reflexive link connected to it.

Parameters:
link - Reference to the link.

groupContains

protected boolean groupContains(DiagramNode node)

getMasterGroup

public Group getMasterGroup()
Gets the hierarchical group in which this node is a subordinate item.

Overrides:
getMasterGroup in class DiagramItem
Returns:
A Group to which this node is attached.

attachTo

public void attachTo(DiagramLink link,
                     int attType,
                     int index)
Attaches a node to a segment or point of the specified link.

Parameters:
link - An DiagramLink to which to attach this node.
attType - One of the AttachToLink constants.
index - Index of a point or segment to which to attach the node.

attachTo

public void attachTo(DiagramNode node,
                     int attType)
Attaches a node to a corner or side of another node.

Parameters:
node - A DiagramNode to which to attach this node.
attType - One of the AttachToNode constants.

attachTo

public 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.

Parameters:
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.

detach

public void detach()
Detaches a node from its master group.


writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Implements Externalizable.

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class DiagramItem
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Implements Externalizable.

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class DiagramItem
Throws:
java.io.IOException
java.lang.ClassNotFoundException

saveToXml

protected void saveToXml(org.w3c.dom.Element xmlElement,
                         XmlPersistContext context)
Description copied from class: DiagramItem
Saves the item content into an XML element.

Overrides:
saveToXml in class DiagramItem
Parameters:
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.

loadFromXml

protected void loadFromXml(org.w3c.dom.Element xmlElement,
                           XmlPersistContext context)
                    throws javax.xml.transform.TransformerException,
                           XmlException
Description copied from class: DiagramItem
Loads the item content from an XML element.

Overrides:
loadFromXml in class DiagramItem
Parameters:
xmlElement - An XmlElement containing the item's data.
context - An XmlPersistContext object providing contextual information about the serialization process and some helper serialization methods
Throws:
javax.xml.transform.TransformerException
XmlException

getObstacle

public boolean getObstacle()
Gets a value indicating whether the link routing algorithm should consider this node an obstacle.

Returns:
true if auto-routed links should go around this node, otherwise false.

setObstacle

public void setObstacle(boolean value)
Sets a value indicating whether the link routing algorithm should consider this node an obstacle.

Parameters:
value - true if auto-routed links should go around this node, otherwise false.

getBounds

public java.awt.geom.Rectangle2D.Float getBounds()
Gets the node location and size.

Specified by:
getBounds in class DiagramItem
Returns:
A Rectangle2D.Float object representing the node bounds.

setBounds

public void setBounds(java.awt.geom.Rectangle2D value)
Sets the node location and size.

Parameters:
value - A Rectangle2D.Float object representing the node bounds.

setBounds

public void setBounds(float x,
                      float y,
                      float w,
                      float h)
Sets the node location and size.

Parameters:
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.

moveTo

public void moveTo(float x,
                   float y)
Moves a node to the specified location.

Parameters:
x - The new horizontal position of the node.
y - The new vertical position of the node.

move

protected void move(double x,
                    double y)

resize

public void resize(float width,
                   float height)
Sets the size of a node.

Parameters:
width - The new width of this node.
height - The new height of this node.

containsPoint

public boolean containsPoint(java.awt.geom.Point2D point)
DiagramItem.containsPoint override.

Specified by:
containsPoint in class DiagramItem
Parameters:
point - The point to check.
Returns:
true it this item contains the specified point; otherwise, false.

containsPoint

public boolean containsPoint(java.awt.geom.Point2D point,
                             float threshold)
Tests whether the specified point is inside this node or within the specified distance from its outlines.

Parameters:
point - The point to check.
threshold - Specifies the size of the area around the node outlines where the point is still considered inside the node.
Returns:
true it this node contains the specified point; otherwise, false.

rectFromPoints

protected void rectFromPoints()

shouldRenderAnchors

protected boolean shouldRenderAnchors(RenderOptions options)
Determines whether the node should render its anchor points.


startCreate

protected void startCreate(java.awt.geom.Point2D org)
Description copied from class: DiagramItem
Invoked once when the user starts creating a new item interactively.

Overrides:
startCreate in class DiagramItem
Parameters:
org - Position of the mouse pointer.

updateCreate

protected void updateCreate(java.awt.geom.Point2D current)
Description copied from class: DiagramItem
Invoked during interactive creation of this item.

Overrides:
updateCreate in class DiagramItem
Parameters:
current - Position of the mouse pointer.

allowCreate

protected boolean allowCreate(java.awt.geom.Point2D current,
                              InteractionState ist)
Description copied from class: DiagramItem
Invoked during interactive creation of items to test whether the operation can be completed in the current context.

Specified by:
allowCreate in class DiagramItem
Parameters:
current - The current mouse pointer position.
ist - An InteractionState object containing more information about the current state of the operation.
Returns:
true to allow the creation of this item; otherwise, false.

completeCreate

protected void completeCreate(java.awt.geom.Point2D end)
Description copied from class: DiagramItem
Invoked when the item creation has been completed.

Overrides:
completeCreate in class DiagramItem
Parameters:
end - The mouse pointer position.

startModify

protected void startModify(java.awt.geom.Point2D org,
                           int handle,
                           InteractionState ist)
Description copied from class: DiagramItem
Invoked when the user starts modifying this item interactively.

Overrides:
startModify in class DiagramItem
Parameters:
org - Position of the mouse pointer.
handle - Index of the adjustment handle used to modify the item.
ist - An InteractionState object containing more information about the current state of the operation.

constraintsInfringed

protected boolean constraintsInfringed()

updateModify

protected void updateModify(java.awt.geom.Point2D current,
                            InteractionState ist)
Description copied from class: DiagramItem
Invoked during interactive modification of this item.

Overrides:
updateModify in class DiagramItem
Parameters:
current - Position of the mouse pointer.
ist - An InteractionState object containing more information about the current state of the operation.

allowModify

protected boolean allowModify(java.awt.geom.Point2D current,
                              InteractionState ist)
Description copied from class: DiagramItem
Invoked during interactive modification of items to test whether the operation can be completed in the current context.

Specified by:
allowModify in class DiagramItem
Parameters:
current - The current mouse pointer position.
ist - An InteractionState object containing more information about the current state of the operation.
Returns:
true to allow the modification of this item; otherwise, false.

completeModify

protected void completeModify(java.awt.geom.Point2D end,
                              InteractionState ist)
Description copied from class: DiagramItem
Invoked when the item modification has been completed.

Overrides:
completeModify in class DiagramItem
Parameters:
end - The mouse pointer position.
ist - An InteractionState object containing more information about the current state of the operation.

cancelModify

protected void cancelModify(InteractionState ist)
Overrides:
cancelModify in class DiagramItem

onUpdateBounds

protected void onUpdateBounds()
Invoked when the bounding rectangle of the node has changed.


getEnabledHandles

public long getEnabledHandles()
Gets a bit mask specifying which manipulation handles are enabled for a node. This effectively controls what kind of modifications users are allowed to perform on this node.

Returns:
A bitwise combination of the AdjustmentHandles constants.

setEnabledHandles

public void setEnabledHandles(long value)
Sets a bit mask specifying which manipulation handles are enabled for a node. This effectively controls what kind of modifications users are allowed to perform on this node.

Parameters:
value - A bitwise combination of the AdjustmentHandles constants.

getAnchorPattern

public AnchorPattern getAnchorPattern()
Gets the anchor points to which link end points are aligned when links connect to this node.

Returns:
An AnchorPattern object that defines the anchor points for this node.

setAnchorPattern

public void setAnchorPattern(AnchorPattern value)
Sets the anchor points to which link end points are aligned when links connect to this node.

Parameters:
value - An AnchorPattern object that defines the anchor points for this node.

nodesIntersect

public static boolean nodesIntersect(DiagramNode node1,
                                     DiagramNode node2)
Determines whether two nodes intersect.

Parameters:
node1 - The first node.
node2 - The second node.
Returns:
true if the nodes intersect, otherwise false.

onDragOver

public boolean onDragOver(DiagramItem item)
Invoked when a diagram item is being dragged over this node.

Parameters:
item - The DiagramItem that is dragged over the node.
Returns:
false if the diagram should notify nodes below this one; otherwise, true.

onDragOut

public void onDragOut(DiagramItem item)
Invoked when a diagram item is being dragged out of this node.

Parameters:
item - The DiagramItem that is dragged out of the node.

onDropOver

public boolean onDropOver(DiagramItem item)
Invoked when a diagram item is dropped over this node.

Parameters:
item - The DiagramItem that is dropped over the node.
Returns:
false if the diagram should notify nodes below this one; otherwise, true.

resizeToFitImage

protected void resizeToFitImage(java.awt.Image image)

setExpandedFlag

public void setExpandedFlag(boolean expanded)
Changes the "expanded" flag without actually expanding or collapsing the tree branch that starts from a node.

Parameters:
expanded - The new value of the flag.

putExpandable

protected void putExpandable(boolean exp)

getExpandable

public boolean getExpandable()
Gets a value indicating whether users are allowed to expand or collapse the tree branch that starts from this node.

Returns:
true if the tree branch that starts from this node can be expanded or collapsed by users, otherwise false.

setExpandable

public void setExpandable(boolean value)
Sets a value indicating whether users are allowed to expand or collapse the tree branch that starts from this node.

Parameters:
value - true if the tree branch that starts from this node can be expanded or collapsed by users, otherwise false.

getExpanded

public boolean getExpanded()
Gets a value indicating whether the tree branch that starts from a node is expanded or collapsed.

Returns:
true if the tree branch that starts from this node is currently expanded, otherwise false.

setExpanded

public void setExpanded(boolean value)
Expands or collapses the tree branch that starts from a node.

Parameters:
value - true if the tree branch that starts from this node should be expanded, otherwise false.

getAllowIncomingLinks

public boolean getAllowIncomingLinks()
Gets a value indicating whether users are allowed to draw links to this node.

Returns:
true if incoming links can be drawn to this node, otherwise false.

setAllowIncomingLinks

public void setAllowIncomingLinks(boolean value)
Sets a value indicating whether users are allowed to draw links to this node.

Parameters:
value - true if incoming links can be drawn to this node, otherwise false.

getAllowOutgoingLinks

public boolean getAllowOutgoingLinks()
Gets a value indicating whether users are allowed to draw links from this node.

Returns:
true if outgoing links can be drawn from this node, otherwise false.

setAllowOutgoingLinks

public void setAllowOutgoingLinks(boolean value)
Sets a value indicating whether users are allowed to draw links from this node.

Parameters:
value - true if outgoing links can be drawn from this node, otherwise false.

getHandlesStyle

public int getHandlesStyle()
Gets the style of the box selection handles.

Returns:
One of the HandlesStyle constants.

setHandlesStyle

public void setHandlesStyle(int value)
Sets the style of the box selection handles.

Parameters:
value - One of the HandlesStyle constants.

createState

protected DiagramItemState createState()
DiagramItem.createState() override.

Overrides:
createState in class DiagramItem

saveState

protected void saveState(DiagramItemState state)
DiagramItem.saveState(com.mindfusion.diagramming.DiagramItemState) override.

Overrides:
saveState in class DiagramItem

restoreState

protected void restoreState(DiagramItemState state)
DiagramItem.restoreState(com.mindfusion.diagramming.DiagramItemState) override.

Overrides:
restoreState in class DiagramItem

createProperties

protected DiagramItemProperties createProperties()
DiagramItem.createProperties() override.

Overrides:
createProperties in class DiagramItem
Returns:
A DiagramItemProperties-derived object containing a snapshot of the item's properties.

saveProperties

protected void saveProperties(DiagramItemProperties props)
DiagramItem.saveProperties(com.mindfusion.diagramming.DiagramItemProperties) override.

Overrides:
saveProperties in class DiagramItem
Parameters:
props - A DiagramItemProperties-derived object where the item's properties should be saved.

restoreProperties

protected void restoreProperties(DiagramItemProperties props)
DiagramItem.restoreProperties(com.mindfusion.diagramming.DiagramItemProperties) override.

Overrides:
restoreProperties in class DiagramItem
Parameters:
props - A DiagramItemProperties -derived object containing a snapshot of the item's properties.