Package syn3d.base

Examples of syn3d.base.ActiveNode


  /* (non-Javadoc)
   * @see javax.swing.tree.TreeModel#getChildCount(java.lang.Object)
   */
  public int getChildCount(Object parent) {
      if (!(parent instanceof ActiveNode)) return 0;
      ActiveNode node = (ActiveNode)parent;
      return node.getChildren().size();
  }
View Full Code Here


  /* (non-Javadoc)
   * @see javax.swing.tree.TreeModel#getChild(java.lang.Object, int)
   */
  public Object getChild(Object parent, int index) {
      if (!(parent instanceof ActiveNode)) return null;
      ActiveNode node = (ActiveNode)parent;
      return node.getChildren().get(index);
  }
View Full Code Here

   * @see javax.swing.tree.TreeModel#getIndexOfChild(java.lang.Object, java.lang.Object)
   */
  public int getIndexOfChild(Object parent, Object child) {
      if (!(parent instanceof ActiveNode)) return 0;
      if (!(child instanceof ActiveNode)) return 0;
      ActiveNode node = (ActiveNode)parent;
      return node.getChildren().indexOf(child);
  }
View Full Code Here

     * @see javax.swing.tree.TreeModel#isLeaf(java.lang.Object)
     */
    public boolean isLeaf(Object node) {
      if (!(node instanceof ActiveNode)) return false;
      if (node == rootNode) return false;
      ActiveNode anode = (ActiveNode)node;
        return isLeaf3D(anode.get3DObject());
    }
View Full Code Here

     */
    public ActiveNode pick(int posX, int posY) {

        int s = lastPickSelection.size();
        for (int i=0; i<s; i+=2) {
            ActiveNode node = (ActiveNode)lastPickSelection.get(i);
            node.highlight(false,lastPickSelection.get(i+1));
        }
        lastPickSelection.clear();
        toggleSinglePick(posX,posY);
        if (lastPickSelection.size()>0) return (ActiveNode)lastPickSelection.get(0);
        return null;
View Full Code Here

     * @see ActiveNode.higlight(boolean,Object
     */
    public ActiveNode pick(int posX, int posY) {
        int s = lastPickSelection.size();
        for (int i=0; i<s; i+=2) {
            ActiveNode node = (ActiveNode)lastPickSelection.get(i);
            node.highlight(false,lastPickSelection.get(i+1));
        }
        lastPickSelection.clear();
        toggleSinglePick(posX,posY);
        if (lastPickSelection.size()>0) return (ActiveNode)lastPickSelection.get(0);
        return null;
View Full Code Here

      tree.setVisibleRowCount(7);
      int result = JOptionPane.showConfirmDialog(JSynoptic.gui.getOwner(), new JScrollPane(tree),
          "Select a scene", JOptionPane.OK_CANCEL_OPTION,
          JOptionPane.PLAIN_MESSAGE);
      if (result == JOptionPane.OK_OPTION) {
        ActiveNode sel = tree.getSelectedNode();
        if (sel instanceof SceneNode) {
          node = new SynopticViewNodeXith3d(sel);
          if (node==null) return false;
          node.attach(this)
        }
View Full Code Here

  /** Adds all expanded path under the given tree path to the arraylist, recusrively */
  protected void recursiveExpandedPathFinder(TreePath current, ArrayList expPaths) {
        if (!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

        boolean highlightSave = autoHighlight;
        autoHighlight = false;
       
        TreePath[] paths = e.getPaths();
        for (int i=0; i<paths.length; ++i) {
            ActiveNode node = (ActiveNode)paths[i].getLastPathComponent();
            node.highlight(e.isAddedPath(i), node.get3DObject());
        }
       
        autoHighlight = highlightSave;
    }
View Full Code Here

      }
     
        public void run() {
            SceneGraphModel model = (SceneGraphModel)getModel();
           
            ActiveNode target;
            if (action==NODE_CHANGED) target = node;
            else target = node.getParent();
           
          ActiveNode[] nodePath = model.getPathToRoot(target);
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.