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
-
BORDER
- Border amount.
-
CENTER
- Center-justify column alignment constant.
-
CLICKTHRESHOLD
- Maximum time inverval to register a double click (in milliseconds).
-
LEFT
- Left-justify column alignment constant.
-
RESIZE_FUDGE_FACTOR
- Fudge factor for resizing of columns.
-
RIGHT
- Right-justify column alignment constant.
-
actionCommand
- The first part of the action command.
-
actionListener
- The action listener to keep track of listeners for our action event.
-
allowResizingOfColumns
- Allow columns to be resized.
-
allowSorting
- Allow sorting.
-
cachedHeight
- The latest vertical size of this component.
-
cachedLastSplitter
- The latest overall row width.
-
cachedWidth
- The latest horizontal size of this component.
-
cellAscent
- The ascent metric of the cell font.
-
cellDescent
- The descent metric of the cell font.
-
cellFont
- The font used to display cell text.
-
cellHeight
- The height of cells, in pixels.
-
cells
- The cells.
-
clickTime
- The time of the previous click.
-
clickedInHeadings
- Mouse button has been pressed in a column heading.
-
colorBg
- The background color of cell text.
-
colorFg
- The foreground color of cell text.
-
colorHBg
- The background color of hilighted cell text.
-
colorHFg
- The foreground color of hilighted cell text.
-
columnAlignments
- The column alignments.
-
columnClicked
- If sorting is allowed, the column clicked in.
-
columnCompareCellsRoutines
- The cell compare routines to use for each column.
-
columnSizes
- If non-null, the the width of each column in pixels.
-
defaultColumnAlignment
- The column alignment to use by default.
-
defaultColumnSorter
- The default cell comparer.
-
dragColumn
- The zero-relative index of the column being resized via the UI.
-
errors
- Error strings.
-
focusIndicatedVisually
- Indicate focus when drawing.
-
focusListener
- The action listener to keep track of listeners for our focus event.
-
forceColumnSizeRecalc
- Column sizes need to be recalculated.
-
forceFullRedraw
- Offscreen image needs to be flushed.
-
forceRedraw
- True if next paint will redraw the entire component even if
its size has not changed.
-
hScrollbarLineIncrement
- The unit increment of the horizontal scrollbar.
-
hasFocus
- This component has the focus.
-
headingBg
- The background color of column heading text.
-
headingFg
- The foreground color of column heading text.
-
headingFont
- The font used to draw heading text.
-
headingHeight
- The heading height in pixels.
-
headingVisible
- Is the heading visible.
-
headings
- The heading titles.
-
highlightedRows
- Flags indicating which rows are currently selected.
-
horizontalScrollbar
- The horizontal scrollbar.
-
isDragging
- Column splitter is being dragged to resize a column.
-
isSun1_1
- True if running under Java 1.1.
-
isSuppressRedraw
- Redrawing of component is currently suppressed.
-
itemListener
- The action listener to keep track of listeners for our item event.
-
lastColumnClicked
- If sorting is allowed, the column previously clicked in.
-
memoryClick
- Temp storage for columnClicked when repainting during a mouse drag.
-
minColumnWidth
- The minimum allowed column width, in pixels.
-
multiSelect
- Allow multiple selections.
-
offscreenImage
- The offscreen image.
-
offscreenImageGraphics
- The graphics context used to draw into the offscreen image.
-
redrawWasSupressed
- Redraw would have occurred if it hadn't been suppressed.
-
sbHPosition
- The horizontal scrollbar value.
-
sbHShow
- Horizontal scrollbar is visible.
-
sbVPosition
- The vertical scrollbar value.
-
sbVShow
- Vertical scrollbar is visible.
-
scrollbarHeight
- The height of the horizontal scrollbar.
-
selectedRow
- The most recently selected row.
-
splitters
- The location of the boundries between columns, in pixels.
-
topRow
- The zero-relative index of the first visible row in the list.
-
verticalScrollbar
- The vertical scrollbar.
-
verticalScrollbarWidth
- The width of the vertical scrollbar.
-
xDragLast
- The latest horizontal position the the splitter being dragged to resize a column.
-
symantec.itools.awt.MultiList()
- Constructs a default MultiList.
-
symantec.itools.awt.MultiList(int)
- Constructs a new MultiList with the specified number of columns.
-
symantec.itools.awt.MultiList(int, boolean)
- Constructs a new MultiList with the spcified number of columns
and whether multiple row selection allowed.
-
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.
-
addActionListener(ActionListener)
- Adds the specified action listener to receive action events
from this object.
-
addCell(int, int, String, Image)
- Sets the contents of a cell, both text and image.
-
addCell(int, int, Cell)
- Sets the contents of a cell to the given cell.
-
addCellImpl(int, int, Cell)
- Adds a cell to the MultiList in the row and column specified.
-
addImageCell(int, int, Image)
- Sets the image of a cell at the given row and column position.
-
addItemListener(ItemListener)
- Adds the specified item listener to receive item events from this object.
-
addNotify()
- Tells this component that it has been added to a container.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener for all property change events.
-
addTextCell(int, int, String)
- Sets the text of a cell at the given row and column position.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a listener for all vetoable property change events.
-
adjustHeadings()
- Adjusts the columns to default width.
-
calcHeadings(String[])
- Initializes new headings with the given list of heading titles.
-
calcVerticalScrollbarPosition(boolean)
- Determines if the vertical scrollbar needs to be shown.
-
calculateHeadingHeight()
- Calculates the height of the column headings and stores that in
headingHeight.
-
changeSelection(int, int)
- This routine changes the selected row, handling multiple selections
as needed.
-
clear()
- Removes all rows from the MultiList.
-
createColumns(int)
- Initializes the MultiList with the specified total numer of columns.
-
deselectAll()
- Deselects all rows in a MultiList.
-
deselectRow(int)
- Deselects the row, if it is not already selected.
-
draw3DBox(Rectangle, boolean)
- Draws a rectangle with 3-dimensional effect into the offscreen image.
-
drawColumnHeading(Rectangle, boolean)
- Draws the specified column heading into an offscreen image.
-
drawHeading(boolean)
- Draws all column headings into an offscreen image.
-
drawRows(int, int, boolean)
- Draws the specifed rows into an offscreen image.
-
getCellBg()
- Gets the current background color of cell text.
-
getCellFg()
- Gets the current foreground color of cell text.
-
getCellFont()
- Returns the font currently used for text in all the cells.
-
getCellImage(int, int)
- Returns the image of the specified cell, if any.
-
getCellText(int, int)
- Returns the text of the specified cell.
-
getColumnAlignment(int)
- Gets the justification of the text for the specified column.
-
getColumnAlignments()
- Gets a string array containing the alignment of each column.
-
getColumnSize(int)
- Get the column size in pixels for the specified column.
-
getColumnSizes()
- Returns a string array containing the width of each column in pixels.
-
getColumnSizesFromSplitters()
- Returns an array of column sizes as determined from the current splitter information.
-
getColumnSorter(int)
- Gets the object used to compare cells for sorting the specified column.
-
getDefaultColumnAlignment()
- Gets the default column alignment.
-
getDefaultColumnSorter()
- Gets the default object used to compare column cells for sorting.
-
getHeading(int)
- Returns the heading text of the specified column.
-
getHeadingBg()
- Returns the color of the column heading text background.
-
getHeadingFg()
- Returns the color of the column heading text foreground.
-
getHeadingFont()
- Returns the font for column heading text.
-
getHeadings()
- Gets a String array of all of the column headings.
-
getListItems()
- Returns the text contents of all the cells as a string array.
-
getMinColumnWidth()
- Returns the minimum allowable column width in pixels.
-
getNumVisibleRows()
- Returns the number of visible rows that can fit in the MulitList.
-
getNumberOfCols()
- Returns the current number of columns.
-
getNumberOfRows()
- Gets the current number of rows.
-
getSelectedObjects()
- Returns an array of Objects (Integers), one for each selected row index.
-
getSelectedRow()
- Returns the zero-relative index of the currently selected row.
-
getSelectedRows()
- Returns an integer index for each selected row.
-
intArrayToStringArray(int[])
- Converts the given array of int into a corresponding array of String.
-
internalCreateColumns(int)
- Internal helper routine.
-
isAllowResizingOfColumns()
- Gets whether columns may currently be resized by the user via the user interface.
-
isAllowSorting()
- Gets the flag controlling sorting of columns when a heading is selected.
-
isFocusIndicatedVisually()
- Returns true if this MultiList indicates it has focus visually.
-
isFocusTraversable()
-
-
isHeadingVisible()
- Returns true if heading of the MultiList is visible.
-
isMultipleMode()
- Returns true if this MultiList allows multiple selections.
-
minimumSize()
- Returns the minimum dimensions to properly display this component.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
paintSelection(int[])
- Paints the specified rows as selected.
-
preferredSize()
- Returns the recommended dimensions to properly display this component.
-
rangeCheckAlignment(int)
- Ensures the given column alignment value is valid.
-
rangeCheckColumn(int)
- Ensures the given column index is valid.
-
redraw()
- Paints this component into an offscreen image for cleaner screen repaints.
-
removeActionListener(ActionListener)
- Removes the specified action listener so it no longer receives
action events from this object.
-
removeItemListener(ItemListener)
- Removes the specified item listener so it no longer receives
item events from this object.
-
removeNotify()
- Tells this component that it is being removed from a container.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener for all property change events.
-
removeRow(int)
- Removes a single row from the MultiList.
-
removeSelectionBorder()
- If there is a selected row, it removes the selection border from it.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a listener for all vetoable property change events.
-
repaintFocus()
- Internal helper routine.
-
resizeHeadings(int)
- Internal helper routine.
-
selectAll()
- Selects all rows in a MultiList.
-
selectRow(int)
- Selects the row, if it is not already selected.
-
setAllowResizingOfColumns(boolean)
- Sets the flag to allow resizing of columns via the user interface.
-
setAllowSorting(boolean)
- Sets the flag to allow sorting of columns when a heading is selected.
-
setCellBg(Color)
- Sets the background color of cell text.
-
setCellColors(Color, Color)
- Sets foreground and background colors of cell text.
-
setCellFg(Color)
- Sets the foreground color of cell text.
-
setCellFont(Font)
- Sets the font used for text in all the cells.
-
setColumnAlignment(int, int)
- Sets the alignment of the text in the specified column.
-
setColumnAlignments(String[])
- Sets the alignment of each column.
-
setColumnSizes(String[])
- Sets the the width of each column in pixels.
-
setColumnSorter(int, CompareCells)
- Sets the object used to compare cells for sorting the specified column.
-
setColumns(int)
-
-
setDefaultColumnAlignment(int)
- Sets the default column alignment.
-
setDefaultColumnSorter(CompareCells)
- Sets the default object used to compare column cells for sorting.
-
setFocusIndicatedVisually(boolean)
- Sets whether this MultiList should visually indicate focus.
-
setHeading(String, int)
- Sets a column's heading text.
-
setHeading(String, int, int)
- Sets a column's heading text and width.
-
setHeadingBg(Color)
- Sets the column heading text background color.
-
setHeadingColors(Color, Color)
- Sets the column heading foreground and background colors.
-
setHeadingFg(Color)
- Sets the column heading text foreground color.
-
setHeadingFont(Font)
- Sets the font for column heading text.
-
setHeadingVisible(boolean)
- Sets whether this MultiList should draw the column headings or not.
-
setHeadings(String[])
- Initializes all the column headings with the given list.
-
setLayout(LayoutManager)
- Takes no action.
-
setListItems(String[])
- Initializes all the MultiList cells with text.
-
setMinColumnWidth(int)
- Sets the minimum allowable column width.
-
setMultipleMode(boolean)
- Sets whether this MultiList should allow multiple selections or not.
-
setNumberOfCols(int)
- Sets the number of columns.
-
setSelectedRow(int)
- Sets the specified row as the selected row.
-
setSupressRedraw(boolean)
- Sets the internal flag to supress redraw.
-
sourceActionEvent(int)
- Fires an action event to the listeners.
-
sourceItemEvent(int)
- Fires an item event to the listeners.
-
tokenizeStringArrayIfNeeded(String[])
- Handles cases where the user might pass either an array of items,
or a single string with itemds separated by the ';' character.
-
triggerRedraw()
- Triggers an entire redraw of this component, unless redrawing is
currently suppressed.
-
update(Graphics)
- Handles redrawing of this component on the screen.
BORDER
protected static final int BORDER
- Border amount. Only calc'd on the right and the bottom side.
CENTER
public static final int CENTER
- Center-justify column alignment constant.
CLICKTHRESHOLD
public static final long CLICKTHRESHOLD
- Maximum time inverval to register a double click (in milliseconds).
LEFT
public static final int LEFT
- Left-justify column alignment constant.
RESIZE_FUDGE_FACTOR
protected static final int RESIZE_FUDGE_FACTOR
- Fudge factor for resizing of columns.
RIGHT
public static final int RIGHT
- Right-justify column alignment constant.
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
actionListener
protected java.awt.event.ActionListener actionListener
- The action listener to keep track of listeners for our action event.
allowResizingOfColumns
protected boolean allowResizingOfColumns
- Allow columns to be resized. Default is true.
allowSorting
protected boolean allowSorting
- Allow sorting. Default is true.
cachedHeight
protected int cachedHeight
- The latest vertical size of this component.
cachedLastSplitter
protected int cachedLastSplitter
- The latest overall row width.
cachedWidth
protected int cachedWidth
- The latest horizontal size of this component.
cellAscent
protected int cellAscent
- The ascent metric of the cell font.
cellDescent
protected int cellDescent
- The descent metric of the cell font.
cellFont
protected java.awt.Font cellFont
- The font used to display cell text.
- See Also:
- getCellFont, setCellFont
cellHeight
protected int cellHeight
- The height of cells, in pixels.
cells
protected symantec.itools.awt.Matrix cells
- The cells.
clickTime
protected transient long clickTime
- The time of the previous click.
Used to detect when a row is double-clicked.
clickedInHeadings
protected transient boolean clickedInHeadings
- Mouse button has been pressed in a column heading.
colorBg
protected java.awt.Color colorBg
- The background color of cell text.
- See Also:
- getCellBg, setCellBg
colorFg
protected java.awt.Color colorFg
- The foreground color of cell text.
- See Also:
- getCellFg, setCellFg
colorHBg
protected java.awt.Color colorHBg
- The background color of hilighted cell text.
Automatically determined.
colorHFg
protected java.awt.Color colorHFg
- The foreground color of hilighted cell text.
Automatically determined.
columnAlignments
protected int[] columnAlignments
- The column alignments.
Values are one of: LEFT, CENTER, or RIGHT.
- See Also:
- LEFT, CENTER, RIGHT, setColumnAlignments
columnClicked
protected int columnClicked
- If sorting is allowed, the column clicked in.
- See Also:
- isAllowSorting, setAllowSorting
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
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
defaultColumnAlignment
protected int defaultColumnAlignment
- The column alignment to use by default.
The initial value is LEFT.
- See Also:
- LEFT, CENTER, RIGHT, getDefaultColumnAlignment, setDefaultColumnAlignment
defaultColumnSorter
protected symantec.itools.awt.CompareCells defaultColumnSorter
- The default cell comparer.
- See Also:
- getDefaultColumnSorter, setDefaultColumnSorter
dragColumn
protected int dragColumn
- The zero-relative index of the column being resized via the UI.
errors
protected transient java.util.ResourceBundle errors
- Error strings.
focusIndicatedVisually
protected boolean focusIndicatedVisually
- Indicate focus when drawing. Default is true.
focusListener
protected java.awt.event.FocusListener focusListener
- The action listener to keep track of listeners for our focus event.
forceColumnSizeRecalc
protected transient boolean forceColumnSizeRecalc
- Column sizes need to be recalculated.
forceFullRedraw
protected transient boolean forceFullRedraw
- Offscreen image needs to be flushed.
forceRedraw
protected transient boolean forceRedraw
- True if next paint will redraw the entire component even if
its size has not changed.
hScrollbarLineIncrement
protected int hScrollbarLineIncrement
- The unit increment of the horizontal scrollbar.
The default value is 4.
hasFocus
protected transient boolean hasFocus
- This component has the focus.
headingBg
protected java.awt.Color headingBg
- The background color of column heading text.
- See Also:
- getHeadingBg, setHeadingBg
headingFg
protected java.awt.Color headingFg
- The foreground color of column heading text.
- See Also:
- getHeadingFg, setHeadingFg
headingFont
protected java.awt.Font headingFont
- The font used to draw heading text.
- See Also:
- getHeadingFont, setHeadingFont
headingHeight
protected int headingHeight
- The heading height in pixels.
If the heading is showing, it includes one pixel for the border (they overlap).
headingVisible
protected boolean headingVisible
- Is the heading visible. Default is true.
headings
protected java.lang.String[] headings
- The heading titles.
- See Also:
- getHeadings, setHeadings, getHeading, setHeading
highlightedRows
protected java.util.BitSet highlightedRows
- Flags indicating which rows are currently selected.
horizontalScrollbar
protected java.awt.Scrollbar horizontalScrollbar
- The horizontal scrollbar.
Always exists. Shown as needed.
isDragging
protected transient boolean isDragging
- Column splitter is being dragged to resize a column.
isSun1_1
protected static boolean isSun1_1
- True if running under Java 1.1.
isSuppressRedraw
protected transient boolean isSuppressRedraw
- Redrawing of component is currently suppressed.
- See Also:
- setSupressRedraw
itemListener
protected java.awt.event.ItemListener itemListener
- The action listener to keep track of listeners for our item event.
lastColumnClicked
protected int lastColumnClicked
- If sorting is allowed, the column previously clicked in.
- See Also:
- isAllowSorting, setAllowSorting
memoryClick
protected int memoryClick
- Temp storage for columnClicked when repainting during a mouse drag.
minColumnWidth
protected int minColumnWidth
- The minimum allowed column width, in pixels.
multiSelect
protected boolean multiSelect
- Allow multiple selections. Default is false.
offscreenImage
protected transient java.awt.Image offscreenImage
- The offscreen image. Used to draw the component before painting it to the screen.
offscreenImageGraphics
protected transient java.awt.Graphics offscreenImageGraphics
- The graphics context used to draw into the offscreen image.
redrawWasSupressed
protected transient boolean redrawWasSupressed
- Redraw would have occurred if it hadn't been suppressed.
sbHPosition
protected int sbHPosition
- The horizontal scrollbar value.
sbHShow
protected transient boolean sbHShow
- Horizontal scrollbar is visible.
sbVPosition
protected int sbVPosition
- The vertical scrollbar value.
sbVShow
protected transient boolean sbVShow
- Vertical scrollbar is visible.
scrollbarHeight
protected int scrollbarHeight
- The height of the horizontal scrollbar. 0 if it is not displayed.
selectedRow
protected int selectedRow
- The most recently selected row.
splitters
protected int[] splitters
- The location of the boundries between columns, in pixels.
topRow
protected int topRow
- The zero-relative index of the first visible row in the list.
verticalScrollbar
protected java.awt.Scrollbar verticalScrollbar
- The vertical scrollbar.
Always exists. Shown as needed.
verticalScrollbarWidth
protected int verticalScrollbarWidth
- The width of the vertical scrollbar. 0 if it is not displayed.
xDragLast
protected int xDragLast
- The latest horizontal position the the splitter being dragged to resize a column.
MultiList
public MultiList()
- Constructs a default MultiList.
MultiList
public MultiList(int cols)
- Constructs a new MultiList with the specified number of columns.
- Parameters:
- cols - the number of columns
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
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
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
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
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
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
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
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
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
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener for all property change events.
- Parameters:
- listener - the listener to add
- See Also:
- removePropertyChangeListener
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
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
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.
calcHeadings
protected void calcHeadings(String[] list)
- Initializes new headings with the given list of heading titles.
- Parameters:
- list - array of heading title strings
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.
calculateHeadingHeight
protected void calculateHeadingHeight()
- Calculates the height of the column headings and stores that in
headingHeight.
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
clear
public void clear()
- Removes all rows from the MultiList.
- See Also:
- removeRow
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
deselectAll
public void deselectAll()
- Deselects all rows in a MultiList.
- See Also:
- selectAll
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
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
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
drawHeading
protected void drawHeading(boolean down)
- Draws all column headings into an offscreen image.
- Parameters:
- down - true if mouse is down in heading
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
getCellBg
public java.awt.Color getCellBg()
- Gets the current background color of cell text.
- Returns:
- the current cell background color
- See Also:
- setCellBg
getCellFg
public java.awt.Color getCellFg()
- Gets the current foreground color of cell text.
- Returns:
- the current cell foreground color
- See Also:
- setCellFg
getCellFont
public java.awt.Font getCellFont()
- Returns the font currently used for text in all the cells.
- See Also:
- setCellFont
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
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
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)
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
getColumnSize
public int getColumnSize(int i)
- Get the column size in pixels for the specified column.
- Parameters:
- i - the zero-relative column index
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
getColumnSizesFromSplitters
protected int[] getColumnSizesFromSplitters()
- Returns an array of column sizes as determined from the current splitter information.
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
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
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
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
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
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
getHeadingFont
public java.awt.Font getHeadingFont()
- Returns the font for column heading text.
- See Also:
- setHeadingFont
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
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
getMinColumnWidth
public int getMinColumnWidth()
- Returns the minimum allowable column width in pixels.
- See Also:
- setMinColumnWidth
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.
getNumberOfCols
public int getNumberOfCols()
- Returns the current number of columns.
- Returns:
- the current number of columns.
- See Also:
- setNumberOfCols
getNumberOfRows
public int getNumberOfRows()
- Gets the current number of rows.
- Returns:
- the current number of rows
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
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
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
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
internalCreateColumns
protected void internalCreateColumns(int i)
- Internal helper routine.
Allocates room for the specified number of columns.
- Parameters:
- i - the new number of columns
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
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
isFocusIndicatedVisually
public boolean isFocusIndicatedVisually()
- Returns true if this MultiList indicates it has focus visually.
- See Also:
- setFocusIndicatedVisually
isFocusTraversable
public boolean isFocusTraversable()
- Overrides:
- isFocusTraversable in class Component
isHeadingVisible
public boolean isHeadingVisible()
- Returns true if heading of the MultiList is visible.
- See Also:
- setHeadingVisible
isMultipleMode
public boolean isMultipleMode()
- Returns true if this MultiList allows multiple selections.
- See Also:
- setMultipleMode
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
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
paintSelection
protected void paintSelection(int selRows)
- Paints the specified rows as selected.
- Parameters:
- selRows - an array of the zero-relative indexes of selected rows
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
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
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
redraw
public void redraw()
- Paints this component into an offscreen image for cleaner screen repaints.
It is not typically called directly.
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
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
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
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener for all property change events.
- Parameters:
- listener - the listener to remove
- See Also:
- addPropertyChangeListener
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
removeSelectionBorder
protected void removeSelectionBorder()
- If there is a selected row, it removes the selection border from it.
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
repaintFocus
protected void repaintFocus()
- Internal helper routine.
Repaints the user input focus, as needed.
resizeHeadings
protected void resizeHeadings(int column)
- Internal helper routine.
Resizes the heading to match the number of columns.
- Parameters:
- column - the number of columns
selectAll
public void selectAll()
- Selects all rows in a MultiList. Does nothing if multiMode is off.
- See Also:
- deselectAll, isMultipleMode, setMultipleMode
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
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
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
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
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
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
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
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
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
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
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
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)
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
triggerRedraw
protected void triggerRedraw()
- Triggers an entire redraw of this component, unless redrawing is
currently suppressed.
- See Also:
- setSupressRedraw
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