Package com.projity.timescale

Examples of com.projity.timescale.TimeInterval


   
    try {
      while(iterator.hasNext()) {
       
        // build field name from start & end
        TimeInterval interval = iterator.next();
        String fieldName = "TIME";
        fieldName += interval.getStart();
        fieldName += "_";
        fieldName += interval.getEnd();
        fieldName += "_" + baseFieldName;
        System.out.println("time based field is " + fieldName);
        // add fields
        JRDesignField field = new JRDesignField();
        field.setName(fieldName);
        field.setValueClass(fieldType);
        design.addField(field);
     
        System.out.println("column header is " + interval.getText2());
       
        // add columns
        JRDesignBand columnHeader = (JRDesignBand) design.getColumnHeader();
 
        JRDesignStaticText staticText = new JRDesignStaticText();
        staticText.setX(maxX);
        staticText.setY(0);
        staticText.setWidth(80);
        staticText.setHeight(15);
        staticText.setTextAlignment(JRTextElement.TEXT_ALIGN_RIGHT);
        staticText.setFont(normalFont);
        staticText.setText(interval.getText1());
        staticText.setPrintWhenDetailOverflows(true);
        columnHeader.addElement(staticText);

        // add textFields
        JRDesignBand detailBand = (JRDesignBand) design.getDetail();
View Full Code Here


  }
 
  public int countProjectIntervals(){
    int count=0;
    TimeIterator iterator=getProjectTimeIterator();
    TimeInterval interval;
    while (iterator.hasNext()){
      interval=iterator.next();
      count++;
    }
    return count;
View Full Code Here

      GroupedCalculatedValues c=(GroupedCalculatedValues)calculatedValues;
     
      TimeIterator timeIterator = coord.getProjectTimeIterator();
      //TODO uncomment when scheduling is corrected
      for (int k=0;timeIterator.hasNext();k++){
        TimeInterval interval=timeIterator.next();
        c.set(k,interval.getStart1(),interval.getEnd1(),0.0,null);
      }
        //return calculatedValues;
      while (j.hasNext()){
        ResourceImpl resource;
        Object obj=j.next();
View Full Code Here

    long start=-1;
    long end=-1;

    while(i.hasNext()){
      TimeInterval interval=i.next();
      if (start==-1) start=interval.getStart1();
      end=interval.getEnd1();

      double x1=coord.toX(interval.getStart1());
      double x2=coord.toX(interval.getEnd1());
      g2.setColor(lineColor);
      if (clipping) g2.draw(new Line2D.Double(x1,h/2,x1,h)); //when scrolling pixel by pixel both lines are needed
      g2.draw(new Line2D.Double(x2,h/2,x2,h));

      String text=interval.getText1();
      LineMetrics metrics=font.getLineMetrics(text,context);
      g2.setColor(textColor);
      g2.drawString(text,(int)x1+2,((int)h)-metrics.getDescent()-metrics.getLeading());

      if (interval.getText2()!=null){
        double X1=/*Math.round(*/coord.toX(interval.getStart2())/*)*/; //round for TimeSpreadSheet
        double X2=coord.toX(interval.getEnd2());

        g2.setColor(lineColor);
        if (clipping) g2.draw(new Line2D.Double(X1,0,X1,h/2));//when scrolling pixel by pixel both lines are needed
        g2.draw(new Line2D.Double(X2,0,X2,h/2));
        text=interval.getText2();
        metrics=font.getLineMetrics(text,context);
        if (clipping||((int)X1+2>=x0)){
          g2.setColor(textColor);
          g2.drawString(text,(int)X1+2,((int)h)/2-metrics.getDescent()-metrics.getLeading());
        }
View Full Code Here

       
       
        if (coord==null) return;
    TimeSpreadSheetModel model=(TimeSpreadSheetModel)spreadSheet.getModel();
    TimeIterator iterator=coord.getProjectTimeIterator();
    TimeInterval interval;
    model.resetTimeIntervals();
    //int totalW=0;
    for (int i=1;iterator.hasNext();i++){
      interval=iterator.next();
      //System.out.println("interval#"+i+"="+interval);
      int w=(int)Math.round(coord.toW(interval.getEnd1()-interval.getStart1()));
      TableColumn col=new TableColumn(i,w);
      col.setMinWidth(w);
      col.setMaxWidth(w);
      addColumn(col);
      model.incrementColumnCount();
View Full Code Here

        Calendar cal=DateTime.calendarInstance();

        PredefinedPaint paint=(PredefinedPaint)calFormat.getMiddle().getPaint();//new PredefinedPaint(PredefinedPaint.DOT_LINE,Colors.VERY_LIGHT_GRAY,Color.WHITE);
        paint.applyPaint(g2, useTextures());
        while (i.hasNext()){
          TimeInterval interval=i.next();
          long s=interval.getStart();
          if (CalendarService.getInstance().getDay(wc, s).isWorking()){
            if (startNonworking!=-1L){
              drawNonWorking(g2, startNonworking, endNonWorking, cal, coord, bounds,useScale2);
              startNonworking=endNonWorking=-1L;
            }
          }else{
            if (startNonworking==-1L) startNonworking=s;
            endNonWorking=s;

          }
        }
        if (startNonworking!=-1L){
          drawNonWorking(g2, startNonworking, endNonWorking, cal, coord, bounds,useScale2);
          startNonworking=endNonWorking=-1L;
        }
      }

    if (container!=null){
      //scale2 separation lines
      TimeIterator i=coord.getTimeIterator(bounds.getX(), bounds.getMaxX(),true);
      g2.setPaint(new PredefinedPaint(PredefinedPaint.DOT_LINE2,Color.GRAY,g2.getBackground()));
      while (i.hasNext()){
        TimeInterval interval=i.next();
        int startX=(int)Math.round(coord.toX(interval.getStart()));
        g2.drawLine(startX,bounds.y,startX,bounds.y+bounds.height);
      }

      //project start
      int projectStartX=(int)Math.round(coord.toX(project.getStart()));
View Full Code Here

TOP

Related Classes of com.projity.timescale.TimeInterval

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.