com.extentech.ExtenBean.swing
Class ExtenBeanTreeNode

java.lang.Object
  extended by com.extentech.ExtenBean.DataObjectImpl
      extended by com.extentech.ExtenBean.swing.ExtenBeanTreeNode
All Implemented Interfaces:
DataObject, RelationalObject, SimpleDataObject, SQLObject, Serializable, Runnable, MutableTreeNode, TreeNode
Direct Known Subclasses:
XMLBeanNode

public class ExtenBeanTreeNode
extends DataObjectImpl
implements MutableTreeNode

An ExtenDataObject which is also a MutableTreeNode

Author:
John McMahon -- copyright 2005, Extentech
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.extentech.ExtenBean.DataObjectImpl
dataObjectActionListeners, doparent, EXTENBEAN_LOADER_NAME, props
 
Constructor Summary
ExtenBeanTreeNode()
           
ExtenBeanTreeNode(DataObject dobj)
          init with an alternate DataObject type
ExtenBeanTreeNode(DataObject dobj, String nodetype)
          init with an alternate DataObject type
ExtenBeanTreeNode(ExtenBeanTreeNode dobj)
          init with an alternate DataObject type
ExtenBeanTreeNode(String text)
           
 
Method Summary
 void activate()
          load the data from the underlying persistence layer
 void add(ExtenBeanTreeNode node)
           
 Enumeration children()
           
 boolean getAllowsChildren()
           
static com.extentech.toolkit.ResourceLoader getBeanLoader()
           
 ExtenBeanTreeNode getCategoryNode(PersistenceEngine factory, String nodetype)
          pass a factory and a node type this method will look up node values in properties file and populate TreeNode particulars such as icons etc.
 TreeNode getChildAt(int childIndex)
           
 int getChildCount()
           
 String getChildNodeType()
           
 Icon getCollapsedIcon()
           
 Color getColor()
          Returns the color used to draw the text.
 SimpleDataObject getDataObject(int x)
          get a new DataObject from this collection of Data.
 com.symantec.itools.javax.swing.icons.ImageIcon getDefaultIcon()
           
 String getDefaultURL()
          Display a default web page or other URL for this DataObject.
 String[] getEditCols()
          get the fields to display in the console determines which fields are editable through the interface
 Icon getExpandedIcon()
           
 ExtenBeanTreeNode getExtenBeanTreeNode(int idx)
           
 Font getFont()
          Returns the Font used to represent this object.
 int getIndex(TreeNode node)
           
 int getLevel()
           
 String getName()
           
 ExtenBeanTreeNode getNewChildNode(ExtenBeanTreeNode newnode, String nodetype)
           
 ExtenBeanTreeNode getNewChildNode(String nodetype)
          create a new child node which conforms to the type of node contained by this node.
 ExtenBeanTreeNode getNewDefaultChildNode()
           
static void getNodeFromResources(ExtenBeanTreeNode node, String nodetype)
          fills node with info from resources/extenbean given nodetype looks up do__cols do__defaults do__table do__keycol
 String getNodeLookupString()
           
 String getNodeName()
           
 String getNodeName(String looky)
           
 String getNodeType()
           
 TreeNode getParent()
           
 TreePath getPath()
          new TreePath(Object[])Constructs a path from an array of Objects, uniquely identifying the path from the root of the tree to a specific node, as returned by the tree's data model.
 Hashtable getRecord(int index)
           
 boolean getSelected()
           
 Icon getSelectedIcon()
           
 String getToolTipText()
           
 JTree getTree()
           
 void getTreeElements(Vector connections, Vector ranges, Hashtable queries, DocumentHandle bk)
           
 Object getUserObject()
           
 void init()
          Post-data initialization tasks.
 void initChildDefinitions()
          init the child node definition for now, limit to one child node type...
 void initNode(int idx, ExtenBeanTreeNode dobj)
          more or less clone this node, except as a singleton
 void insert(MutableTreeNode child, int index)
           
 boolean isDeleted()
           
 boolean isLeaf()
           
 void load()
          A container invokes this method to instruct the instance to synchronize its state by loading it state from the underlying database.
 void remove(int index)
           
 void remove(MutableTreeNode node)
           
 void removeAllChildren()
          blow out the child nodes
 void removeFromParent()
           
 void setCollapsedIcon(com.symantec.itools.javax.swing.icons.ImageIcon i)
           
 void setColor(Color newColor)
          Sets the color used to draw the text.
 void setDefaultIcon(com.symantec.itools.javax.swing.icons.ImageIcon i)
           
 void setExpandedIcon(com.symantec.itools.javax.swing.icons.ImageIcon i)
           
 void setFont(Font newFont)
          Sets the font that is used to represent this object.
 void setIsDeleted(boolean bIsDeleted)
          more than a flag!
 void setName(String name)
           
 void setNodeLookupString(String lustr)
           
 void setNodeName(String n)
           
 void setNodeType(String n)
           
 void setParent(MutableTreeNode newParent)
           
 void setSelected(boolean sel)
           
 void setTree(JTree n)
           
 void setUserObject(Object object)
           
 String toString()
           
 
Methods inherited from class com.extentech.ExtenBean.DataObjectImpl
addChildObject, addDataObjectActionListener, addOrderByItem, beginTrans, dumpNameVals, dumpNameVals, fireDataObjectActionEvent, getAllChildrenInHeirarchy, getCascadeUpdates, getChangedRowCount, getChangedRows, getChildByName, getChildObjects, getChildrenByName, getColinfo, getColinfoByName, getColnames, getColNames, getColNumByName, getData, getDataArray, getDataObjectActionListeners, getDataRow, getDOLookupField, getFactory, getId, getIsMultiKey, getIsMultiple, getIsNew, getIsUpdateable, getKeyCol, getKeyColName, getNumRows, getOrderByHash, getParentForeignKey, getParentId, getParentObject, getProps, getSQL, getStringVal, getStringVal, getTableName, getVal, getVal, getVal, hasChildren, initFromDataObject, isNew, isPageable, passivate, remove, removeAll, removeByKey, removeChangedRow, removeChangedRows, removeDataObjectActionListener, removeDataObjectActionListeners, rollBack, run, setCascadeUpdates, setColinfo, setData, setDataRowChanged, setDataRowChanged, setDEBUG, setDOLookupField, setFactory, setHasChildren, setId, setIsMultiple, setIsNew, setIsUpdateable, setKeyCol, setKeyCol, setLevel, setParent, setParentForeignKey, setProps, setSQL, setTableName, setVal, setVal, setVal, store
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExtenBeanTreeNode

public ExtenBeanTreeNode(String text)

ExtenBeanTreeNode

public ExtenBeanTreeNode()

ExtenBeanTreeNode

public ExtenBeanTreeNode(DataObject dobj)
init with an alternate DataObject type


ExtenBeanTreeNode

public ExtenBeanTreeNode(DataObject dobj,
                         String nodetype)
init with an alternate DataObject type


ExtenBeanTreeNode

public ExtenBeanTreeNode(ExtenBeanTreeNode dobj)
init with an alternate DataObject type

Method Detail

getNodeFromResources

public static void getNodeFromResources(ExtenBeanTreeNode node,
                                        String nodetype)
fills node with info from resources/extenbean given nodetype looks up do__cols do__defaults do__table do__keycol


getBeanLoader

public static com.extentech.toolkit.ResourceLoader getBeanLoader()

setTree

public void setTree(JTree n)

getTree

public JTree getTree()

load

public void load()
Description copied from class: DataObjectImpl
A container invokes this method to instruct the instance to synchronize its state by loading it state from the underlying database.

Specified by:
load in interface DataObject
Specified by:
load in interface SimpleDataObject
Overrides:
load in class DataObjectImpl

init

public void init()
Description copied from interface: DataObject
Post-data initialization tasks.

Specified by:
init in interface DataObject

getDataObject

public SimpleDataObject getDataObject(int x)
get a new DataObject from this collection of Data.

Specified by:
getDataObject in interface SimpleDataObject

activate

public void activate()
Description copied from interface: DataObject
load the data from the underlying persistence layer

Specified by:
activate in interface DataObject

getLevel

public int getLevel()
Specified by:
getLevel in interface RelationalObject
Overrides:
getLevel in class DataObjectImpl

getPath

public TreePath getPath()
new TreePath(Object[])Constructs a path from an array of Objects, uniquely identifying the path from the root of the tree to a specific node, as returned by the tree's data model. The model is free to return an array of any Objects it needs to represent the path. The DefaultTreeModel returns an array of TreeNode objects. The first TreeNode in the path is the root of the tree, the last TreeNode is the node identified by the path. Parameters: path - an array of Objects representing the path to a node


getSelected

public boolean getSelected()

setSelected

public void setSelected(boolean sel)

setNodeName

public void setNodeName(String n)

getCategoryNode

public ExtenBeanTreeNode getCategoryNode(PersistenceEngine factory,
                                         String nodetype)
pass a factory and a node type this method will look up node values in properties file and populate TreeNode particulars such as icons etc.


children

public Enumeration children()
Specified by:
children in interface TreeNode

getAllowsChildren

public boolean getAllowsChildren()
Specified by:
getAllowsChildren in interface TreeNode

getChildAt

public TreeNode getChildAt(int childIndex)
Specified by:
getChildAt in interface TreeNode

getChildCount

public int getChildCount()
Specified by:
getChildCount in interface TreeNode

getIndex

public int getIndex(TreeNode node)
Specified by:
getIndex in interface TreeNode

getParent

public TreeNode getParent()
Specified by:
getParent in interface TreeNode

insert

public void insert(MutableTreeNode child,
                   int index)
Specified by:
insert in interface MutableTreeNode

isLeaf

public boolean isLeaf()
Specified by:
isLeaf in interface TreeNode

isDeleted

public boolean isDeleted()

setIsDeleted

public void setIsDeleted(boolean bIsDeleted)
more than a flag!

Parameters:
bIsDeleted -

remove

public void remove(int index)
Specified by:
remove in interface MutableTreeNode

remove

public void remove(MutableTreeNode node)
Specified by:
remove in interface MutableTreeNode

removeFromParent

public void removeFromParent()
Specified by:
removeFromParent in interface MutableTreeNode

setParent

public void setParent(MutableTreeNode newParent)
Specified by:
setParent in interface MutableTreeNode

setUserObject

public void setUserObject(Object object)
Specified by:
setUserObject in interface MutableTreeNode

getUserObject

public Object getUserObject()

getExpandedIcon

public Icon getExpandedIcon()

getSelectedIcon

public Icon getSelectedIcon()

getCollapsedIcon

public Icon getCollapsedIcon()

getDefaultIcon

public com.symantec.itools.javax.swing.icons.ImageIcon getDefaultIcon()

setDefaultIcon

public void setDefaultIcon(com.symantec.itools.javax.swing.icons.ImageIcon i)

setCollapsedIcon

public void setCollapsedIcon(com.symantec.itools.javax.swing.icons.ImageIcon i)

setExpandedIcon

public void setExpandedIcon(com.symantec.itools.javax.swing.icons.ImageIcon i)

setFont

public void setFont(Font newFont)
Sets the font that is used to represent this object.


getFont

public Font getFont()
Returns the Font used to represent this object.


setColor

public void setColor(Color newColor)
Sets the color used to draw the text.


getColor

public Color getColor()
Returns the color used to draw the text.


add

public void add(ExtenBeanTreeNode node)

getEditCols

public String[] getEditCols()
get the fields to display in the console determines which fields are editable through the interface


removeAllChildren

public void removeAllChildren()
blow out the child nodes


getNewDefaultChildNode

public ExtenBeanTreeNode getNewDefaultChildNode()

getChildNodeType

public String getChildNodeType()

getNewChildNode

public ExtenBeanTreeNode getNewChildNode(String nodetype)
create a new child node which conforms to the type of node contained by this node.


getNewChildNode

public ExtenBeanTreeNode getNewChildNode(ExtenBeanTreeNode newnode,
                                         String nodetype)

initChildDefinitions

public void initChildDefinitions()
init the child node definition for now, limit to one child node type...


getDefaultURL

public String getDefaultURL()
Display a default web page or other URL for this DataObject.


getExtenBeanTreeNode

public ExtenBeanTreeNode getExtenBeanTreeNode(int idx)

initNode

public void initNode(int idx,
                     ExtenBeanTreeNode dobj)
more or less clone this node, except as a singleton


setNodeLookupString

public void setNodeLookupString(String lustr)

getNodeLookupString

public String getNodeLookupString()

getNodeName

public String getNodeName(String looky)

getNodeName

public String getNodeName()

setNodeType

public void setNodeType(String n)

getToolTipText

public String getToolTipText()

getNodeType

public String getNodeType()

toString

public String toString()
Overrides:
toString in class DataObjectImpl

getRecord

public Hashtable getRecord(int index)

getTreeElements

public void getTreeElements(Vector connections,
                            Vector ranges,
                            Hashtable queries,
                            DocumentHandle bk)

getName

public String getName()

setName

public void setName(String name)


Copyright © 2011 Extentech Inc. All Rights Reserved.