Package com.projity.graphic.configuration

Examples of com.projity.graphic.configuration.SpreadSheetFieldArray$Workspace


        cache.removeNodeModelListener(this);
    }
          
        DataSource dataSource;

        SpreadSheetFieldArray fa = null;
        if (fieldArray != null) {
          fa =(SpreadSheetFieldArray) fieldArray.clone();
          CollectionUtils.filter(fa,new Predicate() {
            public boolean evaluate(Object arg0) {
              return !((Field)arg0).isGraphical(); // get rid of fields that can't be shown
View Full Code Here


      ReportDefinition def = ReportUtil.getFromName(ws.reportName);
      if (def != null)
        reportChoice.setSelectedItem(def);
    }
    if (ws.fieldArrayName != null) {
      SpreadSheetFieldArray s = (SpreadSheetFieldArray) Dictionary.get(reportDefinition.getMainSpreadsheetCategory(),ws.fieldArrayName);
      if (s != null)
        columnsChoice.setSelectedItem(s);
    }
  }
View Full Code Here

    ArrayList columnsList = (ArrayList) reportDefinition.getColumnsList();

    ReportColumns columns;
    if(columnsList.size() == 1) {
      // simple flat report
      SpreadSheetFieldArray fields;
      if (fieldArray != null)
        fields =  fieldArray;
      else {
        columns = (ReportColumns)columnsList.get(0);
        fields = columns.getFieldArray();
     
      addFields(fields);
     
      if(hasAggregableField) {
        addAggregableFields(fields,null);
      }
     
      jasperDesign.setPageHeader(getFieldsHeader(fields, false));
     
      jasperDesign.setDetail(getDetail(fields, null));
     
      addPageFooter();
     
      // last page footer (if any)
      if(hasAggregableField) {
        addLastPageFooter(fields);
      }
     
//      int neededW = neededWidth(fields);
//      System.out.println("Needed width is " + neededW);
//      System.out.println("columns number is " + fields.size());
    } else if(columnsList.size() == 2) {
      // reports & subreports
      columns = (ReportColumns)columnsList.get(0);
      String groupByField = columns.getGroupbyField();
      SpreadSheetFieldArray mainFields = columns.getFieldArray();
      columns = (ReportColumns)columnsList.get(1);
      SpreadSheetFieldArray detailFields;
      if (fieldArray != null)
        detailFields = fieldArray;
      else
        detailFields = columns.getFieldArray();
     
View Full Code Here

    SVGRenderer renderer;
    NodeModelCache cache;
    if (view instanceof GanttView){
      renderer=new GanttSVGRenderer();
      SpreadSheet sp=frame.getActiveSpreadSheet();
      SpreadSheetFieldArray fieldArray=sp.getFieldArrayWithWidths(null);
      List<Integer> colWidth=null;
//      if (sp!=null){
//        fieldArray=(SpreadSheetFieldArray)sp.getFieldArray();
//        colWidth=getColWidth(sp, fieldArray);
//      }
      cache=NodeModelCacheFactory.getInstance().createFilteredCache((ReferenceNodeModelCache)frame.getReferenceCache(true),"OfflineGantt",null);
      ((GanttSVGRenderer)renderer).init(frame.getProject(),cache,fieldArray,colWidth,frame.getScale(),true);
      renderer.getParams().setSupportLeftAndRightParts(true);
    }else if (view instanceof ResourceView){
      renderer=new GanttSVGRenderer();
      SpreadSheet sp=frame.getActiveSpreadSheet();
      SpreadSheetFieldArray fieldArray=sp.getFieldArrayWithWidths(null);
      List<Integer> colWidth=null;
//      if (sp!=null){
//        fieldArray=(SpreadSheetFieldArray)sp.getFieldArray();
//        colWidth=getColWidth(sp, fieldArray);
//      }
      cache=NodeModelCacheFactory.getInstance().createFilteredCache((ReferenceNodeModelCache)frame.getReferenceCache(false),"OfflineResources",null);
      ((GanttSVGRenderer)renderer).init(frame.getProject(),cache,fieldArray,colWidth,frame.getScale(),false);
    }else if (view instanceof ProjectView){
      renderer=new GanttSVGRenderer();
      SpreadSheet sp=frame.getActiveSpreadSheet();
      SpreadSheetFieldArray fieldArray=sp.getFieldArrayWithWidths(null);
      List<Integer> colWidth=null;
//      if (sp!=null){
//        fieldArray=(SpreadSheetFieldArray)sp.getFieldArray();
//        colWidth=getColWidth(sp, fieldArray);
//      }
View Full Code Here

  protected GanttRenderer ganttRenderer;
  protected SpreadSheetRenderer spreadSheetRenderer;
  protected FooterRenderer footerRenderer;
  protected Project project;
  public void init(Project project, ReferenceNodeModelCache refCache) {
    SpreadSheetFieldArray fieldArray=null;
    PrintSettings printSettings=project.getPrintSettings(SavableToWorkspace.PERSIST);
    if (printSettings!=null) fieldArray=printSettings.getFieldArray();
    init(project,NodeModelCacheFactory.getInstance().createFilteredCache((ReferenceNodeModelCache)refCache,"OfflineGantt",null),fieldArray,null,-1,true);
  }
View Full Code Here

  public static final String projectFieldArrayCategoryHidden="projectSpreadsheet"+HIDDEN_SUFFIX;
  public static final String timesheetFieldArrayCategory="timesheetSpreadsheet";


  public static SpreadSheetFieldArray removeNonWebFields(SpreadSheetFieldArray in) {
    SpreadSheetFieldArray out= (SpreadSheetFieldArray)in.clone();
    Iterator i = out.iterator();
    while (i.hasNext()) {
      Field f = (Field)i.next();
      if (f.getId().equals("Field.indicators") || /*f.isGraphical() ||*/
          (projectFieldArrayCategory.equals(out.getCategory())&&"Field.id".equals(f.getId())))
        i.remove();

    }
    return out;
  }
View Full Code Here

          // in case out of bounds
        }
      }
    }
    //TODO the column widths are not set, so if they change, they are not used
    SpreadSheetFieldArray s = (SpreadSheetFieldArray) Dictionary.get(getSpreadSheetCategory(),ws.fieldArrayName);
    if (s != null)
      setFieldArray(s);
       Container p = getParent();
       if (p instanceof JViewport && ws.viewPosition != null) {
         try {
View Full Code Here

  public SpreadSheetColumnModel(ArrayList fieldArray,List<Integer> colWidthList) {
    super();
    setFieldArray(fieldArray);
    colWidthMap=new HashMap<String,Integer>();
    if (fieldArray instanceof SpreadSheetFieldArray){
      SpreadSheetFieldArray sa=(SpreadSheetFieldArray)fieldArray;
      if (colWidthList==null&&sa!=null&&sa.getWidths()!=null&&sa.getWidths().size()>0){
        colWidthList=sa.getWidths();
      }
      if (colWidthList==null) return;
      Iterator<Field> a=(Iterator<Field>)sa.iterator();
      Iterator<Integer> s=colWidthList.iterator();
      while (a.hasNext()&&s.hasNext()){
        String f=a.next().getId();
        int size=s.next();
        if (!colWidthMap.containsKey(f)) colWidthMap.put(f, size);
View Full Code Here

    if (newIndex != -1)
      super.moveColumn(columnIndex, newIndex);

    if (columnIndex == newIndex)
      return;
    SpreadSheetFieldArray f = (SpreadSheetFieldArray) getFieldArray();
    fieldArray = f.move(columnIndex+1, newIndex+1);
  }
View Full Code Here

  public SpreadSheetColumnMenu(CommonSpreadSheet spreadSheet, final int col) {
    super();
    // setLabel("");
    setBorder(new BevelBorder(BevelBorder.RAISED));
    final CommonSpreadSheet sp = spreadSheet;
    final SpreadSheetFieldArray fields = (SpreadSheetFieldArray) sp.getFieldArray();
    insert.setIcon(IconManager.getIcon("menu.insertColumn")); //$NON-NLS-1$
    insert.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        Field field = ColumnDialog.getFieldFromDialog(sp,sp.getAvailableFields(),fields);
        if (field != null) {
          int c = col;
          if (c == 0) // takes care of when adding off to right. openproj bug 1815404
            c = fields.size();
          sp.setFieldArray(fields.insertField(c, field));

        }
      }
    });
    hide.setIcon(IconManager.getIcon("menu.hideColumn")); //$NON-NLS-1$

    hide.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
        if (fields.size() > 2 ) { // there is always the hidden Id field, so only allow delete if more than one other field
          sp.setFieldArray(fields.removeField(col));
        } else {
          Alert.warn(Messages.getString("Message.cantEmptySpreadsheet"),sp); //$NON-NLS-1$
        }
      }
    });

    final Field f = (Field) fields.get(col);
   
    rename.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent arg0) {
       
        if (fields.size() > 2 ) { // there is always the hidden Id field, so only allow delete if more than one other field
          FieldAliasDialog.doRename(f);
          sp.setFieldArray(fields);
        } else {
          Alert.warn(Messages.getString("Message.cantEmptySpreadsheet"),sp); //$NON-NLS-1$
        }
View Full Code Here

TOP

Related Classes of com.projity.graphic.configuration.SpreadSheetFieldArray$Workspace

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.