org.histpop.ohpr.session
Class BrowseNode

java.lang.Object
  extended by org.histpop.ohpr.session.BrowseNode
Direct Known Subclasses:
SearchNode

public class BrowseNode
extends java.lang.Object

This class represents a node in the browse tree. It contains a cached state of the associated volume titles and pointers to neighbouring tree nodes. It also includes the SQL name of a field used as a filter for the titles list.


Field Summary
static java.lang.String LABEL_UNDEFINED
          The default value for undefined tree node labels
 
Constructor Summary
BrowseNode(java.lang.String id, java.lang.String filter, BrowseState owner)
          Initialize a new instance of a browse tree node.
 
Method Summary
 void addChild(BrowseNode child)
          Add a child tree node to this tree node
 BrowseNode ancestor(int level)
          Find the ancestor browse tree node.
 void contractAllSubtrees()
          contract all the sub trees
 void destroy()
           
 java.lang.String findLabel(boolean withoutOrderQualifier)
          Find the tree node label which can be displayed in the tree view
 int findLevel()
          find the browse tree level of the current tree node
 java.lang.String getFilter()
           
 java.lang.String getId()
          Get the unique identifier of this node.
 boolean getInvisible()
           
 BrowseNode getNext()
           
 BrowseState getOwner()
           
 BrowseNode getParent()
           
 BrowseNode getSubtree()
           
 boolean getSubTreeExpanded()
           
 TitleQueryState getTitlesState()
           
 boolean isAncestorOf(BrowseNode node)
          Find out whether a given tree node is an ancestor of the current one.
 void setInvisible(boolean invisible)
           
 void setNext(BrowseNode next)
           
 void setOwner(BrowseState owner)
           
 void setParent(BrowseNode parent)
           
 void setSubtree(BrowseNode subtree)
           
 void setSubTreeExpanded(boolean subTreeExpanded)
           
 void setTitlesState(TitleQueryState titlesState)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LABEL_UNDEFINED

public static final java.lang.String LABEL_UNDEFINED
The default value for undefined tree node labels

See Also:
Constant Field Values
Constructor Detail

BrowseNode

public BrowseNode(java.lang.String id,
                  java.lang.String filter,
                  BrowseState owner)
Initialize a new instance of a browse tree node.

Parameters:
id - A unique identifier for the browse tree node.
filter - The SQL field name for the relevant titles filter
owner - The session object owning the whole browse tree.
Method Detail

setParent

public void setParent(BrowseNode parent)

setNext

public void setNext(BrowseNode next)

setSubtree

public void setSubtree(BrowseNode subtree)

setSubTreeExpanded

public void setSubTreeExpanded(boolean subTreeExpanded)

setInvisible

public void setInvisible(boolean invisible)

setTitlesState

public void setTitlesState(TitleQueryState titlesState)

setOwner

public void setOwner(BrowseState owner)

getParent

public BrowseNode getParent()

getNext

public BrowseNode getNext()

getSubtree

public BrowseNode getSubtree()

getFilter

public java.lang.String getFilter()

getSubTreeExpanded

public boolean getSubTreeExpanded()

getInvisible

public boolean getInvisible()

getTitlesState

public TitleQueryState getTitlesState()

getOwner

public BrowseState getOwner()

getId

public java.lang.String getId()
Get the unique identifier of this node. The identifier consists of the value of the order criteria from this tree node as well as those from all the parents.


findLabel

public java.lang.String findLabel(boolean withoutOrderQualifier)
Find the tree node label which can be displayed in the tree view


contractAllSubtrees

public void contractAllSubtrees()
contract all the sub trees


findLevel

public int findLevel()
find the browse tree level of the current tree node


ancestor

public BrowseNode ancestor(int level)
Find the ancestor browse tree node.

Parameters:
level - The browse tree level of the wanted ancestor. The root node starts at level 0.
Returns:
A browse tree node representing the ancestor at the given level.

isAncestorOf

public boolean isAncestorOf(BrowseNode node)
Find out whether a given tree node is an ancestor of the current one.

Parameters:
node - A possible ancestor node
Returns:
TRUE if node is an ancestor of the current one, FALSE otherwise

addChild

public void addChild(BrowseNode child)
Add a child tree node to this tree node


destroy

public void destroy()