public class TreeViewNode extends DiagramNode implements RenderTextCallback, 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 |
|---|
TreeViewNode()
Initializes a new instance of the
TreeViewNode class. |
TreeViewNode(Diagram diagram)
Initializes a new instance of the TreeViewNode class.
|
TreeViewNode(TreeViewNode prototype)
Initializes a new instance of the TreeViewNode class using
the specified node as a prototype.
|
| Modifier and Type | Method and Description |
|---|---|
ConnectionPoint |
createConnectionPoint(DiagramLink link,
java.awt.geom.Point2D point,
boolean incoming)
|
protected DiagramItemProperties |
createProperties()
Creates an item property set corresponding to the type of this diagram item.
|
Command |
createScrollCommand() |
protected void |
drawLocal(java.awt.Graphics2D g,
RenderOptions options)
Draws the tree node on the specified Graphics2D surface.
|
protected void |
getAllIncomingLinks(DiagramLinkList links)
|
protected void |
getAllOutgoingLinks(DiagramLinkList links)
|
java.lang.String |
getCaption()
Gets the text displayed as caption of the node.
|
float |
getCaptionHeight()
Gets the height of the node's caption bar.
|
java.awt.Image |
getCaptionImage()
Gets the image that is displayed in the caption.
|
TreeViewConnectionStyle |
getConnectionStyle()
Gets a value indicating whether drawing a link from/to this
node should connect an item or the whole node as an integral entity.
|
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.
|
boolean |
getEnableStyledText()
Gets a value indicating whether styled text rendering is enabled.
|
java.util.ArrayList<TreeViewItem> |
getFlatItemList()
Gets a list of all items of this node.
|
java.awt.Font |
getFont()
Gets or the font used to render the node's caption.
|
java.awt.geom.Rectangle2D.Float |
getItemRect(TreeViewItem treeItem)
Gets the location and size of the specified TreeViewItem.
|
java.awt.geom.Rectangle2D |
getRepaintRect(boolean includeConnected)
DiagramNode.getRepaintRect(boolean) override. |
TreeItemList |
getRootItems()
Gets a list of the root
TreeViewItem objects displayed in this node. |
boolean |
getScrollable()
Gets a value indicating whether users are allowed to scroll this tree view.
|
float |
getScrollbarLargeChange(boolean vertical) |
float |
getScrollbarMaximum(boolean vertical) |
float |
getScrollPosition()
Gets the current scroll position.
|
SimpleShape |
getShape()
Gets the shape of this node.
|
boolean |
getShowLines()
Gets whether to display lines connecting child items to parent items.
|
TextFormat |
getTextFormat()
Gets a
TextFormat object specifying how to format and align the text of this node. |
java.lang.String |
getTextToEdit()
Implements InplaceEditable.getTextToEdit.
|
TreeViewNodeBuilder |
init()
Returns a TreeViewNodeBuilder object used to configure this TreeViewNode instance.
|
TreeViewItem |
itemFromPoint(java.awt.geom.Point2D point)
Returns the item at the specified location.
|
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 |
onChangeTextPadding() |
protected void |
onClick(int mouseButton,
java.awt.geom.Point2D mousePosition)
DiagramItem.onClick(int, Point2D) override. |
protected void |
onLoad(Diagram diagram)
|
protected void |
onMeasureUnitChanged()
Called when the Diagram's MeasureUnit changes.
|
protected void |
onStyleFontChanged()
Invoked when font property values of an associated style change.
|
protected void |
onUpdateBounds(java.awt.geom.Rectangle2D oldBounds)
DiagramNode#onUpdateBounds(); override. |
protected void |
onZoomChanged()
Called when the Diagram's ZoomFactor changes.
|
void |
readExternal(java.io.ObjectInput in)
Implements Externalizable.
|
void |
removeItem(TreeViewItem item)
Removes the specified item from the node.
|
void |
renderText(java.lang.String text,
java.awt.geom.Rectangle2D dest,
DrawTextHint hint) |
void |
resizeToFitText()
Resizes the tree view so that it is large enough to fit the text of its items.
|
void |
resizeToFitText(boolean ignoreCaption)
Resizes the tree view so that it is large enough to fit the text of its items.
|
protected void |
restoreProperties(DiagramItemProperties props)
|
protected void |
saveProperties(DiagramItemProperties props)
|
protected void |
saveToJson(com.mindfusion.common.JsonObject obj,
JsonPersistContext context)
Saves the item content into a JsonObject.
|
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 |
setCaption(java.lang.String caption)
Sets the text displayed as caption of the node.
|
void |
setCaptionHeight(float value)
Gets the height of the node's caption bar.
|
void |
setCaptionImage(java.awt.Image image)
Gets the image that is displayed in the caption.
|
void |
setConnectionStyle(TreeViewConnectionStyle value)
Sets a value indicating whether drawing a link from/to this
node should connect an item or the whole node as an integral entity.
|
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 |
setEnableStyledText(boolean value)
Sets a value indicating whether styled text rendering is enabled.
|
void |
setFont(java.awt.Font value)
Sets or the font used to render the node's caption.
|
protected void |
setReflexive(DiagramLink link)
Invoked to let a node set the shape of a reflexive link connected to it.
|
void |
setScrollable(boolean value)
Sets a value indicating whether users are allowed to scroll this tree view.
|
void |
setScrollPosition(float value)
Sets the current scroll position.
|
void |
setShape(SimpleShape value)
Sets the shape of this node.
|
void |
setShowLines(boolean value)
Sets whether to display lines connecting child items to parent items.
|
void |
setTextFormat(TextFormat value)
Sets a
TextFormat object specifying how to format and align the text of this node. |
void |
updateScrollPosition(float newValue,
boolean vertical) |
static TreeViewNodeBuilder |
with()
Returns a TreeViewNodeBuilder object used to configure and create new TreeViewNode instances.
|
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable.
|
addLabel, addLabel, allowCreate, allowModify, allowModifyImpl, attachTo, attachTo, attachTo, cancelModify, completeCreate, completeModify, constraintsInfringed, containsPoint, containsPoint, createState, detach, draw, 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, hitTestHandle, labelFromPoint, move, moveTo, nodesIntersect, onDragOut, onDragOver, onDropOver, onModify, onRemove, onRotationAngleChanged, parentConstraintsInfringed, putExpandable, rectFromPoints, removeLabel, resize, resizeToFitImage, restoreState, saveState, setAllowIncomingLinks, setAllowOutgoingLinks, setAnchorPattern, setBounds, setBounds, setBounds, setBoundsDirect, setConstraints, setEnabledHandles, setExpandable, setExpanded, setExpandedFlag, setHandlesStyle, setObstacle, setRotationAngle, shouldRenderAnchors, startCreate, startModify, updateCreate, updateLinkPositions, updateModifyas, clone, getBrush, getEffectiveBrush, getEffectiveFont, getEffectivePen, getEffectiveShadowBrush, getEffectiveTextBrush, 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, onChildModified, onDoubleClick, onStyleChanged, putSelected, query, repaint, repaint, repaint, setBrush, setDiagramDirty, 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 TreeViewNode()
TreeViewNode class.public TreeViewNode(Diagram diagram)
This constructor initializes the TreeViewNode properties with the
values specified in the respective default-value properties of
the Diagram object.
diagram - The Diagram from which to obtain default values for the node properties.public TreeViewNode(TreeViewNode prototype)
public static TreeViewNodeBuilder with()
TreeViewNodeBuilder instance.public TreeViewNodeBuilder init()
TreeViewNodeBuilder instance.protected void drawLocal(java.awt.Graphics2D g,
RenderOptions options)
drawLocal in class DiagramNodeg - An Graphics2D object where the link should be rendered.options - A RenderOptions object specifying options for the drawing operation.public java.lang.String getTextToEdit()
getTextToEdit in interface InplaceEditablepublic void setEditedText(java.lang.String newText)
setEditedText in interface InplaceEditablenewText - The new text of the node'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 TreeViewItem itemFromPoint(java.awt.geom.Point2D point)
point - The point to check.TreeViewItem instance that contains the specified point.protected void onClick(int mouseButton,
java.awt.geom.Point2D mousePosition)
DiagramItem.onClick(int, Point2D) override.onClick in class DiagramItemmouseButton - Specifies the mouse button used to click the item.mousePosition - Specifies the mouse position.public java.awt.geom.Rectangle2D.Float getItemRect(TreeViewItem treeItem)
treeItem - A TreeViewItem instance.RectangleF specifying the item's position and size.public java.util.ArrayList<TreeViewItem> getFlatItemList()
TreeViewItem objects.public java.lang.String getCaption()
public java.awt.Font getFont()
getFont in class DiagramItemFont instance specifying the font attributes.public void setFont(java.awt.Font value)
setFont in class DiagramItemvalue - A Font instance specifying the font attributes.public void setCaption(java.lang.String caption)
caption - A string specifying the caption text.public SimpleShape getShape()
SimpleShape enumeration.public void setShape(SimpleShape value)
value - A member of the SimpleShape enumeration.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 java.awt.Image getCaptionImage()
java.awt.Image class.public void setCaptionImage(java.awt.Image image)
image - An instance of the java.awt.Image class.public boolean getShowLines()
public void setShowLines(boolean value)
value - true to draw connecting lines, or false otherwise.public float getCaptionHeight()
public void setCaptionHeight(float value)
value - A float value specifying the caption bar height. The default value is 8.public void setScrollPosition(float value)
value - A float value specifying the scroll position.public float getScrollPosition()
public TreeItemList getRootItems()
TreeViewItem objects displayed in this node.public TreeViewConnectionStyle getConnectionStyle()
TreeViewConnectionStyle enumeration.public void setConnectionStyle(TreeViewConnectionStyle value)
value - A member of the TreeViewConnectionStyle enumeration.protected void onUpdateBounds(java.awt.geom.Rectangle2D oldBounds)
DiagramNode#onUpdateBounds(); override.onUpdateBounds in class DiagramNodeprotected void setReflexive(DiagramLink link)
setReflexive in class DiagramNodelink - Reference to the link.public java.awt.geom.Rectangle2D getRepaintRect(boolean includeConnected)
DiagramNode.getRepaintRect(boolean) override.getRepaintRect in class DiagramNodeincludeConnected - true is related items should be considered too;
otherwise, false.public void renderText(java.lang.String text,
java.awt.geom.Rectangle2D dest,
DrawTextHint hint)
renderText in interface RenderTextCallbackpublic boolean getScrollable()
true if users are allowed to scroll the tree view,
otherwise false.public void setScrollable(boolean value)
value - true if users are allowed to scroll
the tree view, otherwise false.public TextFormat getTextFormat()
TextFormat object specifying how to format and align the text of this node.TextFormat object specifying the text format and alignment.public void setTextFormat(TextFormat value)
TextFormat object specifying how to format and align the text of this node.value - A TextFormat object specifying the text format and alignment.protected void getAllOutgoingLinks(DiagramLinkList links)
links - A DiagramLinkList the links should be added to.protected void getAllIncomingLinks(DiagramLinkList links)
links - A DiagramLinkList the links should be added to.public ConnectionPoint createConnectionPoint(DiagramLink link, java.awt.geom.Point2D point, boolean incoming)
createConnectionPoint in class DiagramNodelink - A DiagramLink that should be connected to this node.point - The point at which the link should be connected.incoming - true if link is an incoming link; otherwise, false.TreeViewConnectionPoint instance representing the connection.protected void onLoad(Diagram diagram)
onLoad in class DiagramItemprotected 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 methods.javax.xml.transform.TransformerExceptioncom.mindfusion.common.XmlExceptionprotected void saveToXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
saveToXml in class DiagramNodexmlElement - An XmlElement 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 saveToJson(com.mindfusion.common.JsonObject obj,
JsonPersistContext context)
saveToJson in class DiagramNodeobj - A JsonObject where item's data is storedcontext - A JsonPersistContext object providing contextual information
about the serialization process and some 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 onChangeTextPadding()
onChangeTextPadding in class DiagramItemprotected void onStyleFontChanged()
DiagramItemonStyleFontChanged in class DiagramItempublic boolean getEnableStyledText()
true to parse the text of the node's caption and items in order to
find formatting tags; otherwise false.
Initialized with the value of Diagram.getEnableStyledText().public void setEnableStyledText(boolean value)
value - true to parse the text of the node's caption and items in order to
find formatting tags; otherwise false.protected void onMeasureUnitChanged()
onMeasureUnitChanged in class DiagramItemprotected void onZoomChanged()
protected void restoreProperties(DiagramItemProperties props)
restoreProperties in class DiagramNodeprops - A DiagramItemProperties-derived object containing a snapshot
of the item's properties.protected void saveProperties(DiagramItemProperties props)
saveProperties in class DiagramNodeprops - A DiagramItemProperties-derived object where the item's properties
should be saved.protected DiagramItemProperties createProperties()
ChangeItemCmd instance.createProperties in class DiagramNodeDiagramItemProperties-derived object containing a snapshot
of the item's properties.public void removeItem(TreeViewItem item)
item - The TreeViewItem to remove.public void resizeToFitText()
public void resizeToFitText(boolean ignoreCaption)
ignoreCaption - 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 void scaleElements(float scale)
scaleElements in class DiagramNodescale - The value by which to multiply node elements' sizes.public float getScrollbarMaximum(boolean vertical)
public float getScrollbarLargeChange(boolean vertical)
public Command createScrollCommand()
public void updateScrollPosition(float newValue,
boolean vertical)