|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--java.applet.Applet | +--com.java4less.rtree.RTreeApplet
The RTreeApplet is a thin layer on the RTreeList class that allows you to use the RTreeList as an applet in a web page. The parameters for the applet are:
Allmost all parameters are Strings or Integers, however the are some special cases:
The parameters of the applet are:
The following parameters define default values for the nodes:
The following parameters define the value for a given node. The * must be substituted by the node's name. If the parameters are used in Javascript or in a definition file the *_ should not be included:
The following parameters will allow you to execute JavaScript functions when something happens:
See the file Example3.html to see an example of these parameters.
The data for a node or tree can also be loaded from a text file instead of using the parameters of the applet. The advantadge of this approach is:
The structure of the file is very simple; each file contains the definition of the children of one node only. Each line in the file contains one command. The command can be:
For example:
CHILD=Index
ICON=car1.gif
SELECTED_ICON=car2.gif
DATA_FILE=file://www.myserver/IndexNodes.txt
TEXT=Index
CHILD=Features
.
.
.
This file creates a new node called "Index". The following 4 lines contain some parameters for this node. This parameters have the same name as those used in the applet parameters (without the *_). Note that the children of the node "index" will be defined in the file "IndexNodes.txt".
It is also possible to change teh appearance of the tree from Javascript (See the file Example1.html to see an example of this). The following methods can be accessed from javascript :
Inner Class Summary | |
class |
RTreeApplet.borderCanvas
|
Field Summary | |
static int |
BORDER_DOUBLE
|
static int |
BORDER_LINE
|
static int |
BORDER_LINE2
|
static int |
BORDER_LOWERED
|
static int |
BORDER_RAISED
|
static int |
BORDER_SHADOW
|
java.awt.Color |
borderColor
|
int |
borderType
type of the border of the applet |
static int |
NO_BORDER
|
java.awt.Color |
pageBackColor
if you use border type BORDER_SHADOW, this must be the same color as the background of the HTML page |
java.awt.Panel |
simulator
internal, for Rtree Visual Designer only |
RTreeList |
tree
tree |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
RTreeApplet()
|
Method Summary | |
void |
clearTree(java.lang.String nodeName)
|
java.lang.String |
getNodeParent(java.lang.String nodeName)
|
java.lang.String |
getNodeProperty(java.lang.String nodeName,
java.lang.String sParam)
returns the property of the node. |
java.lang.String |
getNodeText(java.lang.String nodeName)
return node's text |
java.lang.String |
getNodeTip(java.lang.String nodeName)
|
java.lang.String |
getSelectedNode(int i)
get the selected node at the specific index.(index range from 1 to getSelectionCount()-1) |
int |
getSelectionCount()
get number of selected nodes |
void |
init()
|
void |
loadNode(java.lang.String nodeName,
java.lang.String sFile)
loads the children of the node nodename from the file sFile. |
void |
refreshTree()
repaints the tree. |
void |
resizeTree()
|
void |
setBorderBackground()
|
void |
setBounds(int x1,
int y1,
int w,
int h)
|
void |
setParam(java.lang.String nodeName,
java.lang.String Param,
java.lang.String Value)
Sets a parameter for a node. |
void |
start()
|
void |
stop()
|
Methods inherited from class java.applet.Applet |
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public RTreeList tree
public static final int NO_BORDER
public static final int BORDER_LINE
public static final int BORDER_RAISED
public static final int BORDER_LOWERED
public static final int BORDER_DOUBLE
public static final int BORDER_SHADOW
public static final int BORDER_LINE2
public int borderType
public java.awt.Color pageBackColor
public java.awt.Color borderColor
public java.awt.Panel simulator
Constructor Detail |
public RTreeApplet()
Method Detail |
public void setParam(java.lang.String nodeName, java.lang.String Param, java.lang.String Value)
Sets a parameter for a node. This methods allows the configuration of the applet from javascript. For example, in order to change the icon of a node called "node1":
javascript:document.tree.setParam('node1','ICON','newicon.gif');
In the example "tree" is the name of the applet.
public void clearTree(java.lang.String nodeName)
public int getSelectionCount()
public java.lang.String getSelectedNode(int i)
public java.lang.String getNodeText(java.lang.String nodeName)
public java.lang.String getNodeTip(java.lang.String nodeName)
public java.lang.String getNodeParent(java.lang.String nodeName)
public java.lang.String getNodeProperty(java.lang.String nodeName, java.lang.String sParam)
returns the property of the node. Supported properties are:
public void setBounds(int x1, int y1, int w, int h)
setBounds
in class java.awt.Component
public void loadNode(java.lang.String nodeName, java.lang.String sFile)
public void refreshTree()
public void resizeTree()
public void init()
init
in class java.applet.Applet
public void stop()
stop
in class java.applet.Applet
public void start()
start
in class java.applet.Applet
public void setBorderBackground()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |