com.java4less.rtree
Class RNode

java.lang.Object
  |
  +--com.java4less.rtree.RNode

public class RNode
extends java.lang.Object

public class RNode
extends Object
Warning: This documentation is only for java programmers. If you are just using the Applet in a HTML page, please read Class MSBTree.RTreeApplet.

This class represents one single node in the tree. The following example creates a node an adds it to the tree:

RNode n=new RNode();

Tree.addFirstLevelNode(n);

See the documentation of the RTreeApplet if you are using the tree in a HTML page.


Field Summary
 java.awt.Color backColor
          background color of the node.
 java.awt.Image backImage
          background image of the node.
 boolean centerText
          is the text of the node to be centered?
 java.lang.String childrenDefinitionFile
          File where the definition of the children of this node is to be found.
 boolean childrenDefinitionLoaded
          if false, the definition file has not been read yet.
 boolean clicked
          if this node clicked?
 java.awt.Color clickedBack
          background color of clicked node
 java.awt.Color clickedColor
          color of clicked node
 java.awt.Font clickedFont
          font of clicked node
 java.awt.Image clickedImage
          background image of clicked node
 java.awt.Color color
          Color of the text.
 boolean expanded
          If expanded the children of the node are visible.
 java.awt.Image expandedIcon
          Icon used for the node when it is expanded.
 java.awt.Font font
          Font used to draw the text.
 int hSize
          internal use.
 java.awt.Image icon
           
 boolean inRMenu
          internal use, is this node in RMenu or RTree?
 int level
          internal use.
 java.lang.String Name
          Name of the node.
 RNode parent
          Node's parent.
 boolean raisedEffectOnSelection
          If true the node will adquire a "Raised effect" when the cursor is placed over it.
 boolean saveToSeparateFile
          for use of RTree Visual Designer
static int SBORDER_LINE
           
static int SBORDER_NO
           
static int SBORDER_RAISED
           
 boolean selected
          is the node selected?
 java.awt.Color selectedBackColor
          background color of the node when it is selected.
 java.awt.Color selectedColor
          Color of the text when the node is selected.
 int selectionSetId
          selection set of the node.
 int submenuBorder
          type of border of this node's submenu.
 java.awt.Color submenuBorderColor
          color of the border of the node's submenu.
 java.awt.Color submenuColor
          color of the background of the node's submenu.
 java.awt.Image submenuImage
          background image of this node's submenu.
 boolean submenuInverted
          is the node's submenu to be inverted.
 java.lang.String target
           
 java.lang.String tipText
          text displayed when the cursor is over the node (use "\n" in order to create a new line).
 java.lang.Object userValue
          Any value you want to store in this node.
 int wSize
          internal use.
 int wSizeText
          internal use.
 int xPos
          internal use.
 int xPosText
          internal use.
 int yPos
          internal use.
 
Constructor Summary
RNode()
           
 
Method Summary
 void addChild(RNode c)
          add a child to the node.
 int calculateWidth(java.awt.Graphics g)
           
 void deleteChild(int c)
          delete a child from the node.
 void deleteChild(RNode n)
          delete a child from the node.
 void deleteChildren()
          remove children
 void draw(java.awt.Graphics g, int x, int y, int h, int w)
          draw the node at the given positions
 RNode getChild(int n)
          returns the child at the specified position (1 is the first child).
 int getChildPosition()
          position of node within parent
 int getChildrenNumber()
          returns number of children of this node.
 int getLineCount()
          returns number of lines in text of node
 java.lang.String getText()
          returns text of node
 boolean hasChildren()
          does this node has children?
 void insertChild(RNode c, int pos)
          insert after this node
 boolean isDescendant(RNode n)
          is this node a descendant of n?
 void setText(java.lang.String t)
          sets text of node
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expanded

public boolean expanded
If expanded the children of the node are visible.

selected

public boolean selected
is the node selected? (the cursor is over the node)

selectionSetId

public int selectionSetId
selection set of the node. Valid values are
0 : (default) single node selection -1: this node cannot be selected 1,2,3,4 ...: multiple node selection. Only nodes with the same SetId can be simultaneously selected.

icon

public java.awt.Image icon

raisedEffectOnSelection

public boolean raisedEffectOnSelection
If true the node will adquire a "Raised effect" when the cursor is placed over it.

expandedIcon

public java.awt.Image expandedIcon
Icon used for the node when it is expanded.

font

public java.awt.Font font
Font used to draw the text.

color

public java.awt.Color color
Color of the text.

selectedColor

public java.awt.Color selectedColor
Color of the text when the node is selected.

backColor

public java.awt.Color backColor
background color of the node.

selectedBackColor

public java.awt.Color selectedBackColor
background color of the node when it is selected.

Name

public java.lang.String Name
Name of the node.

userValue

public java.lang.Object userValue
Any value you want to store in this node.

parent

public RNode parent
Node's parent.

tipText

public java.lang.String tipText
text displayed when the cursor is over the node (use "\n" in order to create a new line).

childrenDefinitionLoaded

public boolean childrenDefinitionLoaded
if false, the definition file has not been read yet.

childrenDefinitionFile

public java.lang.String childrenDefinitionFile
File where the definition of the children of this node is to be found.

backImage

public java.awt.Image backImage
background image of the node.

centerText

public boolean centerText
is the text of the node to be centered?

inRMenu

public boolean inRMenu
internal use, is this node in RMenu or RTree?

SBORDER_NO

public static final int SBORDER_NO

SBORDER_RAISED

public static final int SBORDER_RAISED

SBORDER_LINE

public static final int SBORDER_LINE

submenuBorder

public int submenuBorder
type of border of this node's submenu. Valid values are SBORDER_NO, SBORDER_LINE and SBORDER_RAISED.

submenuImage

public java.awt.Image submenuImage
background image of this node's submenu.

submenuColor

public java.awt.Color submenuColor
color of the background of the node's submenu.

submenuBorderColor

public java.awt.Color submenuBorderColor
color of the border of the node's submenu.

submenuInverted

public boolean submenuInverted
is the node's submenu to be inverted. An inverted submenu is display from bottom to top.

clickedColor

public java.awt.Color clickedColor
color of clicked node

clickedBack

public java.awt.Color clickedBack
background color of clicked node

clickedFont

public java.awt.Font clickedFont
font of clicked node

clickedImage

public java.awt.Image clickedImage
background image of clicked node

clicked

public boolean clicked
if this node clicked?

target

public java.lang.String target

xPos

public int xPos
internal use. Current position in the applet of the node.

yPos

public int yPos
internal use. Current position in the applet.

hSize

public int hSize
internal use. Current size in the applet.

wSize

public int wSize
internal use. Current size in the applet.

level

public int level
internal use. Level of the node. The root has level 0.

xPosText

public int xPosText
internal use. Position of the text

wSizeText

public int wSizeText
internal use. Width of the text

saveToSeparateFile

public boolean saveToSeparateFile
for use of RTree Visual Designer
Constructor Detail

RNode

public RNode()
Method Detail

getChildPosition

public int getChildPosition()
position of node within parent

isDescendant

public boolean isDescendant(RNode n)
is this node a descendant of n?

insertChild

public void insertChild(RNode c,
                        int pos)
insert after this node

addChild

public void addChild(RNode c)
add a child to the node.

getChildrenNumber

public int getChildrenNumber()
returns number of children of this node.

hasChildren

public boolean hasChildren()
does this node has children?

deleteChildren

public void deleteChildren()
remove children

deleteChild

public void deleteChild(int c)
delete a child from the node.

deleteChild

public void deleteChild(RNode n)
delete a child from the node.

getChild

public RNode getChild(int n)
returns the child at the specified position (1 is the first child).

calculateWidth

public int calculateWidth(java.awt.Graphics g)

setText

public void setText(java.lang.String t)
sets text of node

getText

public java.lang.String getText()
returns text of node

getLineCount

public int getLineCount()
returns number of lines in text of node

draw

public void draw(java.awt.Graphics g,
                 int x,
                 int y,
                 int h,
                 int w)
draw the node at the given positions