public class ContainerNode extends DiagramNode implements InplaceEditable
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 |
|---|
ContainerNode()
Initializes a new instance of the ContainerNode class.
|
ContainerNode(ContainerNode prototype)
Initializes a new instance of the ContainerNode class using
the specified node as a prototype.
|
ContainerNode(Diagram parent)
Initializes a new instance of the ContainerNode class with
the default values of the specified diagram.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(DiagramNode node)
Adds a node to this container.
|
DiagramItem |
clone(boolean clipboard)
DiagramItem.clone override.
|
boolean |
containsRecursively(DiagramNode node)
Determines whether this container contains the specified node,
either directly or recursively through other containers.
|
protected DiagramItemProperties |
createProperties()
DiagramItem.createProperties() override. |
Command |
createScrollCommand() |
void |
draw(java.awt.Graphics2D graphics,
RenderOptions options)
DiagramNode.draw override.
|
void |
drawLocal(java.awt.Graphics2D graphics,
RenderOptions options)
Draws the container on the specified Graphics2D surface.
|
boolean |
getAllowAddChildren()
Gets a value indicating whether child nodes can be added interactively to this container.
|
boolean |
getAllowRemoveChildren()
Gets a value indicating whether child nodes can be removed interactively from this container.
|
boolean |
getAutoDeleteChildren()
Gets whether deleting this container should
also remove its child items from the diagram.
|
boolean |
getAutoGrow()
Gets a value indicating whether the container should grow in size when nodes are added to it.
|
boolean |
getAutoShrink()
Gets a value indicating whether the container should
shrink in size when nodes are removed from it.
|
java.lang.String |
getCaption()
Gets the container's caption text.
|
Brush |
getCaptionBackBrush()
Gets the brush used to paint the caption bar of this container.
|
Brush |
getCaptionBrush()
Gets the brush used to draw the container's caption text.
|
TextFormat |
getCaptionFormat()
Gets the caption alignment and format.
|
float |
getCaptionHeight()
Gets the height of the container's caption bar.
|
ReadOnlyDiagramNodeList |
getChildren()
Gets the child nodes of this container.
|
boolean |
getClipChildren()
Gets a value indicating whether child items should be clipped by container boundaries.
|
static ContainerNode |
getContainer(DiagramNode node)
Retrieves the container node (if any) the specified node belongs to.
|
float |
getCornerRadius()
Gets the radius of node's corner arcs when its Shape is set to RoundedRectangle.
|
Pen |
getDividerPen()
Gets the
Pen used to draw the the divider line
between node's caption bar and content area. |
java.awt.geom.Rectangle2D |
getEditRect(DiagramItem item,
java.awt.geom.Point2D mousePosition)
Implements InplaceEditable.getEditRect.
|
Brush |
getEffectiveCaptionBrush()
Creates a
Brush object representing the currently
effective caption brush of the container. |
boolean |
getFoldable()
Gets a value indicating whether the user is allowed
to fold this container.
|
boolean |
getFolded()
Gets a value indicating whether this container is folded.
|
java.awt.geom.Dimension2D |
getFoldedSize()
Gets the size of the container when folded.
|
java.lang.Float |
getFoldIconSize()
Gets the size of the fold / unfold icon.
|
Pen |
getHighlightPen()
Gets the
Pen used to draw the container frame lines
when an item is dragged over the container. |
float |
getMargin()
Gets how much space should be left between
contained nodes and the container borders.
|
java.awt.geom.Dimension2D |
getMinimumSize()
Gets the minimum size of the container.
|
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.
|
boolean |
getScrollable()
Gets a value indicating whether users are
allowed to scroll the contents of this container.
|
float |
getScrollbarLargeChange(boolean vertical) |
float |
getScrollbarMaximum(boolean vertical) |
float |
getScrollX()
Gets the container's horizontal scroll position.
|
float |
getScrollY()
Gets the container's vertical scroll position.
|
SimpleShape |
getShape()
Gets the shape of this container.
|
java.lang.String |
getTextToEdit()
Implements InplaceEditable.getTextToEdit.
|
java.awt.geom.Dimension2D |
getUnfoldedSize()
Returns the original size of a folded container.
|
boolean |
getVisible()
Gets a value indicating whether the container is visible.
|
DiagramItem |
hitTest(java.awt.geom.Point2D point,
float threshold,
boolean onlyNodes,
boolean onlyInteractive,
boolean includeHandles,
boolean includeLabels)
DiagramItem.hitTest override.
|
AdjustmentHandle |
hitTestHandle(java.awt.geom.Point2D point)
|
ContainerNodeBuilder |
init()
Returns a ContainerNodeBuilder object used to configure this ContainerNode instance.
|
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 |
onChildModified(DiagramNode node,
AdjustmentHandle handle)
Called when a group child node has been modified.
|
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 |
onLoad(Diagram diagram)
DiagramItem.onLoad override.
|
protected void |
onRemove()
Called when an item is removed from a Diagram, either by
the user, programmatically or via undo / redo.
|
protected void |
onSelectedChildrenModified(Selection selection) |
void |
readExternal(java.io.ObjectInput in)
Implements Externalizable.
|
void |
remove(DiagramNode node)
Removes a node from this container.
|
void |
resizeToFitChildren(boolean allowShrink,
java.awt.geom.Dimension2D margins)
Resizes the container making it big enough to contain its child nodes.
|
protected void |
restoreProperties(DiagramItemProperties props)
|
protected void |
saveProperties(DiagramItemProperties props)
|
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)
DiagramNode.scaleElements override.
|
void |
setAllowAddChildren(boolean value)
Sets a value indicating whether child nodes can be added interactively to this container.
|
void |
setAllowRemoveChildren(boolean value)
Sets a value indicating whether child nodes can be removed interactively from this container.
|
void |
setAutoDeleteChildren(boolean value)
Sets whether deleting this container should
also remove its child items from the diagram.
|
void |
setAutoGrow(boolean value)
Sets a value indicating whether the container should grow in size when nodes are added to it.
|
void |
setAutoShrink(boolean value)
Sets a value indicating whether the container should
shrink in size when nodes are removed from it.
|
void |
setCaption(java.lang.String value)
Sets the container's caption text.
|
void |
setCaptionBackBrush(Brush value)
Sets the brush used to paint the caption bar of this container.
|
void |
setCaptionBrush(Brush value)
Sets the brush used to draw the container's caption text.
|
void |
setCaptionFormat(TextFormat value)
Sets the caption alignment and format.
|
void |
setCaptionHeight(float value)
Sets the height of the container's caption bar.
|
void |
setClipChildren(boolean value)
Sets a value indicating whether child items should be clipped by container boundaries.
|
void |
setCornerRadius(float value)
Sets the radius of node's corner arcs when its Shape is set to RoundedRectangle.
|
void |
setDividerPen(Pen value)
Sets the
Pen used to draw the the divider line
between node's caption bar and content area. |
void |
setEditedText(java.lang.String newText)
Implements InplaceEditable.setEditedText.
|
void |
setFoldable(boolean value)
Sets a value indicating whether the user is allowed
to fold this container.
|
void |
setFolded(boolean value)
Sets a value indicating whether this container is folded.
|
void |
setFoldedSize(java.awt.geom.Dimension2D value)
Sets the size of the container when folded.
|
void |
setFoldIconSize(java.lang.Float value)
Sets the size of the fold / unfold icon.
|
void |
setHighlightPen(Pen value)
Sets the
Pen used to draw the container frame lines
when an item is dragged over the container. |
void |
setMargin(float value)
Sets how much space should be left between
contained nodes and the container borders.
|
void |
setMinimumSize(java.awt.geom.Dimension2D value)
Sets the minimum size of the container.
|
void |
setScrollable(boolean value)
Sets a value indicating whether users are
allowed to scroll the contents of this container.
|
void |
setScrollX(float value)
Sets the container's horizontal scroll position.
|
void |
setScrollY(float value)
Sets the container's vertical scroll position.
|
void |
setShape(SimpleShape value)
Sets the shape of this container.
|
void |
setVisible(boolean value)
Sets a value indicating whether the container is visible.
|
void |
updateBounds()
Updates the container bounds to fit its contents.
|
void |
updateBounds(boolean includeLinks)
Updates the container bounds to fit its contents.
|
void |
updateScrollPosition(float newValue,
boolean vertical) |
static ContainerNodeBuilder |
with()
Returns a ContainerNodeBuilder object used to configure and create new ContainerNode instances.
|
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable.
|
addLabel, addLabel, allowCreate, allowModify, allowModifyImpl, attachTo, attachTo, attachTo, cancelModify, completeCreate, completeModify, constraintsInfringed, containsPoint, containsPoint, createConnectionPoint, createState, detach, drawShadow, drawShadowLocal, getAllIncomingLinks, getAllLinks, getAllOutgoingLinks, getAllowIncomingLinks, getAllowOutgoingLinks, getAnchorPattern, getBounds, getCenter, getConstraints, getContainer, getEffects, getEnabledHandles, getExpandable, getExpanded, getHandlesStyle, getIncomingLinks, getLabels, getLocalBounds, getLocalBoundsD, getLocalCenter, getMasterGroup, getMasterItem, getNearestBorderPoint, getObstacle, getOutgoingLinks, getRotatedBounds, getRotationAngle, groupContains, labelFromPoint, move, moveTo, nodesIntersect, onModify, onRotationAngleChanged, onUpdateBounds, parentConstraintsInfringed, putExpandable, rectFromPoints, removeLabel, resize, resizeToFitImage, restoreState, saveState, setAllowIncomingLinks, setAllowOutgoingLinks, setAnchorPattern, setBounds, setBounds, setBounds, setBoundsDirect, setConstraints, setEnabledHandles, setExpandable, setExpanded, setExpandedFlag, setHandlesStyle, setObstacle, setReflexive, setRotationAngle, shouldRenderAnchors, startCreate, startModify, updateCreate, updateLinkPositions, updateModifyas, 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, getWeight, getZIndex, hasSubordinates, onAdd, onChangeFont, onChangeTextPadding, onClick, onDoubleClick, 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, setWeight, setZIndex, shouldRender, zBottom, zLevelDown, zLevelUp, zToppublic ContainerNode()
public ContainerNode(Diagram parent)
public ContainerNode(ContainerNode prototype)
public DiagramItem clone(boolean clipboard)
clone in class DiagramItemclipboard - true if the copy will be stored in the OS clipboard, or false otherwise.public static ContainerNodeBuilder with()
ContainerNodeBuilder instance.public ContainerNodeBuilder init()
ContainerNodeBuilder instance.public void add(DiagramNode node)
node - The DiagramNode that should be added to the container.public void remove(DiagramNode node)
node - The DiagramNode that should be removed from the container.public void resizeToFitChildren(boolean allowShrink,
java.awt.geom.Dimension2D margins)
allowShrink - true to allow reducing container's size, or false otherwise.margins - A Dimension specifying size of margin space left around container's child items.public void draw(java.awt.Graphics2D graphics,
RenderOptions options)
draw in class DiagramNodegraphics - A Graphics2D object where the node should be rendered.options - Provides options for the drawing operation.public void drawLocal(java.awt.Graphics2D graphics,
RenderOptions options)
drawLocal in class DiagramNodegraphics - A Graphics2D object where the node should be rendered.options - Provides options for the drawing operation.protected java.awt.geom.Rectangle2D getRepaintRect(boolean includeConnected)
DiagramItemgetRepaintRect in class DiagramNodeincludeConnected - true if related items should be considered too; otherwise, false.protected void scaleElements(float scale)
scaleElements in class DiagramNodescale - The value by which to multiply node elements' sizes.public AdjustmentHandle hitTestHandle(java.awt.geom.Point2D point)
hitTestHandle in class DiagramNodepoint - A Point2D value specifying where to look for a selection handle.public boolean onDragOver(DiagramItem item)
onDragOver in class DiagramNodeitem - The DiagramItem being dragged.public void onDragOut(DiagramItem item)
onDragOut in class DiagramNodeitem - The DiagramItem being dragged.public boolean onDropOver(DiagramItem item)
onDropOver in class DiagramNodeitem - The DiagramItem being dragged.protected void onChildModified(DiagramNode node, AdjustmentHandle handle)
onChildModified in class DiagramItemnode - The DiagramNode that has been moved or resized.handle - An AdjustmentHandles constant indicating
which handle has been used to modify the node.protected void onSelectedChildrenModified(Selection selection)
public void updateBounds()
public void updateBounds(boolean includeLinks)
protected void onRemove()
DiagramNodeonRemove in class DiagramNodepublic 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 void saveToXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
saveToXml in class DiagramNodexmlElement - An Element the item's data should be stored into.context - Provides 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 Element containing the item's data.context - Provides contextual information about the serialization
process and some helper serialization methods.javax.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 node's data.context - A JsonPersistContext object providing contextual information about
the serialization process and helper serialization methods.protected void onLoad(Diagram diagram)
onLoad in class DiagramItemprotected DiagramItemProperties createProperties()
DiagramItem.createProperties() override.createProperties in class DiagramNodeprotected void saveProperties(DiagramItemProperties props)
saveProperties in class DiagramNodeprops - A DiagramItemProperties-derived object where
the item's properties should be saved.protected void restoreProperties(DiagramItemProperties props)
restoreProperties in class DiagramNodeprops - A DiagramItemProperties -derived object containing a
snapshot of the item's properties.public java.lang.String getTextToEdit()
getTextToEdit in interface InplaceEditablepublic void setEditedText(java.lang.String newText)
setEditedText in interface InplaceEditablenewText - The new text of the container's caption.public java.awt.geom.Rectangle2D getEditRect(DiagramItem item, java.awt.geom.Point2D mousePosition)
getEditRect in interface InplaceEditableitem - A reference to this node.mousePosition - A Point2D instance specifying the current pointer position.public static ContainerNode getContainer(DiagramNode node)
node - The DiagramNode whose container you need to find.ContainerNode that contains the specified node,
or null if the node is not contained.public boolean containsRecursively(DiagramNode node)
node - The DiagramNode to check.public DiagramItem hitTest(java.awt.geom.Point2D point, float threshold, boolean onlyNodes, boolean onlyInteractive, boolean includeHandles, boolean includeLabels)
hitTest in class DiagramItempoint - A Point2D value specifying the logical coordinates of a diagram point.threshold - Specifies the size of the area around the item outlines where the point is still considered inside the item.onlyNodes - true to exclude child links from the search.onlyInteractive - true to exclude locked items from the search.includeHandles - true to also consider adjustment handle locations (possibly outside of item's bounds).includeLabels - true to also consider item label locations (possibly outside of item's bounds).public Pen getHighlightPen()
Pen used to draw the container frame lines
when an item is dragged over the container.public void setHighlightPen(Pen value)
Pen used to draw the container frame lines
when an item is dragged over the container.public Pen getDividerPen()
Pen used to draw the the divider line
between node's caption bar and content area.public void setDividerPen(Pen value)
Pen used to draw the the divider line
between node's caption bar and content area.public float getMargin()
public void setMargin(float value)
public java.awt.geom.Dimension2D getMinimumSize()
public void setMinimumSize(java.awt.geom.Dimension2D value)
public java.lang.String getCaption()
public void setCaption(java.lang.String value)
public Brush getCaptionBrush()
public void setCaptionBrush(Brush value)
public Brush getEffectiveCaptionBrush()
Brush object representing the currently
effective caption brush of the container.
This method returns a system brush corresponding to the container's
CaptionBrush if the container's
CaptionBrush is not null, or a
system brush corresponding to the TextBrush
property of the container's style.public float getCaptionHeight()
public void setCaptionHeight(float value)
public Brush getCaptionBackBrush()
public void setCaptionBackBrush(Brush value)
value - A Brush instance that should be used to paint caption bar.public TextFormat getCaptionFormat()
public void setCaptionFormat(TextFormat value)
public boolean getFolded()
public void setFolded(boolean value)
public boolean getFoldable()
public void setFoldable(boolean value)
public java.lang.Float getFoldIconSize()
public void setFoldIconSize(java.lang.Float value)
value - A Float value specifying the size of fold / unfold icon.public boolean getAutoDeleteChildren()
public void setAutoDeleteChildren(boolean value)
value - true to automatically delete child items, or false otherwise.public boolean getAutoGrow()
public void setAutoGrow(boolean value)
value - true to grow container's size automatically, or false otherwise.public boolean getAutoShrink()
public void setAutoShrink(boolean value)
public boolean getVisible()
getVisible in class DiagramItemtrue if the item is visible,
otherwise false.public void setVisible(boolean value)
setVisible in class DiagramItemvalue - true if the item should be visible,
otherwise false.public java.awt.geom.Dimension2D getFoldedSize()
public void setFoldedSize(java.awt.geom.Dimension2D value)
public java.awt.geom.Dimension2D getUnfoldedSize()
public ReadOnlyDiagramNodeList getChildren()
public SimpleShape getShape()
SimpleShape enumeration.public void setShape(SimpleShape value)
value - A member of the SimpleShape enumeration.public float getCornerRadius()
public void setCornerRadius(float value)
value - The radius of node's corner arcs.public boolean getAllowAddChildren()
public void setAllowAddChildren(boolean value)
value - true to allow adding child nodes, otherwise false. The default value is true.public boolean getAllowRemoveChildren()
public void setAllowRemoveChildren(boolean value)
value - true to allow removing child nodes, otherwise false. The default value is true.public boolean getClipChildren()
true if child items should be clipped, otherwise false.public void setClipChildren(boolean value)
value - true to clip child items, otherwise false. The default value is true.public boolean getScrollable()
public void setScrollable(boolean value)
value - true if scrolling is allowed, or false otherwise.public float getScrollX()
public void setScrollX(float value)
value - A float value indicating horizontal scroll offset.public float getScrollY()
public void setScrollY(float value)
value - A float value indicating vertical scroll offset.public float getScrollbarMaximum(boolean vertical)
public Command createScrollCommand()
public float getScrollbarLargeChange(boolean vertical)
public void updateScrollPosition(float newValue,
boolean vertical)