Package elki.gui.util

Class ClassTree


  • public final class ClassTree
    extends java.lang.Object
    Build a tree of available classes for use in Swing UIs.
    Since:
    0.7.0
    Author:
    Erich Schubert
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ClassTree.ClassNode
      Tree node representing a single class.
      static class  ClassTree.PackageNode
      Tree node representing a single class.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ClassTree()
      Private constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.swing.tree.TreeNode build​(java.util.List<java.lang.Class<?>> choices, java.lang.String rootpkg)
      Build the class tree for a given set of choices.
      private static javax.swing.tree.MutableTreeNode simplifyTree​(javax.swing.tree.MutableTreeNode cur, java.lang.String prefix)
      Simplify the tree.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassTree

        private ClassTree()
        Private constructor. Static methods only.
    • Method Detail

      • build

        public static javax.swing.tree.TreeNode build​(java.util.List<java.lang.Class<?>> choices,
                                                      java.lang.String rootpkg)
        Build the class tree for a given set of choices.
        Parameters:
        choices - Class choices
        rootpkg - Root package name (to strip / hide)
        Returns:
        Root node.
      • simplifyTree

        private static javax.swing.tree.MutableTreeNode simplifyTree​(javax.swing.tree.MutableTreeNode cur,
                                                                     java.lang.String prefix)
        Simplify the tree.
        Parameters:
        cur - Current node
        prefix - Prefix to add
        Returns:
        Replacement node