Package com.projity.field

Examples of com.projity.field.Field


      HelpUtil.addDocHelp(component,fieldDoc);
    return component;
  }
 
  public JComponent append(DefaultFormBuilder builder, String fieldId, int span) {
    Field field = Configuration.getFieldFromId(fieldId);
    if (field == null)
      return null;
    JComponent component = getComponent(fieldId,0);
    boolean isCheckbox = component instanceof JCheckBox;
    CellConstraints cc = new CellConstraints().xyw(builder.getColumn() + (isCheckbox ? 0 : 2), builder.getRow(), span);
    if (component instanceof JCheckBox) {// checkboxes already have a label to the right
      builder.add(component,cc);
    } else {
      builder.addLabel(getLabel(fieldId)+":");
      builder.nextColumn(2);
      builder.add(component,cc);
      builder.nextColumn(1);
    }
    String fieldDoc = field.getHelp();
    if (fieldDoc != null)
      HelpUtil.addDocHelp(component,fieldDoc);
    return component;
  }
View Full Code Here


          ResourcePool resourcePool=getResourcePool();
          if (resourcePool!=null){
            Collection projects=resourcePool.getProjects();
            if (projects!=null&&projects.size()>0){
              Project project=(Project)projects.iterator().next();
              Field field=FieldDictionary.getInstance().getFieldFromId("Field.accessControlPolicy");
              if (field != null)
                field.setValue(project, project, AccessControlPolicy.RESTRICTED);
            }
          }
        }
      }
      this.role = role;
View Full Code Here

      }
      public void doDoubleClick(int row, int col) {}
      public void doClick(int row, int col) {
        Object obj = getCurrentRowImpl();
        if (obj!= null) {
        Field field = ((SpreadSheetModel)getModel()).getFieldInColumn(col+1);
        if (field == clickField) {
              NormalTask pred = (NormalTask) (predecessor ? ((Dependency)obj).getLeft() : ((Dependency)obj).getRight());
              dlg.setObject(pred);
              dlg.updateAll();
              pred.getDocument().getObjectSelectionEventManager().fire(this,pred);
View Full Code Here

      }
     
    public Component prepareRenderer(TableCellRenderer renderer, int row,
        int column) {
      Component component =  super.prepareRenderer(renderer, row, column);
      Field field = ((SpreadSheetModel)getModel()).getFieldInColumn(column+1);
      if (field == clickField) {
        JLabel l = (JLabel)component;
        l.setText("<html><a href=\"\">" + l.getText() + "</a></html>");
      }
      return component;
View Full Code Here

    // LEGAL: 612x1008
    // BORDERS: 20x30x20x30
   
    Iterator iterator = fields.iterator();
    while(iterator.hasNext()) {
      Field field = (Field)iterator.next();
      width += field.getColumnWidth();
     
    }
    return width;
  }
View Full Code Here

  }
 
  private void addFields(ArrayList fields) throws JRException {
    Iterator iterator = fields.iterator();
    while(iterator.hasNext()) {
      Field field = (Field)iterator.next();
     
      JRDesignField designField = new JRDesignField();
      designField.setName(getFieldName(field, false));
      designField.setValueClass(getFieldClass(field, false));


//      System.out.println("field is " + designField.getName());
      try{ //TOTO try catch is to avoid problems with duplicate field. Find the cause.
        jasperDesign.addField(designField);
 
        if(isAggregable(field)) {
          hasAggregableField = true;
 
          if(field.isDurationOrWork()) {
            // add extra Long field (used for calculations)
            designField = new JRDesignField();
            designField.setName(getFieldName(field, true));
            designField.setValueClass(getFieldClass(field, true));
            jasperDesign.addField(designField);
View Full Code Here

* @throws JRException
*/
  private void addAggregableFields(ArrayList fields, JRDesignGroup group) throws JRException {
    Iterator iterator = fields.iterator();
    while(iterator.hasNext()) {
      Field field = (Field)iterator.next();

      if(isAggregable(field)) {
        String fieldName = getFieldName(field, true);
        JRDesignVariable variable = new JRDesignVariable();
        variable.setName(fieldName + "Sum");
View Full Code Here

   
    // columns in page header
    Iterator iterator = fields.iterator();
    int x = 0;
    while(iterator.hasNext()) {
      Field field = (Field)iterator.next();
      JRDesignStaticText staticText = new JRDesignStaticText();
      staticText.setX(x);
      if(isSub) {
        staticText.setY(20);
      } else {
        staticText.setY(5);
      }
      staticText.setWidth(field.getColumnWidth());
      staticText.setHeight(15);
      staticText.setForecolor(Color.white);
      if(isSub) {
        staticText.setBackcolor(new Color(0x99, 0x99, 0x99));
      } else {
        staticText.setBackcolor(new Color(0x33, 0x33, 0x33));
      }
      staticText.setMode(JRElement.MODE_OPAQUE);
      staticText.setTextAlignment(JRTextElement.TEXT_ALIGN_RIGHT);
      staticText.setFont(boldFont);
      staticText.setText(field.getName());
      band.addElement(staticText);
     
      x += field.getColumnWidth();
    }
   
    return band;
  }
View Full Code Here

      band.setHeight(40);
    } else {
      band.setHeight(15);
    }
    while(iterator.hasNext()) {
      Field field = (Field)iterator.next();
      JRDesignTextField textField = new JRDesignTextField();
      if(null != group) {
        textField.setEvaluationTime(JRDesignExpression.EVALUATION_TIME_GROUP);
        textField.setEvaluationGroup(group);
//        textField.setBackcolor(Color.black);
//        textField.setForecolor(Color.white);
        textField.setY(5);
        textField.setFont(boldFont);
        textField.setHeight(15);
      }
      else {
        textField.setY(0);
        textField.setFont(normalFont);
        textField.setHeight(12);
      }
      textField.setX(x);
      textField.setWidth(field.getColumnWidth());
      textField.setTextAlignment(JRTextElement.TEXT_ALIGN_RIGHT);

      String fieldName = getFieldName(field, false);
      if(field.isMoney()) {
        // Double
        textField.setPattern(getFieldPattern(field));
      }

      JRDesignExpression expression = new JRDesignExpression();
      expression.setValueClass(getFieldClass(field, false));
      expression.setText("$F{" + fieldName + "}");

      textField.setExpression(expression);
      band.addElement(textField);

      x += field.getColumnWidth();
    }
   
    return band;
  }
View Full Code Here

    JRDesignBand band = new JRDesignBand();
    band.setHeight(40);
    Iterator iterator = fields.iterator();
    int x = 0;
    while(iterator.hasNext()) {
      Field field = (Field)iterator.next();
      if(isAggregable(field)) {
        JRDesignLine line = new JRDesignLine();
        line.setX(x);
        line.setY(0);
        line.setWidth(field.getColumnWidth());
        line.setHeight(0);
        band.addElement(line);
        line.setY(2);
        band.addElement(line);

        JRDesignTextField textField = new JRDesignTextField();
        textField.setX(x);
        textField.setY(4);
        textField.setWidth(field.getColumnWidth());
        textField.setHeight(12);
        textField.setTextAlignment(JRTextElement.TEXT_ALIGN_RIGHT);
        textField.setFont(normalFont);
        JRDesignExpression expression = new JRDesignExpression();

       
        // Money (double) or Duration(long)
        if(field.isMoney()) {
          expression.setValueClass(getFieldClass(field, true));
          textField.setPattern(getFieldPattern(field));
          expression.setText("$V{" + getFieldName(field, true) + "Sum}");
        } else if (field.isWork()) {
          expression.setValueClass(String.class);
          expression.setText("com.projity.datatype.DurationFormat.formatWork($V{" + getFieldName(field, true) + "Sum})" );
        } else if(field.isDuration()) {
          expression.setValueClass(String.class);
          expression.setText("com.projity.datatype.DurationFormat.format($V{" + getFieldName(field, true) + "Sum})" );
        }

        textField.setExpression(expression);
        band.addElement(textField);
      }

      x += field.getColumnWidth();
    }

    return band;

  }
View Full Code Here

TOP

Related Classes of com.projity.field.Field

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.