Examples of HumanResource


Examples of net.sourceforge.ganttproject.resource.HumanResource

            List resources = resourceManager.getResources();

            // String
            // []function=RoleManager.Access.getInstance().getRoleNames();
            for (int i = 0; i < resources.size(); i++) {
                HumanResource p = (HumanResource) resources.get(i);
                addAttribute("id", p.getId(), attrs);
                startPrefixedElement("resource", attrs, handler);
                addAttribute("id", "0", attrs);
                textElement("name", attrs, p.getName(), handler);
                addAttribute("id", "1", attrs);
                textElement("role", attrs, p.getRole().getName(), handler);
                addAttribute("id", "2", attrs);
                textElement("mail", attrs, p.getMail(), handler);
                addAttribute("id", "3", attrs);
                textElement("phone", attrs, p.getPhone(), handler);

                List/*<CustomProperty>*/ customFields = p.getCustomProperties();
                for (int j=0; j<customFields.size(); j++) {
                  CustomProperty nextProperty = (CustomProperty) customFields.get(j);
                  addAttribute("id", nextProperty.getDefinition().getID(), attrs);
                  String value = nextProperty.getValueAsString();
                  textElement("custom-field", attrs, value, handler);
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.HumanResource

  /** write the resources. */
    private void writeResources(OutputStreamWriter out) throws IOException {
      writeResourceHeaders(out);
        // parse all resources
        for (int i = 0; i < resources.size(); i++) {
            HumanResource p = (HumanResource) resources.get(i);

            // ID
            if (csvOptions.bExportResourceID) {
                writeCell(out, "" + p.getId());
            }
            // Name
            if (csvOptions.bExportResourceName) {
                writeTextCell(out, p.getName());
            }
            // Mail
            if (csvOptions.bExportResourceMail) {
                writeTextCell(out, p.getMail());
            }
            // Phone
            if (csvOptions.bExportResourcePhone) {
                writeTextCell(out,p.getPhone());
            }
            // Role
            if (csvOptions.bExportResourceRole) {
                Role role = p.getRole();
                String sRoleID = role==null ? "0":role.getPersistentID();
                writeTextCell(out, sRoleID);
            }
            List customProps = p.getCustomProperties();
            for (int j=0; j<customProps.size(); j++) {
              CustomProperty nextProperty = (CustomProperty) customProps.get(j);
              writeTextCell(out, nextProperty.getValueAsString());
            }
            out.write("\n");
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.HumanResource

            }
        }

        // parse all resources
        for (int i = 0; i < resources.size(); i++) {
            HumanResource p = (HumanResource) resources.get(i);

            if (csvOptions.bExportResourceID) {
                String s = "" + p.getId();
                if (s.length() > iMaxSize)
                    iMaxSize = s.length();
            }
            if (csvOptions.bExportResourceName) {
                String s = "" + p.getName();
                if (s.length() > iMaxSize)
                    iMaxSize = s.length();
            }
            if (csvOptions.bExportResourceMail) {
                String s = "" + p.getMail();
                if (s.length() > iMaxSize)
                    iMaxSize = s.length();
            }
            if (csvOptions.bExportResourcePhone) {
                String s = "" + p.getPhone();
                if (s.length() > iMaxSize)
                    iMaxSize = s.length();
            }
            if (csvOptions.bExportResourceRole) {
                Role role = p.getRole();
                String sRoleID = "0";
                if (role != null)
                    sRoleID = role.getPersistentID();
                String s = "" + sRoleID;
                if (s.length() > iMaxSize)
                    iMaxSize = s.length();
            }
            List customProps = p.getCustomProperties();
            for (int j=0; j<customProps.size(); j++) {
              CustomProperty nextProperty = (CustomProperty) customProps.get(j);
              if (nextProperty.getValueAsString().length() > iMaxSize) {
                iMaxSize = nextProperty.getValueAsString().length();
              }
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.HumanResource

        final BufferedImage testImage = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
        final Graphics g = testImage.getGraphics();
        final int tabSize = 5;
        final List users = myResourceManager.getResources();
        for (Iterator user = users.iterator(); user.hasNext();) {
            HumanResource hr = (HumanResource) user.next();
            int nameWidth = TextLengthCalculatorImpl.getTextLength(g, hr.getName());
            if (nameWidth > width) {
                width = nameWidth;
            }
            ResourceAssignment[] assignments = hr.getAssignments();
            if (assignments != null) {
                for (int i = 0; i < assignments.length; i++) {
                    if (isAssignmentVisible(assignments[i])) {
                        int taskWidth = tabSize + TextLengthCalculatorImpl.getTextLength(g, assignments[i].getTask()
                                .getName());
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.HumanResource

        final int nameLinePadding = 3;
        final int nameLineHeight = getRowHeight();
        boolean isOddRow = false;
        for (Iterator user = users.iterator(); user.hasNext();) {
            HumanResource hr = (HumanResource) user.next();
            {
                // paint resource name here
                String nameOfRes = hr.toString();
   
                if (isOddRow) {
                    g.setColor(ODD_ROW_COLOR);
                    g.fillRect(0, y, width, nameLineHeight);
                }
                g.setColor(Color.black);
                //
                g.drawRect(0, y, width, nameLineHeight);
               
                g.drawString(nameOfRes, 5, y+nameLineHeight-nameLinePadding);
                g.setColor(BORDER_COLOR_3D);
                g.drawLine(1, y+nameLineHeight-1, width-1, y+nameLineHeight-1);
                y += nameLineHeight;
                isOddRow = !isOddRow;
            }
            {
                //paint assigned task names
                ResourceAssignment[] assignments = hr.getAssignments();
                if (assignments != null) {
                    for (int i = 0; i < assignments.length; i++) {
                        if (isAssignmentVisible(assignments[i])) {
                            if (isOddRow) {
                                g.setColor(ODD_ROW_COLOR);
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.HumanResource

        dialogOptions.show();
        area.repaint();
    }

    public ProjectResource newHumanResource() {
        final HumanResource people = ((HumanResourceManager) getHumanResourceManager())
                .newHumanResource();
        people.setRole(getRoleManager().getDefaultRole());
        GanttDialogPerson dp = new GanttDialogPerson(getUIFacade(), getLanguage(),
                people);
        dp.setVisible(true);
        if (dp.result()) {
View Full Code Here

Examples of net.sourceforge.ganttproject.resource.HumanResource

      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.HumanResource

      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
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.