Class GeometryTreeModel

    • Constructor Detail

      • GeometryTreeModel

        public GeometryTreeModel()
        Standard constructor
    • Method Detail

      • createNamespace

        public Node createNamespace(String namespace)
        Create this folder namespace.
        Parameters:
        namespace - a namespace with parts separated by dots.
        Returns:
        the node representing the last part in the tree given by the namespace path.
      • getByNamespace

        public Entry getByNamespace(String namespace)
        Get an entry by it's namespace.
        Parameters:
        namespace - the namespace to use for searching
        Returns:
        the found entry, or null
      • addContained

        public void addContained(String directory,
                                 String namespace)
        Add all files in this directory to the given namespace.
        Parameters:
        directory - the directory containing the files.
        namespace - the namespace to add the files in.
      • getRoot

        public Node getRoot()
      • getChild

        public Object getChild(Object parent,
                               int index)
      • getChildCount

        public int getChildCount(Object parent)
      • isLeaf

        public boolean isLeaf(Object node)
      • valueForPathChanged

        public void valueForPathChanged(TreePath path,
                                        Object newValue)
      • getIndexOfChild

        public int getIndexOfChild(Object parent,
                                   Object child)
      • addDirectory

        public void addDirectory(Node node,
                                 String name)
        Add the directory 'name' to the denoted node.
        Parameters:
        node - the node to add a child for.
        name - the new node's name.
      • addFiles

        public void addFiles(List<File> files,
                             TreePath path)
        Add the list of files to the given path.
        Parameters:
        files - the files to add.
        path - the path, where to add.
      • addFile

        public void addFile(File file,
                            Node parent)
        Add the denoted file to the denoted parent node.
        Parameters:
        file - the file to add.
        parent - the node to add the file in.
      • addFiles

        public void addFiles(List<File> handleFiles,
                             Node parent)
        Add the denoted list of files to the denoted parent node.
        Parameters:
        handleFiles - the files to add.
        parent - the node to add the files in.
      • serialize

        public void serialize(TransformerHandler handler)
                       throws SAXException
        Serialize the model to a XML output.
        Parameters:
        handler - the handler to output to.
        Throws:
        SAXException - if a xml error occurs.
      • deserialize

        public static GeometryTreeModel deserialize(SAXParser sax,
                                                    FileInputStream inputStream)
                                             throws SAXException,
                                                    IOException
        Read a GeometryTreeModel from the given Inputstream and SAXParser
        Parameters:
        sax - the parser to use.
        inputStream - the input stream to read from.
        Returns:
        the new GeometryTreeModel instance.
        Throws:
        SAXException - if an error occurred while reading.
        IOException - if an error occurred while reading.
      • removePath

        public void removePath(TreePath path)
        Remove the denoted element from the model.
        Parameters:
        path - the path describing the element to remove.