Package adams.gui.tools
Class ContainerNesting
- java.lang.Object
-
- adams.gui.tools.ContainerNesting
-
public class ContainerNesting extends Object
Generates a tree structure from a Swing container.
A class name can be provided on the command-line. The provided class requires a default constructor in order to be analyzed.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description ContainerNesting()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static BaseTreeNode
analyze(BaseTreeNode parent, Component comp)
Analyzes the given Swing container.static BaseTree
analyze(Container cont)
Analyzes the given Swing container.protected static String
getLabel(Component comp)
Generates the label for the component.static void
main(String[] args)
Analyzes the class defined by its classname as second parameter.
-
-
-
Method Detail
-
getLabel
protected static String getLabel(Component comp)
Generates the label for the component.- Parameters:
comp
- the component to generate a label for- Returns:
- the label
-
analyze
protected static BaseTreeNode analyze(BaseTreeNode parent, Component comp)
Analyzes the given Swing container.- Parameters:
parent
- the parent in the tree, use null for rootcomp
- the component to analyze- Returns:
- the parent
-
analyze
public static BaseTree analyze(Container cont)
Analyzes the given Swing container.- Parameters:
cont
- the container to analyze- Returns:
- the generated tree of the nested elements
-
main
public static void main(String[] args) throws Exception
Analyzes the class defined by its classname as second parameter. The first parameter is the environment class, e.g., adams.env.Environment.- Parameters:
args
- the command-line parameters (environment class + container class)- Throws:
Exception
-
-