javax.swing.plaf.basic
Class BasicDirectoryModel

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byjavax.swing.plaf.basic.BasicDirectoryModel
All Implemented Interfaces:
EventListener, ListModel, java.beans.PropertyChangeListener, Serializable

public class BasicDirectoryModel
extends AbstractListModel
implements java.beans.PropertyChangeListener

Basic implementation of a file list.

Author:
Jeff Dinkins
See Also:
Serialized Form

Nested Class Summary
(package private)  class BasicDirectoryModel.DoChangeContents
           
(package private)  class BasicDirectoryModel.LoadFilesThread
           
 
Field Summary
private  Vector directories
           
private  int fetchID
           
private  Vector fileCache
           
private  JFileChooser filechooser
           
private  Vector files
           
private  BasicDirectoryModel.LoadFilesThread loadThread
           
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
BasicDirectoryModel(JFileChooser filechooser)
           
 
Method Summary
 boolean contains(Object o)
           
 void fireContentsChanged()
           
 Vector getDirectories()
           
 Object getElementAt(int index)
          Returns the value at the specified index.
 Vector getFiles()
           
 int getSize()
          Returns the length of the list.
 int indexOf(Object o)
           
 void intervalAdded(ListDataEvent e)
          Obsolete - not used.
 void intervalRemoved(ListDataEvent e)
          Obsolete - not used.
 void invalidateFileCache()
          Obsolete - not used.
protected  boolean lt(File a, File b)
           
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 boolean renameFile(File oldFile, File newFile)
          Renames a file in the underlying file system.
protected  void sort(Vector v)
           
 void validateFileCache()
           
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filechooser

private JFileChooser filechooser

fileCache

private Vector fileCache

loadThread

private BasicDirectoryModel.LoadFilesThread loadThread

files

private Vector files

directories

private Vector directories

fetchID

private int fetchID
Constructor Detail

BasicDirectoryModel

public BasicDirectoryModel(JFileChooser filechooser)
Method Detail

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

invalidateFileCache

public void invalidateFileCache()
Obsolete - not used.


getDirectories

public Vector getDirectories()

getFiles

public Vector getFiles()

validateFileCache

public void validateFileCache()

renameFile

public boolean renameFile(File oldFile,
                          File newFile)
Renames a file in the underlying file system.

Parameters:
oldFile - a File object representing the existing file
newFile - a File object representing the desired new file name
Returns:
true if rename succeeded, otherwise false
Since:
1.4

fireContentsChanged

public void fireContentsChanged()

getSize

public int getSize()
Description copied from interface: ListModel
Returns the length of the list.

Specified by:
getSize in interface ListModel
Returns:
the length of the list

contains

public boolean contains(Object o)

indexOf

public int indexOf(Object o)

getElementAt

public Object getElementAt(int index)
Description copied from interface: ListModel
Returns the value at the specified index.

Specified by:
getElementAt in interface ListModel
Parameters:
index - the requested index
Returns:
the value at index

intervalAdded

public void intervalAdded(ListDataEvent e)
Obsolete - not used.


intervalRemoved

public void intervalRemoved(ListDataEvent e)
Obsolete - not used.


sort

protected void sort(Vector v)

lt

protected boolean lt(File a,
                     File b)