Package net.sourceforge.ganttproject.resource

Examples of net.sourceforge.ganttproject.resource.HumanResource$CustomPropertyImpl


            }
        }

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


        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

        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

        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

      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

      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

Related Classes of net.sourceforge.ganttproject.resource.HumanResource$CustomPropertyImpl

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.