All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.ImageListBox

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----symantec.itools.awt.ImageListBox

public class ImageListBox
extends Panel
A box containing a list of images and/or text.

Use an ImageListBox to display a set of images and/or text that the user can select. The user cannot enter text in an ImageListBox.


Variable Index

 o BORDER_NONE
Defines the "no border" style.
 o BORDER_REGULAR
Defines the "regular" (lowered) border style.
 o borderWidth
Width of the left and right borders combined, in pixels.
 o cellHt
Height of a single list cell, in pixels.
 o EVT_IMAGE_SELECT
The ID of the event posted when the image portion of a list item is selected.
 o halfBorderWidth
Width of the left or right border, in pixels.
 o IMAGE_WIDTH
Defines the width of all images displayed in the list, in pixels.
 o lWidth
Width of the list content portion of this component, in pixels.
 o nTopRow
Zero-relative index of the item displayed in the top row.
 o yAdj
Top margin before the contents of the first list item, in pixels.

Constructor Index

 o ImageListBox()
Constructs a default ImageListBox.
 o ImageListBox(Component, String)
Construct an ImageListBox with a specific parent component and the specified label.
 o ImageListBox(Component, String, int, boolean)
Constructs an ImageListBox.
 o ImageListBox(String)
Constructs an ImageListBox with the specified label.
 o ImageListBox(String, boolean)
Constructs an ImageListBox with the specified label and conditionally allow multiple selections.
 o ImageListBox(String, int, boolean)
Constructs an ImageListBox with the specified label, the specified number of visible rows, and conditionally allow multiple list item selection.

Method Index

 o addItem(Image, String)
Adds an item with an image to the end of the list and enables it.
 o addItem(Image, String, boolean)
Adds an item with an image to the end of the list and conditionally enables it.
 o addItem(Image, String, boolean, Color)
Adds an item with an image to the end of the list and conditionally enables it.
 o addItem(String)
Adds an item to the end of the list and enables the item.
 o addItem(String, boolean)
Adds an item to the end of the list and conditionally enables it.
 o addNotify()
Tells this component that it has been added to a container.
 o allowsMultipleSelections()
Returns true if this list allows multiple selections.
 o allSelected()
Query if all of the rows are selected.
 o blockPaint(boolean)
Blocks the repainting of the control.
 o changeImage(int, Image)
Changes the image associated with the item at the specified zero-relative index.
 o changeText(int, String)
Changes the text associated with the item at the specified zero-relative index.
 o clear()
Deletes all items and images from the list.
 o countItems()
Returns the total number of items in the list.
 o ctrlSelect(int)
Selects an index in a ImageListBox using the Ctrl modifier to mimic mouse selecting with the Ctrl modifier.
 o delItem(int)
Deletes the specified item from the list.
 o delItems(int, int)
Deletes multiple items from the list.
 o delSelectedItems()
Deletes the currently selected items from the list.
 o deselect(int)
Deselects the item at the specified index.
 o deselectAll()
Deselects all items in the list.
 o disable(int)
Disables the specified item in the list.
 o enable(int)
Enables the specified item in the list.
 o enable(int, boolean)
Conditionally enables the specified item in the list.
 o extraPaint(Graphics, Rectangle)
Override this method to add any special painting effects after text and images are painted
 o getBorderType()
Gets the current border type of the ImageListBox.
 o getCellBorders()
Gets the current default cell border display mode.
 o getComboMode()
Gets the current "ComboBox mode" setting.
 o getDefaultEnabledTextColor()
Returns the current color for enabled text items.
 o getDisabledTextColor()
Returns the current default color for disabled text items.
 o getEdited(int)
Gets the "edited" flag state for the item at the given zero-relative index.
 o getImage(int)
Gets the image associated with the item at the specified zero-relative index.
 o getItem(int)
Gets the item associated with the specified zero-relative index.
 o getLabel()
Returns the current list box label.
 o getListBoxFont()
Returns the font used for the list box items.
 o getListItems()
Returns the current list as a array.
 o getRows()
Returns the number of currently visible lines in this list.
 o getRowsToShow()
Gets the current number of rows to display.
 o getSelectedIndex()
Gets the zero-relative index of the selected item in the list.
 o getSelectedIndexes()
Returns the indexes of all the selected items in the list.
 o getSelectedItem()
Returns the currently selected item in the list.
 o getSelectedItems()
Returns all of the the selected items in the list.
 o getShowHorizontalScroll()
Gets the current horizontal scrollbar visibility flag.
 o getShowVerticalScroll()
Gets the current vertical scrollbar visibility flag.
 o getVisibleIndex()
Gets the index of the item that was last made visible by the method makeVisible.
 o handleEvent(Event)
Processes events for this component.
 o insertItem(int, Image, String, boolean)
Inserts an item with an image at a specific zero-relative index and conditionally enables it.
 o insertItems(int, Vector, Image, boolean)
Inserts a vector list of items at a specific zero-relative index and conditionally enables them.
 o isEnabled(int)
Gets the enabled state of a specific item in the list.
 o isSelected(int)
Gets the selected state of the item at the given index.
 o isVisibleIndex(int)
Determines if the item at the given index is visible.
 o makeVisible(int)
Scrolls the list as needed to ensure that the specified item is visible.
 o minimumSize()
Returns the minimum dimensions to properly display this component.
 o minimumSize(int)
Returns the minimum dimensions needed to show the given number of rows in the list.
 o mouseCalcIndex(int)
A utility routine that determines the index of the item the mouse is in, given the vertical coordinate of the mouse.
 o paint(Graphics)
Paints this component using the given graphics context.
 o paramString()
Returns a string representing the state of this object.
 o preferredSize()
Returns the recommended dimensions to properly display this component.
 o preferredSize(int)
Returns the preferred dimensions needed for the list with the specified number of rows.
 o reshape(int, int, int, int)
Moves and/or resizes this component.
 o scrollHorizontal(int, boolean)
Scrolls the ImageListBox horizontally
 o scrollVertical(int, boolean)
Scrolls the ImageListBox vertically.
 o select(int)
Selects the item at the specified index.
 o select(String)
Selects the first item in the list which has exactly matching text.
 o selectAll()
Selects all the items in the list.
 o selectMultiple(int, boolean, boolean)
Selects an item at the specified index in a multiple-selection-enabled ImageListBox using Shift, Ctrl or Ctrl-Shift modifiers to mimic mouse selecting with the Shift, Ctrl or Ctrl-Shift modifiers.
 o setBorderType(int)
Sets the border type of the ImageListBox.
 o setCellBorder(int, boolean)
Conditionally show a border around the cell at the specified index.
 o setCellBorders(boolean)
Sets the ImageListBox cell border display default, and resets all items to have the border conditionally.
 o setColumns(int)
Sets the number of columns to be used by minimumSize().
 o setComboMode(boolean)
Sets ImageListBox "ComboBox mode".
 o setDefaultEnabledTextColor(Color)
Sets the default color for enabled text items.
 o setDirectNotify(boolean)
The ImageListBox posts LIST_SELECT and ACTION_EVENT events directly to a specific parent if one is specified.
 o setDirty()
Set the list to be "dirty" to force a complete paint on next repaint.
 o setDisabledTextColor(Color)
Sets the default color for disabled text items.
 o setEdited(int, boolean)
Sets a flag indicating that the item at the given zero-relative index has been edited.
 o setEnabledTextColor(int, Color)
Sets the text color for an item at the given index.
 o setFont(Font)
Sets this component's text font.
 o setListBoxFont(Font)
Sets the font for the items in the list box.
 o setListItems(String[])
Initializes the list with the string array.
 o setMultiColumnMode(boolean)
Sets the mode of the ImageListBox to "MultiColumnListBox mode".
 o setMultipleSelections(boolean)
Sets whether this list should allow multiple selections or not.
 o setRowsToShow(int)
Sets the number of rows to display in the ImageListBox.
 o setShowHorizontalScroll(boolean)
Sets the horizontal scrollbar visibility flag.
 o setShowVerticalScroll(boolean)
Sets the vertical scrollbar visibility flag.
 o setTopRow(int)
Forces the item at the specified index to be visible at the top of the window.
 o shiftSelect(int, boolean)
Selects an index in a multiple-selection-enabled ImageListBox using Shift or Ctrl-Shift modifiers to mimic mouse selecting with the Shift or Ctrl-Shift modifiers.
 o show()
Makes this component visible.
 o update(Graphics)
Handles redrawing of this component on the screen.
 o validIndex(int)
Determines if the given index is valid.

Variables

 o EVT_IMAGE_SELECT
  public final static int EVT_IMAGE_SELECT
The ID of the event posted when the image portion of a list item is selected.

 o BORDER_REGULAR
  public final static int BORDER_REGULAR
Defines the "regular" (lowered) border style. This makes the list box appear lower than the surrounding area.

See Also:
setBorderType, getBorderType
 o BORDER_NONE
  public final static int BORDER_NONE
Defines the "no border" style. This indicates the list box will have no border drawn around it.

See Also:
setBorderType, getBorderType
 o IMAGE_WIDTH
  public final static int IMAGE_WIDTH
Defines the width of all images displayed in the list, in pixels.

 o nTopRow
  protected int nTopRow
Zero-relative index of the item displayed in the top row.

 o lWidth
  protected int lWidth
Width of the list content portion of this component, in pixels. This excludes the border and vertical scroll bar, if present.

 o cellHt
  protected int cellHt
Height of a single list cell, in pixels.

 o yAdj
  protected int yAdj
Top margin before the contents of the first list item, in pixels.

 o borderWidth
  protected int borderWidth
Width of the left and right borders combined, in pixels.

 o halfBorderWidth
  protected int halfBorderWidth
Width of the left or right border, in pixels.

Constructors

 o ImageListBox
  public ImageListBox()
Constructs a default ImageListBox. A default ImageListBox has no label, will size to show all of the existing list items when automatically laid out, and allows single list item selection.

 o ImageListBox
  public ImageListBox(String label)
Constructs an ImageListBox with the specified label. It will size to show all of the existing list items when automatically laid out, and allows single list item selection. Note: he label of an ImageListBox does not get displayed.

Parameters:
label - the label of the list box (not displayed)
 o ImageListBox
  public ImageListBox(String label,
                      boolean bMultipleSelections)
Constructs an ImageListBox with the specified label and conditionally allow multiple selections. It will size to show all of the existing list items when automatically laid out. Note: the label of an ImageListBox does not get displayed.

Parameters:
label - the name label of the list box (not displayed)
bMultipleSelections - if true then multiple selections are allowed; if false only single item selections are allowed
 o ImageListBox
  public ImageListBox(String label,
                      int rows,
                      boolean bMultipleSelections)
Constructs an ImageListBox with the specified label, the specified number of visible rows, and conditionally allow multiple list item selection.

Parameters:
label - the label of the list box (not displayed)
rows - the number of row items to show. If rows is less than or equal to zero, it will size to show all of the existing list items when automatically laid out.
bMultipleSelections - if true then multiple selections are allowed; if false only single item selections are allowed
 o ImageListBox
  public ImageListBox(Component parent,
                      String label)
Construct an ImageListBox with a specific parent component and the specified label. It will size to show all of the existing list items when automatically laid out.

Parameters:
parent - the parent of the list box, where all events are sent
label - the label of the list box (not displayed)
 o ImageListBox
  public ImageListBox(Component parent,
                      String slabel,
                      int rows,
                      boolean bMultipleSelections)
Constructs an ImageListBox. The created ImageListBox will have a specific parent component, the specified label, show a specified number of rows and conditionally allow multiple list item selection. If the specified parent is null, the parent (for event passing purposes) will be determined at event time.

Parameters:
parent - the parent of the list box, where all events should be sent
slabel - the label of the list box (not displayed)
rows - the number of items to show. If rows is less then or equal to zero, it will size to show all of the existing list items when automatically laid out.
bMultipleSelections - if true then multiple selections are allowed; if false only single item selections are allowed

Methods

 o setComboMode
  public void setComboMode(boolean cond)
Sets ImageListBox "ComboBox mode". "ComboBox mode" allows the selection point to follow the mouse even when the mouse button is not down. This only applies when the ImageListBox is not allowing multiple selections.

Parameters:
cond - true for "ComboBox mode", false for normal list box mode.
See Also:
getComboMode
 o getComboMode
  public boolean getComboMode()
Gets the current "ComboBox mode" setting. "ComboBox mode" allows the selection point to follow the mouse even when the mouse button is not down. This only applies when the ImageListBox is not allowing multiple selections.

Returns:
true if in "ComboBox mode", otherwise false
See Also:
setComboMode
 o setRowsToShow
  public void setRowsToShow(int rows)
Sets the number of rows to display in the ImageListBox. This affects the dimensions returned by getPreferredSize and determines the number of rows displayed when this component is automatically laid out.

Parameters:
rows - number of rows to automatically display
See Also:
getRowsToShow
 o getRowsToShow
  public int getRowsToShow()
Gets the current number of rows to display. This affects the dimensions returned by getPreferredSize and determines the number of rows displayed when this component is automatically laid out.

Returns:
the current number of rows to automatically display
See Also:
setRowsToShow
 o setShowVerticalScroll
  public void setShowVerticalScroll(boolean cond)
Sets the vertical scrollbar visibility flag.

Parameters:
cond - if true, the vertical scrollbar will be made visible when necessary; if false, the vertical scrollbar will never be made visible
See Also:
getShowVerticalScroll
 o getShowVerticalScroll
  public boolean getShowVerticalScroll()
Gets the current vertical scrollbar visibility flag.

Returns:
s true if the vertical scrollbar will be made visible when necessary; false if the vertical scrollbar will never be made visible
See Also:
setShowVerticalScroll
 o setShowHorizontalScroll
  public void setShowHorizontalScroll(boolean cond)
Sets the horizontal scrollbar visibility flag.

Parameters:
cond - if true, the horizontal scrollbar will be made visible when necessary; if false, the horizontal scrollbar will never be made visible
See Also:
getShowHorizontalScroll
 o getShowHorizontalScroll
  public boolean getShowHorizontalScroll()
Gets the current horizontal scrollbar visibility flag.

Returns:
s true if the horizontal scrollbar will be made visible when necessary; false if the horizontal scrollbar will never be made visible
See Also:
setShowHorizontalScroll
 o setBorderType
  public void setBorderType(int type)
Sets the border type of the ImageListBox. A regular border makes the list box appear lower than the surrounding area.

Parameters:
type - new border type, BORDER_REGULAR or BORDER_NONE
See Also:
getBorderType, BORDER_REGULAR, BORDER_NONE
 o getBorderType
  public int getBorderType()
Gets the current border type of the ImageListBox. A regular border makes the list box appear lower than the surrounding area.

Returns:
the current border type, BORDER_REGULAR or BORDER_NONE
See Also:
setBorderType, BORDER_REGULAR, BORDER_NONE
 o setCellBorder
  public void setCellBorder(int index,
                            boolean bOn)
Conditionally show a border around the cell at the specified index. Cell borders are always shown as a solid single-pixel wide line around the cell.

Parameters:
index - the zero-relative index of the cell
bOn - true to show the cell borders; false to not show them
See Also:
setCellBorders
 o setCellBorders
  public void setCellBorders(boolean bOn)
Sets the ImageListBox cell border display default, and resets all items to have the border conditionally. Cell borders are always shown as a solid single-pixel wide line around the cell.

Parameters:
bOn - true for "grid lines on by default" mode, false for "grid lines off by default" mode.
See Also:
setCellBorder, getCellBorders
 o getCellBorders
  public boolean getCellBorders()
Gets the current default cell border display mode. Cell borders are always shown as a solid single-pixel wide line around the cell.

Returns:
true if the "grid lines on by default" mode is on, otherwise false
See Also:
setCellBorders
 o setDefaultEnabledTextColor
  public void setDefaultEnabledTextColor(Color color)
Sets the default color for enabled text items.

Parameters:
color - the new default text color
See Also:
setEnabledTextColor, getDefaultEnabledTextColor
 o getDefaultEnabledTextColor
  public Color getDefaultEnabledTextColor()
Returns the current color for enabled text items.

See Also:
setDefaultEnabledTextColor
 o setDisabledTextColor
  public void setDisabledTextColor(Color color)
Sets the default color for disabled text items.

Parameters:
color - the new default disabled text color
See Also:
getDisabledTextColor
 o getDisabledTextColor
  public Color getDisabledTextColor()
Returns the current default color for disabled text items.

Returns:
the current default disabled text color
See Also:
setDisabledTextColor
 o setEnabledTextColor
  public void setEnabledTextColor(int index,
                                  Color color)
Sets the text color for an item at the given index.

Parameters:
index - the zero-relative index of the item
color - the color, null to use the default text color
 o handleEvent
  public boolean handleEvent(Event evt)
Processes events for this component. This is a standard Java AWT method which gets called by the AWT to handle this component's events. The default handler for components dispatches to one of the following methods as needed: action(), gotFocus(), lostFocus(), keyDown(), keyUp(), mouseEnter(), mouseExit(), mouseMove(), mouseDrag(), mouseDown(), or mouseUp(). It is overridden here to handle scrolling and selection using the mouse or keyboard.

Parameters:
evt - the event to handle
Returns:
true if the event was handled and no further action is needed, false to pass the event to this component's parent
Overrides:
handleEvent in class Component
See Also:
action, gotFocus, lostFocus, keyDown, keyUp, mouseEnter, mouseExit, mouseMove, mouseDrag, mouseDown, mouseUp
 o setMultiColumnMode
  public synchronized void setMultiColumnMode(boolean bCellBorders)
Sets the mode of the ImageListBox to "MultiColumnListBox mode". This method always sets the border type to BORDER_NONE, the "ComboBox mode" to be false, and conditionally sets whether the grid should be displayed.

Parameters:
bCellBorders - true to display the cell grid, false to not display the grid
See Also:
BORDER_NONE
 o addItem
  public synchronized void addItem(String item)
Adds an item to the end of the list and enables the item.

Parameters:
item - the item to be added
See Also:
setListItems, addItem, addItem, addItem, addItem
 o setListItems
  public void setListItems(String items[])
Initializes the list with the string array. Any pre-existing items are lost.

Parameters:
items - the new list items
See Also:
getListItems, setListItems, addItem, addItem, addItem, addItem, addItem
 o getListItems
  public String[] getListItems()
Returns the current list as a array.

See Also:
setListItems
 o addItem
  public synchronized void addItem(String item,
                                   boolean bEnabled)
Adds an item to the end of the list and conditionally enables it.

Parameters:
item - the item to be added
bEnabled - if true, enable the item; if false, disable the item
See Also:
setListItems, addItem, addItem, addItem, addItem
 o addItem
  public synchronized void addItem(Image image,
                                   String item)
Adds an item with an image to the end of the list and enables it.

Parameters:
image - the image to display on the item line
item - the item to be added
See Also:
setListItems, addItem, addItem, addItem, addItem
 o addItem
  public synchronized void addItem(Image image,
                                   String item,
                                   boolean bEnabled)
Adds an item with an image to the end of the list and conditionally enables it.

Parameters:
image - the image to display on the item line
item - the item to be added
bEnabled - if true, enable the item; if false, disable the item
See Also:
setListItems, addItem, addItem, addItem, addItem
 o addItem
  public synchronized void addItem(Image image,
                                   String item,
                                   boolean bEnabled,
                                   Color color)
Adds an item with an image to the end of the list and conditionally enables it. The item text will be displayed in the given color.

Parameters:
image - the image to display on the item line
item - the item to be added
bEnabled - if true, enable the item; if false, disable the item
color - the color of the item's text
See Also:
setListItems, addItem, addItem, addItem, addItem
 o insertItem
  public synchronized void insertItem(int index,
                                      Image image,
                                      String item,
                                      boolean bEnabled)
Inserts an item with an image at a specific zero-relative index and conditionally enables it.

Parameters:
index - the zero-relative index to insert at
image - the image to display on the item line
item - the item to be added
bEnabled - if true, enable the item; if false, disable the item
 o insertItems
  public synchronized void insertItems(int index,
                                       Vector itemVector,
                                       Image image,
                                       boolean bEnabled)
Inserts a vector list of items at a specific zero-relative index and conditionally enables them. Each item will be displayed with the given image.

Parameters:
index - the zero-relative index to insert at
itemVector - the item vector to be added
image - the image to display for all inserted items
bEnabled - if true, enable the items; if false, disable the items
 o countItems
  public int countItems()
Returns the total number of items in the list.

Returns:
the number of items in the list
See Also:
getItem
 o getItem
  public String getItem(int index)
Gets the item associated with the specified zero-relative index.

Parameters:
index - the zero-relative position of the item
Returns:
the item text, or null if the index is invalid
See Also:
countItems
 o getImage
  public Image getImage(int index)
Gets the image associated with the item at the specified zero-relative index.

Parameters:
index - the zero-relative position of the item
Returns:
the image at the index, or null if the index is invalid
See Also:
countItems
 o changeImage
  public void changeImage(int index,
                          Image image)
Changes the image associated with the item at the specified zero-relative index.

Parameters:
index - the zero-relative position of the item
image - the new image to associate with the item
 o changeText
  public void changeText(int index,
                         String text)
Changes the text associated with the item at the specified zero-relative index.

Parameters:
index - the zero-relative position of the item
text - the new text to associate with the item
 o setEdited
  public void setEdited(int index,
                        boolean bCond)
Sets a flag indicating that the item at the given zero-relative index has been edited.

Parameters:
index - the zero-relative position of the item
bCond - the "edited" flag
See Also:
getEdited
 o getEdited
  public boolean getEdited(int index)
Gets the "edited" flag state for the item at the given zero-relative index.

Parameters:
index - the zero-relative position of the item
Returns:
true if flagged as edited, false if not
See Also:
setEdited
 o enable
  public void enable(int index)
Enables the specified item in the list.

Parameters:
index - the zero-relative position of the item
See Also:
disable
 o disable
  public void disable(int index)
Disables the specified item in the list.

Parameters:
index - the zero-relative position of the item
See Also:
enable
 o enable
  public void enable(int index,
                     boolean cond)
Conditionally enables the specified item in the list.

Parameters:
index - the zero-relative position of the item
cond - if true, enable the item; if false, disable the item
See Also:
isEnabled
 o isEnabled
  public boolean isEnabled(int index)
Gets the enabled state of a specific item in the list.

Parameters:
index - the zero-relative position of the item in the list
Returns:
true if the item is enabled, false if the item is disabled.
See Also:
enable
 o clear
  public synchronized void clear()
Deletes all items and images from the list.

See Also:
delItem, delItems
 o delItem
  public synchronized void delItem(int index)
Deletes the specified item from the list.

Parameters:
index - the zero-relative index of the item to delete
See Also:
delItems, delSelectedItems
 o delItems
  public synchronized void delItems(int start,
                                    int end)
Deletes multiple items from the list. Note that the end index must be greater than or equal to the start index.

Parameters:
start - the zero-relative start index of the items to delete
end - the zero-relative end index of the items to delete
See Also:
delItem, delSelectedItems
 o delSelectedItems
  public synchronized void delSelectedItems()
Deletes the currently selected items from the list.

See Also:
delItem, delItems
 o getSelectedIndex
  public synchronized int getSelectedIndex()
Gets the zero-relative index of the selected item in the list. If multiple items are selected, the index of the item most recently selected is returned.

Returns:
the zero-relative index of the selected item, or -1 if no item is selected
See Also:
select, deselect, isSelected
 o getSelectedIndexes
  public synchronized int[] getSelectedIndexes()
Returns the indexes of all the selected items in the list.

Returns:
an array of the zero-relative indexes of the selected items
See Also:
select, deselect, isSelected
 o getSelectedItem
  public synchronized String getSelectedItem()
Returns the currently selected item in the list. If multiple items are selected, the item most recently selected is returned.

Returns:
the currently selected item, or null if no item is selected.
See Also:
getSelectedItems, select, deselect, isSelected
 o getSelectedItems
  public synchronized String[] getSelectedItems()
Returns all of the the selected items in the list.

Returns:
an array of all the selected items in the list
See Also:
getSelectedItem, select, deselect, isSelected
 o getLabel
  public synchronized String getLabel()
Returns the current list box label. Note that this label does not get displayed.

Returns:
the current list box label
 o select
  public synchronized void select(int index)
Selects the item at the specified index. This method deselects all others when multiple selections are not enabled.

Parameters:
index - the zero-relative position of the item to select
See Also:
getSelectedItem, deselect, isSelected
 o select
  public synchronized void select(String str)
Selects the first item in the list which has exactly matching text. This method deselects all others when multiple selections are not enabled.

Parameters:
str - the text of the item to select in the list
 o selectMultiple
  public synchronized void selectMultiple(int index,
                                          boolean bShift,
                                          boolean bControl)
Selects an item at the specified index in a multiple-selection-enabled ImageListBox using Shift, Ctrl or Ctrl-Shift modifiers to mimic mouse selecting with the Shift, Ctrl or Ctrl-Shift modifiers.

Parameters:
index - the zero-relative position of the item to select
bShift - whether to select with the Shift modifier
bControl - whether to select with the Ctrl modifier
 o selectAll
  public synchronized void selectAll()
Selects all the items in the list.

See Also:
select, deselectAll
 o deselect
  public synchronized void deselect(int index)
Deselects the item at the specified index.

Parameters:
index - the zero-relative position of the item to deselect
See Also:
deselectAll, select, getSelectedItem, isSelected
 o deselectAll
  public synchronized void deselectAll()
Deselects all items in the list.

See Also:
deselect, selectAll
 o isSelected
  public synchronized boolean isSelected(int index)
Gets the selected state of the item at the given index.

Parameters:
index - the zero-relative index of the item to be checked
Returns:
true if the item at the specified index is selected; false if it is not selected
See Also:
select, deselect, isSelected
 o getRows
  public int getRows()
Returns the number of currently visible lines in this list.

Returns:
the number of visible lines in the list.
 o allowsMultipleSelections
  public boolean allowsMultipleSelections()
Returns true if this list allows multiple selections.

Returns:
true if multiple selections allowed, false otherwise
See Also:
setMultipleSelections
 o setMultipleSelections
  public void setMultipleSelections(boolean cond)
Sets whether this list should allow multiple selections or not.

Parameters:
cond - whether to allow multiple selections
See Also:
allowsMultipleSelections
 o getVisibleIndex
  public int getVisibleIndex()
Gets the index of the item that was last made visible by the method makeVisible.

Returns:
the zero-relative index of the item last made visible by the makeVisible method
See Also:
makeVisible
 o makeVisible
  public synchronized void makeVisible(int index)
Scrolls the list as needed to ensure that the specified item is visible.

Parameters:
index - the zero-relative position of the item
See Also:
getVisibleIndex
 o setTopRow
  public void setTopRow(int index)
Forces the item at the specified index to be visible at the top of the window.

Parameters:
index - the zero-relative position of the item
 o preferredSize
  public Dimension preferredSize(int rows)
Returns the preferred dimensions needed for the list with the specified number of rows.

Parameters:
rows - the number of visible rows in the list
Returns:
the preferred size to show the specified number of rows
 o preferredSize
  public 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. The size returned is big enough to show the maximum number of visible rows as requested when constructed, or all the rows currently in the list.

Overrides:
preferredSize in class Container
See Also:
minimumSize
 o minimumSize
  public Dimension minimumSize(int rows)
Returns the minimum dimensions needed to show the given number of rows in the list.

Parameters:
rows - the number of visible rows in the list
Returns:
the minimum size of this list to show the given number of rows
 o minimumSize
  public 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. The size returned is big enough to show the maximum number of visible rows as requested when constructed, or all the rows currently in the list.

Overrides:
minimumSize in class Container
See Also:
preferredSize
 o addNotify
  public 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 is overridden here to handle list metrics after the peer is created.

Overrides:
addNotify in class Panel
See Also:
removeNotify
 o setColumns
  public synchronized void setColumns(int columns)
Sets the number of columns to be used by minimumSize().

Parameters:
columns - the number of columns
 o blockPaint
  public synchronized void blockPaint(boolean cond)
Blocks the repainting of the control.

Parameters:
cond - true to prevent updating the component, false for normal painting behavior
 o setFont
  public synchronized void setFont(Font f)
Sets this component's text font. This is a standard Java AWT method which gets called to change the font used for drawing text in this component. In this case the text is in the list box items. Note that this method is the same as SetListBoxFont().

Parameters:
f - the new font to use for drawing text
Overrides:
setFont in class Component
See Also:
getFont, getListBoxFont, setListBoxFont
 o setListBoxFont
  public synchronized void setListBoxFont(Font f)
Sets the font for the items in the list box. Note: this method is the same as setFont().

Parameters:
f - the new font to use for list box items
See Also:
getListBoxFont
 o getListBoxFont
  public synchronized Font getListBoxFont()
Returns the font used for the list box items.

See Also:
setListBoxFont
 o scrollVertical
  public synchronized void scrollVertical(int info,
                                          boolean bAbsolute)
Scrolls the ImageListBox vertically.

Parameters:
info - either an absolute value or Event.SCROLL_PAGE_DOWN, Event.SCROLL_PAGE_UP, Event.SCROLL_LINE_DOWN, Event.SCROLL_LINE_UP. The range for an absolute value should be between 0 and (number of rows-1).
bAbsolute - true to treat the info parameter as an absolute value, false to treat it as one of the SCROLL_... constants
 o scrollHorizontal
  public synchronized void scrollHorizontal(int info,
                                            boolean bAbsolute)
Scrolls the ImageListBox horizontally

Parameters:
info - either an absolute value or Event.SCROLL_PAGE_DOWN, Event.SCROLL_PAGE_UP, Event.SCROLL_LINE_DOWN, Event.SCROLL_LINE_UP. The range for absolute value should be between 0 and the width of the largest item, in pixels
bAbsolute - true to treat the info parameter as an absolute value, false to treat it as one of the SCROLL_... constants
 o update
  public synchronized 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 prevent the flicker associated with the standard update() method's repainting of the background before painting the component itself, and to allow the blocking of painting entirely.

Parameters:
g - the graphics context
Overrides:
update in class Component
See Also:
repaint, paint
 o paint
  public synchronized 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 extraPaint
  public void extraPaint(Graphics g,
                         Rectangle rect)
Override this method to add any special painting effects after text and images are painted

Parameters:
g - the graphics
rect - the bounding rectangle
 o show
  public synchronized void show()
Makes this component visible. This is a standard Java AWT method which gets called to show this component. If this component was invisible due to a previous hide() call it make this component visible again.

Overrides:
show in class Component
See Also:
hide
 o reshape
  public synchronized void reshape(int x,
                                   int y,
                                   int width,
                                   int height)
Moves and/or resizes this component. This is a standard Java AWT method which gets called to move and/or resize this component. Components that are in containers with layout managers should not call this method, but rely on the layout manager instead.

Parameters:
x - horizontal position in the parent's coordinate space
y - vertical position in the parent's coordinate space
width - the new width
height - the new height
Overrides:
reshape in class Component
 o setDirty
  public synchronized void setDirty()
Set the list to be "dirty" to force a complete paint on next repaint.

 o allSelected
  public boolean allSelected()
Query if all of the rows are selected.

Returns:
returns true if all rows are selected
 o setDirectNotify
  public void setDirectNotify(boolean bDirectNotify)
The ImageListBox posts LIST_SELECT and ACTION_EVENT events directly to a specific parent if one is specified. If one is not specified, the event is posted directly to the parent container unless the bDirectNotify notify flag is set to false. In that case the event is posted to self so that an extended class can handle it.

Parameters:
bDirectNotify - true to directly notify parent with event, false to post events to self so extended classes can handle it
 o validIndex
  protected boolean validIndex(int index)
Determines if the given index is valid.

Parameters:
index - a zero-relative index to check
Returns:
true if the index is valid, false if not
 o isVisibleIndex
  protected boolean isVisibleIndex(int index)
Determines if the item at the given index is visible.

Parameters:
index - the zero-relative index of the item to check
Returns:
true if the item is visible, false if not
 o paramString
  protected String paramString()
Returns a string representing the state of this object. This is a standard Java AWT method which can be usefull for debugging.

Returns:
a handy string for debugging purposes
Overrides:
paramString in class Container
 o shiftSelect
  protected void shiftSelect(int index,
                             boolean bControl)
Selects an index in a multiple-selection-enabled ImageListBox using Shift or Ctrl-Shift modifiers to mimic mouse selecting with the Shift or Ctrl-Shift modifiers.

Parameters:
index - the zero-relative position of the item to select
bControl - whether to select with the Ctrl modifier
 o ctrlSelect
  protected void ctrlSelect(int index)
Selects an index in a ImageListBox using the Ctrl modifier to mimic mouse selecting with the Ctrl modifier.

Parameters:
index - the zero-relative position of the item to select
 o mouseCalcIndex
  protected int mouseCalcIndex(int y)
A utility routine that determines the index of the item the mouse is in, given the vertical coordinate of the mouse.

Parameters:
y - mouse vertical (y) coordinate
Returns:
the zero-relative index of the item the mouse is in, or -1 if past the end of the list

All Packages  Class Hierarchy  This Package  Previous  Next  Index