com.isti.util.gui
Class SynchJList

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

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/interfaces inherited from class javax.swing.JList
javax.swing.JList.AccessibleJList, javax.swing.JList.DropLocation
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, 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.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, getDropLocation, getDropMode, 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, setDropMode, 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, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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.

Overrides:
requestFocus in class javax.swing.JComponent

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.

Overrides:
setSelectedIndex in class javax.swing.JList
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.

Overrides:
setListData in class javax.swing.JList
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.

Overrides:
setListData in class javax.swing.JList
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.

Overrides:
clearSelection in class javax.swing.JList

getSelectedIndex

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

Overrides:
getSelectedIndex in class javax.swing.JList
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.

Overrides:
paint in class javax.swing.JComponent
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.

Overrides:
validate in class java.awt.Container

getPreferredSize

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

Overrides:
getPreferredSize in class javax.swing.JComponent
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.

Overrides:
getMinimumSize in class javax.swing.JComponent
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.

Overrides:
getMaximumSize in class javax.swing.JComponent
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.

Overrides:
getComponent in class java.awt.Container
Parameters:
indexVal - the index of the component to get.
Returns:
The corresponding component.