public class CompositeNode extends DiagramNode implements ComponentHost
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, savedBoundsbrush, cycleDetected, cycleProtect, modifyDX, modifyDY, modifyHandle, modifying, pen, ptEnd, ptMdfLast, ptOrg, ptSavedEnd, ptSavedOrg, subordinateGroup| Constructor and Description |
|---|
CompositeNode()
Initializes a new instance of the CompositeNode class.
|
CompositeNode(CompositeNode prototype)
Initializes a new instance of the CompositeNode class using the specified diagram item as a prototype.
|
CompositeNode(Diagram diagram)
Initializes a new instance of the CompositeNode class with default values supplied form the specified Diagram.
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyEffects(ComponentBase component,
java.lang.Object parameters,
EffectPhase phase)
Implements ComponentHost.applyEffects
|
void |
arrangeComponents(java.awt.geom.Rectangle2D.Float availableSpace,
java.awt.Graphics2D g2d)
Invokes when the components within this node are being arranged.
|
boolean |
containsComponent(ComponentBase component)
Checks whether the specified component is contained in this node.
|
java.awt.Point |
docToComponent(java.awt.geom.Point2D.Float docPoint,
ComponentBase component)
Converts a point from document coordinates to the local coordinate space of a component inside this node.
|
void |
drawLocal(java.awt.Graphics2D g2d,
RenderOptions options)
Draws the node on the specified Graphics2D surface.
|
void |
drawShadowLocal(java.awt.Graphics2D g2d,
RenderOptions options)
Draws the shadow of this node on the specified Graphics2D surface.
|
ComponentBase |
findComponent(java.lang.String name)
Returns the child component with the specified name or null, if the component was not found.
|
java.awt.geom.Rectangle2D.Float |
getBounds()
DiagramNode.getBounds override
|
java.lang.Object |
getClipboard(ComponentBase source,
java.lang.Class<?> dataType)
Implements ComponentHost.getClipboard
|
ComponentBase |
getComponentAt(java.awt.geom.Point2D point)
Returns the component at the specified point, expressed in document coordinates.
|
java.util.List<ComponentBase> |
getComponents()
Gets a list with the root components contained in the node.
|
ComponentBase |
getFocusedComponent()
Implements ComponentHost.getFocusedComponent
|
protected java.awt.Shape |
getRgnInRect(java.awt.geom.Rectangle2D.Float rc)
Creates a java.awt.Shape object specifying the node shape
for a specified bounding rectangle.
|
protected java.awt.Shape |
getRgnInRect(java.awt.geom.Rectangle2D.Float rc,
boolean inLocal)
Creates a java.awt.Shape object specifying the node shape
for a specified bounding rectangle.
|
CompositeNodeBuilder |
init()
Returns a CompositeNodeBuilder object used to configure this CompositeNode instance.
|
void |
invalidate()
Implements ComponentHost.invalidate
|
void |
invalidate(java.awt.geom.Rectangle2D.Float bounds)
Implements ComponentHost.invalidate
|
void |
invalidateLayout()
Invalidates the component layout, causing rearrangement of content.
|
void |
invalidateLayout(ComponentBase component)
Implements ComponentHost.invalidateLayout
|
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)
DiagramNode.loadFromXml override
|
protected void |
onMeasureUnitChanged()
Called when the diagram's MeasureUnit changes.
|
protected void |
onRemove()
DiagramNode.onRemove override
|
protected void |
onUpdateBounds(java.awt.geom.Rectangle2D oldBounds)
DiagramNode.onUpdateBounds override
|
java.awt.geom.Point2D.Float |
pointToComponent(java.awt.geom.Point2D.Float point)
For internal use.
|
void |
readExternal(java.io.ObjectInput in)
Implements Externalizable
|
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)
DiagramNode.saveToXml override
|
protected boolean |
serializeComponents()
Invoked to query whether the underlying component structure should be automatically serialized.
|
void |
setClipboard(ComponentBase source,
java.lang.Object data)
Implements ComponentHost.setClipboard
|
void |
setFocusedComponent(ComponentBase value)
Implements ComponentHost.setFocusedComponent
|
static CompositeNodeBuilder |
with()
Returns a CompositeNodeBuilder object used to configure and create new CompositeNode instances.
|
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable
|
addLabel, addLabel, allowCreate, allowModify, allowModifyImpl, attachTo, attachTo, attachTo, cancelModify, completeCreate, completeModify, constraintsInfringed, containsPoint, containsPoint, createConnectionPoint, createProperties, createState, detach, draw, drawShadow, getAllIncomingLinks, getAllLinks, getAllOutgoingLinks, getAllowIncomingLinks, getAllowOutgoingLinks, getAnchorPattern, getCenter, getConstraints, getContainer, getEffects, getEnabledHandles, getExpandable, getExpanded, getHandlesStyle, getIncomingLinks, getLabels, getLocalBounds, getLocalBoundsD, getLocalCenter, getMasterGroup, getMasterItem, getNearestBorderPoint, getObstacle, getOutgoingLinks, getRepaintRect, getRotatedBounds, getRotationAngle, groupContains, hitTestHandle, labelFromPoint, move, moveTo, nodesIntersect, onDragOut, onDragOver, onDropOver, onModify, onRotationAngleChanged, parentConstraintsInfringed, putExpandable, rectFromPoints, removeLabel, resize, resizeToFitImage, restoreProperties, restoreState, saveProperties, saveState, scaleElements, setAllowIncomingLinks, setAllowOutgoingLinks, setAnchorPattern, setBounds, setBounds, setBounds, setBoundsDirect, setConstraints, setEnabledHandles, setExpandable, setExpanded, setExpandedFlag, setHandlesStyle, setObstacle, setReflexive, setRotationAngle, shouldRenderAnchors, startCreate, startModify, updateCreate, updateLinkPositions, updateModifyas, 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, 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, zToppublic CompositeNode()
public CompositeNode(Diagram diagram)
diagram - The Diagram from which to obtain default values for the node properties.public CompositeNode(CompositeNode prototype)
prototype - The item to use as a prototype. The properties of the new item are initialized from the property values of this item.public static CompositeNodeBuilder with()
CompositeNodeBuilder instance.public CompositeNodeBuilder init()
CompositeNodeBuilder instance.public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.ExternalizablewriteExternal in class DiagramNodejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.ExternalizablereadExternal in class DiagramNodejava.io.IOExceptionjava.lang.ClassNotFoundExceptionprotected boolean serializeComponents()
protected void onRemove()
onRemove in class DiagramNodeprotected void saveToXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
saveToXml in class DiagramNodexmlElement - 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,
com.mindfusion.common.XmlException
loadFromXml in class DiagramNodexmlElement - 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.TransformerExceptioncom.mindfusion.common.XmlExceptionprotected void saveToJson(com.mindfusion.common.JsonObject obj,
JsonPersistContext context)
saveToJson in class DiagramNodeobj - 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 DiagramNodeobj - A JsonObject containing the item's data.context - A JsonPersistContext object providing contextual information about
the serialization process and helper serialization methods.public void drawLocal(java.awt.Graphics2D g2d,
RenderOptions options)
drawLocal in class DiagramNodeg2d - The Graphics2D surface to draw the node on.options - Provides options for the drawing operation.public void drawShadowLocal(java.awt.Graphics2D g2d,
RenderOptions options)
drawShadowLocal in class DiagramNodeg2d - The Graphics2D object where the shadow should be rendered.options - Provides options for the drawing operation.protected java.awt.Shape getRgnInRect(java.awt.geom.Rectangle2D.Float rc)
rc - The target rectangle.protected java.awt.Shape getRgnInRect(java.awt.geom.Rectangle2D.Float rc,
boolean inLocal)
rc - The target rectangle.inLocal - true if the shape's coordinate should be relative to the node.protected void onUpdateBounds(java.awt.geom.Rectangle2D oldBounds)
onUpdateBounds in class DiagramNodepublic void arrangeComponents(java.awt.geom.Rectangle2D.Float availableSpace,
java.awt.Graphics2D g2d)
public void invalidateLayout()
invalidateLayout in interface ComponentHostpublic ComponentBase findComponent(java.lang.String name)
name - The name of the component to search for.public boolean containsComponent(ComponentBase component)
component - The component to check.public ComponentBase getComponentAt(java.awt.geom.Point2D point)
point - A Point2D specifying the point to test, expressed in document coordinates.protected void onMeasureUnitChanged()
DiagramItemonMeasureUnitChanged in class DiagramItempublic ComponentBase getFocusedComponent()
getFocusedComponent in interface ComponentHostpublic void invalidate()
invalidate in interface ComponentHostpublic void invalidate(java.awt.geom.Rectangle2D.Float bounds)
invalidate in interface ComponentHostpublic void invalidateLayout(ComponentBase component)
invalidateLayout in interface ComponentHostpublic void setFocusedComponent(ComponentBase value)
setFocusedComponent in interface ComponentHostpublic java.lang.Object getClipboard(ComponentBase source, java.lang.Class<?> dataType)
getClipboard in interface ComponentHostpublic void setClipboard(ComponentBase source, java.lang.Object data)
setClipboard in interface ComponentHostpublic void applyEffects(ComponentBase component, java.lang.Object parameters, EffectPhase phase)
applyEffects in interface ComponentHostpublic java.awt.geom.Point2D.Float pointToComponent(java.awt.geom.Point2D.Float point)
public java.awt.Point docToComponent(java.awt.geom.Point2D.Float docPoint,
ComponentBase component)
docPoint - The point to convert.component - The target component.public java.util.List<ComponentBase> getComponents()
public java.awt.geom.Rectangle2D.Float getBounds()
getBounds in interface ComponentHostgetBounds in class DiagramNodeRectangle2D.Float object
representing the node bounds.