Package com.projity.pm.assignment

Examples of com.projity.pm.assignment.AssignmentEntry


      else
        return null;
    }
     
    public void setValueAt(Object aValue, int row, int column) {
      AssignmentEntry entry = getEntryInRow(row);
      if (entry == null)
        return;
     
      if (!entry.isAssigned()) { // assign it first, then set value
        if (resourceAssigner != null) {
          Field field = ((SpreadSheetModel)getModel()).getFieldInColumn(column+1);
          double units = 1.0;
          if (field == AssignmentEntry.getRateField()) {
            units = ((Rate)aValue).getValue();
          }
          resourceAssigner.assign((Resource)entry.getResource(), units);
        }
      }
      super.setValueAt(aValue,row,column);
    }
View Full Code Here


* @return
*/     List getSelectedResources(boolean assignedOnly){
       List list = NodeList.nodeListToImplList(getSelectedNodes());
       ArrayList resourceList = new ArrayList();
      Iterator i = list.iterator();
      AssignmentEntry entry;
      while (i.hasNext()) {
        entry = (AssignmentEntry)i.next();
        if (!assignedOnly || entry.isAssigned()) // see if should add.
          resourceList.add(entry.getResource());
      }
      return resourceList;
     }
View Full Code Here

      }
      return resourceList;
     }
     public TableCellEditor getCellEditor(int row, int column) {
       TableCellEditor editor = null;
      AssignmentEntry entry = getEntryInRow(row);
     
      if (entry != null) {
        Field field = ((SpreadSheetModel)getModel()).getFieldInColumn(column+1);
        if (field == AssignmentEntry.getRateField()) {
          if (entry.getTimeUnitLabel() != null) {
            boolean labor = ((AssignmentEntry)entry).getResource().isLabor();
            editor = new RateEditor(entry.getTimeUnitLabel(),field.isMoney(),labor && field.isPercent(),labor);
          }
        }
      }
      if (editor == null)
        editor =  super.getCellEditor(row, column);
View Full Code Here

      return editor;
    }
    
    public TableCellRenderer getCellRenderer(int row, int column) {
      TableCellRenderer renderer = null;
      AssignmentEntry entry = getEntryInRow(row);
     
      if (entry != null) {
        Field field = ((SpreadSheetModel)getModel()).getFieldInColumn(column+1);
        if (field == AssignmentEntry.getRateField()) {
          if (entry.getTimeUnitLabel() != null) {
            renderer = new RateRenderer();
          }
        }
      }
      if (renderer == null)
View Full Code Here

     * @see javax.swing.JTable#prepareRenderer(javax.swing.table.TableCellRenderer, int, int)
     */
    public Component prepareRenderer(TableCellRenderer renderer, int row,
        int column) {
      Component component =  super.prepareRenderer(renderer, row, column);
      AssignmentEntry entry = getEntryInRow(row);
      component.setForeground(Colors.BLACK);
     
      if (entry != null) {
        if (entry.isAssigned()) {
          if (taskList.size() == entry.getAssignmentCount()) { // if all selected tasks are assigned to this resource, show it green
            //if (column == 0)
              component.setBackground(Colors.PALE_GREEN);           
          } else {
            //if (column == 0)
              component.setBackground(Colors.PALE_YELLOW);
View Full Code Here

  // A transformer to create new elements from Resources
  public class NodeFactoryTransformer implements Transformer{
    public Object transform(Object impl) {
        if (impl instanceof HasAssignments){
            HasAssignments hasAssignments = (HasAssignments) impl;
            return new AssignmentEntry(hasAssignments, null,project);
        }
        return null;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.commons.collections.Closure#execute(java.lang.Object)
     */
    public void execute(Object arg0) {
      AssignmentEntry entry = (AssignmentEntry)(((Node)arg0).getImpl());
      entry.setAssignmentsFromTaskList(taskList);
    }
View Full Code Here

TOP

Related Classes of com.projity.pm.assignment.AssignmentEntry

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.