|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--amber.server.component.ComponentHandler
|
+--amber.server.component.TreeListHandler
This class handles the requirements for the manipulation of the packets moving to and from a tree list component. It is designed to look like a tree control and interacts with the ApplicationInterface as if the tree were running on the server rather than the Browser.
The remote client class also responds to information stored in the parameters field of the XYConstraints object when this handler is added to a panel. The allowed parameters are separated in the string by '|' characters. Any unused trailing parameters are optional and will assume default values, however the parameter order is fixed.
For example, if the component takes 4 parameters which are ints, a valid parameter string would be:
"1|2|3"
In this case the fourth parameter would assume the default value.
The parameter elements for this component are:
| Name | Type | Description | Repeats | Default |
|---|
XYConstraints,
ApplicationInterface,
ComponentHandler,
PTreeList,
TreeList, Serialized Form| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| Field Summary | |
static byte |
AddLine
|
static byte |
ChangeSelection
|
static byte |
ClearTree
|
static byte |
DeleteLine
|
static byte |
GetIndexAtPoint
|
static byte |
GetIndexAtPointResponse
|
static byte |
GetSelectedIndex
|
static byte |
GetSelectedIndexResponse
|
static byte |
GetSelectedLine
|
static byte |
GetSelectedLineResponse
|
static byte |
InsertLine
|
static byte |
NodesDefaultOpen
|
static byte |
ReplaceLine
|
static byte |
SetOpenState
|
static byte |
ToggleLineOpen
|
| Fields inherited from class amber.server.component.ComponentHandler |
actionCommand, active, ApplicationId, CancelReturn, dataEncoder, DefaultTimeout, enabledState, encoderBytes, id, InvalidId, MaximumId, NoReturn, OkCancelType, OkReturn, OkType, OkYesReturn, parentPage, responsePackets, timeoutValue, UnchangeableInvalidId, visibleState, YesNoCancelType, YesNoType, YesReturn |
| 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 | |
TreeListHandler()
Default constructor. |
|
TreeListHandler(ApplicationInterface pageHandler)
The initialising constructor. |
|
TreeListHandler(int id,
ApplicationInterface pageHandler)
The initialising constructor. |
|
| Method Summary | |
protected void |
add(java.lang.String item,
java.lang.String image,
int type)
This adds a string to the end of the tree. |
void |
add(amber.server.component.TreeNode item)
This adds a tree node to the end of the parent in the list. |
protected void |
addTopNode(amber.server.component.TreeNode item)
Adds a node in the list at the end of the list. |
void |
deselect()
Deselects all items in the tree. |
protected int |
determineNesting(amber.server.component.TreeNode item)
Given the specified node this function determines how many levels of parents it has. |
java.util.Vector |
getChildren(amber.server.component.TreeNode node)
Returns the children of the specified parent. |
boolean |
getDefaultNodeOpen()
This function can be used to get the behaviour of the list when child nodes are added. |
int |
getIndex(amber.server.component.TreeNode node)
Returns the index of the node with respect to its parent. |
amber.server.component.TreeNode |
getItem(amber.server.component.TreeNode parent,
int index)
Returns the item specified by the parent and the relative index. |
int |
getItemCount()
Returns the total number of items in the list. |
int |
getItemCount(amber.server.component.TreeNode parent)
Counts the number of items in the sub-tree. |
amber.server.component.TreeNode[] |
getItems()
Returns all the items in the tree. |
protected int |
getLastParentEntry(amber.server.component.TreeNode item)
Gets the index of the last item which has the same parent as this item. |
java.lang.String |
getPanelType()
This function returns the panel component to use with this class. |
protected int |
getSelectedIndex()
Return the index of the item selected in the tree. |
amber.server.component.TreeNode |
getSelectedItem()
Return the text value of the selected item in the tree. |
protected void |
insert(java.lang.String item,
java.lang.String image,
int index,
int type)
Inserts the line at the location specified by the index in the tree. |
void |
insert(amber.server.component.TreeNode item,
int index)
This inserts a tree node to the end of the parent in the list. |
protected void |
insertNode(amber.server.component.TreeNode item,
int index)
Inserts a node in the list at the specified location. |
boolean |
isChildNode(amber.server.component.TreeNode parent,
amber.server.component.TreeNode child)
This function determines if the input TreeNode is a child of the parent. |
protected int |
locateChildNode(amber.server.component.TreeNode itemParent,
int index)
Finds the child node of this parent which matches the specified index. |
protected int |
locationToIndex(java.awt.Point pointInList)
This function converts a physical point location in the tree into a line index. |
amber.server.component.TreeNode |
locationToItem(java.awt.Point pointInList)
This function converts a physical point location in the tree into a TreeNode item. |
protected void |
remove(int position)
Removes an item in the tree. |
void |
remove(amber.server.component.TreeNode node)
Removes an item in the tree. |
void |
remove(amber.server.component.TreeNode parent,
int index)
Removes an item in the tree. |
void |
removeAll()
Removes all items in the tree. |
void |
removeAll(amber.server.component.TreeNode parent)
Removes all child items in the tree based off the current parent node. |
protected void |
replaceItem(java.lang.String newValue,
int index)
Replaces the line specified by the index in the tree. |
protected void |
replaceItem(java.lang.String newValue,
java.lang.String image,
int index,
int type)
Replaces the line specified by the index in the tree. |
void |
replaceItem(amber.server.component.TreeNode newValue,
int index)
Replaces the line specified by the index in the tree. |
void |
replaceItem(amber.server.component.TreeNode newValue,
amber.server.component.TreeNode oldValue)
Replaces the line specified by the input node in the tree. |
void |
resetState()
This function resets the component to a default state. |
void |
select(amber.server.component.TreeNode node)
Selects a specific TreeNode in the tree. |
void |
select(amber.server.component.TreeNode node,
int index)
Selects a specific line in the tree. |
void |
setDefaultNodeOpen(boolean state)
This function can be used to set the behaviour of the list when child nodes are added. |
protected void |
setItemOpenState(int index,
boolean state)
Toggles the open state of the specified line. |
void |
setNodeOpenState(amber.server.component.TreeNode node,
boolean state)
Sets the open state of a node in the tree. |
protected void |
setSelection(int index,
boolean state)
Sets the selection state of a line in the list. |
protected void |
toggleItemState(int index)
Toggles the open state of the specified line. |
void |
toggleNodeOpenState(amber.server.component.TreeNode node)
Toggles the open state of a node in the tree. |
void |
updateNode(amber.server.component.TreeNode node)
Updates the contents of the node in the tree. |
| Methods inherited from class java.awt.Component |
action, add, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAccessibleContext, getAlignmentX, getAlignmentY, getBackground, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getToolkit, getTreeLock, getWidth, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, remove, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, update, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final byte ClearTree
public static final byte GetSelectedIndex
public static final byte GetSelectedIndexResponse
public static final byte GetSelectedLine
public static final byte GetSelectedLineResponse
public static final byte AddLine
public static final byte InsertLine
public static final byte DeleteLine
public static final byte ChangeSelection
public static final byte ReplaceLine
public static final byte GetIndexAtPoint
public static final byte GetIndexAtPointResponse
public static final byte ToggleLineOpen
public static final byte SetOpenState
public static final byte NodesDefaultOpen
| Constructor Detail |
public TreeListHandler()
public TreeListHandler(ApplicationInterface pageHandler)
pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall.
residing on the browser.
public TreeListHandler(int id,
ApplicationInterface pageHandler)
id - The int containing the id of the corresponding remote component
residing on the browser.pageHandler - The handle to the main ApplicationInterface which handles the functions of page overall.| Method Detail |
public void resetState()
resetState in class ComponentHandler
public void add(amber.server.component.TreeNode item)
throws ComponentHandlerException
item - TreeNode containing information on the tree node.ComponentHandlerException - with messaging errors.
public void insert(amber.server.component.TreeNode item,
int index)
throws ComponentHandlerException
item - TreeNode containing information on the tree node.index - int containing the index to insert the node in the
children of this particular parent.ComponentHandlerException - with messaging errors.
public void updateNode(amber.server.component.TreeNode node)
throws ComponentHandlerException
node - TreeNode containing the new information.ComponentHandlerException - with messaging errors.
public void replaceItem(amber.server.component.TreeNode newValue,
amber.server.component.TreeNode oldValue)
throws ComponentHandlerException
newValue - TreeNode containing the node to replace the old node with.oldValue - TreeNode containing the node which is to be replaced.ComponentHandlerException - with messaging errors.
public void replaceItem(amber.server.component.TreeNode newValue,
int index)
throws ComponentHandlerException
newValue - TreeNode containing the node to replace the old node with.index - int location of the object in the tree to replace relative to the parent.ComponentHandlerException - with messaging errors.
public void removeAll()
throws ComponentHandlerException
ComponentHandlerException - with messaging errors.
public void removeAll(amber.server.component.TreeNode parent)
throws ComponentHandlerException
parent - TreeNode parent of the children to remove from the list.ComponentHandlerException - with messaging errors.
public void remove(amber.server.component.TreeNode node)
throws ComponentHandlerException
node - TreeNode to remove from the list.ComponentHandlerException - with messaging errors.
public void remove(amber.server.component.TreeNode parent,
int index)
throws ComponentHandlerException
parent - TreeNode parent of the node to remove from the list.index - int index of the node to remove from the children of the
parent.ComponentHandlerException - with messaging errors.public int getIndex(amber.server.component.TreeNode node)
node - TreeNode to find.public java.util.Vector getChildren(amber.server.component.TreeNode node)
node - TreeNode parent of the children to find.
public amber.server.component.TreeNode getSelectedItem()
throws ComponentHandlerException
ComponentHandlerException - with messaging errors.
public amber.server.component.TreeNode locationToItem(java.awt.Point pointInList)
throws ComponentHandlerException
pointInList - Point containing the location to convert.ComponentHandlerException - with messaging errors.public amber.server.component.TreeNode[] getItems()
public int getItemCount()
public int getItemCount(amber.server.component.TreeNode parent)
parent - TreeNode parent to count the nodes of.
public amber.server.component.TreeNode getItem(amber.server.component.TreeNode parent,
int index)
parent - TreeNode parent of the children nodes.index - int index offset of the child to get.
public void select(amber.server.component.TreeNode node)
throws ComponentHandlerException
node - TreeNode to select.ComponentHandlerException - with messaging errors.
public void toggleNodeOpenState(amber.server.component.TreeNode node)
throws ComponentHandlerException
node - TreeNode to toggle.ComponentHandlerException - with messaging errors.
public void setNodeOpenState(amber.server.component.TreeNode node,
boolean state)
throws ComponentHandlerException
node - TreeNode to open/close.state - boolean which defines the state of parent node being open.
true is open.ComponentHandlerException - with messaging errors.
public void select(amber.server.component.TreeNode node,
int index)
throws ComponentHandlerException
index - int line number to select.ComponentHandlerException - with messaging errors.
public void deselect()
throws ComponentHandlerException
ComponentHandlerException - with messaging errors.
public boolean isChildNode(amber.server.component.TreeNode parent,
amber.server.component.TreeNode child)
parent - TreeNode to test to see if this is the parent.child - TreeNode to test to see if this is a child of the parent.
public void setDefaultNodeOpen(boolean state)
throws ComponentHandlerException
state - The state of the behaviour, when true adding a child to a
parent forces the parent to open.ComponentHandlerException - with messaging errors.public boolean getDefaultNodeOpen()
protected int locationToIndex(java.awt.Point pointInList)
throws ComponentHandlerException
pointInList - Point containing the location to convert.ComponentHandlerException - with messaging errors.
protected void remove(int position)
throws ComponentHandlerException
position - int position of the object to remove.ComponentHandlerException - with messaging errors.protected int getLastParentEntry(amber.server.component.TreeNode item)
item - TreeNode in this level of the tree to find the last node of.
protected int locateChildNode(amber.server.component.TreeNode itemParent,
int index)
itemParent - TreeNode parent of the item to locate.index - int location index of the child node to find.
protected void addTopNode(amber.server.component.TreeNode item)
throws ComponentHandlerException
item - TreeNode to add.ComponentHandlerException - with messaging errors.protected int determineNesting(amber.server.component.TreeNode item)
item - TreeNode to compute the nesting level for.
protected void insertNode(amber.server.component.TreeNode item,
int index)
throws ComponentHandlerException
item - TreeNode to insert.index - int index of the node relative to the parent.ComponentHandlerException - with messaging errors.
protected void add(java.lang.String item,
java.lang.String image,
int type)
throws ComponentHandlerException
item - String containing the text of the line.image - String URL of the image to display before the text.type - int containing the type of line. Major lines are 0, increasing values for
type decrease the size of the string.ComponentHandlerException - with messaging errors.
protected void insert(java.lang.String item,
java.lang.String image,
int index,
int type)
throws ComponentHandlerException
item - String line text.image - String URL of the image to display before the text.index - int line number of the line to insert.type - int containing the indentation of the line in the tree.
Higher numbers are greater indentations. In effect higher numbers
are child lines of lower numbers.ComponentHandlerException - with messaging errors.
protected void replaceItem(java.lang.String newValue,
int index)
throws ComponentHandlerException
newValue - String containing the text of the line.index - int line number of the line to replace.ComponentHandlerException - with messaging errors.
protected void replaceItem(java.lang.String newValue,
java.lang.String image,
int index,
int type)
throws ComponentHandlerException
newValue - String containing the text of the line.image - String URL of the image to display before the text.index - int line number of the line to replace.type - int which defines the nesting of the list items.
Higher numbers are children of lower numbers.ComponentHandlerException - with messaging errors.
protected int getSelectedIndex()
throws ComponentHandlerException
ComponentHandlerException - with messaging errors.
protected void toggleItemState(int index)
throws ComponentHandlerException
index - int line number to toggle the open state.ComponentHandlerException - with messaging errors.
protected void setItemOpenState(int index,
boolean state)
throws ComponentHandlerException
index - int line number to toggle the open state.ComponentHandlerException - with messaging errors.
protected void setSelection(int index,
boolean state)
throws ComponentHandlerException
index - int line number to select/deselect (ignored in deselect).state - boolean state to set the line to.ComponentHandlerException - with messaging errors.public java.lang.String getPanelType()
getPanelType in class ComponentHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||