|
||||||||||
| 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
|
+--amber.awt.TreeList
This is the base functionality required to handle the extended requirements in a tree list.
ApplicationHandler,
ComponentHandler,
BaseComponent, Serialized Form| Inner classes inherited from class java.awt.Panel |
java.awt.Panel.AccessibleAWTPanel |
| Inner classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
| Field Summary | |
protected boolean |
defaultOpen
|
protected java.util.Vector |
images
|
protected int |
itemHeight
|
protected java.util.Vector |
items
|
protected int[] |
lineOpen
|
protected java.util.Vector |
lineType
|
protected int |
maxLineLength
|
protected boolean |
multipleMode
|
protected int |
selectedIndex
|
protected int |
selectedRow
|
protected int |
selectedRowIndex
|
protected int |
startingOffset
|
protected int |
startingRow
|
protected java.util.Vector |
visibleLines
|
protected int |
visibleRows
|
| 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 | |
TreeList()
Default constructor. |
|
| Method Summary | |
void |
add(java.lang.String item)
Adds a line to the end of the list. |
void |
add(java.lang.String item,
java.awt.Image image,
int type)
Adds a line to the end of the list. |
void |
add(java.lang.String item,
int type)
Adds a line to the end of the list. |
void |
addActionListener(java.awt.event.ActionListener l)
|
void |
addItemListener(java.awt.event.ItemListener l)
|
void |
addNotify()
This function overrides the standard addNotify to allow this control to compute the maximum length of the lines in the control at start up. |
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
|
protected void |
createHScrollIfRequired()
|
protected void |
createVScrollIfRequired()
|
void |
deselect()
Deselects the currently selected line if any. |
protected void |
fireActionPerformed(java.awt.event.ActionEvent e)
|
protected void |
fireItemStateChanged(java.awt.event.ItemEvent e)
|
protected void |
generateVisibleLines()
This function works out which of the item lines are ever visible at this time. |
int |
getItemCount()
Returns the number of lines in the list. |
int |
getLineType(int index)
Returns the type of the line in the list. |
int |
getParentLine(int index)
This function returns the index of the parent line for this line. |
int |
getSelectedIndex()
Returns the index of the selected line in the list. |
int[] |
getSelectedIndexes()
|
java.lang.String |
getSelectedItem()
Returns the line items of the selected line in the list. |
java.lang.String[] |
getSelectedItems()
|
java.lang.Object[] |
getSelectedObjects()
Gets all the selected items in the list. |
void |
insert(java.lang.String item,
java.awt.Image image,
int index,
int type)
Inserts a line at the specified location in the list. |
void |
insert(java.lang.String item,
int index)
Inserts a line at the specified location in the list. |
void |
insert(java.lang.String item,
int index,
int type)
Inserts a line at the specified location in the list. |
boolean |
isFocusTraversable()
|
boolean |
isIndexOpen(int index)
This function determines if the line at the specified index is a parent line which is also open (i.e. |
boolean |
isIndexSelected(int index)
This function determines if the line at the specified index is selected or not. |
int |
locationToIndex(java.awt.Point listPoint)
Returns the index of the item at a Point. |
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paint(java.awt.Graphics g)
The paint function which is concerned with rendering the visible items to the Canvas. |
protected void |
processComponentEvent(java.awt.event.ComponentEvent e)
This handles the case where the component is resized. |
protected void |
processHScroll(java.awt.event.AdjustmentEvent e)
|
protected void |
processMouseEvent(java.awt.event.MouseEvent parm1)
|
protected void |
processVScroll(java.awt.event.AdjustmentEvent e)
|
void |
remove(int index)
Removes a specified line in the list. |
void |
removeActionListener(java.awt.event.ActionListener l)
|
void |
removeAll()
Removes all the lines in the list. |
void |
removeItemListener(java.awt.event.ItemListener l)
|
void |
replaceItem(java.lang.String item,
java.awt.Image image,
int index,
int type)
Replaces the specified line in the list with the new line. |
void |
replaceItem(java.lang.String item,
int index)
Replaces the specified line in the list with the new line. |
void |
replaceItem(java.lang.String item,
int index,
int type)
Replaces the specified line in the list with the new line. |
void |
select(int index)
Sets the selected line in the tree. |
void |
setDefaultOpen(boolean state)
Sets the default state when a child node is added. |
void |
setLineType(int index,
int type)
Sets the type of the line in the list. |
void |
setOpenState(int index,
boolean state)
Sets the line state of a parent line open/closed depending on the state of the input argument. |
void |
toggleOpenState(int index)
Toggles the line state of a parent line from open to closed and vice versa. |
void |
update(java.awt.Graphics g)
Overriden update function which stops the background being drawn for no purpose. |
protected void |
updateCanvas()
|
| Methods inherited from class java.awt.Panel |
getAccessibleContext |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, 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, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeContainerListener, removeNotify, setFont, setLayout, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, 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, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, 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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected int itemHeight
protected int selectedRowIndex
protected int selectedIndex
protected java.util.Vector items
protected java.util.Vector images
protected java.util.Vector lineType
protected java.util.Vector visibleLines
protected int[] lineOpen
protected int selectedRow
protected int startingOffset
protected int startingRow
protected int visibleRows
protected boolean multipleMode
protected boolean defaultOpen
protected int maxLineLength
| Constructor Detail |
public TreeList()
| Method Detail |
public void add(java.lang.String item)
item - String to be displayed at the end of the tree.
public void add(java.lang.String item,
int type)
item - String to be displayed at the end of the tree.type - int containing the type of line, larger values reduce the size.
public void add(java.lang.String item,
java.awt.Image image,
int type)
item - String to be displayed at the end of the tree.image - Image to be displayed before the text.type - int containing the type of line, larger values reduce the size.
public void insert(java.lang.String item,
int index)
item - String to be displayed at the specified location.index - int containing the line index to insert at.
public void insert(java.lang.String item,
int index,
int type)
item - String to be displayed at the specified location.type - int containing the type of line, larger values reduce the size.index - int containing the line index to insert at.
public void insert(java.lang.String item,
java.awt.Image image,
int index,
int type)
item - String to be displayed at the specified location.image - Image to be displayed at the specified location in front of the text.type - int containing the type of line, larger values reduce the size.index - int containing the line index to insert at.public void remove(int index)
remove in class java.awt.Containerindex - int containing the line index to remove.public void removeAll()
removeAll in class java.awt.Container
public void replaceItem(java.lang.String item,
int index)
item - New String to be displayed at the specified location.index - int containing the line index of the line to replace.
public void replaceItem(java.lang.String item,
int index,
int type)
item - New String to be displayed at the specified location.index - int containing the line index of the line to replace.type - int containing the type of line, larger values reduce the size.
public void replaceItem(java.lang.String item,
java.awt.Image image,
int index,
int type)
item - New String to be displayed at the specified location.image - New Image to be displayed at the specified location before the text.index - int containing the line index of the line to replace.type - int containing the type of line, larger values reduce the size.public void setDefaultOpen(boolean state)
state - boolean state to set the default open to.public int getItemCount()
public int getLineType(int index)
index - int containing the line index of the line.public int getParentLine(int index)
index - int index of the line to find the parent of.
public void setLineType(int index,
int type)
index - int containing the line index of the line.int - containing the type.public int getSelectedIndex()
public java.lang.String getSelectedItem()
public int[] getSelectedIndexes()
public java.lang.String[] getSelectedItems()
public java.lang.Object[] getSelectedObjects()
getSelectedObjects in interface java.awt.ItemSelectableprotected void updateCanvas()
protected void createVScrollIfRequired()
protected void createHScrollIfRequired()
protected void processHScroll(java.awt.event.AdjustmentEvent e)
protected void processVScroll(java.awt.event.AdjustmentEvent e)
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged in interface java.awt.event.AdjustmentListenerpublic void select(int index)
index - int line number to select.public void toggleOpenState(int index)
index - int line number to open.
public void setOpenState(int index,
boolean state)
index - int line number to open.state - boolean which sets the line to open when true.public void deselect()
public boolean isIndexSelected(int index)
index - int index of the line to check.public boolean isIndexOpen(int index)
index - int index of the line to check.public void update(java.awt.Graphics g)
update in class java.awt.Containerg - Graphics context to draw on.public void addNotify()
addNotify in class java.awt.Panelpublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerg - Graphics object to draw on.protected void generateVisibleLines()
protected void processMouseEvent(java.awt.event.MouseEvent parm1)
processMouseEvent in class java.awt.Componentpublic int locationToIndex(java.awt.Point listPoint)
listPoint - Point containing a point in the list where 0,0 is the top left of the list.public void mousePressed(java.awt.event.MouseEvent e)
public void mouseReleased(java.awt.event.MouseEvent e)
public void removeActionListener(java.awt.event.ActionListener l)
public void addActionListener(java.awt.event.ActionListener l)
protected void fireActionPerformed(java.awt.event.ActionEvent e)
public void removeItemListener(java.awt.event.ItemListener l)
removeItemListener in interface java.awt.ItemSelectablepublic void addItemListener(java.awt.event.ItemListener l)
addItemListener in interface java.awt.ItemSelectableprotected void fireItemStateChanged(java.awt.event.ItemEvent e)
protected void processComponentEvent(java.awt.event.ComponentEvent e)
processComponentEvent in class java.awt.Componente - the component event to handle.public boolean isFocusTraversable()
isFocusTraversable in class java.awt.Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||