Package com.projity.grouping.core

Examples of com.projity.grouping.core.Node


            current=(Node)children.get(children.size()-1);
        }
        return current;
    }
    private Node searchLast(int level){
        Node current=null;
        for (int l=0;!isLeaf(current)&&l<level;l++){
            List children=(List)getChildren(current);
            current=(Node)children.get(children.size()-1);
        }
        return current;
View Full Code Here


      Collection children = getChildren(node);
      if (children == null)
        return null;
      Iterator i = children.iterator();
      while (i.hasNext()) {
        Node found = search((Node)i.next(),key,c);
        if (found != null)
          return found;
      }
      return null;
    }
View Full Code Here

  /* (non-Javadoc)
   * @see javax.swing.tree.TreeModel#valueForPathChanged(javax.swing.tree.TreePath, java.lang.Object)
   */
  public void valueForPathChanged(TreePath path, Object newValue) {
      Node aNode = (Node)path.getLastPathComponent();
      //TODO do we need to treat this?
  }
View Full Code Here

      Node aNode = (Node)path.getLastPathComponent();
      //TODO do we need to treat this?
  }

  protected boolean checkSubprojectEndVoidNodes(Node parent,List inserted){
    Node node;
    int count=0;
    boolean found=false;
    for (Enumeration e=parent.children();e.hasMoreElements();){
      node=(Node)e.nextElement();
      if (checkSubprojectEndVoidNodes(node,inserted)) found=true;
        if (NodeModelUtil.nodeIsSubproject(parent)) {
        if (node.isVoid()) count++;
        else count=0;
      }
    }
    if (NodeModelUtil.nodeIsSubproject(parent)){
      int nbEndVoids=nbMultiprojectEndVoidNodes;
View Full Code Here

    if (!subproject) checkSubprojectEndVoidNodes(root,inserted);
    int nbEndVoids=subproject?nbMultiprojectEndVoidNodes:nbEndVoidNodes;
    //int nbEndVoids=nbEndVoidNodes;
    int count=0;
    Node node;
    for (ListIterator i=root.childrenIterator(root.getChildCount());i.hasPrevious();){
      node=(Node)i.previous();
      if (node.isVoid()) count++;
      else break;
    }
    if (count<nbEndVoids){

      for (int i=0;i<nbEndVoids-count;i++){
        node=NodeFactory.getInstance().createVoidNode();
        root.add(node);
        inserted.add(node);
      }
    } else if (count > nbEndVoids) { // remove void nodes if they shouldt be there
      int removeCount = count -  nbEndVoids;
      for (ListIterator i=root.childrenIterator(root.getChildCount());i.hasPrevious();){
        node=(Node)i.previous();
        if (node.isVoid()) {
          i.remove();
          removeCount--;
          if (removeCount == 0)
            break;
        } else {
View Full Code Here

    super(closure);
    this.parentsOnlyIfProject = parentsOnlyIfProject;
  }

  public void execute(Object arg0) {
    Node node = (Node) arg0;
    Collection nodeList = nodeModel.getChildren(node);
    closure.execute(node);
   
    if (nodeList != null && (!parentsOnlyIfProject  || !(node.getImpl() instanceof Project)))
      CollectionUtils.forAllDo(nodeList, this);
  }
View Full Code Here

  public ShallowChildWalker(SummaryVisitor visitor) {
    super(visitor);
  }
 
  public void execute(Object arg0) {
    Node node = (Node)arg0;
    Collection nodeList = nodeModel.getChildren(node);
    if (nodeList != null)
      CollectionUtils.forAllDo(nodeList, visitor);
  }
View Full Code Here

      selectedFormats.add(format);
    }
  }
 
  void selectFormats(GraphicNode gnode){
    Node node=gnode.getNode();
    Object ganttableObject =node.getImpl();
    selectionFunctor.initialize(); // functor is recycled
    params.getBarStyles().apply(ganttableObject,selectionFunctor); // functional call.  See functor above
  }
View Full Code Here

  public TestFilter() {
    super();
  }

  public boolean evaluate(Object obj) {
    Node node=(Node)obj;
    return true;//model.isSummary((Node)obj);
  }
View Full Code Here

import com.projity.grouping.core.Node;

public class HierarchyUtils {

    public static void extractParents(Collection nodes,Collection parentNodes){
        Node node,parent,current;
        for (Iterator i=nodes.iterator();i.hasNext();){
          node=(Node)i.next();
          current=node;
          parent=null;
          if (current.getParent()==null&&!parentNodes.contains(node)) parentNodes.add(node);
View Full Code Here

TOP

Related Classes of com.projity.grouping.core.Node

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.