public class TreeViewNode 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 |
|---|
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,
android.graphics.PointF pt,
boolean incoming)
|
protected DiagramItemProperties |
createProperties()
Creates an item property set corresponding to the type of this diagram item.
|
protected void |
drawLocal(android.graphics.Canvas 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 area.
|
android.graphics.Bitmap |
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.
|
android.graphics.RectF |
getEditRect(DiagramItem item,
android.graphics.PointF pointerPosition)
Implements InplaceEditable.getEditRect.
|
boolean |
getEnableStyledText()
Gets a value indicating whether styled text rendering is enabled.
|
Font |
getFont()
Gets or the font used to render the node's caption.
|
android.graphics.RectF |
getItemRect(TreeViewItem treeItem)
Gets the location and size of the specified TreeViewItem.
|
android.graphics.RectF |
getRepaintRect(boolean includeConnected)
DiagramNode.getRepaintRect(boolean) override. |
TreeItemList |
getRootItems()
Gets a list of the root
TreeViewItem objects displayed in this node. |
float |
getScrollPosition()
Gets the current scroll position.
|
SimpleShape |
getShape()
Gets the shape of this node.
|
TextFormat |
getTextFormat()
Gets a
TextFormat object specifying how to format and align the text of this node. |
java.lang.String |
getTextToEdit()
Implements InplaceEditable.getTextToEdit.
|
com.mindfusion.diagramming.builders.TreeViewNodeBuilder |
init()
Returns a TreeViewNodeBuilder object used to configure this TreeViewNode instance.
|
TreeViewItem |
itemFromPoint(android.graphics.PointF point)
Returns the item at the specified location.
|
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,
android.graphics.PointF pointerPosition)
DiagramItem.onClick(int, PointF) override. |
protected void |
onLoad(Diagram diagram)
|
protected void |
onMeasureUnitChanged()
Called when the Diagram's MeasureUnit changes.
|
protected void |
onUpdateBounds()
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,
android.graphics.RectF dest,
com.mindfusion.diagramming.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 |
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 area.
|
void |
setCaptionImage(android.graphics.Bitmap 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 |
setEditedText(java.lang.String newText)
Implements InplaceEditable.setEditedText.
|
void |
setEnableStyledText(boolean value)
Sets a value indicating whether styled text rendering is enabled.
|
void |
setFont(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 |
setScrollPosition(float value)
Sets the current scroll position.
|
void |
setShape(SimpleShape value)
Sets the shape of this node.
|
void |
setTextFormat(TextFormat value)
Sets a
TextFormat object specifying how to format and align the text of this node. |
static com.mindfusion.diagramming.builders.TreeViewNodeBuilder |
with()
Returns a TreeViewNodeBuilder object used to configure and create new TreeViewNode instances.
|
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable.
|
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, getEffects, getEnabledHandles, getExpandable, getExpanded, getHandlesStyle, getIncomingLinks, getLocalBounds, getLocalBoundsD, getLocalCenter, getMasterGroup, getObstacle, getOutgoingLinks, getRotatedBounds, getRotationAngle, groupContains, hitTestHandle, move, moveTo, nodesIntersect, onDragOut, onDragOver, onDropOver, onModify, onRemove, onRotationAngleChanged, parentConstraintsInfringed, putExpandable, rectFromPoints, resize, resizeToFitImage, restoreState, saveState, setAllowIncomingLinks, setAllowOutgoingLinks, setAnchorPattern, setBounds, setBounds, setBounds, setBoundsDirect, setConstraints, setEnabledHandles, setExpandable, setExpanded, setExpandedFlag, setHandlesStyle, setObstacle, setRotationAngle, shouldRenderAnchors, startCreate, startModify, updateCreate, updateLinkPositions, updateModifyclone, getBrush, getEffectiveBrush, getEffectiveFont, getEffectivePen, getEffectiveShadowBrush, getEffectiveTextBrush, 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, onAdd, onChangeFont, onChildModified, onDoubleClick, onStyleChanged, putSelected, query, repaint, repaint, repaint, setBrush, setDiagramDirty, setHyperLink, setId, setIgnoreLayout, setLayerIndex, setLocked, 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 com.mindfusion.diagramming.builders.TreeViewNodeBuilder with()
TreeViewNodeBuilder instance.public com.mindfusion.diagramming.builders.TreeViewNodeBuilder init()
TreeViewNodeBuilder instance.protected void drawLocal(android.graphics.Canvas 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 android.graphics.RectF getEditRect(DiagramItem item, android.graphics.PointF pointerPosition)
getEditRect in interface InplaceEditableitem - A reference to this node.mousePosition - A PointF instance specifying the current pointer position.public TreeViewItem itemFromPoint(android.graphics.PointF point)
point - The point to check.TreeViewItem instance that contains the specified point.protected void onClick(int mouseButton,
android.graphics.PointF pointerPosition)
DiagramItem.onClick(int, PointF) override.onClick in class DiagramItemmouseButton - Specifies the mouse button used to click the item.pointerPosition - Specifies the pointer position.public android.graphics.RectF getItemRect(TreeViewItem treeItem)
treeItem - A TreeViewItem instance.RectangleF specifying the item's position and size.public java.lang.String getCaption()
public Font getFont()
getFont in class DiagramItemFont instance specifying the font attributes.public void setFont(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 android.graphics.Bitmap getCaptionImage()
java.awt.Bitmap class.public void setCaptionImage(android.graphics.Bitmap image)
image - An instance of the java.awt.Bitmap class.public float getCaptionHeight()
public void setCaptionHeight(float value)
value - A float value specifying the caption area 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()
DiagramNode.onUpdateBounds(); override.onUpdateBounds in class DiagramNodeprotected void setReflexive(DiagramLink link)
setReflexive in class DiagramNodelink - Reference to the link.public android.graphics.RectF 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,
android.graphics.RectF dest,
com.mindfusion.diagramming.DrawTextHint hint)
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, android.graphics.PointF pt, boolean incoming)
createConnectionPoint in class DiagramNodelink - A DiagramLink that should be connected to this node.pt - 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,
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.TransformerExceptionXmlExceptionprotected 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 onChangeTextPadding()
onChangeTextPadding 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.