Package javax.swing.tree

Examples of javax.swing.tree.TreeModel


     */
    public static DisplayNode getRootNode(final JTree pTree) {
        final ParameterHolder rootNode = new ParameterHolder();
        UIutils.invokeOnGuiThread(new Runnable() {
            public void run() {
                TreeModel aModel = pTree.getModel();
                if (aModel != null) {
                    rootNode.setObject(aModel.getRoot());
                }
            }
        });
        Object anObj = rootNode.getObject();
        if (anObj != null && anObj instanceof DisplayNode) {
View Full Code Here


     */
    public static DisplayNode getRootNode(final JTree pTree) {
        final ParameterHolder rootNode = new ParameterHolder();
        UIutils.invokeOnGuiThread(new Runnable() {
            public void run() {
                TreeModel aModel = pTree.getModel();
                if (aModel != null) {
                    rootNode.setObject(aModel.getRoot());
                }
            }
        });
        Object anObj = rootNode.getObject();
        if (anObj != null && anObj instanceof DisplayNode) {
View Full Code Here

    }

    public void saveProjectPanelStatus()
    {
        selectedPaths.clear();
        TreeModel model = projectPalette1.jTree1.getModel();
        recursionSaveProjectStatus((MyNode) model.getRoot());
    }
View Full Code Here

    backend.addListener(StatusChangeListener.class, this);
    backend.addListener(PreferenceListener.class, this);

    RosterTreeModel model = new RosterTreeModel();
    backend.addListener(RosterListener.class, model);
    TreeModel offlineModel=model;
    TreeModel onlineModel=model;
 
    if (UIManager.getLookAndFeel().isNativeLookAndFeel()) {
      System.out.println("using mac hack");
        onlineModel = new TreeModelFilter(model, new OnlineSelector());
        offlineModel = new TreeModelFilter(model, new OfflineSelector());
View Full Code Here

     */
    public static DisplayNode getRootNode(final JTree pTree) {
        final ParameterHolder rootNode = new ParameterHolder();
        UIutils.invokeOnGuiThread(new Runnable() {
            public void run() {
                TreeModel aModel = pTree.getModel();
                if (aModel != null) {
                    rootNode.setObject(aModel.getRoot());
                }
            }
        });
        Object anObj = rootNode.getObject();
        if (anObj != null && anObj instanceof DisplayNode) {
View Full Code Here

  }

  @RunsInCurrentThread
  TreePath findMatchingPath(JTree tree, String path) {
    String[] pathStrings = splitPath(path);
    TreeModel model = tree.getModel();
    List<Object> newPathValues = new ArrayList<Object>(pathStrings.length + 1);
    Object node = model.getRoot();
    int pathElementCount = pathStrings.length;
    for (int stringIndex = 0; stringIndex < pathElementCount; stringIndex++) {
      String pathString = pathStrings[stringIndex];
      Object match = null;
      if (stringIndex == 0 && tree.isRootVisible()) {
        if (!pathString.equals(value(tree, node))) throw pathNotFound(path);
        newPathValues.add(node);
        continue;
      }
      int childCount = model.getChildCount(node);
      for (int childIndex = 0; childIndex < childCount; childIndex++) {
        Object child = model.getChild(node, childIndex);
        if (pathString.equals(value(tree, child))) {
          if (match != null) throw multipleMatchingNodes(pathString, value(tree, node));
          match = child;
        }
      }
View Full Code Here

        RootNode action = ActionMgr.getAction(comp, RootNode.class);
        if (action != null) {
            return action.getValue();
        }
        if (comp instanceof JTree){
            TreeModel aModel = ((JTree)comp).getModel();
            if (aModel != null) {
                return ((DisplayNode)aModel.getRoot());
            }

        }
        if (comp instanceof ListView){
            return ((ListView)comp).getRootNode();
View Full Code Here

        RootNode action = ActionMgr.getAction(comp, RootNode.class);
        if (action != null) {
            return action.getValue();
        }
        if (comp instanceof JTree){
            TreeModel aModel = ((JTree)comp).getModel();
            if (aModel != null) {
                return ((DisplayNode)aModel.getRoot());
            }

        }
        if (comp instanceof ListView){
            return ((ListView)comp).getRootNode();
View Full Code Here

        RootNode action = ActionMgr.getAction(comp, RootNode.class);
        if (action != null) {
            return action.getValue();
        }
        if (comp instanceof JTree){
            TreeModel aModel = ((JTree)comp).getModel();
            if (aModel != null) {
                return ((DisplayNode)aModel.getRoot());
            }

        }
        if (comp instanceof ListView){
            return ((ListView)comp).getRootNode();
View Full Code Here

    }

    public void saveProjectPanelStatus()
    {
        selectedPaths.clear();
        TreeModel model = projectPalette1.jTree1.getModel();
        recursionSaveProjectStatus((MyNode) model.getRoot());
    }
View Full Code Here

TOP

Related Classes of javax.swing.tree.TreeModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.