samples.javaclient.analyzer
Class CatalogTreeNode

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended bysamples.javaclient.analyzer.CatalogTreeNode
All Implemented Interfaces:
BITreeNode, java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public class CatalogTreeNode
extends javax.swing.tree.DefaultMutableTreeNode
implements BITreeNode

A node of a CatalogTree. This object can represent a folder, a crosstab, a graph, or a saved selection.

See Also:
CatalogExplorer, FavoritesExplorer, Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.tree.DefaultMutableTreeNode
 
Field Summary
private  int m_children
           
private  oracle.dss.bicontext.BIContext m_context
           
private  oracle.dss.bicontext.BISearchResult m_entry
           
private  java.lang.String m_fullPathName
           
private  int[] m_indexes
           
private  boolean m_isRoot
           
private  boolean m_loaded
           
private  BITreeModel m_model
           
private  java.lang.String m_name
           
private  java.lang.String m_type
           
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
 
Constructor Summary
CatalogTreeNode(BITreeModel model, java.lang.String rootName)
          Constructor for the root node.
CatalogTreeNode(BITreeModel model, java.lang.String pathName, oracle.dss.bicontext.BISearchResult entry)
          Constructor for nodes other than the root node.
 
Method Summary
 javax.swing.tree.TreeNode getChildAt(int index)
          Gets a child node, from an index.
private  void getChildList()
          Creates a node for each child of this node.
private  oracle.dss.bicontext.BIContext getDirContext()
          Gets the folder for the object that this node represents.
 java.lang.String getFullPathName()
          Gets the path name for the object that this node represents, relative to the root folder.
 int[] getIndexes()
          Gets the indexes of displayed child nodes.
 java.lang.String getName()
          Gets the Catalog name of the object that this node represents.
 java.lang.String getObjectType()
          Gets the type of object that this node represents.
private  oracle.dss.bicontext.BISearchResult getSearchResult()
          Gets the object that this node represents.
private  void initializeFromEntry(javax.naming.directory.SearchResult entry)
          Initializes this node from information in a SearchResult.
 boolean isFolder(oracle.dss.bicontext.BISearchResult entry)
          Indicates whether this node represents a folder.
 boolean isLeaf()
          Indicates whether this node is a leaf node (has no children).
 boolean isLoaded()
          Indicates whether child nodes for this node are displayed.
 boolean isRoot()
          Indicates whether this node is the root node.
 void load()
          Displays child nodes of this node.
 void removeAllChildren()
          Removes all child nodes.
 java.lang.String toString()
          Gets a String representation of this node.
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_entry

private oracle.dss.bicontext.BISearchResult m_entry

m_name

private java.lang.String m_name

m_fullPathName

private java.lang.String m_fullPathName

m_type

private java.lang.String m_type

m_loaded

private boolean m_loaded

m_children

private int m_children

m_context

private oracle.dss.bicontext.BIContext m_context

m_isRoot

private boolean m_isRoot

m_indexes

private int[] m_indexes

m_model

private BITreeModel m_model
Constructor Detail

CatalogTreeNode

public CatalogTreeNode(BITreeModel model,
                       java.lang.String rootName)
Constructor for the root node.

Parameters:
model - The tree model to which this node belongs.
rootName - The label for this node.

CatalogTreeNode

public CatalogTreeNode(BITreeModel model,
                       java.lang.String pathName,
                       oracle.dss.bicontext.BISearchResult entry)
Constructor for nodes other than the root node.

Parameters:
model - The tree model to which this node belongs.
pathName - The location of this object in the Catalog, relative to the root folder.
entry - The search result that contains information about the object that this node represents. The search result comes from a call to the search method of a BIContext.
Method Detail

initializeFromEntry

private void initializeFromEntry(javax.naming.directory.SearchResult entry)
Initializes this node from information in a SearchResult. This method gets information about the object that the node represents, from the search result object. It gets the full path name, the number of children (for folders), the Catalog label for the object, and the object type.

Parameters:
entry - The search result that has information about the object that this node represents. oracle.dss.bicontext.BIContext.search returns an enumeration of search results.

getIndexes

public int[] getIndexes()
Gets the indexes of displayed child nodes.

Returns:
An array of indexes, one for each child node.

getDirContext

private oracle.dss.bicontext.BIContext getDirContext()
Gets the folder for the object that this node represents.

Returns:
The folder for the object that this node represents.

getSearchResult

private oracle.dss.bicontext.BISearchResult getSearchResult()
Gets the object that this node represents.

Returns:
The object that this node represents.

getName

public java.lang.String getName()
Gets the Catalog name of the object that this node represents.

Returns:
The name of the object that this node represents.

getFullPathName

public java.lang.String getFullPathName()
Gets the path name for the object that this node represents, relative to the root folder.

Returns:
The full path name.

getObjectType

public java.lang.String getObjectType()
Gets the type of object that this node represents. Valid return values are specified in the oracle.dss.util.persistence.PersistableConstants interface. This application handles values of: oracle.dss.util.persistence.PersistableConstants.FOLDER, oracle.dss.util.persistence.PersistableConstants.GRAPH, oracle.dss.util.persistence.PersistableConstants.CROSSTAB, and oracle.dss.util.persistence.PersistableConstants.SELECTION.

Returns:
The Object type for the object that this node represents.

load

public void load()
Displays child nodes of this node. This method calls getChildList to create the child nodes.

Specified by:
load in interface BITreeNode
See Also:
getChildList()

getChildList

private void getChildList()
Creates a node for each child of this node. Also calls the fireTreeStructureChanged method on the model, to fire a TreeModelEvent.


isLoaded

public boolean isLoaded()
Indicates whether child nodes for this node are displayed.

Specified by:
isLoaded in interface BITreeNode
Returns:
true if child nodes are displayed, false if they are not.

isFolder

public boolean isFolder(oracle.dss.bicontext.BISearchResult entry)
Indicates whether this node represents a folder.

Parameters:
entry - The search result that provides access to the object that this node represents.
Returns:
true if this node represents a folder, false if it represents an object, such as a graph.

getChildAt

public javax.swing.tree.TreeNode getChildAt(int index)
Gets a child node, from an index.

Specified by:
getChildAt in interface javax.swing.tree.TreeNode
Parameters:
index - The index of the child node you want.

removeAllChildren

public void removeAllChildren()
Removes all child nodes.


isLeaf

public boolean isLeaf()
Indicates whether this node is a leaf node (has no children).

Specified by:
isLeaf in interface javax.swing.tree.TreeNode
Returns:
true if this node has no child nodes, false if it has child nodes.

isRoot

public boolean isRoot()
Indicates whether this node is the root node. The root node represents the root folder in the Catalog.

Returns:
true if this node is the root node, false if it is not.

toString

public java.lang.String toString()
Gets a String representation of this node.

Returns:
The Catalog name of the object that this node represents.