Class symantec.itools.awt.MultiList
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.MultiList

Object
   |
   +----Component
           |
           +----Container
                   |
                   +----Panel
                           |
                           +----symantec.itools.awt.MultiList

public class MultiList
extends Panel
implements Serializable, ItemSelectable
This class implements a multi-column listbox component. Use to create a box that displays a matrix of items that the user can selectRow. The user cannot type or edit a selection in a list box.

The user can resize a column at run-time by dragging the column boundary to a new position.

Version:
1.1, July 14, 1997
Author:
Symantec

Variable Index

 o BORDER
Border amount.
 o CENTER
Center-justify column alignment constant.
 o CLICKTHRESHOLD
Maximum time inverval to register a double click (in milliseconds).
 o LEFT
Left-justify column alignment constant.
 o RESIZE_FUDGE_FACTOR
Fudge factor for resizing of columns.
 o RIGHT
Right-justify column alignment constant.
 o actionCommand
The first part of the action command.
 o actionListener
The action listener to keep track of listeners for our action event.
 o allowResizingOfColumns
Allow columns to be resized.
 o allowSorting
Allow sorting.
 o cachedHeight
The latest vertical size of this component.
 o cachedLastSplitter
The latest overall row width.
 o cachedWidth
The latest horizontal size of this component.
 o cellAscent
The ascent metric of the cell font.
 o cellDescent
The descent metric of the cell font.
 o cellFont
The font used to display cell text.
 o cellHeight
The height of cells, in pixels.
 o cells
The cells.
 o clickTime
The time of the previous click.
 o clickedInHeadings
Mouse button has been pressed in a column heading.
 o colorBg
The background color of cell text.
 o colorFg
The foreground color of cell text.
 o colorHBg
The background color of hilighted cell text.
 o colorHFg
The foreground color of hilighted cell text.
 o columnAlignments
The column alignments.
 o columnClicked
If sorting is allowed, the column clicked in.
 o columnCompareCellsRoutines
The cell compare routines to use for each column.
 o columnSizes
If non-null, the the width of each column in pixels.
 o defaultColumnAlignment
The column alignment to use by default.
 o defaultColumnSorter
The default cell comparer.
 o dragColumn
The zero-relative index of the column being resized via the UI.
 o errors
Error strings.
 o focusIndicatedVisually
Indicate focus when drawing.
 o focusListener
The action listener to keep track of listeners for our focus event.
 o forceColumnSizeRecalc
Column sizes need to be recalculated.
 o forceFullRedraw
Offscreen image needs to be flushed.
 o forceRedraw
True if next paint will redraw the entire component even if its size has not changed.
 o hScrollbarLineIncrement
The unit increment of the horizontal scrollbar.
 o hasFocus
This component has the focus.
 o headingBg
The background color of column heading text.
 o headingFg
The foreground color of column heading text.
 o headingFont
The font used to draw heading text.
 o headingHeight
The heading height in pixels.
 o headingVisible
Is the heading visible.
 o headings
The heading titles.
 o highlightedRows
Flags indicating which rows are currently selected.
 o horizontalScrollbar
The horizontal scrollbar.
 o isDragging
Column splitter is being dragged to resize a column.
 o isSun1_1
True if running under Java 1.1.
 o isSuppressRedraw
Redrawing of component is currently suppressed.
 o itemListener
The action listener to keep track of listeners for our item event.
 o lastColumnClicked
If sorting is allowed, the column previously clicked in.
 o memoryClick
Temp storage for columnClicked when repainting during a mouse drag.
 o minColumnWidth
The minimum allowed column width, in pixels.
 o multiSelect
Allow multiple selections.
 o offscreenImage
The offscreen image.
 o offscreenImageGraphics
The graphics context used to draw into the offscreen image.
 o redrawWasSupressed
Redraw would have occurred if it hadn't been suppressed.
 o sbHPosition
The horizontal scrollbar value.
 o sbHShow
Horizontal scrollbar is visible.
 o sbVPosition
The vertical scrollbar value.
 o sbVShow
Vertical scrollbar is visible.
 o scrollbarHeight
The height of the horizontal scrollbar.
 o selectedRow
The most recently selected row.
 o splitters
The location of the boundries between columns, in pixels.
 o topRow
The zero-relative index of the first visible row in the list.
 o verticalScrollbar
The vertical scrollbar.
 o verticalScrollbarWidth
The width of the vertical scrollbar.
 o xDragLast
The latest horizontal position the the splitter being dragged to resize a column.

Constructor Index

 o symantec.itools.awt.MultiList()
Constructs a default MultiList.
 o symantec.itools.awt.MultiList(int)
Constructs a new MultiList with the specified number of columns.
 o symantec.itools.awt.MultiList(int, boolean)
Constructs a new MultiList with the spcified number of columns and whether multiple row selection allowed.
 o symantec.itools.awt.MultiList(int, boolean, Color)
Constructs a new MultiList with the specified number of columns, whether multiple row selection is allowed, and given background color.

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this object.
 o addCell(int, int, String, Image)
Sets the contents of a cell, both text and image.
 o addCell(int, int, Cell)
Sets the contents of a cell to the given cell.
 o addCellImpl(int, int, Cell)
Adds a cell to the MultiList in the row and column specified.
 o addImageCell(int, int, Image)
Sets the image of a cell at the given row and column position.
 o addItemListener(ItemListener)
Adds the specified item listener to receive item events from this object.
 o addNotify()
Tells this component that it has been added to a container.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all property change events.
 o addTextCell(int, int, String)
Sets the text of a cell at the given row and column position.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a listener for all vetoable property change events.
 o adjustHeadings()
Adjusts the columns to default width.
 o calcHeadings(String[])
Initializes new headings with the given list of heading titles.
 o calcVerticalScrollbarPosition(boolean)
Determines if the vertical scrollbar needs to be shown.
 o calculateHeadingHeight()
Calculates the height of the column headings and stores that in headingHeight.
 o changeSelection(int, int)
This routine changes the selected row, handling multiple selections as needed.
 o clear()
Removes all rows from the MultiList.
 o createColumns(int)
Initializes the MultiList with the specified total numer of columns.
 o deselectAll()
Deselects all rows in a MultiList.
 o deselectRow(int)
Deselects the row, if it is not already selected.
 o draw3DBox(Rectangle, boolean)
Draws a rectangle with 3-dimensional effect into the offscreen image.
 o drawColumnHeading(Rectangle, boolean)
Draws the specified column heading into an offscreen image.
 o drawHeading(boolean)
Draws all column headings into an offscreen image.
 o drawRows(int, int, boolean)
Draws the specifed rows into an offscreen image.
 o getCellBg()
Gets the current background color of cell text.
 o getCellFg()
Gets the current foreground color of cell text.
 o getCellFont()
Returns the font currently used for text in all the cells.
 o getCellImage(int, int)
Returns the image of the specified cell, if any.
 o getCellText(int, int)
Returns the text of the specified cell.
 o getColumnAlignment(int)
Gets the justification of the text for the specified column.
 o getColumnAlignments()
Gets a string array containing the alignment of each column.
 o getColumnSize(int)
Get the column size in pixels for the specified column.
 o getColumnSizes()
Returns a string array containing the width of each column in pixels.
 o getColumnSizesFromSplitters()
Returns an array of column sizes as determined from the current splitter information.
 o getColumnSorter(int)
Gets the object used to compare cells for sorting the specified column.
 o getDefaultColumnAlignment()
Gets the default column alignment.
 o getDefaultColumnSorter()
Gets the default object used to compare column cells for sorting.
 o getHeading(int)
Returns the heading text of the specified column.
 o getHeadingBg()
Returns the color of the column heading text background.
 o getHeadingFg()
Returns the color of the column heading text foreground.
 o getHeadingFont()
Returns the font for column heading text.
 o getHeadings()
Gets a String array of all of the column headings.
 o getListItems()
Returns the text contents of all the cells as a string array.
 o getMinColumnWidth()
Returns the minimum allowable column width in pixels.
 o getNumVisibleRows()
Returns the number of visible rows that can fit in the MulitList.
 o getNumberOfCols()
Returns the current number of columns.
 o getNumberOfRows()
Gets the current number of rows.
 o getSelectedObjects()
Returns an array of Objects (Integers), one for each selected row index.
 o getSelectedRow()
Returns the zero-relative index of the currently selected row.
 o getSelectedRows()
Returns an integer index for each selected row.
 o intArrayToStringArray(int[])
Converts the given array of int into a corresponding array of String.
 o internalCreateColumns(int)
Internal helper routine.
 o isAllowResizingOfColumns()
Gets whether columns may currently be resized by the user via the user interface.
 o isAllowSorting()
Gets the flag controlling sorting of columns when a heading is selected.
 o isFocusIndicatedVisually()
Returns true if this MultiList indicates it has focus visually.
 o isFocusTraversable()
 o isHeadingVisible()
Returns true if heading of the MultiList is visible.
 o isMultipleMode()
Returns true if this MultiList allows multiple selections.
 o minimumSize()
Returns the minimum dimensions to properly display this component.
 o paint(Graphics)
Paints this component using the given graphics context.
 o paintSelection(int[])
Paints the specified rows as selected.
 o preferredSize()
Returns the recommended dimensions to properly display this component.
 o rangeCheckAlignment(int)
Ensures the given column alignment value is valid.
 o rangeCheckColumn(int)
Ensures the given column index is valid.
 o redraw()
Paints this component into an offscreen image for cleaner screen repaints.
 o removeActionListener(ActionListener)
Removes the specified action listener so it no longer receives action events from this object.
 o removeItemListener(ItemListener)
Removes the specified item listener so it no longer receives item events from this object.
 o removeNotify()
Tells this component that it is being removed from a container.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all property change events.
 o removeRow(int)
Removes a single row from the MultiList.
 o removeSelectionBorder()
If there is a selected row, it removes the selection border from it.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a listener for all vetoable property change events.
 o repaintFocus()
Internal helper routine.
 o resizeHeadings(int)
Internal helper routine.
 o selectAll()
Selects all rows in a MultiList.
 o selectRow(int)
Selects the row, if it is not already selected.
 o setAllowResizingOfColumns(boolean)
Sets the flag to allow resizing of columns via the user interface.
 o setAllowSorting(boolean)
Sets the flag to allow sorting of columns when a heading is selected.
 o setCellBg(Color)
Sets the background color of cell text.
 o setCellColors(Color, Color)
Sets foreground and background colors of cell text.
 o setCellFg(Color)
Sets the foreground color of cell text.
 o setCellFont(Font)
Sets the font used for text in all the cells.
 o setColumnAlignment(int, int)
Sets the alignment of the text in the specified column.
 o setColumnAlignments(String[])
Sets the alignment of each column.
 o setColumnSizes(String[])
Sets the the width of each column in pixels.
 o setColumnSorter(int, CompareCells)
Sets the object used to compare cells for sorting the specified column.
 o setColumns(int)
 o setDefaultColumnAlignment(int)
Sets the default column alignment.
 o setDefaultColumnSorter(CompareCells)
Sets the default object used to compare column cells for sorting.
 o setFocusIndicatedVisually(boolean)
Sets whether this MultiList should visually indicate focus.
 o setHeading(String, int)
Sets a column's heading text.
 o setHeading(String, int, int)
Sets a column's heading text and width.
 o setHeadingBg(Color)
Sets the column heading text background color.
 o setHeadingColors(Color, Color)
Sets the column heading foreground and background colors.
 o setHeadingFg(Color)
Sets the column heading text foreground color.
 o setHeadingFont(Font)
Sets the font for column heading text.
 o setHeadingVisible(boolean)
Sets whether this MultiList should draw the column headings or not.
 o setHeadings(String[])
Initializes all the column headings with the given list.
 o setLayout(LayoutManager)
Takes no action.
 o setListItems(String[])
Initializes all the MultiList cells with text.
 o setMinColumnWidth(int)
Sets the minimum allowable column width.
 o setMultipleMode(boolean)
Sets whether this MultiList should allow multiple selections or not.
 o setNumberOfCols(int)
Sets the number of columns.
 o setSelectedRow(int)
Sets the specified row as the selected row.
 o setSupressRedraw(boolean)
Sets the internal flag to supress redraw.
 o sourceActionEvent(int)
Fires an action event to the listeners.
 o sourceItemEvent(int)
Fires an item event to the listeners.
 o tokenizeStringArrayIfNeeded(String[])
Handles cases where the user might pass either an array of items, or a single string with itemds separated by the ';' character.
 o triggerRedraw()
Triggers an entire redraw of this component, unless redrawing is currently suppressed.
 o update(Graphics)
Handles redrawing of this component on the screen.

Variables

 o BORDER
protected static final int BORDER
Border amount. Only calc'd on the right and the bottom side.

 o CENTER
public static final int CENTER
Center-justify column alignment constant.

 o CLICKTHRESHOLD
public static final long CLICKTHRESHOLD
Maximum time inverval to register a double click (in milliseconds).

 o LEFT
public static final int LEFT
Left-justify column alignment constant.

 o RESIZE_FUDGE_FACTOR
protected static final int RESIZE_FUDGE_FACTOR
Fudge factor for resizing of columns.

 o RIGHT
public static final int RIGHT
Right-justify column alignment constant.

 o actionCommand
protected java.lang.String actionCommand
The first part of the action command. It is sent when a row is double-clicked, or enter is pressed.

See Also:
sourceActionEvent
 o actionListener
protected java.awt.event.ActionListener actionListener
The action listener to keep track of listeners for our action event.

 o allowResizingOfColumns
protected boolean allowResizingOfColumns
Allow columns to be resized. Default is true.

 o allowSorting
protected boolean allowSorting
Allow sorting. Default is true.

 o cachedHeight
protected int cachedHeight
The latest vertical size of this component.

 o cachedLastSplitter
protected int cachedLastSplitter
The latest overall row width.

 o cachedWidth
protected int cachedWidth
The latest horizontal size of this component.

 o cellAscent
protected int cellAscent
The ascent metric of the cell font.

 o cellDescent
protected int cellDescent
The descent metric of the cell font.

 o cellFont
protected java.awt.Font cellFont
The font used to display cell text.

See Also:
getCellFont, setCellFont
 o cellHeight
protected int cellHeight
The height of cells, in pixels.

 o cells
protected symantec.itools.awt.Matrix cells
The cells.

 o clickTime
protected transient long clickTime
The time of the previous click. Used to detect when a row is double-clicked.

 o clickedInHeadings
protected transient boolean clickedInHeadings
Mouse button has been pressed in a column heading.

 o colorBg
protected java.awt.Color colorBg
The background color of cell text.

See Also:
getCellBg, setCellBg
 o colorFg
protected java.awt.Color colorFg
The foreground color of cell text.

See Also:
getCellFg, setCellFg
 o colorHBg
protected java.awt.Color colorHBg
The background color of hilighted cell text. Automatically determined.

 o colorHFg
protected java.awt.Color colorHFg
The foreground color of hilighted cell text. Automatically determined.

 o columnAlignments
protected int[] columnAlignments
The column alignments. Values are one of: LEFT, CENTER, or RIGHT.

See Also:
LEFT, CENTER, RIGHT, setColumnAlignments
 o columnClicked
protected int columnClicked
If sorting is allowed, the column clicked in.

See Also:
isAllowSorting, setAllowSorting
 o columnCompareCellsRoutines
protected java.util.Hashtable columnCompareCellsRoutines
The cell compare routines to use for each column. The routines are indexed using an Integer of the column index.

See Also:
getColumnSorter, setColumnSorter
 o columnSizes
protected int[] columnSizes
If non-null, the the width of each column in pixels. If null, the columns are automatically sized.

See Also:
getColumnSizes, setColumnSizes
 o defaultColumnAlignment
protected int defaultColumnAlignment
The column alignment to use by default. The initial value is LEFT.

See Also:
LEFT, CENTER, RIGHT, getDefaultColumnAlignment, setDefaultColumnAlignment
 o defaultColumnSorter
protected symantec.itools.awt.CompareCells defaultColumnSorter
The default cell comparer.

See Also:
getDefaultColumnSorter, setDefaultColumnSorter
 o dragColumn
protected int dragColumn
The zero-relative index of the column being resized via the UI.

 o errors
protected transient java.util.ResourceBundle errors
Error strings.

 o focusIndicatedVisually
protected boolean focusIndicatedVisually
Indicate focus when drawing. Default is true.

 o focusListener
protected java.awt.event.FocusListener focusListener
The action listener to keep track of listeners for our focus event.

 o forceColumnSizeRecalc
protected transient boolean forceColumnSizeRecalc
Column sizes need to be recalculated.

 o forceFullRedraw
protected transient boolean forceFullRedraw
Offscreen image needs to be flushed.

 o forceRedraw
protected transient boolean forceRedraw
True if next paint will redraw the entire component even if its size has not changed.

 o hScrollbarLineIncrement
protected int hScrollbarLineIncrement
The unit increment of the horizontal scrollbar. The default value is 4.

 o hasFocus
protected transient boolean hasFocus
This component has the focus.

 o headingBg
protected java.awt.Color headingBg
The background color of column heading text.

See Also:
getHeadingBg, setHeadingBg
 o headingFg
protected java.awt.Color headingFg
The foreground color of column heading text.

See Also:
getHeadingFg, setHeadingFg
 o headingFont
protected java.awt.Font headingFont
The font used to draw heading text.

See Also:
getHeadingFont, setHeadingFont
 o headingHeight
protected int headingHeight
The heading height in pixels. If the heading is showing, it includes one pixel for the border (they overlap).

 o headingVisible
protected boolean headingVisible
Is the heading visible. Default is true.

 o headings
protected java.lang.String[] headings
The heading titles.

See Also:
getHeadings, setHeadings, getHeading, setHeading
 o highlightedRows
protected java.util.BitSet highlightedRows
Flags indicating which rows are currently selected.

 o horizontalScrollbar
protected java.awt.Scrollbar horizontalScrollbar
The horizontal scrollbar. Always exists. Shown as needed.

 o isDragging
protected transient boolean isDragging
Column splitter is being dragged to resize a column.

 o isSun1_1
protected static boolean isSun1_1
True if running under Java 1.1.

 o isSuppressRedraw
protected transient boolean isSuppressRedraw
Redrawing of component is currently suppressed.

See Also:
setSupressRedraw
 o itemListener
protected java.awt.event.ItemListener itemListener
The action listener to keep track of listeners for our item event.

 o lastColumnClicked
protected int lastColumnClicked
If sorting is allowed, the column previously clicked in.

See Also:
isAllowSorting, setAllowSorting
 o memoryClick
protected int memoryClick
Temp storage for columnClicked when repainting during a mouse drag.

 o minColumnWidth
protected int minColumnWidth
The minimum allowed column width, in pixels.

 o multiSelect
protected boolean multiSelect
Allow multiple selections. Default is false.

 o offscreenImage
protected transient java.awt.Image offscreenImage
The offscreen image. Used to draw the component before painting it to the screen.

 o offscreenImageGraphics
protected transient java.awt.Graphics offscreenImageGraphics
The graphics context used to draw into the offscreen image.

 o redrawWasSupressed
protected transient boolean redrawWasSupressed
Redraw would have occurred if it hadn't been suppressed.

 o sbHPosition
protected int sbHPosition
The horizontal scrollbar value.

 o sbHShow
protected transient boolean sbHShow
Horizontal scrollbar is visible.

 o sbVPosition
protected int sbVPosition
The vertical scrollbar value.

 o sbVShow
protected transient boolean sbVShow
Vertical scrollbar is visible.

 o scrollbarHeight
protected int scrollbarHeight
The height of the horizontal scrollbar. 0 if it is not displayed.

 o selectedRow
protected int selectedRow
The most recently selected row.

 o splitters
protected int[] splitters
The location of the boundries between columns, in pixels.

 o topRow
protected int topRow
The zero-relative index of the first visible row in the list.

 o verticalScrollbar
protected java.awt.Scrollbar verticalScrollbar
The vertical scrollbar. Always exists. Shown as needed.

 o verticalScrollbarWidth
protected int verticalScrollbarWidth
The width of the vertical scrollbar. 0 if it is not displayed.

 o xDragLast
protected int xDragLast
The latest horizontal position the the splitter being dragged to resize a column.

Constructors

 o MultiList
public MultiList()
Constructs a default MultiList.

 o MultiList
public MultiList(int cols)
Constructs a new MultiList with the specified number of columns.

Parameters:
cols - the number of columns
 o MultiList
public MultiList(int cols,
                 boolean multi)
Constructs a new MultiList with the spcified number of columns and whether multiple row selection allowed.

Parameters:
cols - the number of columns
multi - true for multiple row selection, false otherwise
 o MultiList
public MultiList(int cols,
                 boolean multi,
                 Color bg)
Constructs a new MultiList with the specified number of columns, whether multiple row selection is allowed, and given background color.

Parameters:
cols - the number of columns
multi - true for multiple row selection, false otherwise
bg - the background color

Methods

 o addActionListener
public synchronized void addActionListener(ActionListener l)
Adds the specified action listener to receive action events from this object.

Parameters:
l - the action listener
See Also:
removeActionListener
 o addCell
public void addCell(int r,
                    int c,
                    String s,
                    Image i)
Sets the contents of a cell, both text and image.

Parameters:
r - the zero-relative row index
c - the zero-relative column index
s - the new cell text
i - the new cell image
See Also:
addTextCell, addImageCell
 o addCell
public void addCell(int row,
                    int column,
                    Cell cell)
Sets the contents of a cell to the given cell.

Parameters:
row - the zero-relative row index
column - the zero-relative column index
cell - the new cell
See Also:
addCell, addTextCell, addImageCell
 o addCellImpl
protected void addCellImpl(int row,
                           int column,
                           Cell cell)
Adds a cell to the MultiList in the row and column specified. All addCell forms call this method.

Parameters:
row - the zero-relative row index
column - the zero-relative column index
cell - the cell that is being added to the MultiList
 o addImageCell
public void addImageCell(int r,
                         int c,
                         Image i)
Sets the image of a cell at the given row and column position.

Parameters:
r - the zero-relative row index
c - the zero-relative column index
i - the new cell image
See Also:
addTextCell, addCell
 o addItemListener
public synchronized void addItemListener(ItemListener l)
Adds the specified item listener to receive item events from this object.

Parameters:
l - the item listener
See Also:
removeItemListener, sourceItemEvent
 o addNotify
public synchronized void addNotify()
Tells this component that it has been added to a container. This is a standard Java AWT method which gets called by the AWT when this component is added to a container. Typically, it is used to create this component's peer. It has been overridden here to add local event listeners.

Overrides:
addNotify in class Panel
See Also:
removeNotify
 o addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all property change events.

Parameters:
listener - the listener to add
See Also:
removePropertyChangeListener
 o addTextCell
public void addTextCell(int r,
                        int c,
                        String s)
Sets the text of a cell at the given row and column position.

Parameters:
r - the zero-relative row index
c - the zero-relative column index
s - the new cell text
See Also:
addImageCell, addCell
 o addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener for all vetoable property change events.

Parameters:
listener - the listener to add
See Also:
removeVetoableChangeListener
 o adjustHeadings
public void adjustHeadings()
Adjusts the columns to default width. The width of the columns is adjusted so that all columns fit into the overall width of the MultiList.

 o calcHeadings
protected void calcHeadings(String[] list)
Initializes new headings with the given list of heading titles.

Parameters:
list - array of heading title strings
 o calcVerticalScrollbarPosition
protected void calcVerticalScrollbarPosition(boolean minusHorizontalScrollbar)
Determines if the vertical scrollbar needs to be shown. If column sizes are being automatically determined, forces a column size recalc as needed.

 o calculateHeadingHeight
protected void calculateHeadingHeight()
Calculates the height of the column headings and stores that in headingHeight.

 o changeSelection
public void changeSelection(int newSelection,
                            int meta)
This routine changes the selected row, handling multiple selections as needed.

Parameters:
newSelection - the zero-relative index of the newly selected row
meta - the state of the modifier keys from Event.modifiers
See Also:
setSelectedRow, CTRL_MASK, SHIFT_MASK
 o clear
public void clear()
Removes all rows from the MultiList.

See Also:
removeRow
 o createColumns
public void createColumns(int i)
Initializes the MultiList with the specified total numer of columns. All old column data is lost. Row data is preserved. Note that this method is identical to the method setNumberOfCols(), but doesn't allow the change to be vetoed.

Parameters:
i - the new number of columns
See Also:
setNumberOfCols, getNumberOfCols
 o deselectAll
public void deselectAll()
Deselects all rows in a MultiList.

See Also:
selectAll
 o deselectRow
public void deselectRow(int row)
Deselects the row, if it is not already selected.

Parameters:
row - the zero-relative row index
See Also:
selectRow
 o draw3DBox
protected void draw3DBox(Rectangle r,
                         boolean up)
Draws a rectangle with 3-dimensional effect into the offscreen image.

Parameters:
r - the rectangle bounds
up - true to draw as if raised, false to draw as if lowered
 o drawColumnHeading
protected void drawColumnHeading(Rectangle columnHeadingRect,
                                 boolean isSelected)
Draws the specified column heading into an offscreen image.

Parameters:
columnHeadingRect - the heading bounds
isSelected - true if the column heading is selected
 o drawHeading
protected void drawHeading(boolean down)
Draws all column headings into an offscreen image.

Parameters:
down - true if mouse is down in heading
 o drawRows
protected void drawRows(int cellRow,
                        int numRowsToDraw,
                        boolean toRepaint)
Draws the specifed rows into an offscreen image.

Parameters:
cellRow - the zero-relative index of the first row to draw
numRowsToDraw - the number of rows to draw
toRepaint - if true, calls the repaint method to update the screen
 o getCellBg
public java.awt.Color getCellBg()
Gets the current background color of cell text.

Returns:
the current cell background color
See Also:
setCellBg
 o getCellFg
public java.awt.Color getCellFg()
Gets the current foreground color of cell text.

Returns:
the current cell foreground color
See Also:
setCellFg
 o getCellFont
public java.awt.Font getCellFont()
Returns the font currently used for text in all the cells.

See Also:
setCellFont
 o getCellImage
public java.awt.Image getCellImage(int r,
                                   int c)
Returns the image of the specified cell, if any.

Parameters:
r - the zero-relative row index
c - the zero-relative column index
Returns:
the cell image, or null if the cell is not allocated
See Also:
getCellText, addCell, addImageCell
 o getCellText
public java.lang.String getCellText(int r,
                                    int c)
Returns the text of the specified cell.

Parameters:
r - the zero-relative row index
c - the zero-relative column index
Returns:
the cell text or the empty string ("") if the cell is not allocated
See Also:
getCellImage, addCell, addTextCell
 o getColumnAlignment
public int getColumnAlignment(int column)
Gets the justification of the text for the specified column. If the column is allocated, it returns the justification. Otherwise it returns the default justification.

Parameters:
column - the zero-relative column index
Returns:
the alignment of the column as one of the values LEFT, CENTER, or RIGHT
See Also:
setColumnAlignment(int, int)
 o getColumnAlignments
public java.lang.String[] getColumnAlignments()
Gets a string array containing the alignment of each column. The possible values for each element are "Left", "Center", or "Right".

Returns:
an array of strings containing the alignment for each column
See Also:
setColumnAlignments
 o getColumnSize
public int getColumnSize(int i)
Get the column size in pixels for the specified column.

Parameters:
i - the zero-relative column index
 o getColumnSizes
public java.lang.String[] getColumnSizes()
Returns a string array containing the width of each column in pixels. If columns are being automatically sized, it will return null.

See Also:
setColumnSizes
 o getColumnSizesFromSplitters
protected int[] getColumnSizesFromSplitters()
Returns an array of column sizes as determined from the current splitter information.

 o getColumnSorter
public symantec.itools.awt.CompareCells getColumnSorter(int column)
Gets the object used to compare cells for sorting the specified column. If no sorter has been explicitly specified, the default column sorter will be returned.

Parameters:
column - the zero-relative column index
Returns:
the object used to compare column cells
See Also:
setColumnSorter
 o getDefaultColumnAlignment
public int getDefaultColumnAlignment()
Gets the default column alignment. This value is used when a column alignment is not specified.

Returns:
the default column alignment, one of: LEFT, CENTER, or RIGHT
See Also:
setDefaultColumnAlignment, LEFT, CENTER, RIGHT
 o getDefaultColumnSorter
public symantec.itools.awt.CompareCells getDefaultColumnSorter()
Gets the default object used to compare column cells for sorting.

Returns:
the object used to compare column cells by default
See Also:
setDefaultColumnSorter, getColumnSorter
 o getHeading
public java.lang.String getHeading(int i)
Returns the heading text of the specified column.

Parameters:
i - the zero-relative index of the column
See Also:
setHeading
 o getHeadingBg
public java.awt.Color getHeadingBg()
Returns the color of the column heading text background.

Returns:
the current column heading background color
See Also:
setHeadingBg
 o getHeadingFg
public java.awt.Color getHeadingFg()
Returns the color of the column heading text foreground.

Returns:
the current column heading foreground color
See Also:
setHeadingFg
 o getHeadingFont
public java.awt.Font getHeadingFont()
Returns the font for column heading text.

See Also:
setHeadingFont
 o getHeadings
public java.lang.String[] getHeadings()
Gets a String array of all of the column headings.

Returns:
an array of all of the current headings
See Also:
setHeadings
 o getListItems
public java.lang.String[] getListItems()
Returns the text contents of all the cells as a string array. A new string is used for each row. The contents of each row's column are separated by ";". For example, the string "col0;;col2" would result from a "col0" in column 0, an empty column 1, and "col2" in column 2.

Returns:
the string array containing the text of all the cells
See Also:
setListItems
 o getMinColumnWidth
public int getMinColumnWidth()
Returns the minimum allowable column width in pixels.

See Also:
setMinColumnWidth
 o getNumVisibleRows
protected int getNumVisibleRows()
Returns the number of visible rows that can fit in the MulitList. Note: This could be more than the number of rows in the MultiList.

 o getNumberOfCols
public int getNumberOfCols()
Returns the current number of columns.

Returns:
the current number of columns.
See Also:
setNumberOfCols
 o getNumberOfRows
public int getNumberOfRows()
Gets the current number of rows.

Returns:
the current number of rows
 o getSelectedObjects
public java.lang.Object[] getSelectedObjects()
Returns an array of Objects (Integers), one for each selected row index. This is a standard method of the java.awt.ItemSelectable interface.

Returns:
the zero-relative indexes of the selected rows May return null (no rows selected)
See Also:
getSelectedRows, setSelectedRow, ItemSelectable
 o getSelectedRow
public int getSelectedRow()
Returns the zero-relative index of the currently selected row. Returns -1 if nothing is selected, or if more than one item is selected (in multi-mode)

See Also:
setSelectedRow, isMultipleMode, setMultipleMode
 o getSelectedRows
public int[] getSelectedRows()
Returns an integer index for each selected row.

Returns:
the zero-relative indexes of the selected rows
See Also:
getSelectedRow, setSelectedRow
 o intArrayToStringArray
protected java.lang.String[] intArrayToStringArray(int intArray)
Converts the given array of int into a corresponding array of String.

Parameters:
intArray - the array of ints
Returns:
an array of String
 o internalCreateColumns
protected void internalCreateColumns(int i)
Internal helper routine. Allocates room for the specified number of columns.

Parameters:
i - the new number of columns
 o isAllowResizingOfColumns
public boolean isAllowResizingOfColumns()
Gets whether columns may currently be resized by the user via the user interface.

Returns:
true if resizing of columns via the UI is allowed; if false, columns cannot be resized via the UI
See Also:
setAllowResizingOfColumns
 o isAllowSorting
public boolean isAllowSorting()
Gets the flag controlling sorting of columns when a heading is selected.

Returns:
true if columns will be sorted when column heading is clicked; if false, no sorting will occur
See Also:
setAllowSorting
 o isFocusIndicatedVisually
public boolean isFocusIndicatedVisually()
Returns true if this MultiList indicates it has focus visually.

See Also:
setFocusIndicatedVisually
 o isFocusTraversable
public boolean isFocusTraversable()
Overrides:
isFocusTraversable in class Component
 o isHeadingVisible
public boolean isHeadingVisible()
Returns true if heading of the MultiList is visible.

See Also:
setHeadingVisible
 o isMultipleMode
public boolean isMultipleMode()
Returns true if this MultiList allows multiple selections.

See Also:
setMultipleMode
 o minimumSize
public synchronized java.awt.Dimension minimumSize()
Returns the minimum dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the minimum size of this component.

Overrides:
minimumSize in class Container
See Also:
preferredSize
 o paint
public void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its [0,0] coordinate is this component's top-left corner.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class Container
See Also:
repaint, update
 o paintSelection
protected void paintSelection(int selRows)
Paints the specified rows as selected.

Parameters:
selRows - an array of the zero-relative indexes of selected rows
 o preferredSize
public synchronized java.awt.Dimension preferredSize()
Returns the recommended dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the recommended size of this component.

Overrides:
preferredSize in class Container
See Also:
minimumSize
 o rangeCheckAlignment
protected void rangeCheckAlignment(int alignment)
Ensures the given column alignment value is valid. An IllegalArgumentException is thrown if the value is invalid.

Parameters:
alignment - the column alignment value to validate, should be one of: LEFT, CENTER, or RIGHT
See Also:
LEFT, CENTER, RIGHT
 o rangeCheckColumn
protected void rangeCheckColumn(int column)
Ensures the given column index is valid. An IllegalArgumentException is thrown if it is out of range.

Parameters:
column - the zero-relative column index to validate
 o redraw
public void redraw()
Paints this component into an offscreen image for cleaner screen repaints. It is not typically called directly.

 o removeActionListener
public synchronized void removeActionListener(ActionListener l)
Removes the specified action listener so it no longer receives action events from this object.

Parameters:
l - the action listener
See Also:
addActionListener
 o removeItemListener
public synchronized void removeItemListener(ItemListener l)
Removes the specified item listener so it no longer receives item events from this object.

Parameters:
l - the action listener
See Also:
addItemListener, sourceItemEvent
 o removeNotify
public synchronized void removeNotify()
Tells this component that it is being removed from a container. This is a standard Java AWT method which gets called by the AWT when this component is removed from a container. Typically, it is used to destroy the peers of this component and all its subcomponents. It has been overridden here to remove local event listeners.

Overrides:
removeNotify in class Container
See Also:
addNotify
 o removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all property change events.

Parameters:
listener - the listener to remove
See Also:
addPropertyChangeListener
 o removeRow
public void removeRow(int row)
Removes a single row from the MultiList.

Parameters:
row - the zero-relative index of the row to remove
See Also:
clear
 o removeSelectionBorder
protected void removeSelectionBorder()
If there is a selected row, it removes the selection border from it.

 o removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a listener for all vetoable property change events.

Parameters:
listener - the listener to remove
See Also:
addVetoableChangeListener
 o repaintFocus
protected void repaintFocus()
Internal helper routine. Repaints the user input focus, as needed.

 o resizeHeadings
protected void resizeHeadings(int column)
Internal helper routine. Resizes the heading to match the number of columns.

Parameters:
column - the number of columns
 o selectAll
public void selectAll()
Selects all rows in a MultiList. Does nothing if multiMode is off.

See Also:
deselectAll, isMultipleMode, setMultipleMode
 o selectRow
public void selectRow(int row)
Selects the row, if it is not already selected.

Parameters:
row - the zero-relative row index
See Also:
deselectRow
 o setAllowResizingOfColumns
public void setAllowResizingOfColumns(boolean allowResizing) throws PropertyVetoException
Sets the flag to allow resizing of columns via the user interface.

Parameters:
allowResizing - if true the user may resize columns via the UI; if false, columns cannot be resized via the UI
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isAllowResizingOfColumns
 o setAllowSorting
public void setAllowSorting(boolean b) throws PropertyVetoException
Sets the flag to allow sorting of columns when a heading is selected.

Parameters:
b - if true allow columns to be sorted when column heading is clicked; if false, no sorting will occur
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isAllowSorting
 o setCellBg
public void setCellBg(Color c) throws PropertyVetoException
Sets the background color of cell text.

Parameters:
c - the background color of cell text
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getCellBg, setCellFg, setCellColors
 o setCellColors
public void setCellColors(Color fg,
                          Color bg) throws PropertyVetoException
Sets foreground and background colors of cell text.

Parameters:
fg - the foreground color of cell text
bg - the background color of cell text
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setCellFg, setCellBg, getCellFg, getCellBg
 o setCellFg
public void setCellFg(Color c) throws PropertyVetoException
Sets the foreground color of cell text.

Parameters:
c - the foreground color of cell text
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getCellFg, setCellBg, setCellColors
 o setCellFont
public void setCellFont(Font f) throws PropertyVetoException
Sets the font used for text in all the cells.

Parameters:
f - the font for cell text
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getCellFont
 o setColumnAlignment
public void setColumnAlignment(int column,
                               int alignment) throws PropertyVetoException
Sets the alignment of the text in the specified column.

Parameters:
column - the zero-relative column index
alignment - one of the values: LEFT, CENTER, or RIGHT
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
LEFT, CENTER, RIGHT, getColumnAlignment
 o setColumnAlignments
public void setColumnAlignments(String[] list) throws PropertyVetoException
Sets the alignment of each column. If null is passed, then the default alignment for all columns is used.

Parameters:
list - an array of strings that determines column alignment. Each item should contain one of the following: "Left", "Center", or "Right"
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getColumnAlignments
 o setColumnSizes
public void setColumnSizes(String[] list) throws PropertyVetoException
Sets the the width of each column in pixels. Setting the column sizes to null will turn auto resizing on.

Parameters:
list - a string array containing column sizes in pixels
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getColumnSizes
 o setColumnSorter
public void setColumnSorter(int column,
                            CompareCells compare)
Sets the object used to compare cells for sorting the specified column.

Parameters:
column - the zero-relative column index
compare - the object used to compare column cells
See Also:
getColumnSorter
 o setColumns
public void setColumns(int i) throws PropertyVetoException
Note: setColumns() is deprecated.

Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setNumberOfCols(int)
 o setDefaultColumnAlignment
public void setDefaultColumnAlignment(int newDefaultColumnAlignment) throws PropertyVetoException
Sets the default column alignment. This value is used when an alignment is not specified for a column.

Parameters:
newDefaultColumnAlignment - the new default column alignment, one of: LEFT, CENTER, or RIGHT
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getDefaultColumnAlignment, LEFT, CENTER, RIGHT
 o setDefaultColumnSorter
public void setDefaultColumnSorter(CompareCells newDefaultSorter)
Sets the default object used to compare column cells for sorting.

Parameters:
newDefaultSorter - the object used to compare column cells by default
See Also:
getDefaultColumnSorter, setColumnSorter
 o setFocusIndicatedVisually
public void setFocusIndicatedVisually(boolean b) throws PropertyVetoException
Sets whether this MultiList should visually indicate focus.

Parameters:
b - the boolean to visually indicate focus
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isFocusIndicatedVisually
 o setHeading
public void setHeading(String h,
                       int i) throws PropertyVetoException
Sets a column's heading text.

Parameters:
h - the new column heading text
i - the zero-relative index of the column
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setHeading(java.lang.String, int, int), getHeading
 o setHeading
public void setHeading(String h,
                       int i,
                       int pixels) throws PropertyVetoException
Sets a column's heading text and width.

Parameters:
h - the new column heading text
i - the zero-relative index of the column
pixels - the new width of the column, in pixels
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setHeading(java.lang.String, int), getHeading
 o setHeadingBg
public void setHeadingBg(Color c) throws PropertyVetoException
Sets the column heading text background color.

Parameters:
c - background color for heading text
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getHeadingBg, setHeadingFg, setHeadingColors
 o setHeadingColors
public void setHeadingColors(Color fg,
                             Color bg) throws PropertyVetoException
Sets the column heading foreground and background colors.

Parameters:
fg - foreground Color for heading text
bg - background Color for heading text
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
setHeadingFg, setHeadingBg, getHeadingFg, getHeadingBg
 o setHeadingFg
public void setHeadingFg(Color c) throws PropertyVetoException
Sets the column heading text foreground color.

Parameters:
c - foreground color for heading text
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getHeadingFg, setHeadingBg, setHeadingColors
 o setHeadingFont
public void setHeadingFont(Font newFont) throws PropertyVetoException
Sets the font for column heading text.

Parameters:
newFont - the font for heading text
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getHeadingFont
 o setHeadingVisible
public void setHeadingVisible(boolean b) throws PropertyVetoException
Sets whether this MultiList should draw the column headings or not.

Parameters:
b - the boolean to draw column headings
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isHeadingVisible
 o setHeadings
public void setHeadings(String[] list) throws PropertyVetoException
Initializes all the column headings with the given list. For each string in the given list, create a column, use the string as its heading, and give it a default width.

Parameters:
list - array of heading title strings
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getHeadings
 o setLayout
public void setLayout(LayoutManager mgr)
Takes no action. This is a standard Java AWT method which gets called to specify which layout manager should be used to layout the components in standard containers. Since layout managers CANNOT BE USED with this container the standard setLayout has been OVERRIDDEN for this container and does nothing.

Parameters:
l - the layout manager to use to layout this container's components (IGNORED)
Overrides:
setLayout in class Container
See Also:
getLayout
 o setListItems
public void setListItems(String[] items) throws PropertyVetoException
Initializes all the MultiList cells with text. Each string in the provided array initializes one row. The contents of each column are separated by ";". For example, the string "col0;col1;col2" would result in "col0" being placed in column 0, "col1" in column 1, and "col2" in column 2. Any remaining columns will get cleared.

Parameters:
items - the string array used to initialize all cell contents
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getListItems
 o setMinColumnWidth
public void setMinColumnWidth(int size) throws PropertyVetoException
Sets the minimum allowable column width.

Parameters:
size - the minimum column width in pixels
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getMinColumnWidth
 o setMultipleMode
public void setMultipleMode(boolean b) throws PropertyVetoException
Sets whether this MultiList should allow multiple selections or not.

Parameters:
b - the boolean to allow multiple selections
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
isMultipleMode
 o setNumberOfCols
public void setNumberOfCols(int i) throws PropertyVetoException
Sets the number of columns.

Parameters:
i - the new number of columns
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getNumberOfCols
 o setSelectedRow
public void setSelectedRow(int row) throws IllegalArgumentException
Sets the specified row as the selected row.

Parameters:
row - the zero-relative index of the row to selectRow
Throws: IllegalArgumentException
if the row parameter is out of range
See Also:
getSelectedRow
 o setSupressRedraw
public boolean setSupressRedraw(boolean supressRedraw)
Sets the internal flag to supress redraw. Call this to supress redraw, saving the returned boolean. After you've done what you wanted to do restore the flag.

Parameters:
supressRedraw - the new value for the supressing of redraw flags
 o sourceActionEvent
protected void sourceActionEvent(int selectedRow)
Fires an action event to the listeners. The action command sent is the value specified in actionCommand concatenated with the selectedRow. By default the actionCommand is "RowSelected:", so a typical action command sent might be "RowSelected:0".

Parameters:
selectedRow - the zero-relative index of the row generating the event
See Also:
actionCommand
 o sourceItemEvent
protected void sourceItemEvent(int eventType)
Fires an item event to the listeners.

Parameters:
eventType - value indicating the kind of state change, one of: ItemEvent.SELECTED or ItemEvent.DESELECTED
See Also:
SELECTED, DESELECTED, addItemListener, removeItemListener
 o tokenizeStringArrayIfNeeded
protected java.lang.String[] tokenizeStringArrayIfNeeded(String[] list)
Handles cases where the user might pass either an array of items, or a single string with itemds separated by the ';' character. This may occur in the setHeadings, setColumnAlignments, or setColumnSizes methods.

Parameters:
list - the input list
an - array of items, one per String
See Also:
setHeadings, setColumnAlignments, setColumnSizes
 o triggerRedraw
protected void triggerRedraw()
Triggers an entire redraw of this component, unless redrawing is currently suppressed.

See Also:
setSupressRedraw
 o update
public void update(Graphics g)
Handles redrawing of this component on the screen. This is a standard Java AWT method which gets called by the Java AWT (repaint()) to handle repainting this component on the screen. The graphics context clipping region is set to the bounding rectangle of this component and its [0,0] coordinate is this component's top-left corner. Typically this method paints the background color to clear the component's drawing space, sets graphics context to be the foreground color, and then calls paint() to draw the component. It is overridden here to eliminate the unneeded repainting of the background.

Parameters:
g - the graphics context
Overrides:
update in class Container
See Also:
repaint, paint

All Packages  Class Hierarchy  This Package  Previous  Next  Index