Examples of TreeNode


Examples of org.jbox2d.collision.broadphase.TreeNode

    m_nodeCapacity = 16;
    m_nodes = new TreeNode[16];

    // Build a linked list for the free list.
    for (int i = 0; i < m_nodeCapacity; i++) {
      m_nodes[i] = new TreeNode();
      m_nodes[i].parent = i + 1;
      m_nodes[i].height = -1;
    }
    m_nodes[m_nodeCapacity - 1].parent = TreeNode.NULL_NODE;
    m_freeList = 0;
View Full Code Here

Examples of org.jwall.web.policy.TreeNode

       
    }
   
    public static String getPath( TreeNode res ){
        TreeNode cur = res;
        StringBuffer s = new StringBuffer();
       
        while( cur != null ){
            if( cur.getName().startsWith( "/" ) || ( s.length() > 0 && s.charAt( 0 ) == '/' ) )
                s.insert( 0, cur.getName() );
            else
                s.insert( 0, "/" + cur.getName() );

            cur = cur.getParent();
        }
       
        String p = s.toString();
       
        while( p.indexOf("//") >= 0 )
View Full Code Here

Examples of org.olat.core.gui.components.tree.TreeNode

  @Override
  protected void event(UserRequest ureq, Component source, Event event) {
    if (source == olatMenuTree) {
      if (event.getCommand().equals(MenuTree.COMMAND_TREENODE_CLICKED)) {
        // process menu commands
        TreeNode selTreeNode = olatMenuTree.getSelectedNode();
        // cleanup old content controller (never null)
        removeAsListenerAndDispose(contentCtr);
       
        // create new content controller
        // Following cases:
        // 1a) Simple Action Extension using only ureq and windowControl -> handled by default implementation of createController
        // 1b) Specialised Action Extension which needs some more internals -> handled by the class extending GenericMainController, by overwriting createController
        // 2)  uobject is something special which needs evaluation by class extending GenericMainController
        Object uobject = selTreeNode.getUserObject();
        contentCtr = getContentCtr(uobject, ureq);
        listenTo(contentCtr);
        Component resComp = contentCtr.getInitialComponent();
        content.setContent(resComp);
      } else { // the action was not allowed anymore
View Full Code Here

Examples of org.olat.core.gui.components.tree.TreeNode

   */
  public static TreeNode findNodeByUserObject(Object userObject, TreeNode node) {
    if (node.getUserObject().equals(userObject)) return node;
    int childcnt = node.getChildCount();
    for (int i = 0; i < childcnt; i++) {
      TreeNode child = (TreeNode) node.getChildAt(i);
      TreeNode result = findNodeByUserObject(userObject, child);
      if (result != null) return result;
    }
    return null;
  }
View Full Code Here

Examples of org.olat.core.gui.components.tree.TreeNode

  }

  public static TreeNode resolveTreeNode(String treePath, TreeModel treeModel) {
    // even for the root node, our parameter may not be the empty string, therefore the prefix to be chopped here
    treePath =  treePath.substring(1);
    TreeNode cur = treeModel.getRootNode();
    if (!treePath.equals("")) { // if we are not the root node       
      String[] res = treePath.split("_");
      for (int i = res.length -1; i >= 0; i--) {
        String spos = res[i];
        Integer chdPos = Integer.parseInt(spos);
        TreeNode chd = (TreeNode) cur.getChildAt(chdPos);
        if (chd == null) throw new AssertException("cannot find: "+treePath);
        cur = chd;
      }
    }
    return cur;
View Full Code Here

Examples of org.olat.core.gui.components.tree.TreeNode

    // if in load performance mode -> generate the treeposition and include it as param,
    // since the nodeid itself is random and thus not replayable
    StringBuilder conPath = new StringBuilder();
    // we need at least one char in the var, even if we click the root node
    conPath.append('_');
    TreeNode cur = node;
    TreeNode par = (TreeNode) cur.getParent();
    while (par != null) {
      int cpos = cur.getPosition();
      conPath.append(cpos).append('_');
      cur = par;
      par = (TreeNode) cur.getParent();
View Full Code Here

Examples of org.olat.core.gui.components.tree.TreeNode

    //add node
    outNodeList.add(node);
    int childcnt = node.getChildCount();
    for (int i = 0; i < childcnt; i++) {
      //add all subnodes.
      TreeNode child = (TreeNode) node.getChildAt(i);
      makeTreeFlat(child, outNodeList);
    }
  }
View Full Code Here

Examples of org.olat.core.gui.components.tree.TreeNode

    TreeHelper.makeTreeFlat(treemodel.getRootNode(), flatModel);
    keys = new String[flatModel.size()];
    values = new String[keys.length];
    int i = 0;
    for (Iterator iterator = flatModel.iterator(); iterator.hasNext();) {
      TreeNode treeNode = (TreeNode) iterator.next();
      keys[i] = treeNode.getIdent();
      values[i] = treeNode.getTitle();
      i++;
    }
    component = new SelectionTreeComponent(name, getTranslator(), this, treemodel);
  }
View Full Code Here

Examples of org.olat.core.gui.components.tree.TreeNode

    }
    // keys,values initialized
    // create and add radio elements
    Map<String, Component> checkboxitems = new HashMap<String, Component>();
    for (int i = 0; i < keys.length; i++) {
      TreeNode tn = treemodel.getNodeById(keys[i]);
      if(selectableFilter.accept(tn)){
        CheckboxElementComponent ssec = new CheckboxElementComponent(getName()+"_"+keys[i], translator, this, i, null);
        checkboxitems.put(keys[i], ssec);
      }else{
        StaticTextElement ste = new StaticTextElementImpl(keys[i], tn.getTitle());
        ste.setRootForm(this.getRootForm());
        checkboxitems.put(keys[i], new StaticTextElementComponent(ste));
      }
    }
    component.setComponents(checkboxitems);
View Full Code Here

Examples of org.olat.core.gui.components.tree.TreeNode

      iframectr.getInitialComponent().setVisible(false);
      getWindowControl().setInfo(translate("scorm.course.completed"));
     
    } else {
      scormAdapter.olatLaunchSahs(bootId);
      TreeNode bootnode = treeModel.getNodeByScormItemId(bootId);

      iframectr.setCurrentURI((String) bootnode.getUserObject());
      menuTree.setSelectedNodeId(bootnode.getIdent());
     
      updateNextPreviousButtons(bootId);
    }
   
    myContent.put("contentpackage", iframectr.getInitialComponent());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.