Package com.projity.grouping.core

Examples of com.projity.grouping.core.Node


    if (openedAlready != null && openedAlready.isOpenedAsSubproject()) {
      Alert.error(Messages.getString("GraphicManager.SelectedProjectAlreadyOpenedAsSubproject")); //$NON-NLS-1$
      return;
    }
    SubProj subprojectTask = project.getSubprojectHandler().createSubProj(subprojectUniqueId);
    Node subprojectNode = getCurrentFrame().addNodeForImpl(subprojectTask,NodeModel.EVENT);
    ProjectFactory.getInstance().openSubproject(project, subprojectNode, true);

    //Undo
    if (undo){
      UndoController undoContoller=project.getUndoController();
View Full Code Here


        return;
    if (nodes.size() > 1) {
      Alert.warn(Messages.getString("Message.onlySelectOneElement"),getContainer()); //$NON-NLS-1$
      return;
    }
    final Node node=(Node)nodes.get(0);
    Object impl=node.getImpl();
    if (impl instanceof Task||(impl instanceof Assignment&&taskType)){
      Task task=(Task)((impl instanceof Assignment)?(((Assignment)impl).getTask()):impl);
      if (taskInformationDialog == null) {
        taskInformationDialog = TaskInformationDialog.getInstance(getFrame(),task, notes);
        taskInformationDialog.pack();
View Full Code Here

  protected Node lastNode=null;
  public void selectionChanged(SelectionNodeEvent e) {
    if (assignResourcesDialog != null)
      assignResourcesDialog.selectionChanged(e);

    Node currentNode=e.getCurrentNode();
    Object currentImpl=currentNode.getImpl();
    setButtonState(currentImpl,currentFrame.getProject());
    // if on resource view, hide task info and vice versa.  Otherwise just show it
    if (lastNode!=null&&taskInformationDialog!=null&&(lastNode.getImpl() instanceof Task||lastNode.getImpl() instanceof Assignment)&&currentNode.getImpl() instanceof Resource){
      taskInformationDialog.setVisible(false);
      doInformationDialog(false);
    } else if (lastNode!=null&&resourceInformationDialog!=null&&lastNode.getImpl() instanceof Resource&&(currentNode.getImpl() instanceof Task||currentNode.getImpl() instanceof Assignment)){
      resourceInformationDialog.setVisible(false);
      doInformationDialog(false);
    }else{
      if (taskInformationDialog != null)
        taskInformationDialog.selectionChanged(e);
View Full Code Here

    }

    public void dump(Collection tasks,String indent){
        if (tasks!=null)
        for (Iterator i=tasks.iterator();i.hasNext();){
            Node node=(Node)i.next();
            Task task=(Task)node.getImpl();
            System.out.println(indent+task.getWbsParentTask()+"->"+task);
            dump(task.getWbsChildrenNodes(),indent+"-");
        }
    }
View Full Code Here

*/
  public void setAllTasksAsUnchangedFromPersisted(boolean justSaved) {
    getTaskOutline().getHierarchy().visitAll(new Closure(){
      int id=1;
      public void execute(Object o) {
        Node node=(Node)o;
        if (node.getImpl() instanceof NormalTask){
          NormalTask task=(NormalTask)node.getImpl();
          task.setDirty(false);
          task.setLastSavedStart(task.getStart()); //
          task.setLastSavedFinish(task.getEnd());
          Iterator j = task.getAssignments().iterator();
          while (j.hasNext())
            ((Assignment)j.next()).setDirty(false);


          j=task.getDependencyList(true).iterator();
          while (j.hasNext())
            ((Dependency)j.next()).setDirty(false);

          Node parent=(Node)node.getParent();
          if (parent==null||parent.isRoot()) task.setLastSavedParentId(-1L);
          else task.setLastSavedParentId(((Task)parent.getImpl()).getUniqueId());
          task.setLastSavedPosistion(parent.getIndex(node));



        }
      }
View Full Code Here

  private class TaskIterator implements Iterator<Task>{
    private Iterator iterator;
    private Task next=null;
    private Task nextElement(){
          Node node=null;
          while(iterator.hasNext() && !((node=(Node)iterator.next()).getImpl() instanceof Task));
          if (node!=null && node.getImpl() instanceof Task) next=(Task)node.getImpl();
          else next=null;
          return next;
    }
View Full Code Here

    return newOne;
  }


  public void setLocalParent(Task child, Task parent) {
    Node childNode = getTaskModel().search(child);
    Node parentNode = parent == null ? null : getTaskModel().search(parent);
    setLocalParent(childNode,parentNode);
  }
View Full Code Here

  public void setLocalParent(Node childNode, Node parentNode) {
    Task child = (Task) childNode.getImpl();
    Task parent = (Task) (parentNode == null ? null : parentNode.getImpl());
    if (child.getWbsParentTask() == parent)
      return;
    Node oldParentNode = getTaskModel().search(child.getWbsParentTask());
    if (oldParentNode != null)
      oldParentNode.getChildren().remove(childNode);
    ArrayList temp = new ArrayList();
    temp.add(childNode);
    getTaskModel().move(parentNode, temp, -1,NodeModel.NORMAL);
    setDefaultRelationship(parentNode,childNode);
  }
View Full Code Here

    setDefaultRelationship(parentNode,childNode);
  }

  public Node createLocalTaskNode(Node parentNode) {
    NormalTask task=new NormalTask(this);
    Node childNode = NodeFactory.getInstance().createNode(task); // get a node for this task
    connectTask(task);
    addToDefaultOutline(parentNode,childNode);
    getSchedulingAlgorithm().addObject(task);
    return childNode;
  }
View Full Code Here


    connectTask(newTask); // put task in project list
    taskOutlines.addToAll(newlyCreated,nodeModel); // update all node models except the one passed in
    Task parentTask = newTask.getWbsParentTask();
    Node parentNode = (parentTask == null) ? null : nodeModel.search(newTask.getWbsParentTask());
    Node childNode =  nodeModel.search(newTask);
    setDefaultRelationship(parentNode,childNode);
    newTask.markTaskAsNeedingRecalculation();
    updateScheduling(this,newlyCreated,ObjectEvent.CREATE);
    //objectEventManager.fireCreateEvent(eventSource,newlyCreated,hierarchyInfo);
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.