Skip navigation links


com.essbase.eas.ui.ptree
Class PTreeNode

java.lang.Object
  extended by javax.swing.tree.DefaultMutableTreeNode
      extended by com.essbase.eas.ui.ptree.PTreeNode

All Implemented Interfaces:
PrintableObject, java.awt.event.ActionListener, java.awt.event.ItemListener, java.beans.PropertyChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.event.DocumentListener, javax.swing.tree.MutableTreeNode, javax.swing.tree.TreeNode
Direct Known Subclasses:
PTreeButtonNode, PTreeCheckBoxNode, PTreeComboBoxNode, PTreeDateNode, PTreeLabelNode, PTreeNumericFieldNode, PTreePasswordFieldNode, PTreeRadioButtonNode, PTreeTextAreaNode, PTreeTextFieldNode, PTreeTimeFieldNode

public class PTreeNode
extends javax.swing.tree.DefaultMutableTreeNode
implements PrintableObject, java.beans.PropertyChangeListener, javax.swing.event.DocumentListener, java.awt.event.ItemListener, java.awt.event.ActionListener

Extends the DefaultMutableTreeNode class to implement some specific features that we need to support in the OLAP console properties. Notes:

10/13/2000, nvarma: Although this class isn't declared abstract, it should be considered to be abstract. No instances of this class should ever be created.

Version:
1.00, 10/13/2000
Author:
Namita Varma
See Also:
Serialized Form

Field Summary
static java.util.ResourceBundle bundle
           
protected static javax.swing.AbstractAction cancelAction
           
protected  java.lang.String caption
           
protected  boolean editable
           
protected  java.lang.Object editValue
           
protected  boolean enabled
           
protected  boolean enableRemoval
           
protected static javax.swing.AbstractAction enterAction
           
protected  javax.swing.Icon icon
           
protected static java.awt.event.KeyAdapter keyAdapter
           
protected  java.lang.Object nodeObject
           
protected  java.lang.String tipText
           

 

Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject

 

Constructor Summary
PTreeNode()
           
PTreeNode(java.lang.Object userObject, boolean allowsChildren, java.lang.String caption)
           
PTreeNode(java.lang.Object userObject, boolean allowsChildren, java.lang.String caption, java.lang.Object nodeObject)
           
PTreeNode(java.lang.Object userObject, java.lang.String caption, boolean allowsChildren)
           
PTreeNode(java.lang.String caption)
           

 

Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected static void addAction(javax.swing.JComponent jc, javax.swing.Action action, javax.swing.KeyStroke keystroke)
           
 void addAndNotify(javax.swing.tree.DefaultMutableTreeNode child)
           
 void addNodesAndNotify(java.lang.Object[] nodes)
           
 void addSortedChild(PTreeNode child, java.text.Collator collator)
           
 void addSortedChild(PTreeNode child, java.text.Collator collator, boolean notify)
           
 void cancelEditing()
           
 void changedUpdate(javax.swing.event.DocumentEvent e)
           
 java.lang.Object clone()
           
 int drawObject(java.awt.Graphics graphics, java.awt.print.PageFormat pageFormat, int posX, int posY, int height)
          Draws the object at the x and y.
protected  int drawText(java.awt.Graphics graphics, java.lang.String text, int posX, int posY, int height)
           
protected  int drawText(java.awt.Graphics graphics, java.lang.String text, int posX, int posY, int height, java.awt.Color clr)
           
protected  int drawText(java.awt.Graphics graphics, java.lang.String text, int posX, int posY, int height, java.awt.Color clr, java.awt.Font font)
           
protected  int drawText(java.awt.Graphics graphics, java.lang.String text, int posX, int posY, int height, java.awt.Font font)
           
 void editNode(PTree tree)
           
 void endEditing()
           
 java.lang.String getCaption()
           
 PTreeNode getChildForUserObject(java.lang.Object value)
          returns the child node that has the associated user object.
 java.awt.Component[] getContextMenuItems()
           
protected  java.lang.Object getEditingValue()
           
protected  java.lang.String getEditText()
           
 int getHeight(java.awt.print.PageFormat pageFormat, java.awt.Font font)
          Returns the height of the object with the font
 javax.swing.Icon getIcon()
           
protected  PTreeLabel getLabel()
           
 java.lang.Object getNodeObject()
           
 java.lang.Object[] getPrintableObjects()
           
 java.lang.String getToolTipText()
           
 PTree getTree()
           
 java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree, java.lang.Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
          retrieves the tree cell renderer for this object.
 int getWidth(java.awt.print.PageFormat pageFormat, java.awt.Font font)
          Returns the width of the object using the font
 void handleClick(int x, int y)
          used to handle a single click event; the default implementation is to do nothing.
 void handleDoubleClick(int x, int y)
          used to handle a double click event; the default implementation is to do nothing.
 void handleRightClick(int x, int y)
           
 void insertUpdate(javax.swing.event.DocumentEvent e)
           
 void installListeners()
           
protected  void installListeners(java.lang.Object component)
           
 boolean isEditable()
           
 boolean isEnabled()
           
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 void nodeChanged()
           
 void nodeRemoved()
           
 int paintCheckIcon(javax.swing.Icon icon, java.awt.Graphics g, int x, int y, int height, boolean selected)
           
protected  int paintIcon(java.awt.Component c, java.awt.Graphics g, javax.swing.Icon icon, int posX, int posY, int height)
           
 int paintRadioIcon(javax.swing.Icon icon, java.awt.Graphics g, int x, int y, int height, boolean selected)
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void remove(javax.swing.tree.MutableTreeNode aChild)
           
protected static void removeAction(javax.swing.JComponent jc, javax.swing.Action action, javax.swing.KeyStroke keystroke)
           
 void removeAllChildren()
           
 void removeAndNotify(javax.swing.tree.MutableTreeNode aChild)
           
 void removeUpdate(javax.swing.event.DocumentEvent e)
           
 void setCaption(java.lang.String value)
           
 void setChildrenEnabled(boolean value)
           
 void setDescendantsEnabled(boolean value)
           
 void setEditable(boolean edit)
           
protected  void setEditingValue(java.lang.Object value)
           
 void setEnabled(boolean enable)
           
 void setEnableRemoval(boolean bEnable)
           
 void setIcon(javax.swing.Icon value)
           
 void setNodeObject(java.lang.Object object)
           
 void setTipText(java.lang.String tip)
           
 void setTree(PTree tree)
           
 void setUserObject(java.lang.Object parm1)
           
 java.lang.String toString()
           
 void uninstallListeners()
           
protected  void uninstallListeners(java.lang.Object component)
           
 void willExpand()
           

 

Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, 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, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, removeFromParent, setAllowsChildren, setParent

 

Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

caption

protected java.lang.String caption

icon

protected javax.swing.Icon icon

tipText

protected java.lang.String tipText

enableRemoval

protected boolean enableRemoval

editable

protected boolean editable

enabled

protected boolean enabled

nodeObject

protected java.lang.Object nodeObject

editValue

protected java.lang.Object editValue

bundle

public static java.util.ResourceBundle bundle

enterAction

protected static final javax.swing.AbstractAction enterAction

cancelAction

protected static final javax.swing.AbstractAction cancelAction

keyAdapter

protected static final java.awt.event.KeyAdapter keyAdapter

Constructor Detail

PTreeNode

public PTreeNode()

PTreeNode

public PTreeNode(java.lang.Object userObject,
                 boolean allowsChildren,
                 java.lang.String caption)
Parameters:
userObject - is a JCheckBox, JComboBox, JLabel, JTextField, JTextArea based on the node type.
allowsChildren - true if this node can have child nodes.
caption - is the name of the node on the tree

PTreeNode

public PTreeNode(java.lang.Object userObject,
                 boolean allowsChildren,
                 java.lang.String caption,
                 java.lang.Object nodeObject)

PTreeNode

public PTreeNode(java.lang.String caption)

PTreeNode

public PTreeNode(java.lang.Object userObject,
                 java.lang.String caption,
                 boolean allowsChildren)

Method Detail

willExpand

public void willExpand()

setDescendantsEnabled

public void setDescendantsEnabled(boolean value)

setChildrenEnabled

public void setChildrenEnabled(boolean value)

toString

public java.lang.String toString()
Overrides:
toString in class javax.swing.tree.DefaultMutableTreeNode

getTreeCellRendererComponent

public java.awt.Component getTreeCellRendererComponent(javax.swing.JTree tree,
                                                       java.lang.Object value,
                                                       boolean selected,
                                                       boolean expanded,
                                                       boolean leaf,
                                                       int row,
                                                       boolean hasFocus)
retrieves the tree cell renderer for this object. In PTreeNode we return a null pointer; this method should be overridden by any object that wishes to do special rendering.

getIcon

public javax.swing.Icon getIcon()

setIcon

public void setIcon(javax.swing.Icon value)

getCaption

public java.lang.String getCaption()

setCaption

public void setCaption(java.lang.String value)

isEnabled

public boolean isEnabled()

setEnabled

public void setEnabled(boolean enable)

getChildForUserObject

public PTreeNode getChildForUserObject(java.lang.Object value)
returns the child node that has the associated user object.

clone

public java.lang.Object clone()
Overrides:
clone in class javax.swing.tree.DefaultMutableTreeNode

isEditable

public boolean isEditable()

setEditable

public void setEditable(boolean edit)

handleDoubleClick

public void handleDoubleClick(int x,
                              int y)
used to handle a double click event; the default implementation is to do nothing. Derived classes that wish to perform some action when they are double clicked should override this method.

handleClick

public void handleClick(int x,
                        int y)
used to handle a single click event; the default implementation is to do nothing. Derived classes that wish to perform some action when they are clicked should override this method.

handleRightClick

public void handleRightClick(int x,
                             int y)

uninstallListeners

public void uninstallListeners()

uninstallListeners

protected void uninstallListeners(java.lang.Object component)

installListeners

public void installListeners()

installListeners

protected void installListeners(java.lang.Object component)

setUserObject

public void setUserObject(java.lang.Object parm1)
Specified by:
setUserObject in interface javax.swing.tree.MutableTreeNode
Overrides:
setUserObject in class javax.swing.tree.DefaultMutableTreeNode

getPrintableObjects

public java.lang.Object[] getPrintableObjects()

getHeight

public int getHeight(java.awt.print.PageFormat pageFormat,
                     java.awt.Font font)
Description copied from interface: PrintableObject
Returns the height of the object with the font
Specified by:
getHeight in interface PrintableObject
font - font
Returns:
the height

drawObject

public int drawObject(java.awt.Graphics graphics,
                      java.awt.print.PageFormat pageFormat,
                      int posX,
                      int posY,
                      int height)
Description copied from interface: PrintableObject
Draws the object at the x and y.
Specified by:
drawObject in interface PrintableObject
Parameters:
graphics - graphics to draw
pageFormat - the current page format
posX - the x position
posY - the Y position
height - the height
Returns:
the width of the object

drawText

protected int drawText(java.awt.Graphics graphics,
                       java.lang.String text,
                       int posX,
                       int posY,
                       int height)

drawText

protected int drawText(java.awt.Graphics graphics,
                       java.lang.String text,
                       int posX,
                       int posY,
                       int height,
                       java.awt.Color clr)

drawText

protected int drawText(java.awt.Graphics graphics,
                       java.lang.String text,
                       int posX,
                       int posY,
                       int height,
                       java.awt.Font font)

drawText

protected int drawText(java.awt.Graphics graphics,
                       java.lang.String text,
                       int posX,
                       int posY,
                       int height,
                       java.awt.Color clr,
                       java.awt.Font font)

paintIcon

protected int paintIcon(java.awt.Component c,
                        java.awt.Graphics g,
                        javax.swing.Icon icon,
                        int posX,
                        int posY,
                        int height)

paintCheckIcon

public int paintCheckIcon(javax.swing.Icon icon,
                          java.awt.Graphics g,
                          int x,
                          int y,
                          int height,
                          boolean selected)

paintRadioIcon

public int paintRadioIcon(javax.swing.Icon icon,
                          java.awt.Graphics g,
                          int x,
                          int y,
                          int height,
                          boolean selected)

getWidth

public int getWidth(java.awt.print.PageFormat pageFormat,
                    java.awt.Font font)
Description copied from interface: PrintableObject
Returns the width of the object using the font
Specified by:
getWidth in interface PrintableObject
font - font
Returns:
the width

getContextMenuItems

public java.awt.Component[] getContextMenuItems()

setTree

public void setTree(PTree tree)

getTree

public PTree getTree()

setTipText

public void setTipText(java.lang.String tip)

getToolTipText

public java.lang.String getToolTipText()

removeAllChildren

public void removeAllChildren()
Overrides:
removeAllChildren in class javax.swing.tree.DefaultMutableTreeNode

remove

public void remove(javax.swing.tree.MutableTreeNode aChild)
Specified by:
remove in interface javax.swing.tree.MutableTreeNode
Overrides:
remove in class javax.swing.tree.DefaultMutableTreeNode

removeAndNotify

public void removeAndNotify(javax.swing.tree.MutableTreeNode aChild)

addAndNotify

public void addAndNotify(javax.swing.tree.DefaultMutableTreeNode child)

setEnableRemoval

public void setEnableRemoval(boolean bEnable)

nodeRemoved

public void nodeRemoved()

addNodesAndNotify

public void addNodesAndNotify(java.lang.Object[] nodes)

editNode

public void editNode(PTree tree)

nodeChanged

public void nodeChanged()

addSortedChild

public void addSortedChild(PTreeNode child,
                           java.text.Collator collator)

addSortedChild

public void addSortedChild(PTreeNode child,
                           java.text.Collator collator,
                           boolean notify)

setNodeObject

public void setNodeObject(java.lang.Object object)

getNodeObject

public java.lang.Object getNodeObject()

getLabel

protected PTreeLabel getLabel()

getEditText

protected java.lang.String getEditText()

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent e)
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent e)
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent e)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getEditingValue

protected java.lang.Object getEditingValue()

setEditingValue

protected void setEditingValue(java.lang.Object value)

endEditing

public void endEditing()

cancelEditing

public void cancelEditing()

addAction

protected static void addAction(javax.swing.JComponent jc,
                                javax.swing.Action action,
                                javax.swing.KeyStroke keystroke)

removeAction

protected static void removeAction(javax.swing.JComponent jc,
                                   javax.swing.Action action,
                                   javax.swing.KeyStroke keystroke)

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.