Ejemplo n.º 1
0
 @Override
 public int compareTo(final DayTime otherDayTime) {
   if (day.compareTo(otherDayTime.day) == 0) {
     return time.compareTo(otherDayTime.time);
   }
   return day.compareTo(otherDayTime.day);
 }
Ejemplo n.º 2
0
 public Dimension2D calculateDimension(StringBounder stringBounder) {
   int n = 0;
   for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
     n++;
   }
   return new Dimension2DDouble(n * dayWidth, getHeight());
 }
Ejemplo n.º 3
0
 private Day getEnd() {
   Day result = null;
   for (Task t : tasks) {
     if (result == null || result.compareTo(t.getEnd()) < 0) {
       result = (Day) t.getEnd();
     }
   }
   return result;
 }
Ejemplo n.º 4
0
  public void drawU(UGraphic ug) {
    int n = 0;
    String last = null;

    double pendingX = -1;
    for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
      final String text = "" + d.getMonth().name();
      if (pendingX == -1) {
        pendingX = n * dayWidth;
        last = text;
      }
      ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
      ug = ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE));
      if (text.equals(last) == false) {
        manage(ug, 0, 0, n, last, pendingX);
        pendingX = n * dayWidth;
      }
      last = text;
      n++;
    }
    manage(ug, 0, 0, n, last, pendingX);
  }
Ejemplo n.º 5
0
  public void drawU(UGraphic ug, double x, double y) {
    int n = 0;
    String last = null;

    double pendingX = -1;
    for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
      final String text = "" + d.getMonth().name();
      if (pendingX == -1) {
        pendingX = n * dayWidth;
        last = text;
      }
      ug.getParam().setColor(HtmlColorUtils.BLACK);
      ug.getParam().setBackcolor(HtmlColorUtils.WHITE);
      if (text.equals(last) == false) {
        manage(ug, x, y, n, last, pendingX);
        pendingX = n * dayWidth;
      }
      last = text;
      n++;
    }
    manage(ug, x, y, n, last, pendingX);
  }