JIDE 3.5.15

com.jidesoft.list
Class ImagePreviewList

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.jidesoft.list.ImagePreviewList
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable

public class ImagePreviewList
extends JList

ImagePreviewList is a component that can preview images. It takes any ListModel. The element in list can be either ImagePreviewList.PreviewImageIcon or an ImagePreviewList.PreviewImageIcon. If it's NamedImageIcon, you can specify the size, title and description for each image. If it's ImageIcon, you can only specify title and description by calling ImageIcon#setDescription(String) and pass in a string that contains both title and description using "[title]\n[description]".

By default, each image preview will have details about each image. You can use setShowDetails(int) to show or hide certain details.

The preview size can be changed using setCellDimension(java.awt.Dimension).

This component is still in beta.

See Also:
Serialized Form

Nested Class Summary
static interface ImagePreviewList.PreviewImageIcon
          An interface to allow specify title, description and size information in addition to the icon itself.
 
Nested classes/interfaces inherited from class javax.swing.JList
JList.AccessibleJList, JList.DropLocation
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static int SHOW_ALL
           
static int SHOW_DESCRIPTION
           
static int SHOW_NONE
           
static int SHOW_SIZE
           
static int SHOW_TITLE
           
 
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
ImagePreviewList()
           
ImagePreviewList(ListModel dataModel)
           
ImagePreviewList(Object[] listData)
           
ImagePreviewList(Vector<?> listData)
           
 
Method Summary
protected  void configureList()
          Configure the list.
 Dimension getCellDimension()
           
 Color getGridBackground()
          Gets the grid background.
 Color getGridForeground()
          Gets the grid line color.
 Color getHighlightBackground()
          Gets the selection highlight color.
 int getShowDetails()
          Gets the show details value.
 void setCellDimension(Dimension cellDimension)
           
 void setGridBackground(Color gridBackground)
          Sets the grid background.
 void setGridForeground(Color gridForeground)
          Sets the grid line color.
 void setHighlightBackground(Color highlightBackground)
          Sets the selection highlight color.
 void setShowDetails(int showDetails)
          Sets the show details value.
 
Methods inherited from class javax.swing.JList
addListSelectionListener, addSelectionInterval, clearSelection, 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, getSelectedIndex, 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, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, 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, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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, 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, getComponent, 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, validate, 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
 

Field Detail

SHOW_NONE

public static final int SHOW_NONE
See Also:
Constant Field Values

SHOW_TITLE

public static final int SHOW_TITLE
See Also:
Constant Field Values

SHOW_DESCRIPTION

public static final int SHOW_DESCRIPTION
See Also:
Constant Field Values

SHOW_SIZE

public static final int SHOW_SIZE
See Also:
Constant Field Values

SHOW_ALL

public static final int SHOW_ALL
See Also:
Constant Field Values
Constructor Detail

ImagePreviewList

public ImagePreviewList()

ImagePreviewList

public ImagePreviewList(Vector<?> listData)

ImagePreviewList

public ImagePreviewList(Object[] listData)

ImagePreviewList

public ImagePreviewList(ListModel dataModel)
Method Detail

configureList

protected void configureList()
Configure the list.


getShowDetails

public int getShowDetails()
Gets the show details value. It's a boolean OR of SHOW_DESCRIPTION, SHOW_SIZE, SHOW_TITLE.

Returns:
the show details value.

setShowDetails

public void setShowDetails(int showDetails)
Sets the show details value. You can use boolean OR of SHOW_DESCRIPTION, SHOW_SIZE, SHOW_TITLE. Or you can use SHOW_ALL or SHOW_NONE for all the details or none of the details.

Parameters:
showDetails - the new show details value.

getCellDimension

public Dimension getCellDimension()

setCellDimension

public void setCellDimension(Dimension cellDimension)

getGridForeground

public Color getGridForeground()
Gets the grid line color. This color is used to paint the grid line.

Returns:
the grid line color.

setGridForeground

public void setGridForeground(Color gridForeground)
Sets the grid line color. This color is used to paint the grid line.

Parameters:
gridForeground - the grid line color.

getGridBackground

public Color getGridBackground()
Gets the grid background. This color is used to paint the background inside each grid.

Returns:
the grid background color.

setGridBackground

public void setGridBackground(Color gridBackground)
Sets the grid background. This color is used to paint the background inside each grid.

Parameters:
gridBackground - the grid background color.

getHighlightBackground

public Color getHighlightBackground()
Gets the selection highlight color. This color is used to paint the grid background when it is selected. Please note, you should have alpha value less than 255 on this color. Otherwise it will cover the whole grid.

Returns:
the grid selection highlight color.

setHighlightBackground

public void setHighlightBackground(Color highlightBackground)
Sets the selection highlight color. This color is used to paint the grid background when it is selected. Please note, you should have alpha value less than 255 on this color. Otherwise it will cover the whole grid.

Parameters:
highlightBackground - the grid selection highlight color.

JIDE 3.5.15