Class DefaultTreeModel<T>

  • Type Parameters:
    T - the type of data in the tree
    All Implemented Interfaces:
    TreeModel<T>

    public class DefaultTreeModel<T>
    extends Object
    implements TreeModel<T>
    A default implementation of TreeModel that starts with a ValueEncoder (for the element to string conversion), a TreeModelAdapter, and a list of root nodes. This implementation is not thread safe.
    Since:
    5.3
    • Constructor Detail

      • DefaultTreeModel

        public DefaultTreeModel​(ValueEncoder<T> encoder,
                                TreeModelAdapter<T> adapter,
                                T root)
        Creates a new model starting from a single root element.
        Parameters:
        encoder - used to convert values to strings and vice-versa
        adapter - adapts elements to the tree
        root - defines the root node of the model
      • DefaultTreeModel

        public DefaultTreeModel​(ValueEncoder<T> encoder,
                                TreeModelAdapter<T> adapter,
                                List<T> roots)
        Standard constructor.
        Parameters:
        encoder - used to convert values to strings and vice-versa
        adapter - adapts elements to the tree
        roots - defines the root nodes of the model