no.geosoft.cc.directory
Class FileSystemModel
Object
|
+--FileSystemModel
- All Implemented Interfaces:
- TreeModel
- public class FileSystemModel
- extends Object
- implements TreeModel
A TreeModel implementation for a disk directory structure.
Typical usage:
FileSystemModel model = new FileSystemModel (new File ("/"));
JTree tree = new JTree (model);
- Author:
- GeoSoft
Constructor Summary |
FileSystemModel(File root)
Create a tree model using the specified file as root. |
FileSystemModel
public FileSystemModel(File root)
- Create a tree model using the specified file as root.
- Parameters:
root
- Root file (directory typically).
getRoot
public Object getRoot()
- Specified by:
getRoot
in interface TreeModel
getChild
public Object getChild(Object parent,
int index)
- Specified by:
getChild
in interface TreeModel
getChildCount
public int getChildCount(Object parent)
- Specified by:
getChildCount
in interface TreeModel
isLeaf
public boolean isLeaf(Object node)
- Specified by:
isLeaf
in interface TreeModel
valueForPathChanged
public void valueForPathChanged(TreePath path,
Object newValue)
- Specified by:
valueForPathChanged
in interface TreeModel
getIndexOfChild
public int getIndexOfChild(Object parent,
Object child)
- Specified by:
getIndexOfChild
in interface TreeModel
addTreeModelListener
public void addTreeModelListener(TreeModelListener listener)
- Specified by:
addTreeModelListener
in interface TreeModel
removeTreeModelListener
public void removeTreeModelListener(TreeModelListener listener)
- Specified by:
removeTreeModelListener
in interface TreeModel
fireTreeNodesChanged
public void fireTreeNodesChanged(TreeModelEvent event)
fireTreeNodesInserted
public void fireTreeNodesInserted(TreeModelEvent event)
fireTreeNodesRemoved
public void fireTreeNodesRemoved(TreeModelEvent event)
fireTreeStructureChanged
public void fireTreeStructureChanged(TreeModelEvent event)
main
public static void main(String[] args)
- Testing this class.
- Parameters:
args
- Not used
Copyright © 2004 - Geotechnical Software Services geosoft.no