com.mindfusion.diagramming
Class ControlNode

java.lang.Object
  extended by com.mindfusion.diagramming.DiagramItem
      extended by com.mindfusion.diagramming.DiagramNode
          extended by com.mindfusion.diagramming.ControlNode
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class ControlNode
extends DiagramNode

ControlNode is an adapter class that enables using any java.awt.Component -derived object as a diagram node.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.mindfusion.diagramming.DiagramNode
allowIncomingLinks, allowOutgoingLinks, anchorPattern, AV_Cancel, AV_EndModIncoming, AV_EndModOutgoing, AV_StartModIncoming, AV_StartModOutgoing, AV_UpdateIncoming, AV_UpdateOutgoing, AV_UpdIntscIncoming, AV_UpdIntscOutgoing, AV_UpdPosIncoming, AV_UpdPosOutgoing, bounds, enabledHandles, handlesStyle, incomingLinks, masterGroup, obstacle, outgoingLinks, savedBounds
 
Fields inherited from class com.mindfusion.diagramming.DiagramItem
brush, cycleDetected, cycleProtect, modifyDX, modifyDY, modifyHandle, modifying, pen, ptEnd, ptMdfLast, ptOrg, ptSavedEnd, ptSavedOrg, subordinateGroup
 
Constructor Summary
ControlNode()
          Initializes a new instance of the ControlNode class.
ControlNode(ControlNode prototype)
          Initializes a new instance of the ControlNode class using the specified control node as a prototype.
ControlNode(Diagram parent)
          Initializes a new instance of the ControlNode class with default values supplied form the specified Diagram.
ControlNode(DiagramView diagramView)
          Initializes a new instance of the ControlNode class.
ControlNode(DiagramView diagramView, java.awt.Component control)
          Initializes a new instance of the ControlNode class.
 
Method Summary
protected  DiagramItemProperties createProperties()
          DiagramItem.createProperties() override.
protected  void drawLocal(java.awt.Graphics2D g, RenderOptions options)
          DiagramItem.drawShadow(java.awt.Graphics2D, com.mindfusion.diagramming.RenderOptions) override.
 java.awt.Component getControl()
          Gets the java.awt.Component hosted inside this node.
 int getMouseInputMode()
          Gets whether mouse input is processed by the diagram or the hosted control.
protected  void loadFromXml(org.w3c.dom.Element xmlElement, XmlPersistContext context)
          Loads the item content from an XML element.
protected  void onAdd()
          DiagramItem.onAdd() override.
protected  void onLoad(Diagram diagram)
          DiagramItem.onLoad(com.mindfusion.diagramming.Diagram) override.
protected  void onRemove()
          DiagramItem.onRemove() override.
protected  void onUpdateBounds()
          DiagramNode.onUpdateBounds() override.
 void readExternal(java.io.ObjectInput in)
          Implements Externalizable.
protected  void restoreProperties(DiagramItemProperties props)
          DiagramItem.restoreProperties(com.mindfusion.diagramming.DiagramItemProperties) override.
protected  void saveProperties(DiagramItemProperties props)
          DiagramItem.saveProperties(com.mindfusion.diagramming.DiagramItemProperties) override.
protected  void saveToXml(org.w3c.dom.Element xmlElement, XmlPersistContext context)
          Saves the item content into an XML element.
 void setControl(java.awt.Component value)
          Sets the java.awt.Component that should be hosted inside this node.
 void setMouseInputMode(int value)
          Sets whether mouse input is processed by the diagram or the hosted control.
 void setVisible(boolean value)
          Sets a value indicating whether the node is visible.
 void writeExternal(java.io.ObjectOutput out)
          Implements Externalizable.
 
Methods inherited from class com.mindfusion.diagramming.DiagramNode
allowCreate, allowModify, attachTo, attachTo, attachTo, cancelModify, completeCreate, completeModify, constraintsInfringed, containsPoint, containsPoint, createConnectionPoint, createState, detach, draw, drawShadow, drawShadowLocal, getAllIncomingLinks, getAllLinks, getAllOutgoingLinks, getAllowIncomingLinks, getAllowOutgoingLinks, getAnchorPattern, getBounds, getCenter, getConstraints, getEffects, getEnabledHandles, getExpandable, getExpanded, getHandlesStyle, getIncomingLinks, getLocalBounds, getLocalBoundsD, getMasterGroup, getObstacle, getOutgoingLinks, getRepaintRect, getRotatedBounds, getRotationAngle, groupContains, move, moveTo, nodesIntersect, onDragOut, onDragOver, onDropOver, onRotationAngleChanged, putExpandable, rectFromPoints, resize, resizeToFitImage, restoreState, saveState, setAllowIncomingLinks, setAllowOutgoingLinks, setAnchorPattern, setBounds, setBounds, setBoundsDirect, setConstraints, setEnabledHandles, setExpandable, setExpanded, setExpandedFlag, setHandlesStyle, setObstacle, setReflexive, setRotationAngle, shouldRenderAnchors, startCreate, startModify, updateCreate, updateLinkPositions, updateModify
 
Methods inherited from class com.mindfusion.diagramming.DiagramItem
clone, getBrush, getEffectiveBrush, getEffectiveFont, getEffectivePen, getEffectiveShadowBrush, getEffectiveTextBrush, getFont, getHyperLink, getId, getIgnoreLayout, getLayerIndex, getLayoutTraits, getLocked, getMeasureUnit, getParent, getPen, getPrintable, getRuntimeIndex, getSelected, getShadowBrush, getShadowOffsetX, getShadowOffsetY, getStyle, getSubordinateGroup, getTag, getTextBrush, getTextPadding, getToolTip, getValue, getVisible, getWeight, getZIndex, hasSubordinates, onChangeFont, onChangeTextPadding, onChildModified, onClick, onDoubleClick, onModify, onStyleChanged, putSelected, query, repaint, repaint, repaint, setBrush, setDiagramDirty, setFont, setHyperLink, setId, setIgnoreLayout, setLayerIndex, setLocked, setPen, setPrintable, setSelected, setShadowBrush, setShadowOffsetX, setShadowOffsetY, setStyle, setTag, setTextBrush, setTextPadding, setToolTip, 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
 

Constructor Detail

ControlNode

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


ControlNode

public ControlNode(Diagram parent)
Initializes a new instance of the ControlNode class with default values supplied form the specified Diagram.

Parameters:
parent - The Diagram from which to obtain default values for the node properties.

ControlNode

public ControlNode(DiagramView diagramView)
Initializes a new instance of the ControlNode class.

Parameters:
diagramView - The DiagramView that should become a parent of the hosted control.

ControlNode

public ControlNode(ControlNode prototype)
Initializes a new instance of the ControlNode class using the specified control node as a prototype.

Parameters:
prototype - The node to use as a prototype. The properties of the new node are initialized from the property values of this node.

ControlNode

public ControlNode(DiagramView diagramView,
                   java.awt.Component control)
Initializes a new instance of the ControlNode class.

Parameters:
diagramView - The DiagramView that should become a parent of the hosted control.
control - The java.awt.Component that should be hosted inside this node.
Method Detail

getControl

public java.awt.Component getControl()
Gets the java.awt.Component hosted inside this node.

Returns:
A java.awt.Component instance.

setControl

public void setControl(java.awt.Component value)
Sets the java.awt.Component that should be hosted inside this node.

Parameters:
value - A java.awt.Component instance.

getMouseInputMode

public int getMouseInputMode()
Gets whether mouse input is processed by the diagram or the hosted control.

Returns:
A member of the MouseInputMode enumeration.

setMouseInputMode

public void setMouseInputMode(int value)
Sets whether mouse input is processed by the diagram or the hosted control.

Parameters:
value - A member of the MouseInputMode enumeration.

setVisible

public void setVisible(boolean value)
Sets a value indicating whether the node is visible.

Overrides:
setVisible in class DiagramItem
Parameters:
value - true if the node should be visible, otherwise false.

drawLocal

protected void drawLocal(java.awt.Graphics2D g,
                         RenderOptions options)
DiagramItem.drawShadow(java.awt.Graphics2D, com.mindfusion.diagramming.RenderOptions) override. Draws the hosted control on the specified Graphics2D surface.

Overrides:
drawLocal in class DiagramNode
Parameters:
g - A Graphics2D object where the link should be rendered.
options - A RenderOptions object specifying options for the drawing operation.

onUpdateBounds

protected void onUpdateBounds()
DiagramNode.onUpdateBounds() override.

Overrides:
onUpdateBounds in class DiagramNode

onAdd

protected void onAdd()
DiagramItem.onAdd() override.

Overrides:
onAdd in class DiagramItem

onLoad

protected void onLoad(Diagram diagram)
DiagramItem.onLoad(com.mindfusion.diagramming.Diagram) override.

Overrides:
onLoad in class DiagramItem

onRemove

protected void onRemove()
DiagramItem.onRemove() override.

Overrides:
onRemove in class DiagramNode

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 DiagramNode
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 DiagramNode
Throws:
java.io.IOException
java.lang.ClassNotFoundException

saveToXml

protected void saveToXml(org.w3c.dom.Element xmlElement,
                         XmlPersistContext context)
Saves the item content into an XML element.

Overrides:
saveToXml in class DiagramNode
Parameters:
xmlElement - An Element the item's data should be stored into.
context - Provides 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
Loads the item content from an XML element.

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

createProperties

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

Overrides:
createProperties in class DiagramNode
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 DiagramNode
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 DiagramNode
Parameters:
props - A DiagramItemProperties -derived object containing a snapshot of the item's properties.