FileDocCategorySizeDatePackage
BoxJTree.javaAPI Docmp4parser 1.0-RC-172336Wed Dec 19 20:10:21 GMT 2012com.coremedia.iso.gui

BoxJTree

public class BoxJTree extends JTree implements org.jdesktop.application.session.PropertySupport

Fields Summary
Constructors Summary
public BoxJTree()

        setRootVisible(false);
        setLargeModel(true);
        setName("boxTree");
    
Methods Summary
public java.lang.StringconvertValueToText(java.lang.Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)

        if (value instanceof Box) {
            return ((Box) value).getType();
        } else {
            return super.convertValueToText(value, selected, expanded, leaf, row, hasFocus);    //To change body of overridden methods use File | Settings | File Templates.
        }
    
public java.lang.ObjectgetSessionState(java.awt.Component c)

        Enumeration<TreePath> treePathEnumeration = this.getExpandedDescendants(new TreePath(this.getModel().getRoot()));
        java.util.List<String> openPath = new LinkedList<String>();
        Path oldMp4Path = null;
        if (treePathEnumeration != null) {


            while (treePathEnumeration.hasMoreElements()) {
                TreePath treePath = treePathEnumeration.nextElement();
                openPath.add(Path.createPath((Box) treePath.getLastPathComponent()));
            }
        }
        return openPath;

    
public voidsetSessionState(java.awt.Component c, java.lang.Object state)

        LinkedList<String> openPath = (LinkedList<String>) state;

        if (!openPath.isEmpty()) {

            for (String s : openPath) {
                Box expanded = Path.getPath((Box) this.getModel().getRoot(), s);
                List path = new LinkedList();
                while (expanded != null) {
                    path.add(expanded);
                    expanded = expanded.getParent();
                }
                if (path.size() > 0) {
                    Collections.reverse(path);
                    TreePath tp = new TreePath(path.toArray());
                    this.expandPath(tp);
                }
            }
        }