|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindfusion.diagramming.DiagramItem
com.mindfusion.diagramming.DiagramNode
com.mindfusion.diagramming.TreeViewNode
public class TreeViewNode
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 | |
---|---|
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. |
Method Summary | |
---|---|
ConnectionPoint |
createConnectionPoint(DiagramLink link,
java.awt.geom.Point2D pt,
boolean incoming)
DiagramNode.createConnectionPoint(DiagramLink, Point2D, boolean) override. |
protected DiagramItemProperties |
createProperties()
Creates an item property set corresponding to the type of this diagram item. |
protected void |
drawLocal(java.awt.Graphics2D g,
RenderOptions options)
Draws the tree node on the specified Graphics2D surface. |
protected void |
getAllIncomingLinks(DiagramLinkList links)
DiagramNode.getAllIncomingLinks(DiagramLinkList) override. |
protected void |
getAllOutgoingLinks(DiagramLinkList links)
DiagramNode.getAllOutgoingLinks(DiagramLinkList) ; override. |
java.lang.String |
getCaption()
Gets the text displayed as caption of the node. |
float |
getCaptionHeight()
Gets the height of the node's caption area. |
java.awt.Image |
getCaptionImage()
Gets the image that is displayed in the caption. |
int |
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. |
java.awt.geom.Rectangle2D |
getEditRect(java.awt.geom.Point2D mousePosition)
|
boolean |
getEnableStyledText()
Gets a value indicating whether styled text rendering is enabled. |
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. |
float |
getScrollPosition()
Gets the current scroll position. |
int |
getShape()
Gets the shape of this node. |
TextFormat |
getTextFormat()
|
java.lang.String |
getTextToEdit()
|
TreeViewItem |
itemFromPoint(java.awt.geom.Point2D 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,
java.awt.geom.Point2D mousePosition)
DiagramItem.onClick(int, Point2D) override. |
protected void |
onLoad(Diagram diagram)
DiagramItem.onLoad(com.mindfusion.diagramming.Diagram) override. |
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,
java.awt.geom.Rectangle2D 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)
DiagramNode.restoreProperties(DiagramItemProperties) override. |
protected void |
saveProperties(DiagramItemProperties props)
DiagramNode.saveProperties(DiagramItemProperties) override. |
protected void |
saveToXml(org.w3c.dom.Element xmlElement,
XmlPersistContext context)
Saves the item content into an XML element. |
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(java.awt.Image image)
Gets the image that is displayed in the caption. |
void |
setConnectionStyle(int 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)
|
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 |
setScrollPosition(float value)
Sets the current scroll position. |
void |
setShape(int value)
Sets the shape of this node. |
void |
setTextFormat(TextFormat value)
|
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public 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)
Method Detail |
---|
protected void drawLocal(java.awt.Graphics2D g, RenderOptions options)
drawLocal
in class DiagramNode
g
- An Graphics2D
object where the link should be rendered.options
- A RenderOptions object specifying options for the drawing operation.
public java.awt.geom.Rectangle2D getEditRect(java.awt.geom.Point2D mousePosition)
getEditRect
in interface InplaceEditable
public java.lang.String getTextToEdit()
getTextToEdit
in interface InplaceEditable
public void setEditedText(java.lang.String newText)
setEditedText
in interface InplaceEditable
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 DiagramItem
mouseButton
- 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.lang.String getCaption()
public java.awt.Font getFont()
getFont
in class DiagramItem
Font
instance specifying the font attributes.public void setFont(java.awt.Font value)
setFont
in class DiagramItem
value
- A Font
instance specifying the font attributes.public void setCaption(java.lang.String caption)
caption
- A string specifying the caption text.public int getShape()
SimpleShape
constants.public void setShape(int value)
value
- One of the SimpleShape
constants.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 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 int getConnectionStyle()
public void setConnectionStyle(int value)
protected void onUpdateBounds()
DiagramNode.onUpdateBounds()
; override.
onUpdateBounds
in class DiagramNode
protected void setReflexive(DiagramLink link)
setReflexive
in class DiagramNode
link
- Reference to the link.public java.awt.geom.Rectangle2D getRepaintRect(boolean includeConnected)
DiagramNode.getRepaintRect(boolean)
override.
getRepaintRect
in class DiagramNode
includeConnected
- true
is related items should be considered too;
otherwise, false
.
public void renderText(java.lang.String text, java.awt.geom.Rectangle2D dest, com.mindfusion.diagramming.DrawTextHint hint)
public TextFormat getTextFormat()
public void setTextFormat(TextFormat value)
protected void getAllOutgoingLinks(DiagramLinkList links)
DiagramNode.getAllOutgoingLinks(DiagramLinkList)
; override.
links
- A DiagramLinkList
the links should be added to.protected void getAllIncomingLinks(DiagramLinkList links)
DiagramNode.getAllIncomingLinks(DiagramLinkList)
override.
links
- A DiagramLinkList
the links should be added to.public ConnectionPoint createConnectionPoint(DiagramLink link, java.awt.geom.Point2D pt, boolean incoming)
DiagramNode.createConnectionPoint(DiagramLink, Point2D, boolean)
override.
createConnectionPoint
in class DiagramNode
link
- 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)
DiagramItem.onLoad(com.mindfusion.diagramming.Diagram)
override.
onLoad
in class DiagramItem
protected void loadFromXml(org.w3c.dom.Element xmlElement, XmlPersistContext context) throws javax.xml.transform.TransformerException, XmlException
loadFromXml
in class DiagramNode
xmlElement
- 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.TransformerException
XmlException
protected void saveToXml(org.w3c.dom.Element xmlElement, XmlPersistContext context)
saveToXml
in class DiagramNode
xmlElement
- 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 DiagramItem
public 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()
protected void onZoomChanged()
protected void restoreProperties(DiagramItemProperties props)
DiagramNode.restoreProperties(DiagramItemProperties)
override.
restoreProperties
in class DiagramNode
props
- A DiagramItemProperties
-derived object containing a snapshot
of the item's properties.protected void saveProperties(DiagramItemProperties props)
DiagramNode.saveProperties(DiagramItemProperties)
override.
saveProperties
in class DiagramNode
props
- A DiagramItemProperties
-derived object where the item's properties
should be saved.protected DiagramItemProperties createProperties()
ChangeItemCmd
instance.
createProperties
in class DiagramNode
DiagramItemProperties
-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.Externalizable
writeExternal
in class DiagramNode
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
readExternal
in class DiagramNode
java.io.IOException
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |