Search in sources :

Example 6 with TeamMember

use of teamdash.team.TeamMember in project processdash by dtuma.

the class ProjectHistoryBridgedAbstract method loadIdentityInfo.

protected void loadIdentityInfo(ManifestEntry teamList) {
    if (teamList != null) {
        try {
            if (identities == null)
                identities = new HashMap<String, String>();
            Element xml = parseXml(teamList.getStream());
            TeamMemberList team = new TeamMemberList(xml);
            for (TeamMember indiv : team.getTeamMembers()) {
                String infoStr = indiv.getServerIdentityInfo();
                Map info = HTMLUtils.parseQuery(infoStr);
                String username = (String) info.get("username");
                if (StringUtils.hasValue(username))
                    identities.put(username, indiv.getName());
            }
        } catch (Exception e) {
        }
    }
}
Also used : TeamMemberList(teamdash.team.TeamMemberList) HashMap(java.util.HashMap) Element(org.w3c.dom.Element) HashMap(java.util.HashMap) Map(java.util.Map) TeamMember(teamdash.team.TeamMember) ParseException(java.text.ParseException) IOException(java.io.IOException) SAXException(org.xml.sax.SAXException)

Example 7 with TeamMember

use of teamdash.team.TeamMember in project processdash by dtuma.

the class TeamProjectBottomUp method addTeamMember.

private void addTeamMember(TeamMemberList newTeam, String shortName, TeamProject subproject, double totalSubprojectTime) {
    // create a new row in the team list, and set the name/initials.
    newTeam.maybeAddEmptyRow();
    int pos = newTeam.getRowCount() - 1;
    newTeam.setValueAt(shortName, pos, TeamMemberList.NAME_COLUMN);
    newTeam.setValueAt(shortName, pos, TeamMemberList.INITIALS_COLUMN);
    // retrieve the newly added pseudo-team-member. (Note that we couldn't
    // do this until the name was set above, because the getTeamMembers()
    // method only returns nonempty individuals.)
    TeamMember newMember = (TeamMember) newTeam.getTeamMembers().get(pos);
    // find out when the subteam is starting, and set that as the start
    // date for our new pseudo-team-member.
    TeamMemberList subTeam = subproject.getTeamMemberList();
    Date subteamStartDate = subTeam.getDateForEffort(0);
    newMember.setStartDate(subteamStartDate);
    // now, find out when the subteam plans to finish.  Then, create an
    // artificial schedule that causes our pseudo-team-member's to finish
    // on that date.
    long teamEndTime = subteamStartDate.getTime();
    for (Iterator i = subTeam.getTeamMembers().iterator(); i.hasNext(); ) {
        TeamMember m = (TeamMember) i.next();
        double memberTime = sumUpTime(subproject.getWBS(), m.getInitials());
        Date memberEndDate = m.getSchedule().getDateForEffort(memberTime);
        if (memberEndDate != null)
            teamEndTime = Math.max(teamEndTime, memberEndDate.getTime());
    }
    Date teamEndDate = new Date(teamEndTime);
    double teamDuration = newMember.getSchedule().dateToDoubleWeekValue(teamEndDate) - newMember.getSchedule().getStartWeek();
    newMember.getSchedule().setHoursPerWeek(totalSubprojectTime / teamDuration);
}
Also used : TeamMemberList(teamdash.team.TeamMemberList) Iterator(java.util.Iterator) TeamMember(teamdash.team.TeamMember) Date(java.util.Date)

Example 8 with TeamMember

use of teamdash.team.TeamMember in project processdash by dtuma.

the class TeamTimePanel method rebuildPanelContents.

private void rebuildPanelContents() {
    // remove all components from this container.
    removeAll();
    teamMemberBars.clear();
    labelFont = null;
    // create the indicator for the balanced team duration. It is
    // added to the container first, so it will display on top of
    // other components.
    balancedBar = new JPanel();
    balancedBar.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
    balancedBar.setBackground(Color.darkGray);
    add(balancedBar);
    // give the balanced bar a max/min/pref size of 0,0 so it will
    // not influence panel layout.
    Dimension d = new Dimension(0, 0);
    balancedBar.setMaximumSize(d);
    balancedBar.setMinimumSize(d);
    balancedBar.setPreferredSize(d);
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 3;
    c.gridy = 0;
    layout.setConstraints(balancedBar, c);
    // create and add the panel displaying milestone commit dates.
    commitDatePane = new CommitDatePane();
    add(commitDatePane);
    c = new GridBagConstraints();
    c.gridx = 2;
    c.gridy = 0;
    c.fill = GridBagConstraints.BOTH;
    c.insets.left = c.insets.right = 0;
    c.insets.top = c.insets.bottom = 0;
    c.weightx = c.weighty = 1;
    layout.setConstraints(commitDatePane, c);
    teamEffectiveDate = (Date) dataModel.getWBSModel().getRoot().getAttribute(WBSSynchronizer.EFFECTIVE_DATE_ATTR);
    if (teamEffectiveDate == null)
        teamEffectiveDate = A_LONG_TIME_AGO;
    historicalTeamMemberCollateralTime = 0;
    List teamMembers = teamList.getTeamMembers();
    // create a constraints object for the name labels.
    GridBagConstraints nc = new GridBagConstraints();
    nc.gridx = 0;
    nc.anchor = GridBagConstraints.WEST;
    nc.fill = GridBagConstraints.BOTH;
    nc.insets.left = COLORED_BAR_SIDE_INSET;
    nc.insets.right = 0;
    nc.insets.top = nc.insets.bottom = 0;
    // create a constraints object for hours per week
    GridBagConstraints hc = new GridBagConstraints();
    hc.gridx = 1;
    hc.anchor = GridBagConstraints.CENTER;
    hc.fill = GridBagConstraints.BOTH;
    hc.insets.left = hc.insets.right = 0;
    hc.insets.top = hc.insets.bottom = 0;
    // create a constraints object for the horizontal bars.
    GridBagConstraints bc = new GridBagConstraints();
    bc.gridx = 2;
    bc.fill = GridBagConstraints.BOTH;
    bc.insets.left = 0;
    bc.insets.right = COLORED_BAR_SIDE_INSET;
    bc.insets.top = bc.insets.bottom = 0;
    bc.weightx = bc.weighty = 1;
    int row = 1;
    // create a horizontal bar to show balanced team milestone dates
    teamMilestoneBar = new TeamMilestoneBar();
    teamMemberBars.add(teamMilestoneBar);
    // create horizontal progress bars for each team member
    for (int i = 0; i < teamMembers.size(); i++) {
        TeamMember m = (TeamMember) teamMembers.get(i);
        // included, do not create a bar for them.
        if (subteamFilter != null && !subteamFilter.contains(m.getId()))
            continue;
        // this individual.
        if (showRemainingWork) {
            Date endDate = m.getSchedule().getEndDate();
            if (endDate != null && endDate.before(teamEffectiveDate)) {
                historicalTeamMemberCollateralTime += m.getSchedule().getEffortForDate(teamEffectiveDate);
                continue;
            }
        }
        TeamMemberBar bar = new TeamMemberBar(m);
        teamMemberBars.add(bar);
        teamMilestoneBar.effectivePastHours += bar.effectivePastHours;
    }
    teamMilestoneBar.effectivePastHours += historicalTeamMemberCollateralTime;
    // add all horizontal bars to our panel.
    boolean onlyOneVisiblePerson = teamMemberBars.size() == 2;
    for (TeamMemberBar bar : teamMemberBars) {
        // possibly skip over this row if requested
        if (bar instanceof TeamMilestoneBar) {
            if (!showBalancedBar || onlyOneVisiblePerson)
                continue;
        } else {
            if (!showTeamMemberBars)
                continue;
        }
        JLabel name = bar.getNameLabel();
        nc.gridy = row;
        add(name);
        layout.setConstraints(name, nc);
        if (isShowHoursPerWeek()) {
            JLabel hours = bar.getHoursPerWeekLabel();
            hc.gridy = row;
            add(hours);
            layout.setConstraints(hours, hc);
        }
        bc.gridy = row;
        add(bar);
        layout.setConstraints(bar, bc);
        row++;
    }
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) JLabel(javax.swing.JLabel) TeamMemberList(teamdash.team.TeamMemberList) List(java.util.List) ArrayList(java.util.ArrayList) Dimension(java.awt.Dimension) Paint(java.awt.Paint) GradientPaint(java.awt.GradientPaint) TeamMember(teamdash.team.TeamMember) Date(java.util.Date)

Example 9 with TeamMember

use of teamdash.team.TeamMember in project processdash by dtuma.

the class WBSSynchronizer method finalizeDatasetIdMappings.

private Map<Integer, String> finalizeDatasetIdMappings(Map<String, String> initialsMap) {
    Map<Integer, String> result = new HashMap<Integer, String>();
    for (TeamMember m : teamProject.getTeamMemberList().getTeamMembers()) {
        String initials = m.getInitials().toLowerCase();
        String datasetId = initialsMap.get(initials);
        if (datasetId != null)
            result.put(m.getId(), datasetId);
    }
    return result;
}
Also used : HashMap(java.util.HashMap) TeamMember(teamdash.team.TeamMember)

Example 10 with TeamMember

use of teamdash.team.TeamMember in project processdash by dtuma.

the class WBSSynchronizer method addTeamMember.

private void addTeamMember(TeamMemberList team, String initials, String username, String fullName) {
    team.maybeAddEmptyRow();
    TeamMember m = team.get(team.getRowCount() - 1);
    m.setName(fullName);
    m.setInitials(initials);
    if (XMLUtils.hasValue(username))
        m.setServerIdentityInfo("searchType=username&search=" + username + "&username=" + username);
}
Also used : TeamMember(teamdash.team.TeamMember)

Aggregations

TeamMember (teamdash.team.TeamMember)11 TeamMemberList (teamdash.team.TeamMemberList)6 Iterator (java.util.Iterator)4 List (java.util.List)4 ArrayList (java.util.ArrayList)3 Date (java.util.Date)3 HashMap (java.util.HashMap)3 Element (org.w3c.dom.Element)2 Dimension (java.awt.Dimension)1 GradientPaint (java.awt.GradientPaint)1 GridBagConstraints (java.awt.GridBagConstraints)1 Paint (java.awt.Paint)1 File (java.io.File)1 IOException (java.io.IOException)1 ParseException (java.text.ParseException)1 LinkedList (java.util.LinkedList)1 Map (java.util.Map)1 ButtonGroup (javax.swing.ButtonGroup)1 JLabel (javax.swing.JLabel)1 JMenu (javax.swing.JMenu)1