com.isti.util.gui
Class SynchJList

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JList
                  extended bycom.isti.util.gui.SynchJList
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable

Deprecated. Having thread-synchronization blocks on Swing objects is not recommended because if a thread holds the object's lock and then calls a Swing method that requires the AWT-tree-lock a deadlock can occur if the AWT event-dispatch thread holds the AWT-tree-lock and requires the object's lock (for repaint, etc). See 'SortedValuesJList' for an example of how this should be done.

public class SynchJList
extends javax.swing.JList

Class SynchJList extends JList to add extra thread synchronization.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JList
javax.swing.JList.AccessibleJList
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JList
HORIZONTAL_WRAP, VERTICAL, VERTICAL_WRAP
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
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
SynchJList()
          Deprecated. Creates a synchronized JList.
SynchJList(javax.swing.ListCellRenderer cellRendererObj)
          Deprecated. Creates a synchronized JList.
SynchJList(javax.swing.ListModel dataModel)
          Deprecated. Creates a synchronized JList that displays the elements in the specified, non-null model.
SynchJList(java.lang.Object[] listData)
          Deprecated. Creates a synchronized JList that displays the elements in the specified array.
SynchJList(java.util.Vector listData)
          Deprecated. Creates a synchronized JList that displays the elements in the specified Vector.
 
Method Summary
 void clearSelection()
          Deprecated. Clears the selection.
 void ensureSelectionVisible()
          Deprecated. Ensures that the current list selection is visible.
 void ensureSelectionVisibleLater()
          Deprecated. Ensures that the current list selection is visible.
 java.lang.Object getCellAt(int indexVal)
          Deprecated. Returns the object associated with the given index on the list.
 java.awt.Component getComponent(int indexVal)
          Deprecated. Overridden version of 'getComponent()' that is synchronized to the JList model object.
 java.awt.Dimension getMaximumSize()
          Deprecated. Overridden version of 'getMaximumSize()' that is synchronized to the JList model object.
 java.awt.Dimension getMinimumSize()
          Deprecated. Overridden version of 'getMinimumSize()' that is synchronized to the JList model object.
 java.awt.Dimension getPreferredSize()
          Deprecated. Overridden version of 'getPreferredSize()' that is synchronized to the JList model object.
 int getSelectedIndex()
          Deprecated. Returns the first selected index.
 void handleListUpdate()
          Deprecated. Called after updates to the list have occurred to repaint the list.
 void paint(java.awt.Graphics graphicsObj)
          Deprecated. Overridden version of 'paint()' that is synchronized to the JList model object.
 void requestFocus()
          Deprecated. Requests that this list has the keyboard focus.
 void setListData(java.lang.Object[] arr)
          Deprecated. Constructs a ListModel from an array of objects and then applies 'setModel' to it.
 void setListData(java.util.Vector vec)
          Deprecated. Constructs a ListModel from a Vector and then applies 'setModel' to it.
 void setSelectedIndex(int val)
          Deprecated. Sets the selected index for the list.
 void setSelectedIndexLater(int val)
          Deprecated. Sets the selected index for the list.
 void validate()
          Deprecated. Overridden version of 'validate()' that is synchronized to the JList model object.
 
Methods inherited from class javax.swing.JList
addListSelectionListener, addSelectionInterval, createSelectionModel, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, getPreferredScrollableViewportSize, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setModel, setPrototypeCellValue, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setUI, setValueIsAdjusting, setVisibleRowCount, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SynchJList

public SynchJList()
Deprecated. 
Creates a synchronized JList.


SynchJList

public SynchJList(javax.swing.ListModel dataModel)
Deprecated. 
Creates a synchronized JList that displays the elements in the specified, non-null model.

Parameters:
dataModel - the data model for this list.
Throws:
java.lang.IllegalArgumentException - if dataModel is null.

SynchJList

public SynchJList(java.lang.Object[] listData)
Deprecated. 
Creates a synchronized JList that displays the elements in the specified array.

Parameters:
listData - the array of Objects to be loaded into the data model.

SynchJList

public SynchJList(java.util.Vector listData)
Deprecated. 
Creates a synchronized JList that displays the elements in the specified Vector.

Parameters:
listData - the Vector to be loaded into the data model.

SynchJList

public SynchJList(javax.swing.ListCellRenderer cellRendererObj)
Deprecated. 
Creates a synchronized JList.

Parameters:
cellRendererObj - the cell renderer to use with the list.
Method Detail

requestFocus

public void requestFocus()
Deprecated. 
Requests that this list has the keyboard focus. The request is delayed, which may help it succeed by making it happen after other Swing business is performed.


handleListUpdate

public void handleListUpdate()
Deprecated. 
Called after updates to the list have occurred to repaint the list.


setSelectedIndex

public void setSelectedIndex(int val)
Deprecated. 
Sets the selected index for the list. This method does not throw an exception if the index value is out of range. This method is thread synchronized.

Parameters:
val - the index value.

setSelectedIndexLater

public void setSelectedIndexLater(int val)
Deprecated. 
Sets the selected index for the list. The action is delayed to prevent possible Swing problems (race conditions?). This method does not throw an exception if the index value is out of range.

Parameters:
val - the index value.

ensureSelectionVisible

public void ensureSelectionVisible()
Deprecated. 
Ensures that the current list selection is visible. This method is thread synchronized.


ensureSelectionVisibleLater

public void ensureSelectionVisibleLater()
Deprecated. 
Ensures that the current list selection is visible. The action is delayed to prevent possible Swing problems (race conditions?).


setListData

public void setListData(java.util.Vector vec)
Deprecated. 
Constructs a ListModel from a Vector and then applies 'setModel' to it. This method is thread synchronized.

Parameters:
vec - a Vector containing the items to display in the list.

setListData

public void setListData(java.lang.Object[] arr)
Deprecated. 
Constructs a ListModel from an array of objects and then applies 'setModel' to it. This method is thread synchronized.

Parameters:
arr - an array of Objects containing the items to display in the list.

clearSelection

public void clearSelection()
Deprecated. 
Clears the selection. This method is thread synchronized.


getSelectedIndex

public int getSelectedIndex()
Deprecated. 
Returns the first selected index. This method is thread synchronized.

Returns:
The first selected index, or -1 if there is no selection.

getCellAt

public java.lang.Object getCellAt(int indexVal)
Deprecated. 
Returns the object associated with the given index on the list.

Parameters:
indexVal - the index value to use.
Returns:
The associated object, or null if none matched.

paint

public void paint(java.awt.Graphics graphicsObj)
Deprecated. 
Overridden version of 'paint()' that is synchronized to the JList model object.

Parameters:
graphicsObj - the graphics context object to use.

validate

public void validate()
Deprecated. 
Overridden version of 'validate()' that is synchronized to the JList model object.


getPreferredSize

public java.awt.Dimension getPreferredSize()
Deprecated. 
Overridden version of 'getPreferredSize()' that is synchronized to the JList model object.

Returns:
A dimension object holding the size.

getMinimumSize

public java.awt.Dimension getMinimumSize()
Deprecated. 
Overridden version of 'getMinimumSize()' that is synchronized to the JList model object.

Returns:
A dimension object holding the size.

getMaximumSize

public java.awt.Dimension getMaximumSize()
Deprecated. 
Overridden version of 'getMaximumSize()' that is synchronized to the JList model object.

Returns:
A dimension object holding the size.

getComponent

public java.awt.Component getComponent(int indexVal)
Deprecated. 
Overridden version of 'getComponent()' that is synchronized to the JList model object.

Parameters:
indexVal - the index of the component to get.
Returns:
The corresponding component.