org.ChinaVO.FITSManager.FListView
Class FListView

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.ChinaVO.FITSManager.FListView.FListView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class FListView
extends javax.swing.JPanel

Simulate windows explorer's view, contain 5 type views:

FListView.VIEWDETAILS=1 details view
FListView.VIEWLIST=2 list view
FListView.VIEWICONS=3 icons view
FListView.VIEWTILES=4 tiles view
FListView.VIEWTHUMBNAILS=5 thumbnails view

In these 5 views, detail view is a FDetailview(base on JTable), called it viewDetail, and other 4 view are all FCommonList(base on JList), call them viewCommon.
Someone who want to use this FListView, he/she should implements the FListViewDataRequestInterface.

remark: user should initialize the columns in detail view, in fact it's a JTable instance.
Items in this views are all FItemCell objects, FItemCell base on JLabel.

Version:
v1.0.02 009-12-17 9:44:54
Author:
Fany
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static int BIGICON
           
static FListViewItemCell defaulNullFItemCell
           
static javax.swing.Icon defaultNullIcon
           
static int NormalICON
           
static int SMALLICON
           
static int THUMBNAIL
           
static int VIEWDETAILS
           
static int VIEWICONS
           
static int VIEWLIST
           
static int VIEWTHUMBNAILS
           
static int VIEWTILES
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
FListView(FListViewDataRequestInterface request)
          constructor.
 
Method Summary
 void addFocusListener(java.awt.event.FocusListener l)
           
 void addInputMethodListener(java.awt.event.InputMethodListener l)
           
 void addItem(FListViewItemCell c)
          add a new item into FListView.
 void addKeyListener(java.awt.event.KeyListener l)
           
 void addListSelectionListener(javax.swing.event.ListSelectionListener l)
           
 void addMouseListener(java.awt.event.MouseListener l)
           
 void addMouseMotionListener(java.awt.event.MouseMotionListener l)
           
 void addMouseWheelListener(java.awt.event.MouseWheelListener l)
           
 void clearData()
          remove all items.
 void clearSelection()
          Clear all selection.
 void getAdvancedData(FListViewDataRequestInterface request)
           
 FList getFListView()
          Get the FList.
 FListViewItemCell getItemCell(int column, int row)
          Get reference of an item in viewDetail.
 int getItemCount()
          Items' quantity.
 javax.swing.Icon getItemIcons(int index)
          Get an item's icon from FList
 int getSelectedItemIndex()
          Returns the smallest selected cell index; the selection when only a single item is selected in the list.
 int[] getSelectedItemIndexes()
          Get selected items' indexes.
 FDetailView getViewDetail()
          Get the viewDetail.
 int getViewType()
          Get current view type.
 void initColumns(java.util.List<java.lang.Object> name, java.util.List<java.lang.Integer> align, java.util.List<java.lang.Integer> width)
          Initiaize columns for detail view.
 void removeColumn(int col)
          remove a column in detail view, by its index.
 void removeItem(int index)
          remove a item by its index.
 void resetItemText(int index, java.lang.String text)
          reset the text of the item specify.
 void setItemCell(FListViewItemCell ic, int column, int row)
          set information for a item in viewDetail.
 void setItemIcons(javax.swing.Icon icon, int index)
          Set item icon for viewCommons.
 void setView(int viewType)
          Change the type of view.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addHierarchyBoundsListener, addHierarchyListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VIEWDETAILS

public static final int VIEWDETAILS
See Also:
Constant Field Values

VIEWLIST

public static final int VIEWLIST
See Also:
Constant Field Values

VIEWICONS

public static final int VIEWICONS
See Also:
Constant Field Values

VIEWTILES

public static final int VIEWTILES
See Also:
Constant Field Values

VIEWTHUMBNAILS

public static final int VIEWTHUMBNAILS
See Also:
Constant Field Values

BIGICON

public static final int BIGICON
See Also:
Constant Field Values

NormalICON

public static final int NormalICON
See Also:
Constant Field Values

SMALLICON

public static final int SMALLICON
See Also:
Constant Field Values

THUMBNAIL

public static final int THUMBNAIL
See Also:
Constant Field Values

defaultNullIcon

public static final javax.swing.Icon defaultNullIcon

defaulNullFItemCell

public static final FListViewItemCell defaulNullFItemCell
Constructor Detail

FListView

public FListView(FListViewDataRequestInterface request)
constructor.

Parameters:
request - instance of FListViewDataRequestInterface.
Method Detail

addMouseListener

public void addMouseListener(java.awt.event.MouseListener l)
Overrides:
addMouseListener in class java.awt.Component

addMouseMotionListener

public void addMouseMotionListener(java.awt.event.MouseMotionListener l)
Overrides:
addMouseMotionListener in class java.awt.Component

addMouseWheelListener

public void addMouseWheelListener(java.awt.event.MouseWheelListener l)
Overrides:
addMouseWheelListener in class java.awt.Component

addKeyListener

public void addKeyListener(java.awt.event.KeyListener l)
Overrides:
addKeyListener in class java.awt.Component

addFocusListener

public void addFocusListener(java.awt.event.FocusListener l)
Overrides:
addFocusListener in class java.awt.Component

addInputMethodListener

public void addInputMethodListener(java.awt.event.InputMethodListener l)
Overrides:
addInputMethodListener in class java.awt.Component

addListSelectionListener

public void addListSelectionListener(javax.swing.event.ListSelectionListener l)

initColumns

public void initColumns(java.util.List<java.lang.Object> name,
                        java.util.List<java.lang.Integer> align,
                        java.util.List<java.lang.Integer> width)
Initiaize columns for detail view.

Parameters:
name - name list of the columns
align - align type list of the columns.
such as: SwingConstants.LEFT, SwingConstants.RIGHT etc.
width - width lengths list of the columns

removeColumn

public void removeColumn(int col)
remove a column in detail view, by its index.

Parameters:
col - index

addItem

public void addItem(FListViewItemCell c)
add a new item into FListView.

Parameters:
c - a FListViewItemCell.

getItemCount

public int getItemCount()
Items' quantity.

Returns:
counts.

getItemCell

public FListViewItemCell getItemCell(int column,
                                     int row)
Get reference of an item in viewDetail.

Parameters:
column - column index.
row - row index.
Returns:
the reference of item.

setItemCell

public void setItemCell(FListViewItemCell ic,
                        int column,
                        int row)
set information for a item in viewDetail.

Parameters:
ic - FListViewItemCell.
column -
row -

setItemIcons

public void setItemIcons(javax.swing.Icon icon,
                         int index)
Set item icon for viewCommons.

Parameters:
icon - Icon instance.
index - index of item.

getItemIcons

public javax.swing.Icon getItemIcons(int index)
Get an item's icon from FList

Parameters:
index -
Returns:
the Icon

removeItem

public void removeItem(int index)
remove a item by its index.

Parameters:
index - index of the item.

clearData

public void clearData()
remove all items.


setView

public void setView(int viewType)
Change the type of view.

Parameters:
viewType - type of view.
FListView.VIEWDETAILS=1 details view
FListView.VIEWLIST=2 list view
FListView.VIEWICONS=3 icons view
FListView.VIEWTILES=4 tiles view
FListView.VIEWTHUMBNAILS=5 thumbnails view

getViewType

public int getViewType()
Get current view type.

Returns:
type of view.

getViewDetail

public FDetailView getViewDetail()
Get the viewDetail.

Returns:
the viewDetail.

getFListView

public FList getFListView()
Get the FList.

Returns:
the FList.

getSelectedItemIndex

public int getSelectedItemIndex()
Returns the smallest selected cell index; the selection when only a single item is selected in the list. When multiple items are selected, it is simply the smallest selected index. Returns -1 if there is no selection.

Returns:
index

getSelectedItemIndexes

public int[] getSelectedItemIndexes()
Get selected items' indexes.

Returns:
indexes

resetItemText

public void resetItemText(int index,
                          java.lang.String text)
reset the text of the item specify.

Parameters:
index - index of the item.
text - new text.

clearSelection

public void clearSelection()
Clear all selection.


getAdvancedData

public void getAdvancedData(FListViewDataRequestInterface request)