Examples of ResourceNode


Examples of net.sourceforge.ganttproject.resource.ResourceNode

        while (it.hasNext())
            addResource((ProjectResource) it.next());
    }

    public DefaultMutableTreeNode addResource(ProjectResource people) {
        DefaultMutableTreeNode result = new ResourceNode(people);
        insertNodeInto(result, root, root.getChildCount());
        myResourceManager.toString();
        return result;
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

    }

    /** Move Up the selected resource */
    public boolean moveUp(HumanResource resource) {
        myResourceManager.up(resource);
        ResourceNode rn = getNodeForResource(resource);
        int index = root.getIndex(root.getChildBefore(rn));
        removeNodeFromParent(rn);
        insertNodeInto(rn, root, index);
        return true;
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

        return true;
    }

    public boolean moveDown(HumanResource resource) {
        myResourceManager.down(resource);
        ResourceNode rn = getNodeForResource(resource);
        int index = root.getIndex(root.getChildAfter(rn));
        removeNodeFromParent(rn);
        insertNodeInto(rn, root, index);
        return true;
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

    /**
     * @inheritDoc
     */
    public Object getValueAt(Object node, int column) {
        Object res = null;
        ResourceNode rn = null;
        AssignmentNode an = null;

        if (node instanceof ResourceNode)
            rn = (ResourceNode) node;
        else if (node instanceof AssignmentNode)
            an = (AssignmentNode) node;

        boolean hasChild = rn != null;

        switch (column) {
        case 0: // name
            if (hasChild) {
                res = rn.getName();
            } else {
                res = an.getTask().getName();
            }
            break;
        case 1: // def role
            if (hasChild) {
                res = rn.getDefaultRole();
            } else {
                res = "";
            }
            break;
        case 2: // mail
            if (hasChild) {
                res = rn.getEMail();
            } else {
                res = "";
            }
            break;
        case 3: // phone
            if (hasChild) {
                res = rn.getPhone();
            } else {
                res = "";
            }
            break;
        case 4: // assign role
            if (hasChild) {
                res = "";
            } else {
                res = an.getRoleForAssigment();
            }
            break;
        default: // custom column
          if (hasChild) {
            res = rn.getCustomField(this.getColumnName(column));
          }
          else
            res ="";
          break;
        }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

      /* only custom columns are removable */
      return ((HumanResourceManager)myResourceManager).checkCustomField(name);
    }

  public void resourceChanged(ProjectResource resource) {
    ResourceNode node = getNodeForResource(resource);
    if (node==null) {
      return;
    }
    TreeNode parent = node.getParent();
    int index = parent.getIndex(node);
    assert index>=0;
    nodesChanged(parent, new int[] {index});
  }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

    nodesChanged(parent, new int[] {index});
  }

    public void resourceAssignmentsChanged(ProjectResource[] resources) {
        for (int i=0; i<resources.length; i++) {
            ResourceNode nextNode = exists(resources[i]);
            buildAssignmentsSubtree(nextNode);
        }
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

        }
        return dmtnselected;
    }

    public boolean isExpanded(ProjectResource pr) {
        ResourceNode node = ((ResourceTreeTableModel) getTreeTableModel())
                .exists(pr);
        if (node != null)
            return getTreeTable().isExpanded(new TreePath(node.getPath()));
        return false;
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

      if(selectedNodes.length==0) {
        return;
        }
      DefaultMutableTreeNode selectedNode = selectedNodes[0];
        if (selectedNode instanceof ResourceNode) {
            ResourceNode rn = (ResourceNode) selectedNode;
            int index = rn.getParent().getIndex(rn);
            if (index > 0) {
                HumanResource people = (HumanResource)selectedNodes[0].getUserObject();
                ttModel.moveUp(people);
                getTree().setSelectionPath(new TreePath(rn.getPath()));
            }
        }
    }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.ResourceNode

      if(selectedNodes.length==0) {
        return;
        }
      DefaultMutableTreeNode selectedNode = selectedNodes[0];
        if (selectedNode instanceof ResourceNode) {
            ResourceNode rn = (ResourceNode) selectedNode;
            int index = rn.getParent().getIndex(rn);
            if (index < rn.getParent().getChildCount() - 1) {
                HumanResource people = (HumanResource)selectedNodes[0].getUserObject();
                ttModel.moveDown(people);
                getTree().setSelectionPath(new TreePath(rn.getPath()));
            }
        }
    }
View Full Code Here

Examples of org.apache.oodt.cas.resource.structs.ResourceNode

                    .intValue();
        } catch (Exception e) {
            e.printStackTrace();
        }

        ResourceNode resource = new ResourceNode(id, ip, capacity);

        return resource;
    }
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.