Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.awt.tree
Class FlexTreeNode  view FlexTreeNode download FlexTreeNode.java

java.lang.Object
  extended bycom.flexstor.common.awt.tree.FlexTreeNode

public class FlexTreeNode
extends java.lang.Object

The FlexTreeNode is a support class for the Tree. It is used to represent a single line item in the Tree. This class is based on the Proto View TreeViewJ version 2.0

Version:
2.1

Field Summary
private  boolean bAlwaysShowPlusMinus
           
private  boolean bExpanded
           
private  boolean bRemoved
           
private  boolean bSelected
           
private  boolean bSubRoot
           
private  boolean bTrueRoot
           
private  java.awt.Color cBgSel
           
private  java.awt.Color cDotBorder
           
private  java.awt.Color cFg
           
private  java.awt.Color cFgSel
           
private  java.awt.Color cLine
           
static int FIRST
           
private  java.awt.Image iCollapsed
           
private static java.awt.Image iDefCol
           
private static java.awt.Image iDefExp
           
private  java.awt.Image iExpanded
           
static int LAST
           
protected  FlexTreeNode nFirstChild
           
protected  FlexTreeNode nLastChild
           
private  int nLevel
           
 FlexTreeNode nNext
           
protected  FlexTreeNode nParent
           
protected  FlexTreeNode nPrev
           
private  int nTreeID
           
private  java.lang.String sLabel
           
 
Constructor Summary
FlexTreeNode()
           
FlexTreeNode(java.lang.String sLabel)
           
FlexTreeNode(java.lang.String sLabel, java.awt.Image expanded, java.awt.Image collapsed)
           
 
Method Summary
protected  int _paint(Tree Tree, java.awt.Graphics g, int count)
           
 void addChild(FlexTreeNode n, int nPosition)
           
 void drawSelectedBorder(java.awt.Graphics g, int l, int t, int w, int h)
           
 void forceLayout()
           
 void forceRepaint()
           
 java.util.ArrayList getAllChildren()
           
 boolean getAlwaysShowPlusMinus()
           
 FlexTreeNode getChild(int n)
          Returns the Nth child of this node.
 java.util.ArrayList getChildren()
           
 java.awt.Image getCollapsedImage()
           
 java.awt.Image getExpandedImage()
           
 FlexTreeNode getFirstChild()
           
 java.awt.Color getForeground()
          Get the foreground color for this node.
 java.lang.String getLabel()
          Return the text label of the this node.
private  FlexTreeNode getLastChild()
           
 FlexTreeNode getLastVisible()
           
 java.util.ArrayList getLeafNodes()
          Returns all the leaf nodes of this node and all sub nodes.
 int getLevel()
          Get the level of this node within the tree hierarchy.
 FlexTreeNode getNext()
          Return the next node following this node.
protected  FlexTreeNode getNextParent()
           
 FlexTreeNode getNextSibling()
          Return the next sibling node for this node.
 FlexTreeNode getNextVisible()
          Return the next node that is visible.
 FlexTreeNode getParent()
          Return the parent node of this node
 int getPosition()
          Gets the position of this node in its parent container.
 FlexTreeNode getPrev()
          Return the previous node following this node.
protected  FlexTreeNode getPrevLast(FlexTreeNode node)
           
 FlexTreeNode getPrevSibling()
          Return the previous sibling node for this node.
 FlexTreeNode getPrevVisible()
          Return the previous node that is visible.
 boolean getRemoved()
           
 java.awt.Color getSelectedForeground()
          Get the selected foreground color for this node.
 int getTreeID()
           
 boolean hasChildren()
          Return a boolean value indicating whether or not the node has any child nodes associated with it.
 boolean isChild(FlexTreeNode node)
          Check if the "node" is a child of this node.
 boolean isDescendant(FlexTreeNode node)
          Check if the "node" is a descendant of this node.
 boolean isExpanded()
          Return the expanded state of the node.
 boolean isRoot()
           
protected  boolean isSelected()
           
 boolean isTrueRoot()
           
protected  FlexTreeNode lastVisible(FlexTreeNode node)
           
protected  int lineFromNode(Tree tree)
           
protected  FlexTreeNode nodeAtLine(int Line)
           
 void remove()
           
 void removeChildren()
           
 void setAlwaysShowPlusMinus(boolean bAlwaysShowPlusMinus)
           
protected  void setAsRoot()
           
protected  void setAsTrueRoot(int id)
           
 void setDefaultImages()
           
 void setExpanded(boolean expanded, boolean bChild)
           
 void setForeground(java.awt.Color color)
          Set the foreground color for this node
 void setImages(java.awt.Image expanded, java.awt.Image collapsed)
           
 void setLabel(java.lang.String sLabel)
          Set the text label of the this node.
 void setRedraw(boolean bState)
           
protected  void setSelected(boolean b)
           
 void setSelectedForeground(java.awt.Color color)
          Set the foreground color for this node when selected
(package private)  boolean sortChildren(boolean bRecursive, boolean bCase)
           
(package private)  void switchNodes(FlexTreeNode one, FlexTreeNode two)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST

public static final int FIRST
See Also:
Constant Field Values

LAST

public static final int LAST
See Also:
Constant Field Values

iDefExp

private static java.awt.Image iDefExp

iDefCol

private static java.awt.Image iDefCol

iExpanded

private java.awt.Image iExpanded

iCollapsed

private java.awt.Image iCollapsed

sLabel

private java.lang.String sLabel

cFg

private java.awt.Color cFg

cBgSel

private java.awt.Color cBgSel

cFgSel

private java.awt.Color cFgSel

cLine

private java.awt.Color cLine

cDotBorder

private java.awt.Color cDotBorder

bTrueRoot

private boolean bTrueRoot

bSubRoot

private boolean bSubRoot

nTreeID

private int nTreeID

nLevel

private int nLevel

bRemoved

private boolean bRemoved

bExpanded

private boolean bExpanded

nNext

public FlexTreeNode nNext

nPrev

protected FlexTreeNode nPrev

nFirstChild

protected FlexTreeNode nFirstChild

nLastChild

protected FlexTreeNode nLastChild

nParent

protected FlexTreeNode nParent

bAlwaysShowPlusMinus

private boolean bAlwaysShowPlusMinus

bSelected

private boolean bSelected
Constructor Detail

FlexTreeNode

public FlexTreeNode()

FlexTreeNode

public FlexTreeNode(java.lang.String sLabel)

FlexTreeNode

public FlexTreeNode(java.lang.String sLabel,
                    java.awt.Image expanded,
                    java.awt.Image collapsed)
Method Detail

getTreeID

public int getTreeID()

forceRepaint

public void forceRepaint()

forceLayout

public void forceLayout()

setRedraw

public void setRedraw(boolean bState)

setAlwaysShowPlusMinus

public void setAlwaysShowPlusMinus(boolean bAlwaysShowPlusMinus)

getAlwaysShowPlusMinus

public boolean getAlwaysShowPlusMinus()

setAsTrueRoot

protected void setAsTrueRoot(int id)

setAsRoot

protected void setAsRoot()

isTrueRoot

public boolean isTrueRoot()

isRoot

public boolean isRoot()

addChild

public void addChild(FlexTreeNode n,
                     int nPosition)

getChildren

public java.util.ArrayList getChildren()

getFirstChild

public FlexTreeNode getFirstChild()

getAllChildren

public java.util.ArrayList getAllChildren()

getChild

public FlexTreeNode getChild(int n)
Returns the Nth child of this node. If there are less than N children, then the last child is returned. If there are no childen, then null is returned.


getLastChild

private FlexTreeNode getLastChild()

setForeground

public void setForeground(java.awt.Color color)
Set the foreground color for this node


getForeground

public java.awt.Color getForeground()
Get the foreground color for this node. If no foreground color has been set, then the return value is null.


setSelectedForeground

public void setSelectedForeground(java.awt.Color color)
Set the foreground color for this node when selected


getSelectedForeground

public java.awt.Color getSelectedForeground()
Get the selected foreground color for this node.


isChild

public boolean isChild(FlexTreeNode node)
Check if the "node" is a child of this node.


isDescendant

public boolean isDescendant(FlexTreeNode node)
Check if the "node" is a descendant of this node.


remove

public void remove()

removeChildren

public void removeChildren()

_paint

protected int _paint(Tree Tree,
                     java.awt.Graphics g,
                     int count)

drawSelectedBorder

public void drawSelectedBorder(java.awt.Graphics g,
                               int l,
                               int t,
                               int w,
                               int h)

nodeAtLine

protected FlexTreeNode nodeAtLine(int Line)

lineFromNode

protected int lineFromNode(Tree tree)

getParent

public FlexTreeNode getParent()
Return the parent node of this node


getNextVisible

public FlexTreeNode getNextVisible()
Return the next node that is visible. The visible nodes are the nodes whose ancestors are all expanded. Even if a node is scrolled out of view, it can still be considered visible.


getNext

public FlexTreeNode getNext()
Return the next node following this node. The next node may not be visible and it may not be either a child nor a sibling of this node. This method is used for enumerating all nodes


getPrev

public FlexTreeNode getPrev()
Return the previous node following this node. The previous node may not be visible and it may not be either a child nor a sibling of this node. This method is used for enumerating all nodes in reverse


getPrevLast

protected FlexTreeNode getPrevLast(FlexTreeNode node)

getNextParent

protected FlexTreeNode getNextParent()

getPrevVisible

public FlexTreeNode getPrevVisible()
Return the previous node that is visible. The visible nodes are the nodes whose ancestors are all expanded. Even if a node is scrolled out of view, it can still be considered visible.


lastVisible

protected FlexTreeNode lastVisible(FlexTreeNode node)

getLastVisible

public FlexTreeNode getLastVisible()

hasChildren

public boolean hasChildren()
Return a boolean value indicating whether or not the node has any child nodes associated with it.


getLevel

public int getLevel()
Get the level of this node within the tree hierarchy.


getNextSibling

public FlexTreeNode getNextSibling()
Return the next sibling node for this node. The value will be null if there is no next sibling.


getPrevSibling

public FlexTreeNode getPrevSibling()
Return the previous sibling node for this node. The value will be null if there is no previous sibling.


getLabel

public java.lang.String getLabel()
Return the text label of the this node.


setLabel

public void setLabel(java.lang.String sLabel)
Set the text label of the this node. Note: this method does not update tree painting.


setExpanded

public void setExpanded(boolean expanded,
                        boolean bChild)

isExpanded

public boolean isExpanded()
Return the expanded state of the node. If true, the node is expanded. If false the node is not expanded.


sortChildren

boolean sortChildren(boolean bRecursive,
                     boolean bCase)

switchNodes

void switchNodes(FlexTreeNode one,
                 FlexTreeNode two)

getRemoved

public boolean getRemoved()

setImages

public void setImages(java.awt.Image expanded,
                      java.awt.Image collapsed)

getExpandedImage

public java.awt.Image getExpandedImage()

getCollapsedImage

public java.awt.Image getCollapsedImage()

setDefaultImages

public void setDefaultImages()

getPosition

public int getPosition()
Gets the position of this node in its parent container.


getLeafNodes

public java.util.ArrayList getLeafNodes()
Returns all the leaf nodes of this node and all sub nodes.


isSelected

protected boolean isSelected()

setSelected

protected void setSelected(boolean b)