|
instrument/JTree API Documentation | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.pvv.bcd.instrument.JTree.DefaultNodeFactory
The default node factory will
create DefaultMutableTreeNode type nodes
with DefaultNodeInfo type user objects.
DefaultNodeInfo,
DefaultMutableTreeNode| Constructor Summary | |
DefaultNodeFactory()
Default constructor, doesn't do anything. |
|
| Method Summary | |
javax.swing.tree.TreeNode |
cloneNode(javax.swing.tree.TreeNode node)
Will clone a node. |
javax.swing.tree.TreeNode |
createNode(java.lang.Object ob)
Will create a new node with a given user object. |
javax.swing.tree.TreeNode |
createNode(java.lang.String title,
java.lang.String contents)
Will create a new node based on XML data. |
javax.swing.tree.TreeNode |
createNode(javax.swing.tree.TreeNode parent)
Will create a default empty node. |
java.awt.datatransfer.Transferable |
createTransferable(java.lang.Object[] nodes,
DndId dndId)
Will create and return a suitable Transferable carrying
data for multiple nodes. |
java.awt.datatransfer.Transferable |
createTransferable(java.lang.Object node,
DndId dndId)
Will create and return a suitable Transferable carrying
data for one node. |
void |
setUserObjectTitle(java.lang.Object userobject,
java.lang.String title)
Sets the displayable title of a node. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DefaultNodeFactory()
| Method Detail |
public javax.swing.tree.TreeNode cloneNode(javax.swing.tree.TreeNode node)
clone()
on the node. Rather, we use our own logic for achieving this. If
the node to be cloned is of type
DefaultMutableTreeNode, the new
node will copy the user object also. If the user object is
Copyable,
a new object is created by calling its copy() method.
If it is not,
the new node will have the exact same user object as the original.
Calls createNode() to achieve this.cloneNode in interface NodeFactorynode - Node to clonecreateNode(Object)public javax.swing.tree.TreeNode createNode(javax.swing.tree.TreeNode parent)
DefaultNodeInfo object as its user object.createNode in interface NodeFactoryparent - Parent of the new node to create, not used in the
default implementationDefaultMutableTreeNodecreateNode(Object),
createNode(String, String)public javax.swing.tree.TreeNode createNode(java.lang.Object ob)
createNode in interface NodeFactoryob - User object to insert into nodeDefaultMutableTreeNodecreateNode(String, String),
createNode(TreeNode)
public javax.swing.tree.TreeNode createNode(java.lang.String title,
java.lang.String contents)
createNode in interface NodeFactorytitle - Title of new nodecontents - Textual contents of new nodeDefaultMutableTreeNodecreateNode(Object),
createNode(TreeNode)
public void setUserObjectTitle(java.lang.Object userobject,
java.lang.String title)
setUserObjectTitle in interface UserObjectFactoryuserobject - Node to set title on. The default implementation
expects this to be a DefaultNodeInfo type object.title - New title to set on the node.
public java.awt.datatransfer.Transferable createTransferable(java.lang.Object node,
DndId dndId)
throws org.pvv.bcd.Util.FeatureNotSupportedException
Transferable carrying
data for one node.createTransferable in interface NodeFactorynode - Node to create a Transferable for. The default
implementation expects this to be a DefaultMutableTreeNode.Unique - DND id associated with this transfer.Transferable suitable for transferring
the given node data.
The default implementation will return a DefaultTransferable.org.pvv.bcd.Util.FeatureNotSupportedException - if data transfer is not supported
by this node factory.createTransferable(Object[], DndId),
DefaultTransferable
public java.awt.datatransfer.Transferable createTransferable(java.lang.Object[] nodes,
DndId dndId)
throws org.pvv.bcd.Util.FeatureNotSupportedException
Transferable carrying
data for multiple nodes.createTransferable in interface NodeFactorynodes - Nodes to create a Transferable for. The default
implementation expects these to be DefaultMutableTreeNode.Unique - DND id associated with this transfer.Transferable suitable for transferring the
given node data.
The default implementation will return a DefaultTransferable.org.pvv.bcd.Util.FeatureNotSupportedException - if data transfer is not supported
by this node factory.createTransferable(Object, DndId),
DefaultTransferable
|
instrument/JTree API Documentation | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||