Package syn3d.base

Examples of syn3d.base.ActiveNode


  /** Adds all expanded path under the given tree path to the arraylist, recusrively */
  protected void recursiveExpandedPathFinder(TreePath current, ArrayList expPaths) {
        if (!sceneTree.isExpanded(current)) return;
        expPaths.add(current);
        ActiveNode node = (ActiveNode)current.getLastPathComponent();
      for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
          recursiveExpandedPathFinder(current.pathByAddingChild((ActiveNode)it.next()),expPaths);
      }
       
  }
View Full Code Here


      String cmd = e.getActionCommand();
    if (cmd.equals("delete_node")) {
      Object o = sceneTree.getLastSelectedPathComponent();
      if (o==null) return;
      if (!(o instanceof ActiveNode)) return;
      ActiveNode node = (ActiveNode)o;
      node.remove();
      return;
    }
     
      // Use the following to do something special when the user selects a ChildMenu item
      // The tree already listens to add events, so there is nothing to do here
View Full Code Here

      }
     
      if (dest==null) dest = ((SceneGraphModel)sceneTree.getModel()).getRoot();
     
      if (!(dest instanceof ActiveNode)) return;
      ActiveNode node = (ActiveNode)dest;
     
      JPopupMenu menu = pluginManager.getChildMenu(node, this);
      List actions = node.getActions();
      if ((menu==null) && ((actions==null) || (actions.size()==0)))
          return; // this component does not have any declared potential children, and no actions
      // If there are actions, but no children, new menu
      if (menu==null) menu = new JPopupMenu();
      // Otherwise, add separator if needed
      else if ((actions!=null) && (actions.size()>0)) menu.add(new JPopupMenu.Separator(), 0);
      // Now add actions on top of menu, keeping order
      if (actions!=null)
          for (int i=actions.size()-1; i>=0; --i) {
              Object a = actions.get(i);
              if (a!=null) menu.add(new ActionMenuItem(node, a), 0);
          }
      // Finally popup the result
      menu.show((JComponent)e.getSource(), e.getX(), e.getY());
     
    } else if (e.getClickCount()==2 && (e.getModifiers()&MouseEvent.BUTTON1_MASK)==MouseEvent.BUTTON1_MASK){
     
      Object dest = null;
      TreePath path = sceneTree.getPathForLocation(e.getX(), e.getY());
     
      if (path != null) sceneTree.setSelectionPath(path);
     
      if (sceneTree.getSelectionPath() != null) {
        dest = sceneTree.getSelectionPath().getLastPathComponent();
      }
     
      if (dest==null) dest = ((SceneGraphModel)sceneTree.getModel()).getRoot();
     
      if (!(dest instanceof ActiveNode)) return;
      ActiveNode node = (ActiveNode)dest;
       pluginManager.showProperties(node, this);
    }
   
  }
View Full Code Here

TOP

Related Classes of syn3d.base.ActiveNode

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.