|
||||||||||
| 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.ComplexList
This is the base functionality required to handle the extended requirements in a multi-item list.
ApplicationHandler,
ComponentHandler, 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 | |
static int |
ArrowDown
|
static int |
ArrowNone
The arrow value for the selected column. |
static int |
ArrowUp
|
static int |
CENTER
The text alignment is centred. |
protected java.util.Vector |
columnAlignments
|
protected java.util.Vector |
columnSizes
|
protected int |
headerHeight
|
protected java.util.Vector |
headers
|
protected int |
itemHeight
|
protected java.util.Vector |
items
|
static int |
LEFT
The text alignment is left justified. |
protected java.util.Vector |
lineType
|
protected boolean |
multipleMode
|
static int |
RIGHT
The text alignment is right justified. |
protected int |
selectedIndex
|
protected int |
selectedRowIndex
|
protected int[] |
selectedRows
|
protected int |
startingColumn
|
protected int |
startingRow
|
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 | |
ComplexList()
Default constructor. |
|
| Method Summary | |
void |
add(java.util.Vector item)
Adds a line to the end of the list. |
void |
add(java.util.Vector 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 |
addSubItem(java.lang.Object data,
int rowIndex)
Adds a new column item to the end of the specified line in the list. |
void |
adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
|
protected void |
componentSetUp()
This function sets up the various sub items in the control and sets their default state. |
protected void |
createHScrollIfRequired()
|
protected void |
createVScrollIfRequired()
|
void |
deselect(int index)
Deselects the specified line. |
protected void |
fireActionPerformed(java.awt.event.ActionEvent e)
|
protected void |
fireItemStateChanged(java.awt.event.ItemEvent e)
|
int |
getItemCount()
Returns the number of lines in the list. |
int |
getLineType(int index)
Returns the type of the line in the list. |
int |
getSelectedColumn()
Returns the column index of the selected column if any. |
int |
getSelectedColumnState()
Returns the column state of the selected column if any. |
int |
getSelectedIndex()
Returns the index of the selected line in the list. |
int[] |
getSelectedIndexes()
Returns an array of the selected indexes as an array of ints. |
java.util.Vector |
getSelectedItem()
Returns the line items of the selected line in the list. |
java.util.Vector[] |
getSelectedItems()
Returns an array of Vectors which are the items in the selected line. |
java.lang.Object[] |
getSelectedObjects()
Gets all the selected items in the list. |
void |
insert(java.util.Vector item,
int index)
Inserts a line at the specified location in the list. |
void |
insert(java.util.Vector item,
int index,
int type)
Inserts a line at the specified location in the list. |
void |
insertSubItem(java.lang.Object data,
int rowIndex,
int columnIndex)
Inserts a new column item into a specified column location of the specified line in the list. |
boolean |
isFocusTraversable()
Defines whether this control can be focused. |
boolean |
isIndexSelected(int index)
This function determines if the specified line is selected. |
boolean |
isMultipleMode()
Returns the multi-line selection state. |
int |
locationToColumn(java.awt.Point listPoint)
Returns the column index of the item at a Point. |
int |
locationToIndex(java.awt.Point listPoint)
Returns the index of the item at a Point. |
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paint(java.awt.Graphics g)
Primary painting function. |
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 |
processKeyEvent(java.awt.event.KeyEvent e)
This function handles the key events in the list. |
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 |
removeSubItem(int rowIndex,
int columnIndex)
Removes a specified line/column item in the list. |
void |
replaceItem(java.util.Vector item,
int index)
Replaces the specified line in the list with the new line. |
void |
replaceItem(java.util.Vector item,
int index,
int type)
Replaces the specified line in the list with the new line. |
void |
select(int index)
Selects the specified line. |
void |
setColumnAlignment(int index,
int alignment)
Sets the alignment of the column text in the list. |
void |
setColumnAlignments(java.util.Vector alignments)
This function is used to set the various text alignments of the columns in the list. |
void |
setColumnHeaders(java.util.Vector newHeaders)
This function is used to set the various headers of the columns in the list. |
void |
setColumnSizes(java.util.Vector sizes)
This function is used to set the various widths of the columns in the list. |
void |
setDrawHeaders(boolean on)
This function turns the rendering of the list headers on and off. |
void |
setHeaderHeight(int height)
Normally the header height is specified by the size of the font. |
void |
setItemHeight(int height)
Normally the line item height is specified by the size of the font. |
void |
setLineType(int index,
int type)
Sets the type of the line in the list. |
void |
setMultipleMode(boolean mode)
Sets the multi-line selection state. |
void |
setSelectedColumn(int index,
int value)
Sets the selected Column. |
void |
setSubItem(java.lang.Object data,
int rowIndex,
int columnIndex)
Replaces a column item with a new item at a specified column location of the specified line in the list. |
void |
showColumn(int index)
Shows the specified column number. |
void |
showLine(int index)
Shows the specified line number. |
void |
update(java.awt.Graphics g)
Overridden to remove the buffer clearing. |
protected void |
updateCanvas()
Updates the entire window and adds the scroll bars if necessary. |
| Methods inherited from class java.awt.Panel |
addNotify, 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, 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 |
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int ArrowNone
public static final int ArrowDown
public static final int ArrowUp
protected java.util.Vector items
protected int itemHeight
protected int headerHeight
protected int selectedRowIndex
protected java.util.Vector headers
protected java.util.Vector columnSizes
protected java.util.Vector columnAlignments
protected java.util.Vector lineType
protected int[] selectedRows
protected int startingColumn
protected int startingRow
protected int visibleRows
protected boolean multipleMode
protected int selectedIndex
| Constructor Detail |
public ComplexList()
| Method Detail |
public void setColumnAlignments(java.util.Vector alignments)
sizes - Vector containing Integers with the alignments.public void setColumnSizes(java.util.Vector sizes)
sizes - Vector containing Integers with the widths in pixels.public void setColumnHeaders(java.util.Vector newHeaders)
newHeaders - Vector containing Objects to put into the headers.public void add(java.util.Vector item)
item - Vector containing Objects which are to be displayed in
the columns of the line.
public void add(java.util.Vector item,
int type)
item - Vector containing Objects which are to be displayed in
the columns of the line.type - int containing the type of line, larger values reduce the size.
public void insert(java.util.Vector item,
int index)
item - Vector containing Objects which are to be displayed in
the columns of the line.index - int containing the line index to insert at.
public void insert(java.util.Vector item,
int index,
int type)
item - Vector containing Objects which are to be displayed in
the columns of the line.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.util.Vector item,
int index)
item - Vector containing Objects which are to be displayed in
the columns of the line.index - int containing the line index of the line to replace.
public void replaceItem(java.util.Vector item,
int index,
int type)
item - Vector containing Objects which are to be displayed in
the columns of the line.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 addSubItem(java.lang.Object data,
int rowIndex)
data - Object containing the data to add to a new column at the
end of the line. If there are insufficient columns to display this item
it is ignored.rowIndex - int containing the line index of the line to add the column to.
public void insertSubItem(java.lang.Object data,
int rowIndex,
int columnIndex)
data - Object containing the data to insert in the specified column at the
specified line. If there are insufficient columns to display this item
it is ignored.rowIndex - int containing the line index of the line to insert the column into.columnIndex - int containing the column index of the column to insert the data into.
public void setSubItem(java.lang.Object data,
int rowIndex,
int columnIndex)
data - Object containing the data to replace the specified column item with.rowIndex - int containing the line index of the line containing the column to change.columnIndex - int containing the column index of the column to alter.
public void removeSubItem(int rowIndex,
int columnIndex)
rowIndex - int containing the line index of the line/column item to remove.columnIndex - int containing the column index of the column to remove.public void setDrawHeaders(boolean on)
on - boolean which turns on the header rendering when true.public void setItemHeight(int height)
height - int size of each line vertically. Setting the height to a
negative value reverts to the font height.public void setHeaderHeight(int height)
height - int size of each header vertically. The function accepts
the following type of variables:public int getItemCount()
public int getLineType(int index)
index - int containing the line index of the line.
public void setLineType(int index,
int type)
index - int containing the line index of the line.type - int containing the type.
public void setColumnAlignment(int index,
int alignment)
index - int containing the column index.alignment - int containing the alignment.public int getSelectedIndex()
public int getSelectedColumn()
public int getSelectedColumnState()
public java.util.Vector getSelectedItem()
public int[] getSelectedIndexes()
public java.util.Vector[] getSelectedItems()
public boolean isMultipleMode()
public void setMultipleMode(boolean mode)
mode - boolean true if multiple lines in the list can be selected at once.public java.lang.Object[] getSelectedObjects()
getSelectedObjects in interface java.awt.ItemSelectablepublic boolean isFocusTraversable()
isFocusTraversable in class java.awt.Component
public void setSelectedColumn(int index,
int value)
index - int index of the column to select.value - int arrow display state for the selected column.public void select(int index)
index - int containing the line index of the line to select.
A value of -1 deselects all the items in the list.public void deselect(int index)
index - int containing the line index of the line to deselect.public void showLine(int index)
index - int line to display.public void showColumn(int index)
index - int line to display.public boolean isIndexSelected(int index)
index - int line number to check.public void update(java.awt.Graphics g)
update in class java.awt.Containerg - Graphics context to update.public void paint(java.awt.Graphics g)
paint in class java.awt.Containerg - Graphics context to paint into.public 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 int locationToColumn(java.awt.Point listPoint)
listPoint - Point containing a point in the list where 0,0 is the top left of the list.
protected void componentSetUp()
throws java.lang.Exception
protected void updateCanvas()
protected void createVScrollIfRequired()
protected void createHScrollIfRequired()
protected void processHScroll(java.awt.event.AdjustmentEvent e)
protected void processVScroll(java.awt.event.AdjustmentEvent e)
protected void processMouseEvent(java.awt.event.MouseEvent parm1)
processMouseEvent in class java.awt.Componentpublic void mousePressed(java.awt.event.MouseEvent e)
public void mouseReleased(java.awt.event.MouseEvent e)
protected void processKeyEvent(java.awt.event.KeyEvent e)
processKeyEvent in class java.awt.Componente - the key event to handle.protected void processComponentEvent(java.awt.event.ComponentEvent e)
processComponentEvent in class java.awt.Componente - the component event to handle.public void mouseEntered(java.awt.event.MouseEvent e)
public void mouseExited(java.awt.event.MouseEvent e)
public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
adjustmentValueChanged in interface java.awt.event.AdjustmentListenerpublic 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)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||