Package org.archive.wayback.util.graph

Examples of org.archive.wayback.util.graph.RegionData


          maxValue = pc.getTotal();
        }
      }
    }

    RegionData data[] = new RegionData[ppcs.size()];
    for(int y = 0; y < ppcs.size(); y++) {
      int activeP = -1;
      Partition<Partition<CaptureSearchResult>> ppc = ppcs.get(y);
      String label = formatter.format(formatKey, ppc.getStart());
//      cal.setTime(ppc.getStart());
//      String label = String.valueOf(cal.get(Calendar.YEAR));
      List<Partition<CaptureSearchResult>> pcs = ppc.list();
      int count = pcs.size();
      int values[] = new int[count];
      for(int m = 0; m < count; m++) {
        Partition<CaptureSearchResult> pc = pcs.get(m);
        values[m] = normalizeInt(pc.getTotal(), maxValue, 15);
        if(pc.isContainsClosest()) {
          activeP = m;
        }
      }
      data[y] = new RegionData(label, activeP, values);
    }
    GraphConfiguration config = new GraphConfiguration();
    return new Graph(width, height, data, config);
  }
View Full Code Here


          maxValue = month.getTotal();
        }
      }
    }

    RegionData yearRD[] = new RegionData[years.size()];
    for(int y = 0; y < years.size(); y++) {
      int activeMonth = -1;
      Partition<Partition<CaptureSearchResult>> year = years.get(y);
      cal.setTime(year.getStart());
      String label = String.valueOf(cal.get(Calendar.YEAR));
      List<Partition<CaptureSearchResult>> months = year.list();
      if(months.size() != 12) {
        throw new RuntimeException("Not 12 months...");
      }
      int values[] = new int[12];
      for(int m = 0; m < 12; m++) {
        Partition<CaptureSearchResult> month = months.get(m);
        values[m] = normalizeInt(month.getTotal(), maxValue, 15);
        if(month.isContainsClosest()) {
          activeMonth = m;
        }
      }
      yearRD[y] = new RegionData(label, activeMonth, values);
    }
    GraphConfiguration config = new GraphConfiguration();
    return new Graph(width, height, yearRD, config);
  }
View Full Code Here

TOP

Related Classes of org.archive.wayback.util.graph.RegionData

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.