Class symantec.itools.awt.ImageListBox
All Packages Class Hierarchy This Package Previous Next Index
Class symantec.itools.awt.ImageListBox
Object
|
+----Component
|
+----Container
|
+----Panel
|
+----symantec.itools.awt.ImageListBox
- public class ImageListBox
- extends Panel
- implements ItemSelectable
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.
- Version:
- 1.1, June 7, 1997
- Author:
- Symantec
-
BORDER_NONE
- Defines the "no border" style.
-
BORDER_REGULAR
- Defines the "regular" (lowered) border style.
-
EVT_IMAGE_SELECT
- The ID of the event posted when the image portion of a list item
is selected.
-
HBar
- The horizontal scroll bar.
-
IMAGE_WIDTH
- Defines the width of all images displayed in the list, in pixels.
-
LINE_SLOP
- Extra space at end of a line.
-
VBar
- The vertical scroll bar.
-
bAllDirty
- If true the list is dirty (needs repaint).
-
bAllowShowHBar
- If true the horizontal scrollbar will be made
visible when necessary, false if it will never be made visible.
-
bAllowShowVBar
- If true the vertical scrollbar will be made
visible when necessary, false if it will never be made visible.
-
bBlockPaint
- If true the repainting of the control is prevented.
-
bCellBorders
- If true list items have borders by default.
-
bComboMode
- If true this ImageListBox is in "ComboBox mode".
-
bHBarVisible
- True if the horizontal scroll bar is currently visible.
-
bInternalBlockPaint
- True if repainting is temporarily disabled for efficiency purposes.
-
bMouseDrawHandled
- True if drawing was handled on mouse down and no drawing action needs
to be taken on mouse up.
-
bMultipleSelections
- It true multiple list items can be selected at the same time.
-
bVBarVisible
- True if the vertical scroll bar is currently visible.
-
barSize
- The width of scroll bars, in pixels.
-
borderDarkColor
- Color used in drawing of the border.
-
borderDarkerColor
- Color used in drawing of the border.
-
borderLightColor
- Color used in drawing of the border.
-
borderLighterColor
- Color used in drawing of the border.
-
borderType
- The current border type of this ImageListBox, one of BORDER_REGULAR or
BORDER_NONE.
-
borderWidth
- Width of the left and right borders combined, in pixels.
-
cachedBackground
- Cached value of the background color.
-
cellHt
- Height of a single list cell, in pixels.
-
colsToShow
- The number of columns to show when this component is automatically laid out.
-
countSelected
- The number of list items currently selected.
-
disabledColor
- The default color for disabled text items.
-
enabledColor
- The default color for enabled text items.
-
errors
- Error strings.
-
fastDownCount
- Used to detect two mouse pressed events without a mouse released
event in-between.
-
fm
- The font metrics of the font used for drawing text.
-
font
- The font used for drawing text.
-
fontDescent
- The typical distance from the base line to the bottom of most characters
in the current font.
-
fontHeight
- The standard height of a line of text in the current font.
-
halfBorderWidth
- Width of the left or right border, in pixels.
-
ilbLabel
- The label of this listbox (not displayed).
-
items
- A vector of the items in the list.
-
lWidth
- Width of the list content portion of this component, in pixels.
-
lastDownModifiers
- Not used.
-
lastIndex
- The zero-relative index of the item the mouse was last moved over,
dragged over, or clicked on.
-
lastSelected
- The zero-relative index of the currently selected item in the list.
-
lastTempIndex
- The zero-relative index of the item the mouse was pressed on.
-
longestLineValue
- The width of the widest list item, in pixels.
-
nTopRow
- Zero-relative index of the item displayed in the top row.
-
prevSelectRow
- The zero-relative index of the row at which the mouse was
previously released.
-
prevSelectTime
- The time at which the mouse was released, in milliseconds.
-
rowsToShow
- The number of rows to show when this component is automatically laid out.
-
textHighlight
- The background color for highlighted text.
-
textHighlightText
- The text color for highlighted text.
-
visibleCols
- The number of currently visible columns in this list.
-
visibleIndex
- The zero-relative index of the first visible list item.
-
visibleRows
- The number of currently visible lines in this list.
-
xCoord
- The amount the list items are scrolled horizontally, in pixels.
-
yAdj
- Top margin before the contents of the first list item, in pixels.
-
symantec.itools.awt.ImageListBox()
- Constructs a default ImageListBox.
-
symantec.itools.awt.ImageListBox(String)
- Constructs an ImageListBox with the specified label.
-
symantec.itools.awt.ImageListBox(String, boolean)
- Constructs an ImageListBox with the specified label and
conditionally allows multiple selections.
-
symantec.itools.awt.ImageListBox(String, int, boolean)
- Constructs an ImageListBox with the specified label, the
specified number of visible rows, and conditionally allows multiple
list item selection.
-
symantec.itools.awt.ImageListBox(Component, String, int, boolean)
-
-
symantec.itools.awt.ImageListBox(Component, String)
-
-
addActionListener(ActionListener)
- Adds the specified action listener to receive action events
from this component.
-
addItem(String)
- Adds an item to the end of the list and enables the item.
-
addItem(String, boolean)
- Adds an item to the end of the list and conditionally enables
it.
-
addItem(Image, String)
- Adds an item with an image to the end of the list and enables
it.
-
addItem(Image, String, boolean)
- Adds an item with an image to the end of the list and
conditionally enables it.
-
addItem(Image, String, boolean, Color)
- Adds an item with an image to the end of the list and
conditionally enables it.
-
addItem(ListItem)
- Adds an ListItem to the end of the list.
-
addItemListener(ItemListener)
- Adds the specified item listener to receive item events
-
addNotify()
- Tells this component that it has been added to a container.
-
addPropertyChangeListener(PropertyChangeListener)
- Adds a listener for all event changes.
-
addVetoableChangeListener(VetoableChangeListener)
- Adds a vetoable listener for all event changes.
-
allSelected()
-
-
allowsMultipleSelections()
-
-
blockPaint(boolean)
- Blocks the repainting of the control.
-
calculateBorderColors(Color)
- Used to calculate the border colors from the background color.
-
changeImage(int, Image)
-
-
changeText(int, String)
-
-
clear()
- Clears the list.
-
countItems()
- Returns the total number of items in the list.
-
ctrlSelect(int)
- Selects an index in a ImageListBox using the Ctrl modifier
to mimic mouse selecting with the Ctrl modifier.
-
delItem(int)
- Delete an item from the list.
-
delItems(int, int)
- Delete multiple items from the list.
-
delSelectedItems()
- Deletes the currently selected items from the list.
-
deselect(int)
-
-
deselectAll()
- Deselects all items in the list.
-
disable(int)
-
-
enable(int, boolean)
-
-
enable(int)
-
-
extraPaint(Graphics, Rectangle)
- Override this method to add any special painting effects after text and images are painted
-
getBorderType()
- Gets the current border type of the ImageListBox.
-
getBorderWidth()
- Get the width of the border around the component.
-
getCellBorders()
-
-
getCellHeight()
- Get the height of an individual row.
-
getColumns()
- Returns the number of columns to be used by minimumSize().
-
getComboMode()
-
-
getEdited(int)
-
-
getEnabledTextColor(int)
- Gets the text color for an item at the given index.
-
getImage(int)
- Gets the image associated with the specified zero-relative index.
-
getImageURL(int)
- Gets the URL of the image displayed at the given zero-based index.
-
getItem(int)
-
-
getLabel()
- Returns the current list box label.
-
getListItems()
- Returns the current list as an array.
-
getMinimumSize(int)
- Returns the minimum dimensions needed to show the given number of rows
in the list.
-
getMinimumSize()
- Returns the minimum dimensions to properly display this component.
-
getPreferredSize(int)
- Returns the preferred dimensions needed for the list with
the specified number of rows.
-
getPreferredSize()
- Returns the recommended dimensions to properly display this component.
-
getRows()
- Returns the number of currently visible lines in this list.
-
getRowsToShow()
- Gets the current number of rows to display.
-
getSelectedIndex()
- Gets the zero-relative index of the selected item in the list.
-
getSelectedIndexes()
- Returns the indexes of all the selected items in the list.
-
getSelectedItem()
- Returns the currently selected item in the list.
-
getSelectedItems()
- Returns all of the the selected items in the list.
-
getSelectedObjects()
- Returns the selected items in the list.
-
getShowHorizontalScroll()
-
-
getShowVerticalScroll()
-
-
getText(int)
- Gets the item text associated with the specified zero-relative index.
-
getTopRow()
- Returns the index of the item visible at
the top of the window.
-
getVisibleIndex()
- Gets the index of the item that was last made visible by
the method makeVisible.
-
insertItem(int, Image, String, boolean)
- Inserts an item with an image at a specific zero-relative index and
conditionally enables it.
-
insertItems(int, Vector, Image, boolean)
- Inserts a vector list of items at a specific zero-relative index and
conditionally enables them.
-
isAllSelected()
- Query if all rows are selected.
-
isCellBorders()
- Gets the current default cell border display mode.
-
isComboMode()
- Gets the current "ComboBox mode" setting.
-
isDirty()
- Query the lists all "dirty" state
-
isEdited(int)
- Gets the "edited" flag state for the item at the given
zero-relative index.
-
isEnabled(int)
- Gets the enabled state of a specific item in the list.
-
isFocusTraversable()
-
-
isMultipleSelections()
- Returns true if this list allows multiple selections.
-
isSelected(int)
- Get the selected state of the item at the given index.
-
isShowHorizontalScroll()
- Gets the current horizontal scrollbar visibility flag.
-
isShowVerticalScroll()
- Gets the current vertical scrollbar visibility flag.
-
isVisibleIndex(int)
- Determines if the item at the given index is visible.
-
keyCalcIndex(int, boolean)
- Determines the current index given a new absolute or relative index.
-
makeVisible(int)
-
-
minimumSize(int)
-
-
minimumSize()
-
-
mouseCalcIndex(int)
- A utility routine that determines the index of the item the mouse is in,
given the vertical coordinate of the mouse.
-
notifyHelper(int, int, int, boolean)
- Utility routine to generate action and/or item events in response to
key or mouse events.
-
paint(Graphics)
- Paints this component using the given graphics context.
-
paramString()
- Returns a string representing the state of this object.
-
preferredSize(int)
-
-
preferredSize()
-
-
removeActionListener(ActionListener)
- Removes the specified action listener so it no longer receives
action events from this component.
-
removeItemListener(ItemListener)
- Removes the specified item listener so it no longer receives
item events.
-
removeNotify()
- Tells this component that it is being removed from a container.
-
removePropertyChangeListener(PropertyChangeListener)
- Removes a listener for all event changes.
-
removeVetoableChangeListener(VetoableChangeListener)
- Removes a vetoable listener for all event changes.
-
reshape(int, int, int, int)
- Moves and/or resizes this component.
-
scrollHorizontal(int, boolean)
- Scrolls the ImageListBox horizontally
-
scrollVertical(int, boolean)
- Scrolls the ImageListBox vertically.
-
select(int)
-
-
select(String)
-
-
selectAll()
- Selects all the items in the list.
-
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.
-
setBorderType(int)
- Sets the border type of the ImageListBox.
-
setCellBorder(int, boolean)
- Conditionally show a border around the cell at the specified index.
-
setCellBorders(boolean)
- Sets the ImageListBox cell border display default, and
resets all items to have the border conditionally.
-
setColumns(int)
- Sets the number of columns to be used by getMinimumSize().
-
setComboMode(boolean)
- Sets ImageListBox "ComboBox mode".
-
setDirty(boolean)
- Set the list to be "dirty" (true) to force a complete
paint on next repaint, or "clean" (false) to avoid a complete
paint on the next repaint.
-
setDirty()
-
-
setEdited(int, boolean)
- Set a flag indicating that the item at the given zero-relative index
has been edited.
-
setEnabled(int, boolean)
- Conditionally enables the specified item in the list.
-
setEnabledTextColor(int, Color)
- Sets the text color for an item at the given index.
-
setFont(Font)
- Set the font for the items in the list box.
-
setImage(int, Image)
- Change the image associated with an item at a
specific zero-relative index.
-
setImageURL(int, URL)
- Sets the URL of the image to display at the given zero based index
-
setLabel(String)
- Sets the current list box label.
-
setListItems(String[])
- Initializes the list with the string array.
-
setMultiColumnMode(boolean)
- Sets the mode of the ImageListBox to "MultiColumnListBox
mode".
-
setMultipleSelections(boolean)
- Sets whether this list should allow multiple selections
or not.
-
setRowsToShow(int)
- Sets the number of rows to display in the ImageListBox.
-
setSelectedIndex(int, boolean)
- Select the item at the specified index.
-
setSelectedItem(String, boolean)
- Sets the slelection state of the first item in the list which has exactly
matching text.
-
setShowHorizontalScroll(boolean)
- Sets the horizontal scrollbar visibility flag.
-
setShowVerticalScroll(boolean)
- Sets the vertical scrollbar visibility flag.
-
setText(int, String)
- Changes the text associated with the item at the specified
zero-relative index.
-
setTopRow(int)
- Forces the item at the specified index to be visible at
the top of the window.
-
setVisibleIndex(int)
- Forces the item at the specified index to be visible in
the window.
-
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.
-
show()
- Makes this component visible.
-
sourceActionEvent(String)
- Fire an action event to the listeners
-
sourceItemEvent()
- Fire an item event to the listeners
-
update(Graphics)
- Handles redrawing of this component on the screen.
-
validIndex(int)
- Determines if the given index is valid.
BORDER_NONE
public static final int BORDER_NONE
- Defines the "no border" style. This indicates the list box will have no
border drawn around it.
- See Also:
- setBorderType, getBorderType
BORDER_REGULAR
public static final int BORDER_REGULAR
- Defines the "regular" (lowered) border style. This makes the list box
appear lower than the surrounding area.
- See Also:
- setBorderType, getBorderType
EVT_IMAGE_SELECT
public static final int EVT_IMAGE_SELECT
- The ID of the event posted when the image portion of a list item
is selected.
HBar
protected java.awt.Scrollbar HBar
- The horizontal scroll bar. It always exists event if not shown or showable.
IMAGE_WIDTH
public static final int IMAGE_WIDTH
- Defines the width of all images displayed in the list, in pixels.
LINE_SLOP
protected final int LINE_SLOP
- Extra space at end of a line.
VBar
protected java.awt.Scrollbar VBar
- The vertical scroll bar. It always exists event if not shown or showable.
bAllDirty
protected transient boolean bAllDirty
- If true the list is dirty (needs repaint).
bAllowShowHBar
protected boolean bAllowShowHBar
- If true the horizontal scrollbar will be made
visible when necessary, false if it will never be made visible.
- See Also:
- setShowHorizontalScroll
bAllowShowVBar
protected boolean bAllowShowVBar
- If true the vertical scrollbar will be made
visible when necessary, false if it will never be made visible.
- See Also:
- setShowVerticalScroll
bBlockPaint
protected boolean bBlockPaint
- If true the repainting of the control is prevented.
bCellBorders
protected boolean bCellBorders
- If true list items have borders by default.
Borders are always shown as a solid single-pixel wide line around
the cell.
- See Also:
- setCellBorders
bComboMode
protected boolean bComboMode
- If true this ImageListBox is in "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.
- See Also:
- setComboMode
bHBarVisible
protected boolean bHBarVisible
- True if the horizontal scroll bar is currently visible.
bInternalBlockPaint
protected transient boolean bInternalBlockPaint
- True if repainting is temporarily disabled for efficiency purposes.
bMouseDrawHandled
protected boolean bMouseDrawHandled
- True if drawing was handled on mouse down and no drawing action needs
to be taken on mouse up.
bMultipleSelections
protected boolean bMultipleSelections
- It true multiple list items can be selected at the same time.
bVBarVisible
protected boolean bVBarVisible
- True if the vertical scroll bar is currently visible.
barSize
protected transient int barSize
- The width of scroll bars, in pixels. Calculated in addNotify.
borderDarkColor
protected java.awt.Color borderDarkColor
- Color used in drawing of the border.
borderDarkerColor
protected java.awt.Color borderDarkerColor
- Color used in drawing of the border.
borderLightColor
protected java.awt.Color borderLightColor
- Color used in drawing of the border.
borderLighterColor
protected java.awt.Color borderLighterColor
- Color used in drawing of the border.
borderType
protected int borderType
- The current border type of this ImageListBox, one of BORDER_REGULAR or
BORDER_NONE.
A regular border makes the list box appear lower than the surrounding area.
- See Also:
- getBorderType, BORDER_REGULAR, BORDER_NONE
borderWidth
protected int borderWidth
- Width of the left and right borders combined, in pixels.
cachedBackground
protected java.awt.Color cachedBackground
- Cached value of the background color. Used to determine if calculated colors need to be updated.
cellHt
protected int cellHt
- Height of a single list cell, in pixels.
colsToShow
protected int colsToShow
- The number of columns to show when this component is automatically laid out.
countSelected
protected transient int countSelected
- The number of list items currently selected.
disabledColor
protected java.awt.Color disabledColor
- The default color for disabled text items.
enabledColor
protected java.awt.Color enabledColor
- The default color for enabled text items.
errors
protected transient java.util.ResourceBundle errors
- Error strings.
fastDownCount
protected int fastDownCount
- Used to detect two mouse pressed events without a mouse released
event in-between. This may sometimes happen if the mouse is pressed
twice very quickly.
fm
protected transient java.awt.FontMetrics fm
- The font metrics of the font used for drawing text.
font
protected java.awt.Font font
- The font used for drawing text.
fontDescent
protected transient int fontDescent
- The typical distance from the base line to the bottom of most characters
in the current font.
fontHeight
protected transient int fontHeight
- The standard height of a line of text in the current font.
halfBorderWidth
protected int halfBorderWidth
- Width of the left or right border, in pixels.
ilbLabel
protected java.lang.String ilbLabel
- The label of this listbox (not displayed).
items
protected java.util.Vector items
- A vector of the items in the list.
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.
lastDownModifiers
protected transient int lastDownModifiers
- Not used.
lastIndex
protected transient int lastIndex
- The zero-relative index of the item the mouse was last moved over,
dragged over, or clicked on. This field is only valid while the
mouse is over this component. When the mouse is not over this component
the value is -1.
lastSelected
protected transient int lastSelected
- The zero-relative index of the currently selected item in the list.
If multiple items are selected, this is the index of the item most
recently selected. If no items are selected, the value is -1.
lastTempIndex
protected transient int lastTempIndex
- The zero-relative index of the item the mouse was pressed on.
It is used when bMultipleSelections is false, and valid
between the time the mouse is pressed and released.
All other times it equals -1.
longestLineValue
protected int longestLineValue
- The width of the widest list item, in pixels.
nTopRow
protected int nTopRow
- Zero-relative index of the item displayed in the top row.
prevSelectRow
protected transient long prevSelectRow
- The zero-relative index of the row at which the mouse was
previously released.
This is used to determine when a double-click occurs.
prevSelectTime
protected transient long prevSelectTime
- The time at which the mouse was released, in milliseconds.
This is used to determine when a double-click occurs.
rowsToShow
protected int rowsToShow
- The number of rows to show when this component is automatically laid out.
If rows is less than or equal to zero, it will size to show all of the
existing list items when automatically laid out.
textHighlight
protected java.awt.Color textHighlight
- The background color for highlighted text.
textHighlightText
protected java.awt.Color textHighlightText
- The text color for highlighted text.
visibleCols
protected transient int visibleCols
- The number of currently visible columns in this list.
visibleIndex
protected int visibleIndex
- The zero-relative index of the first visible list item.
visibleRows
protected transient int visibleRows
- The number of currently visible lines in this list.
xCoord
protected int xCoord
- The amount the list items are scrolled horizontally, in pixels.
yAdj
protected int yAdj
- Top margin before the contents of the first list item, in pixels.
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.
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)
ImageListBox
public ImageListBox(String label,
boolean bMultipleSelections)
- Constructs an ImageListBox with the specified label and
conditionally allows 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
ImageListBox
public ImageListBox(String slabel,
int rows,
boolean bMultipleSelections)
- Constructs an ImageListBox with the specified label, the
specified number of visible rows, and conditionally allows multiple
list item selection.
- Parameters:
- slabel - 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
ImageListBox
public ImageListBox(Component parent,
String slabel,
int rows,
boolean bMultipleSelections)
- Note: ImageListBox() is deprecated.
see constructor ImageListBox(String slabel, int rows, boolean bMultipleSelections)
-
ImageListBox
public ImageListBox(Component parent,
String label)
- Note: ImageListBox() is deprecated.
see constructor ImageListBox(String slabel, int rows, boolean bMultipleSelections)
-
addActionListener
public synchronized void addActionListener(ActionListener l)
- Adds the specified action listener to receive action events
from this component.
- Parameters:
- l - the action listener
addItem
public synchronized void addItem(String item) throws PropertyVetoException
- Adds an item to the end of the list and enables the item.
- Parameters:
- item - the item to be added
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setListItems(java.lang.String[]), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), addItem(java.awt.Image, java.lang.String, boolean, java.awt.Color)
addItem
public synchronized void addItem(String item,
boolean bEnabled) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setListItems(java.lang.String[]), addItem(java.lang.String), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), addItem(java.awt.Image, java.lang.String, boolean, java.awt.Color)
addItem
public synchronized void addItem(Image image,
String item) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setListItems(java.lang.String[]), addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String, boolean), addItem(java.awt.Image, java.lang.String, boolean, java.awt.Color)
addItem
public synchronized void addItem(Image image,
String item,
boolean bEnabled) throws PropertyVetoException
- Adds an item with an image to the end of the list and
conditionally enables it.
- Parameters:
- image - the image to display on item line
- item - the item to be added
- bEnabled - if true, enable the item; if false, disable the item
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setListItems(java.lang.String[]), addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean, java.awt.Color)
addItem
public synchronized void addItem(Image image,
String item,
boolean bEnabled,
Color color) throws PropertyVetoException
- 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 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setListItems(java.lang.String[]), addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean)
addItem
protected void addItem(ListItem li) throws PropertyVetoException
- Adds an ListItem to the end of the list.
- Parameters:
- li - the item to add
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setListItems(java.lang.String[]), addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), addItem(java.awt.Image, java.lang.String, boolean, java.awt.Color)
addItemListener
public synchronized void addItemListener(ItemListener l)
- Adds the specified item listener to receive item events
- 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 hook-up event listeners.
It is also used to handle list metrics after the peer is created.
- Overrides:
- addNotify in class Panel
- See Also:
- removeNotify
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- Adds a listener for all event changes.
- Parameters:
- PropertyChangeListener - listener the listener to add.
- See Also:
- removePropertyChangeListener
addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
- Adds a vetoable listener for all event changes.
- Parameters:
- VetoableChangeListener - listener the listener to add.
- See Also:
- removeVetoableChangeListener
allSelected
public boolean allSelected()
- Note: allSelected() is deprecated.
-
- See Also:
- isAllSelected
allowsMultipleSelections
public boolean allowsMultipleSelections()
- Note: allowsMultipleSelections() is deprecated.
-
- See Also:
- isMultipleSelections
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
calculateBorderColors
protected void calculateBorderColors(Color c)
- Used to calculate the border colors from the background color.
- See Also:
- addNotify, setBackground
changeImage
public void changeImage(int index,
Image image) throws PropertyVetoException
- Note: changeImage() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setImage(int, java.awt.Image)
changeText
public void changeText(int index,
String text) throws PropertyVetoException
- Note: changeText() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setText(int, java.lang.String)
clear
public synchronized void clear()
- Clears the list.
- See Also:
- delItem, delItems
countItems
public int countItems()
- Returns the total number of items in the list.
- Returns:
- the number of items in the list
- See Also:
- getItem
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
delItem
public synchronized void delItem(int index) throws PropertyVetoException
- Delete an item from the list.
- Parameters:
- index - the zero-relative index of the item to delete
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- delItems, delSelectedItems
delItems
public synchronized void delItems(int start,
int end) throws PropertyVetoException
- Delete 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
- end - the zero-relative end index of the items
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- delItem, delSelectedItems
delSelectedItems
public synchronized void delSelectedItems() throws PropertyVetoException
- Deletes the currently selected items from the list.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- delItem, delItems
deselect
public synchronized void deselect(int index) throws PropertyVetoException
- Note: deselect() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setSelectedIndex(int, boolean)
deselectAll
public synchronized void deselectAll() throws PropertyVetoException
- Deselects all items in the list.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- selectAll
disable
public void disable(int index) throws PropertyVetoException
- Note: disable() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setEnabled(int, boolean)
enable
public void enable(int index,
boolean cond) throws PropertyVetoException
- Note: enable() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setEnabled(int, boolean)
enable
public void enable(int index) throws PropertyVetoException
- Note: enable() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setEnabled(int, boolean)
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
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
getBorderWidth
public int getBorderWidth()
- Get the width of the border around the component.
This value is the number of pixels needed to display the border
completely on both sides of the component; it is not the width of
one side of the border.
- Returns:
- the width in pixels
getCellBorders
public boolean getCellBorders()
- Note: getCellBorders() is deprecated.
-
- See Also:
- isCellBorders
getCellHeight
public int getCellHeight()
- Get the height of an individual row.
- Returns:
- the height in pixels
getColumns
public synchronized int getColumns()
- Returns the number of columns to be used by minimumSize().
- Returns:
- the number of columns
- See Also:
- setColumns
getComboMode
public boolean getComboMode()
- Note: getComboMode() is deprecated.
-
- See Also:
- isComboMode
getEdited
public boolean getEdited(int index)
- Note: getEdited() is deprecated.
-
- See Also:
- isEdited
getEnabledTextColor
public java.awt.Color getEnabledTextColor(int index)
- Gets the text color for an item at the given index.
- Parameters:
- index - the zero-relative index of the item
- Returns:
- the color, null if the default text color is used
or the index is not valid.
getImage
public java.awt.Image getImage(int index)
- Gets the image associated with 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:
- setImage(int, java.awt.Image)
getImageURL
public java.net.URL getImageURL(int index)
- Gets the URL of the image displayed at the given zero-based index.
- Parameters:
- index - the zero-relative index of the image to get
- Returns:
- the URL of the image
- See Also:
- setImage
getItem
public java.lang.String getItem(int index)
- Note: getItem() is deprecated.
-
- See Also:
- getText
getLabel
public synchronized java.lang.String getLabel()
- Returns the current list box label.
- Returns:
- the current list box label
- See Also:
- setLabel
getListItems
public java.lang.String[] getListItems()
- Returns the current list as an array.
- Returns:
- String[] current list
- See Also:
- setListItems
getMinimumSize
public java.awt.Dimension getMinimumSize(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
getMinimumSize
public java.awt.Dimension getMinimumSize()
- 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:
- getMinimumSize in class Container
- See Also:
- preferredSize
getPreferredSize
public java.awt.Dimension getPreferredSize(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
getPreferredSize
public java.awt.Dimension getPreferredSize()
- 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:
- getPreferredSize in class Container
- See Also:
- minimumSize
getRows
public int getRows()
- Returns the number of currently visible lines in this list.
- Returns:
- the number of visible lines in the list.
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
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
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
getSelectedItem
public synchronized java.lang.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:
- setSelectedItem, getSelectedItems, deselect, isSelected
getSelectedItems
public synchronized java.lang.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, setSelectedItem, isSelected
getSelectedObjects
public java.lang.Object[] getSelectedObjects()
- Returns the selected items in the list.
Needed in order to implement the java.awt.ItemSelectable interface
- Returns:
- an array of selected items in the list, as an array of Objects.
- See Also:
- getSelectedItem, setSelectedItem, isSelected, ItemSelectable
getShowHorizontalScroll
public boolean getShowHorizontalScroll()
- Note: getShowHorizontalScroll() is deprecated.
-
- See Also:
- isShowHorizontalScroll
getShowVerticalScroll
public boolean getShowVerticalScroll()
- Note: getShowVerticalScroll() is deprecated.
-
- See Also:
- isShowVerticalScroll
getText
public java.lang.String getText(int index)
- Gets the item text 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:
- setText
getTopRow
public synchronized int getTopRow()
- Returns the index of the item visible at
the top of the window.
- Returns:
- index the zero-relative position of the item
- See Also:
- setTopRow
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
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
insertItems
public synchronized void insertItems(int index,
Vector itemVector,
Image image,
boolean bEnabled) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
isAllSelected
public boolean isAllSelected()
- Query if all rows are selected.
- Returns:
- returns true if all rows in the ImageListBox
are selected
isCellBorders
public boolean isCellBorders()
- 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
isComboMode
public boolean isComboMode()
- 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
isDirty
public synchronized boolean isDirty()
- Query the lists all "dirty" state
- Returns:
- true if on the next repaint the entire list will be
repainted, or false if the list will not be repainted.
- See Also:
- setDirty(boolean)
isEdited
public boolean isEdited(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
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:
- setEnabled(int, boolean)
isFocusTraversable
public boolean isFocusTraversable()
- Overrides:
- isFocusTraversable in class Component
isMultipleSelections
public boolean isMultipleSelections()
- Returns true if this list allows multiple selections.
- Returns:
- true if multiple selections allowed, false otherwise
- See Also:
- setMultipleSelections
isSelected
public synchronized boolean isSelected(int index)
- Get 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
isShowHorizontalScroll
public boolean isShowHorizontalScroll()
- Gets the current horizontal scrollbar visibility flag.
- Returns:
- true if the horizontal scrollbar will be made
visible when necessary; false if the horizontal scrollbar
will never be made visible
- See Also:
- setShowHorizontalScroll
isShowVerticalScroll
public boolean isShowVerticalScroll()
- Gets the current vertical scrollbar visibility flag.
- Returns:
- true if the vertical scrollbar will be made
visible when necessary; false if the vertical scrollbar
will never be made visible
- See Also:
- setShowVerticalScroll
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
keyCalcIndex
protected int keyCalcIndex(int offset,
boolean bAbsolute)
- Determines the current index given a new absolute or relative index.
- Parameters:
- offset - the value used to compute the new index
- boolean - true if offset is zero-relative, false if offset is
relative to the current index value
- Returns:
- the new current index value
makeVisible
public synchronized void makeVisible(int index) throws PropertyVetoException
- Note: makeVisible() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setVisibleIndex
minimumSize
public java.awt.Dimension minimumSize(int rows)
- Note: minimumSize() is deprecated.
-
- See Also:
- getMinimumSize(int)
minimumSize
public java.awt.Dimension minimumSize()
- Note: minimumSize() is deprecated.
-
- Overrides:
- minimumSize in class Container
- See Also:
- getMinimumSize
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
notifyHelper
protected void notifyHelper(int x,
int y,
int index,
boolean bDoubleClick)
- Utility routine to generate action and/or item events in response to
key or mouse events.
- Parameters:
- x - mouse component-relative horizontal position, in pixels
- x - mouse component-relative vertical position, in pixels
- index - zero-relative index of currently selected item
- bDoubleClick - true if mouse double-clicked on item
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
paramString
protected java.lang.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
preferredSize
public java.awt.Dimension preferredSize(int rows)
- Note: preferredSize() is deprecated.
-
- See Also:
- getPreferredSize(int)
preferredSize
public java.awt.Dimension preferredSize()
- Note: preferredSize() is deprecated.
-
- Overrides:
- preferredSize in class Container
- See Also:
- getPreferredSize
removeActionListener
public synchronized void removeActionListener(ActionListener l)
- Removes the specified action listener so it no longer receives
action events from this component.
- Parameters:
- l - the action listener
removeItemListener
public synchronized void removeItemListener(ItemListener l)
- Removes the specified item listener so it no longer receives
item events.
- 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 unhook event listeners.
- Overrides:
- removeNotify in class Container
- See Also:
- addNotify
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- Removes a listener for all event changes.
- Parameters:
- PropertyChangeListener - listener the listener to remove.
- See Also:
- addPropertyChangeListener
removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
- Removes a vetoable listener for all event changes.
- Parameters:
- VetoableChangeListener - listener the listener to remove.
- See Also:
- addVetoableChangeListener
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
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
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
select
public synchronized void select(int index) throws PropertyVetoException
- Note: select() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setSelectedIndex(int, boolean)
select
public synchronized void select(String str) throws PropertyVetoException
- Note: select() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setSelectedItem(java.lang.String, boolean)
selectAll
public synchronized void selectAll()
- Selects all the items in the list.
- See Also:
- select, deselectAll
selectMultiple
public synchronized void selectMultiple(int index,
boolean bShift,
boolean bControl) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
setBorderType
public void setBorderType(int type) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getBorderType, BORDER_REGULAR, BORDER_NONE
setCellBorder
public void setCellBorder(int index,
boolean bOn) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setCellBorders
setCellBorders
public void setCellBorders(boolean bOn) throws PropertyVetoException
- 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.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setCellBorder, isCellBorders
setColumns
public synchronized void setColumns(int columns) throws PropertyVetoException
- Sets the number of columns to be used by getMinimumSize().
- Parameters:
- columns - the number of columns
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getColumns
setComboMode
public void setComboMode(boolean cond) throws PropertyVetoException
- 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.
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isComboMode
setDirty
public synchronized void setDirty(boolean isDirty) throws PropertyVetoException
- Set the list to be "dirty" (true) to force a complete
paint on next repaint, or "clean" (false) to avoid a complete
paint on the next repaint.
- Parameters:
- isDirty - true if the list is dirty (needs repaint)
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isDirty
setDirty
public synchronized void setDirty() throws PropertyVetoException
- Note: setDirty() is deprecated.
-
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- setDirty(boolean)
setEdited
public void setEdited(int index,
boolean bCond) throws PropertyVetoException
- Set 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isEdited
setEnabled
public void setEnabled(int index,
boolean cond) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isEnabled
setEnabledTextColor
public void setEnabledTextColor(int index,
Color color) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
setFont
public synchronized void setFont(Font f)
- Set the font for the items in the list box.
- Parameters:
- f - new font to use for list box items
- Overrides:
- setFont in class Component
setImage
public void setImage(int index,
Image image) throws PropertyVetoException
- Change the image associated with an item at a
specific zero-relative index.
- Parameters:
- index - the zero-relative position of the item
- image - the image to associate with an item
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getImage(int)
setImageURL
public void setImageURL(int index,
URL aUrl) throws MalformedURLException, PropertyVetoException
- Sets the URL of the image to display at the given zero based index
- Parameters:
- aURL - the image URL
- Throws: MalformedURLException
- if the URL parameter is bad
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getImage
setLabel
public synchronized void setLabel(String label) throws PropertyVetoException
- Sets the current list box label.
- Parameters:
- label - the new list box label
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getLabel
setListItems
public void setListItems(String[] items) throws PropertyVetoException
- Initializes the list with the string array. Any pre-existing items are
lost.
- Parameters:
- items - the new list items
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getListItems, setListItems(java.lang.String[]), addItem(java.lang.String), addItem(java.lang.String, boolean), addItem(java.awt.Image, java.lang.String), addItem(java.awt.Image, java.lang.String, boolean), addItem(java.awt.Image, java.lang.String, boolean, java.awt.Color)
setMultiColumnMode
public synchronized void setMultiColumnMode(boolean bCellBorders) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- BORDER_NONE
setMultipleSelections
public void setMultipleSelections(boolean cond) throws PropertyVetoException
- Sets whether this list should allow multiple selections
or not.
- Parameters:
- cond - whether to allow multiple selections
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- allowsMultipleSelections
setRowsToShow
public void setRowsToShow(int rows) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getRowsToShow
setSelectedIndex
public synchronized void setSelectedIndex(int index,
boolean isSelected) throws PropertyVetoException
- Select the item at the specified index.
This method deselects all others when multiple
selections not enabled.
- Parameters:
- index - the zero-relative position of the item to select
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getSelectedItem, deselect, isSelected
setSelectedItem
public synchronized void setSelectedItem(String str,
boolean isSelected) throws PropertyVetoException
- Sets the slelection state of the first item in the list which has exactly
matching text.
- Parameters:
- str - the String to select in the list
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getSelectedItem
setShowHorizontalScroll
public void setShowHorizontalScroll(boolean cond) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isShowHorizontalScroll
setShowVerticalScroll
public void setShowVerticalScroll(boolean cond) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- isShowVerticalScroll
setText
public void setText(int index,
String text) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getText
setTopRow
public void setTopRow(int index) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getTopRow
setVisibleIndex
public synchronized void setVisibleIndex(int index) throws PropertyVetoException
- Forces the item at the specified index to be visible in
the window.
- Parameters:
- index - the zero-relative position of the item to be
made visible
- Throws: PropertyVetoException
- if the specified property value is unacceptable
- See Also:
- getVisibleIndex
shiftSelect
protected void shiftSelect(int index,
boolean bControl) throws PropertyVetoException
- 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
- Throws: PropertyVetoException
- if the specified property value is unacceptable
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
sourceActionEvent
protected void sourceActionEvent(String command)
- Fire an action event to the listeners
- Parameters:
- command - the string containing the command to send
with the event.
sourceItemEvent
protected void sourceItemEvent()
- Fire an item event to the listeners
- See Also:
- addItemListener, removeItemListener
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 Container
- See Also:
- repaint, paint
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
All Packages Class Hierarchy This Package Previous Next Index