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) {
}
}
}
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);
}
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++;
}
}
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;
}
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);
}
Aggregations