## edu.stanford.nlp.trees.tregex.gui
Class FileTreeModel

    java.lang.Object
      javax.swing.tree.DefaultTreeModel
          edu.stanford.nlp.trees.tregex.gui.FileTreeModel

All Implemented Interfaces:
  FileTreeNode.FileTreeNodeListener, Serializable, TreeModel

    public class FileTreeModel

extends DefaultTreeModel
implements FileTreeNode.FileTreeNodeListener

Component for managing the data for files containing trees.

Author:
  Anna Rafferty
See Also:
  Serialized Form

Field Summary
`static String` `DEFAULT_CHINESE_ENCODING`
`static String` `DEFAULT_ENCODING`
`static String` `DEFAULT_NEGRA_ENCODING`

Fields inherited from class javax.swing.tree.DefaultTreeModel
`asksAllowsChildren, listenerList`

Constructor Summary
`FileTreeModel(FileTreeNode root)`

Method Summary
`void` `addFileFolder(EnumMap<TregexGUI.FilterType,String> filters, File[] files)` Forks off a new thread to load your files based on the filters you set in the interface
`void` `addTreeModelListener(TreeModelListener l)`
`protected void` `fireTreeStructureChanged(TreePath parentPath)`
`FileTreeNode` `getChild(Object parent, int childNum)`
`int` `getChildCount(Object parent)`
`static String` `getCurEncoding()`
`int` `getIndexOfChild(Object parent, Object child)`
`FileTreeNode` `getRoot()`
`TreeReaderFactory` `getTRF()`
`boolean` `isEmpty()` Returns true if the root has no children; false otherwise
`boolean` `isLeaf(Object node)`
`void` `removeTreeModelListener(TreeModelListener l)`
`static void` `setCurEncoding(String curEncoding)`
`void` `setTRF(TreeReaderFactory trf)`
`void` `treeNodeChanged(FileTreeNode n)`

Methods inherited from class javax.swing.tree.DefaultTreeModel
`asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getListeners, getPathToRoot, getPathToRoot, getTreeModelListeners, insertNodeInto, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, setAsksAllowsChildren, setRoot, valueForPathChanged`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_ENCODING

    public static final String DEFAULT_ENCODING

See Also:
  Constant Field Values

### DEFAULT_CHINESE_ENCODING

    public static final String DEFAULT_CHINESE_ENCODING

See Also:
  Constant Field Values

### DEFAULT_NEGRA_ENCODING

    public static final String DEFAULT_NEGRA_ENCODING

See Also:
  Constant Field Values

Constructor Detail

### FileTreeModel

    public FileTreeModel(FileTreeNode root)

Method Detail

### addTreeModelListener

    public void addTreeModelListener(TreeModelListener l)

  Specified by:
    `addTreeModelListener` in interface `TreeModel`
  Overrides:
    `addTreeModelListener` in class `DefaultTreeModel`

### fireTreeStructureChanged

    protected void fireTreeStructureChanged(TreePath parentPath)

### getChild

    public FileTreeNode getChild(Object parent,
                                 int childNum)

  Specified by:
    `getChild` in interface `TreeModel`
  Overrides:
    `getChild` in class `DefaultTreeModel`

### getChildCount

    public int getChildCount(Object parent)

  Specified by:
    `getChildCount` in interface `TreeModel`
  Overrides:
    `getChildCount` in class `DefaultTreeModel`

### getIndexOfChild

    public int getIndexOfChild(Object parent,
                               Object child)

  Specified by:
    `getIndexOfChild` in interface `TreeModel`
  Overrides:
    `getIndexOfChild` in class `DefaultTreeModel`

### isLeaf

    public boolean isLeaf(Object node)

  Specified by:
    `isLeaf` in interface `TreeModel`
  Overrides:
    `isLeaf` in class `DefaultTreeModel`

### removeTreeModelListener

    public void removeTreeModelListener(TreeModelListener l)

  Specified by:
    `removeTreeModelListener` in interface `TreeModel`
  Overrides:
    `removeTreeModelListener` in class `DefaultTreeModel`

### treeNodeChanged

    public void treeNodeChanged(FileTreeNode n)

  Specified by:
    `treeNodeChanged` in interface `FileTreeNode.FileTreeNodeListener`

### isEmpty

    public boolean isEmpty()

  Returns true if the root has no children; false otherwise

### getRoot

    public FileTreeNode getRoot()

  Specified by:
    `getRoot` in interface `TreeModel`
  Overrides:
    `getRoot` in class `DefaultTreeModel`

### addFileFolder

    public void addFileFolder(EnumMap<TregexGUI.FilterType,String> filters,
                              File[] files)

  Forks off a new thread to load your files based on the filters you set in the interface

### getTRF

    public TreeReaderFactory getTRF()

### setTRF

    public void setTRF(TreeReaderFactory trf)

### getCurEncoding

    public static String getCurEncoding()

### setCurEncoding

    public static void setCurEncoding(String curEncoding)

Stanford NLP Group