Package com.projity.grouping.core

Examples of com.projity.grouping.core.Node


        openprojTask.setOwningProject(project);
        openprojTask.setProjectId(project.getUniqueId());
        converter.to(openprojTask, task, state);
       
        //openproj task node conversion
        Node openprojTaskNode=NodeFactory.getInstance().createNode(openprojTask);
       
        //openproj node hierarchy
        NormalTask openprojParentTask=parentTask==null? null : state.getOpenprojTask(parentTask);
        Node openprojParentTaskNode=openprojParentTask==null? null : state.getOpenprojTaskNode(openprojParentTask);
        project.addToDefaultOutline(openprojParentTaskNode,openprojTaskNode);

       
        state.mapOpenprojTask(task, openprojTask);
        state.mapOpenprojTaskNode(openprojTask, openprojTaskNode);
View Full Code Here


        int row = getCurrentRow();
        if (row == -1)  { // fix for bug when inserting subproject and no selection
          row = 0; // use 0th row if no selection
          addRowSelectionInterval(0, 0);
        }
    Node current = getCurrentRowNode();
    Node newNode = NodeFactory.getInstance().createNode(impl);
        SpreadSheetModel model=(SpreadSheetModel)getModel();
        NodeModel nodeModel = model.getCache().getModel();

    LinkedList previousNodes=model.getPreviousVisibleNodesFromRow(row);
    if (previousNodes==null) previousNodes=new LinkedList();
View Full Code Here

    }

    boolean found = false;
    GraphicNode gnode = null;
    Object obj;
    Node node;
    while (ctx.isForward() ? i.hasNext() : i.hasPrevious()) {
      gnode=(GraphicNode)(ctx.isForward() ? i.next() : i.previous());
      if (gnode.isVoid())
        continue;
      node = gnode.getNode();
      obj = node.getImpl();
      if (ctx.matches(obj)) {
        found = true;
        break;
      }
    }
View Full Code Here

    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

    this.hierarchy=hierarchy;
    this.dataFactory = dataFactory;
  }

  public void addBefore(LinkedList siblings,Node newNode,int actionType){
    Node previous,next,parent;
    boolean firstChild;
    if (siblings.size()==0){
      return;
    }else if (siblings.size()==1){
      previous=null;
      next=(Node)siblings.removeLast();
      parent=null;
      firstChild=true;
    }else{
      previous=(Node)siblings.removeFirst()//no need to clone, list used only here, see CommonSpreadSheetModel
      next=(Node)siblings.removeLast();
      parent=(Node)next.getParent();
      firstChild=(parent==previous);
      if (firstChild) parent=previous;
      else parent=(Node)previous.getParent();
      remove(siblings, NodeModel.SILENT);
    }
    siblings.add(newNode);
    add(parent,siblings,(firstChild)?0:(parent.getIndex(previous)+1),NodeModel.SILENT);
View Full Code Here

    getDataFactory().setGroupDirty(true);
    //TODO need undo here
  }

  public void addBefore(Node sibling,Node newNode,int actionType){
    Node parent=(Node)sibling.getParent();
    add(parent,newNode,parent.getIndex(sibling),actionType);
  }
View Full Code Here

public abstract class ResourceLinker extends Linker {
  public void initIterator(){
    iterator=((Project)getParent()).getResourcePool().getResourceOutline().iterator();
  }
  public Object executeNext(){
        Node  node=(Node)iterator.next();
        if (!(node.getImpl() instanceof ResourceImpl)) {
      return null;
        }
   
      ResourceImpl resource=(ResourceImpl)node.getImpl(); //ResourceImpl to have the EnterpriseResource link
      //if (globalIdsOnly) CommonDataObject.makeGlobal(resource); //modify enterprise resource in fact
      return resource;
  }
View Full Code Here

  public void addBefore(Node sibling,Node newNode,int actionType){
    Node parent=(Node)sibling.getParent();
    add(parent,newNode,parent.getIndex(sibling),actionType);
  }
  public void addBefore(Node sibling,List newNodes,int actionType){
    Node parent=(Node)sibling.getParent();
    add(parent,newNodes,parent.getIndex(sibling),actionType);
  }
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.