gov.lanl.PidTrader
Class ObjectFinderList

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.List
              |
              +--gov.lanl.PidTrader.ObjectFinderList
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable

public class ObjectFinderList
extends java.awt.List

A Class that supports the selection of one or more objects through a scrolling list. Given a title (string) and an object, these are inserted in the list so that the title is assocaited with the object, when the title is selected, the object is marked for return. The method GetObjects, then, returns the list of marked objects.

See Also:
List, Serialized Form
 

Field Summary
protected  java.util.Hashtable indexTable_
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ObjectFinderList()
          The empty constructor.
ObjectFinderList(int rows)
          Creates a new scrolling list initialized with the specified number of visible lines and multiple selections disabled.
ObjectFinderList(int rows, boolean multipleMode)
          Creates a new scrolling list initialized with the specified number of visible lines and multiple selections enabled or disabled, depending on the value of the boolean parameter.
 
Method Summary
 void add(java.lang.String label, java.lang.Object obj)
          Add a label and associate it with an object.
 void addItem(java.lang.String label, java.lang.Object obj)
          Add a label and associate it with an object.
 void addObject(java.lang.String label, int index, java.lang.Object obj)
          Add a label at a specific location and associate it with an object.
 void addObject(java.lang.String label, java.lang.Object obj)
          Add a label and associate it with an object.
 java.lang.Object getObject(int index)
          Get the object associated with a label at a specific location
 java.lang.Object getObject(java.lang.String label)
          Get the object associated with a given label
 java.lang.Object[] getObjects()
          Get the list of objects associated with the ordered set of labels in the list.
 java.lang.Object[] getSelectedObjects()
          Get the list of Objects associated with the list of items selected
 void remove(int position)
          Remove the item from the list and the objects associated with it.
 void remove(java.lang.String item)
          Remove the item from the list and the objects associated with it.
 void removeAll()
          Remove all the items in the list and all the objects associated with them.
 void replaceObject(java.lang.String label, int index, java.lang.Object new_obj)
          Replace a label at a specific location, remove the object associated with the previous lable and associate it with the new object.
 
Methods inherited from class java.awt.List
add, add, addActionListener, addItem, addItem, addItemListener, addNotify, allowsMultipleSelections, clear, countItems, delItem, delItems, deselect, getAccessibleContext, getActionListeners, getItem, getItemCount, getItemListeners, getItems, getListeners, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, getRows, getSelectedIndex, getSelectedIndexes, getSelectedItem, getSelectedItems, getVisibleIndex, isIndexSelected, isMultipleMode, isSelected, makeVisible, minimumSize, minimumSize, paramString, preferredSize, preferredSize, processActionEvent, processEvent, processItemEvent, removeActionListener, removeItemListener, removeNotify, replaceItem, select, setMultipleMode, setMultipleSelections
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

indexTable_

protected java.util.Hashtable indexTable_
Constructor Detail

ObjectFinderList

public ObjectFinderList()
The empty constructor. Creates a new scrolling list initialized with no visible lines and multiple selections disabled.


ObjectFinderList

public ObjectFinderList(int rows)
Creates a new scrolling list initialized with the specified number of visible lines and multiple selections disabled.

Parameters:
rows - the number of items to show.

ObjectFinderList

public ObjectFinderList(int rows,
                        boolean multipleMode)
Creates a new scrolling list initialized with the specified number of visible lines and multiple selections enabled or disabled, depending on the value of the boolean parameter.

Parameters:
rows - the number of items to show.
multipleMode - if true then multiple selections are allowed.
Method Detail

add

public void add(java.lang.String label,
                java.lang.Object obj)
Add a label and associate it with an object. Note: using add(String label), which is the normal add method will effectively result in adding a null object. Same is true for addItem(String Label)

Parameters:
label - the label that appears in the list
obj - the object associated with the label

addItem

public void addItem(java.lang.String label,
                    java.lang.Object obj)
Add a label and associate it with an object. Note: using add(String label), which is the normal add method will effectively result in adding a null object. Same is true for addItem(String Label)

Parameters:
label - the label that appears in the list
obj - the object associated with the label

addObject

public void addObject(java.lang.String label,
                      java.lang.Object obj)
Add a label and associate it with an object.

Parameters:
label - the label that appears in the list
obj - the object associated with the label

addObject

public void addObject(java.lang.String label,
                      int index,
                      java.lang.Object obj)
Add a label at a specific location and associate it with an object.

Parameters:
label - the label that appears in the list
index - the index of the position in the list
obj - the object associated with the label

replaceObject

public void replaceObject(java.lang.String label,
                          int index,
                          java.lang.Object new_obj)
Replace a label at a specific location, remove the object associated with the previous lable and associate it with the new object.

Parameters:
label - the label that appears in the list
index - the index of the position in the list
new_obj - the object associated with the label

getObject

public java.lang.Object getObject(int index)
Get the object associated with a label at a specific location

Parameters:
index - the index of the position of the label in the list
Returns:
the object associated with the indexed label; returned value is null if there is no associated object

getObject

public java.lang.Object getObject(java.lang.String label)
Get the object associated with a given label

Parameters:
label - to be looked up
Returns:
the object associated with the indexed label; returned value is null if there is no associated object

getObjects

public java.lang.Object[] getObjects()
Get the list of objects associated with the ordered set of labels in the list.

Returns:
the list of objects associated with the labels; an object in the list may be null when there is no ojbect associated with the related label

removeAll

public void removeAll()
Remove all the items in the list and all the objects associated with them.

Overrides:
removeAll in class java.awt.List

remove

public void remove(java.lang.String item)
Remove the item from the list and the objects associated with it.

Overrides:
remove in class java.awt.List
Parameters:
item - the label of the item to remove

remove

public void remove(int position)
Remove the item from the list and the objects associated with it.

Overrides:
remove in class java.awt.List
Parameters:
position - the position, in the list, of the item to remove

getSelectedObjects

public java.lang.Object[] getSelectedObjects()
Get the list of Objects associated with the list of items selected

Specified by:
getSelectedObjects in interface java.awt.ItemSelectable
Overrides:
getSelectedObjects in class java.awt.List
Returns:
the list of selected objects