All Packages  Class Hierarchy  This Package  Previous  Next  Index


Class MSBTree.RMenu

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----MSBTree.RMenu


public class RMenu
extends Panel
implements Runnable

Warning: This documentation is only for java programmers. If you are just using the Applet in a HTML page, please read Class MSBTree.RMenuApplet.

The RMenu is a subclass of Panel. Therefore you can add it to any container in your java application. In order to create a menu you must follow these steps:

  1. Create menu and add it to a container.
  2. Create nodes and add them to the menu You can:
    1. add a node to the first level with the method addFirstLevelNode().
    2. or add the node to another node.
  3. You can also read the definition of the menu from a file like this: menu.createTreeFromFile(tree.Root,<filename>). See documention of the applet for details  Class MSBTree.RMenuApplet about the parameters in the file.
  4. Start the menu. The menuimplements the Runnable interface in other to be able to run the initial animation, for this reason you must start it like this: new Thread(menu).start();

 


Variables

o backImage

 public Image backImage
background image of the menu.

o EXPAND_ON_CLICK

 public static final int EXPAND_ON_CLICK
expand nodes when the user clicks on them.

o EXPAND_ON_ENTER

 public static final int EXPAND_ON_ENTER
expand nodes when the mouse enters them.

o expandOn

 public int expandOn
specifies how the nodes are going to be expanded. Valid values are EXPAND_ON_CLICK or EXPAND_ON_ENTER.

o tipDelay

 public int tipDelay
specifies the number of milliseconds the tree will wait before showing a tip for the current node.

o loadingFont

 public Font loadingFont
font of the text displayed to the user while definition files or applet parameters are read.

o loadingImage

 public Image loadingImage
Image to be displayed while definition files or applet parameters are read.

 

o loadingText

 public String loadingText
this text will be shown to the user while definition files or applet parameters are read.

o menuInternalMargin

 public int menuInternalMargin  
 
space between the border of the menu and the items. The default value is 1 pixel.

o menuType

 public int menuType  
Type of menu: MENU_VERTICAL, MENU_HORIZONTAL (see menuAligment ) and MENU_DEFINED (see userDefinedX and userDefinedY). In MENU_DEFINED the user must specify the location of the items in the applet.

o menuAlignment

 public int menuAlignment
how items are going to be aligned on a horizontal menu. (ALIGN_LEFT, ALIGN_RIGHT or ALIGN_CENTER).

o openingURLText

 public String openingURLText
Text to be displyed while openning an URL.

o backColor

 public Color backColor
background color of the menu.

o iconsWidth

 public int iconsWidth
Width of the icons. The default value is 16.

o submenuBorder

 public int submenuBorder


default type of border of the nodes' submenu. Valid values are SBORDER_NO, SBORDER_LINE and SBORDER_RAISED.

o submenuBorderColor

 public Color submenuBorderColor 
default color of the border of the nodes' submenu.

o submenuColor

 public Color submenuColor
Default color of the background of the nodes' submenu.

o submenuInverted

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

o submenuImage

 public Image submenuImage     
default background image of the nodes' submenu.

o showTip

 public boolean showTip
If false, no tips will be displayed.

o tipFont

 public Font tipFont
Font used to display tips.

o tipColor

 public Color tipColor
color of the font.

o tipBorder

 public Color tipBorder
color of the border of the box used to displayed tips.

o tipBack

 public Color tipBack
background of the box used to displayed tips.

o Root

 public RNode Root

root of the menu. Menus always have a root but it is hidden.

o leftMargin

 public int leftMargin
left margin of the menu.
 

o topMargin

 public int topMargin
top margin of the menu.

o parentApplet

 public Applet parentApplet
Applet (if any) in which the menu is placed. This is used to read the applet's parameters.

o hSeparator

 public Image hSeparator
separator of items in a horizontal menu.

o defaultTarget

 public String defaultTarget
Target frame where URL should be openned after double-clicking a node. Valid values are:

"_self" show in the current frame
"_parent" show in the parent frame
"_top" show in the topmost frame
"_blank" show in a new unnamed top-level window
name show in a new top-level window named name
 

o itemHeight

 public int itemHeight
Height of the items in the menu. The default is 20. 

o itemWidth

 public int itemWidth
 
Width of the items in the menu. The default is 100. 

o userDefinedX

 public int[] userDefinedX
 
 x coordinates of the items for a menu of type DEFINED.  

o userDefinedY

 public int[] userDefinedY
 
 y coordinates of the items for a menu of type DEFINED. 

Constructors

o RMenu

 public RMenu()

Methods

o addFirstLevelNode

 public void addFirstLevelNode(RNode n)
adds the node to the root.

o clear

 public void clear(RNode n)
deletes the children of the node.

o convertColor

 public Color convertColor(String c)
converts a color parameter (as string) to a color class.

o convertFont

 public Font convertFont(String f)
converts a font parameter (as string) to a Font class.

o createTreeFromFile

 public void createTreeFromFile(RNode startNode,
                                String sFile)
 
processes the file sfile. The nodes will be added as children of startNode.

o createTreeFromParameters

 public void createTreeFromParameters(Applet pApplet)
create the menu using the parameters of the applet.

o expandNode

 public void expandNode(String Name,
                        boolean expand)
Expands or collapses a node.

o findNode

 public RNode findNode(RNode n,
                       String Name)
find a node by name.

o paint

 public void paint(Graphics g)
Overrides:
paint in class Container

o processParameter

 public void processParameter(RNode currentNode,
                              String ParamName,
                              String ParamValue)
process a parameter. This method ís used to provide access to paramters from javascript.

o refresh

 public void refresh()
repaints the menu.

o run

 public void run()
starts the menu.


All Packages  Class Hierarchy  This Package  Previous  Next  Index