Oracle Data-aware Controls Reference

oracle.dacf.control.swing
Class TreeControlNode

java.lang.Object
  extended byoracle.dacf.util.InfoBusMemberHelper
      extended byoracle.dacf.control.swing.TreeControlNode
All Implemented Interfaces:
javax.infobus.DataItemChangeListener, java.util.EventListener, javax.infobus.InfoBusDataConsumer, javax.infobus.InfoBusEventListener, InfoBusManagerListener, javax.infobus.InfoBusMember, javax.swing.tree.MutableTreeNode, java.beans.PropertyChangeListener, javax.swing.tree.TreeNode

public class TreeControlNode
extends InfoBusMemberHelper
implements javax.swing.tree.MutableTreeNode, javax.infobus.DataItemChangeListener, javax.infobus.InfoBusDataConsumer, InfoBusManagerListener

Version:
PUBLIC

Field Summary
static java.util.Enumeration EMPTY_ENUMERATION
          An enumeration that is always empty.
 
Fields inherited from class oracle.dacf.util.InfoBusMemberHelper
m_infoBus, m_propListeners, m_sourceRef, m_syncLock, m_vetoListeners
 
Method Summary
 java.util.Enumeration children()
          Returns the children of the reciever as an Enumeration.
 java.util.Enumeration children(boolean loadChildren)
          Returns the children of the reciever as an Enumeration.
 void dataItemAdded(javax.infobus.DataItemAddedEvent e)
          Indicates that a new item was added to the bound aggregate data item (e.g.
 void dataItemAvailable(javax.infobus.InfoBusItemAvailableEvent event)
           
 void dataItemDeleted(javax.infobus.DataItemDeletedEvent e)
          Indicates that an item was deleted from the bound aggregate data item (e.
 void dataItemRevoked(javax.infobus.DataItemRevokedEvent e)
          Indicates that the bound data item (and its sub-items, if any) has been revoked, and is temporarily unavailable.
 void dataItemRevoked(javax.infobus.InfoBusItemRevokedEvent event)
           
 void dataItemValueChanged(javax.infobus.DataItemValueChangedEvent e)
          Indicates a changed value in the bound data item.
 java.util.Enumeration depthFirstEnumeration()
           
protected  void dropInfoBusInt()
          Removes this object from its currently bound InfoBus and data item.
 boolean getAllowsChildren()
          Returns true if the receiver allows children.
 javax.swing.tree.TreeNode getChildAt(int index)
          Returns the child TreeNode at the specified index
 int getChildCount()
          Returns the number of children TreeNodes the receiver contains.
 javax.swing.tree.TreeNode getFirstChild()
          Returns this node's first child.
 int getIndex(javax.swing.tree.TreeNode node)
          Returns the index of node in the receiver's children.
 javax.swing.tree.TreeNode getLastChild()
          Returns this node's last child.
 java.lang.String getName()
           
 javax.swing.tree.TreeNode getParent()
          Returns the parent TreeNode of the receiver.
 TreeControlNode[] getPath()
          Returns the path from the root to this node.
protected  TreeControlNode[] getPathToRoot(TreeControlNode node, int depth)
          Builds the parents of node up to and including the root node, where the original node is the last element in the returned array.
 TreeDataSource getTreeDataSource()
           
 TreeNodeData getTreeNodeData()
           
 java.lang.Object getUserObject()
           
 void insert(javax.swing.tree.MutableTreeNode child, int index)
           
 boolean isCurrentRow()
          Returns whether the node is displaying the current row.
 boolean isLeaf()
          Returns true if the receiver is a leaf.
protected  void joinInfoBusInt()
           
 void propertyChange(java.beans.PropertyChangeEvent event)
          This method gets called when the object's InfoBus property is changed.
 void releaseResources(InfoBusManagerReleaseEvent e)
          A signalling method used to indicate the the control should free all resources and unregister any listeners that it has registered.
 void remove(int index)
           
 void remove(javax.swing.tree.MutableTreeNode node)
           
 void removeFromParent()
           
 void rowsetCursorMoved(javax.infobus.RowsetCursorMovedEvent e)
          Indicates that the cursor for the bound RowsetAccess data item has changed rows.
 void setCurrentRow(boolean currentRow)
          Sets whether the node is displaying the current row.
 void setInfoBusName(java.lang.String infoBusName)
           
 void setName(java.lang.String name)
           
 void setParent(javax.swing.tree.MutableTreeNode newParent)
           
 void setTreeDataSource(TreeDataSource nuTreeDataSource)
           
 void setTreeNodeData(TreeNodeData data)
           
 void setUserObject(java.lang.Object object)
           
 java.lang.String toString()
           
 
Methods inherited from class oracle.dacf.util.InfoBusMemberHelper
addInfoBusPropertyListener, addInfoBusVetoableListener, clearRef, getInfoBus, joinInfoBus, joinInfoBus, leaveInfoBus, removeInfoBusPropertyListener, removeInfoBusVetoableListener, setInfoBus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_ENUMERATION

public static final java.util.Enumeration EMPTY_ENUMERATION
An enumeration that is always empty. This is used when an enumeration of a leaf node's children is requested.

Method Detail

getTreeNodeData

public TreeNodeData getTreeNodeData()

setTreeNodeData

public void setTreeNodeData(TreeNodeData data)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

setInfoBusName

public void setInfoBusName(java.lang.String infoBusName)

joinInfoBusInt

protected void joinInfoBusInt()

releaseResources

public void releaseResources(InfoBusManagerReleaseEvent e)
Description copied from interface: InfoBusManagerListener
A signalling method used to indicate the the control should free all resources and unregister any listeners that it has registered.

Specified by:
releaseResources in interface InfoBusManagerListener

dropInfoBusInt

protected void dropInfoBusInt()
Removes this object from its currently bound InfoBus and data item.


setTreeDataSource

public void setTreeDataSource(TreeDataSource nuTreeDataSource)

getTreeDataSource

public TreeDataSource getTreeDataSource()

setUserObject

public void setUserObject(java.lang.Object object)
Specified by:
setUserObject in interface javax.swing.tree.MutableTreeNode

dataItemAvailable

public void dataItemAvailable(javax.infobus.InfoBusItemAvailableEvent event)
Specified by:
dataItemAvailable in interface javax.infobus.InfoBusDataConsumer

dataItemRevoked

public void dataItemRevoked(javax.infobus.InfoBusItemRevokedEvent event)
Specified by:
dataItemRevoked in interface javax.infobus.InfoBusDataConsumer

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
This method gets called when the object's InfoBus property is changed.

The object is removed as a data consumer from its previous InfoBus, and is added as a consumer to its new InfoBus.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
event - The event.

rowsetCursorMoved

public void rowsetCursorMoved(javax.infobus.RowsetCursorMovedEvent e)
Indicates that the cursor for the bound RowsetAccess data item has changed rows.

A reference to the rowset data item can be obtained from the event.

Specified by:
rowsetCursorMoved in interface javax.infobus.DataItemChangeListener
See Also:
DataItemChangeListener.rowsetCursorMoved(javax.infobus.RowsetCursorMovedEvent)

dataItemValueChanged

public void dataItemValueChanged(javax.infobus.DataItemValueChangedEvent e)
Indicates a changed value in the bound data item.

A reference to the data item that changed can be obtained from the event.

Specified by:
dataItemValueChanged in interface javax.infobus.DataItemChangeListener
See Also:
DataItemChangeListener.dataItemValueChanged(javax.infobus.DataItemValueChangedEvent)

dataItemAdded

public void dataItemAdded(javax.infobus.DataItemAddedEvent e)
Indicates that a new item was added to the bound aggregate data item (e.g. ArrayAccess, a JDK Collection, etc).

A reference to the data item that was added, and a reference to the one that gained it, can be obtained from the event.

Specified by:
dataItemAdded in interface javax.infobus.DataItemChangeListener
See Also:
DataItemChangeListener.dataItemAdded(javax.infobus.DataItemAddedEvent)

dataItemDeleted

public void dataItemDeleted(javax.infobus.DataItemDeletedEvent e)
Indicates that an item was deleted from the bound aggregate data item (e. g. ArrayAccess, a JDK Collection, etc).

A reference to the data item that was deleted, and a reference to the one that lost it, can be obtained from the event.

Specified by:
dataItemDeleted in interface javax.infobus.DataItemChangeListener
See Also:
DataItemChangeListener.dataItemDeleted(javax.infobus.DataItemDeletedEvent)

dataItemRevoked

public void dataItemRevoked(javax.infobus.DataItemRevokedEvent e)
Indicates that the bound data item (and its sub-items, if any) has been revoked, and is temporarily unavailable.

A reference to the data item that was revoked can be obtained from the event.

When this method is called, the node and all of it's children will be removed from the tree.

Specified by:
dataItemRevoked in interface javax.infobus.DataItemChangeListener
See Also:
DataItemChangeListener.dataItemRevoked(javax.infobus.DataItemRevokedEvent)

getUserObject

public java.lang.Object getUserObject()

insert

public void insert(javax.swing.tree.MutableTreeNode child,
                   int index)
Specified by:
insert in interface javax.swing.tree.MutableTreeNode

remove

public void remove(int index)
Specified by:
remove in interface javax.swing.tree.MutableTreeNode

remove

public void remove(javax.swing.tree.MutableTreeNode node)
Specified by:
remove in interface javax.swing.tree.MutableTreeNode

removeFromParent

public void removeFromParent()
Specified by:
removeFromParent in interface javax.swing.tree.MutableTreeNode

setParent

public void setParent(javax.swing.tree.MutableTreeNode newParent)
Specified by:
setParent in interface javax.swing.tree.MutableTreeNode

children

public java.util.Enumeration children()
Returns the children of the reciever as an Enumeration.

Will not automatically load all child nodes.

Specified by:
children in interface javax.swing.tree.TreeNode

children

public java.util.Enumeration children(boolean loadChildren)
Returns the children of the reciever as an Enumeration. May automatically load all child nodes depending upon the value of loadChildren.

Parameters:
loadChildren - true: load children if not loaded

getAllowsChildren

public boolean getAllowsChildren()
Returns true if the receiver allows children.

Specified by:
getAllowsChildren in interface javax.swing.tree.TreeNode

getFirstChild

public javax.swing.tree.TreeNode getFirstChild()
Returns this node's first child. If this node has no children, throws NoSuchElementException.

Returns:
the first child of this node
Throws:
java.util.NoSuchElementException - if this node has no children

getLastChild

public javax.swing.tree.TreeNode getLastChild()
Returns this node's last child. If this node has no children, throws NoSuchElementException.

Returns:
the last child of this node
Throws:
java.util.NoSuchElementException - if this node has no children

getChildAt

public javax.swing.tree.TreeNode getChildAt(int index)
Returns the child TreeNode at the specified index

Specified by:
getChildAt in interface javax.swing.tree.TreeNode
Returns:
the requested node or null if the index is out of bounds

getChildCount

public int getChildCount()
Returns the number of children TreeNodes the receiver contains.

Specified by:
getChildCount in interface javax.swing.tree.TreeNode

getIndex

public int getIndex(javax.swing.tree.TreeNode node)
Returns the index of node in the receiver's children. If the receiver does not contain node, -1 will be returned.

Specified by:
getIndex in interface javax.swing.tree.TreeNode

getParent

public javax.swing.tree.TreeNode getParent()
Returns the parent TreeNode of the receiver.

Specified by:
getParent in interface javax.swing.tree.TreeNode

isLeaf

public boolean isLeaf()
Returns true if the receiver is a leaf.

Specified by:
isLeaf in interface javax.swing.tree.TreeNode

setCurrentRow

public void setCurrentRow(boolean currentRow)
Sets whether the node is displaying the current row.

Parameters:
currentRow - True if the node is displaying the current row.
See Also:
isCurrentRow()

isCurrentRow

public boolean isCurrentRow()
Returns whether the node is displaying the current row.

Returns:
True if the node is displaying the current row.
See Also:
setCurrentRow(boolean currentRow)

toString

public java.lang.String toString()

getPath

public TreeControlNode[] getPath()
Returns the path from the root to this node. The last element in the path is this node.

Returns:
an array of TreeControlNodes listing the path, where the first element in the array is the root and the last element is this node.

getPathToRoot

protected TreeControlNode[] getPathToRoot(TreeControlNode node,
                                          int depth)
Builds the parents of node up to and including the root node, where the original node is the last element in the returned array. The length of the returned array gives the node's depth in the tree.

Parameters:
depth - an int giving the number of steps already taken towards the root (on recursive calls), used to size the returned array
Returns:
an array of TreeNodes giving the path from the root to the specified node

depthFirstEnumeration

public java.util.Enumeration depthFirstEnumeration()

Oracle Data-aware Controls Reference

 

Copyright © 1997, 2003, Oracle. All rights reserved.