Package net.sourceforge.ganttproject.resource

Examples of net.sourceforge.ganttproject.resource.AssignmentNode


    private void handlePopupTrigger(MouseEvent e) {
        if (e.isPopupTrigger() || e.getButton()==MouseEvent.BUTTON3) {
          DefaultMutableTreeNode[] selectedNodes = table.getSelectedNodes();
          if (selectedNodes.length==1 && selectedNodes[0] instanceof AssignmentNode) {
            AssignmentNode assignmentNode = (AssignmentNode) selectedNodes[0];
            Mediator.getTaskSelectionManager().clear();
            Mediator.getTaskSelectionManager().addTask(assignmentNode.getTask());
            Point popupPoint = getPopupMenuPoint(e);
            getUIFacade().showPopupMenu(this, new Action[] {getTaskPropertiesAction(), myDeleteAssignmentAction}, popupPoint.x, popupPoint.y);
          }
          else {
            createPopupMenu(e);
View Full Code Here


            chartWidth = getWidth();
        }

        ResourceTreeImageGenerator resourceTreeGenerator = new ResourceTreeImageGenerator(getHumanResourceManager()) {
            protected boolean isAssignmentVisible(ResourceAssignment assignment) {
                AssignmentNode an = appli.getResourcePanel()
                        .getResourceTreeTableModel().getNodeForAssigment(assignment);
                return appli.getResourcePanel().getResourceTreeTable().isVisible(an);
            }
            protected int getRowHeight() {
              return ResourceLoadGraphicArea.this.getRowHeight();
View Full Code Here

        }
        return res;
    }

    public AssignmentNode getNodeForAssigment(ResourceAssignment assignement) {
        AssignmentNode res = null;
        Enumeration childs = getNodeForResource(assignement.getResource())
                .children();
        while (childs.hasMoreElements() && res == null) {
            AssignmentNode an = (AssignmentNode) childs.nextElement();
            if (assignement.equals(an.getUserObject()))
                res = an;
        }
        return res;
    }
View Full Code Here

        }
        return res;
    }

    private AssignmentNode exists(ResourceNode rn, ResourceAssignment ra) {
        AssignmentNode res = null;
        Enumeration en = rn.children();
        while (res == null && en.hasMoreElements()) {
            AssignmentNode an = (AssignmentNode) en.nextElement();
            if (an.getUserObject().equals(ra))
                res = an;
        }
        return res;
    }
View Full Code Here

     * @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));
View Full Code Here

        int[] indices = new int[assignments.length];
        TreeNode[] children = new TreeNode[assignments.length];
        if (assignments.length>0) {
            for (int i = 0; i < assignments.length; i++) {
                indices[i] = i;
                AssignmentNode an = new AssignmentNode(assignments[i]);
                children[i] = an;
                resourceNode.add(an);
            }
        }
        fireTreeStructureChanged(this, resourceNode.getPath(), indices, children);
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.resource.AssignmentNode

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.