18 package org.turro.zkoss.svg;
34 if(this.equals(GANTT_BY_DAYS)) {
36 }
else if(this.equals(GANTT_BY_WEEKS)) {
37 return toWeeks(hours);
38 }
else if(this.equals(GANTT_BY_MONTHS)) {
39 return toMonths(hours);
40 }
else if(this.equals(GANTT_BY_QUARTERS)) {
41 return toQuarters(hours);
42 }
else if(this.equals(GANTT_BY_YEARS)) {
43 return toYears(hours);
48 private static final double SWITCH_MEASURE = 100.0d;
51 if(hours > SWITCH_MEASURE) {
52 if(toDays(hours) > SWITCH_MEASURE) {
53 if(toWeeks(hours) > SWITCH_MEASURE) {
54 if(toMonths(hours) > SWITCH_MEASURE) {
55 if(toQuarters(hours) > SWITCH_MEASURE) {
56 return GANTT_BY_YEARS;
58 return GANTT_BY_QUARTERS;
61 return GANTT_BY_MONTHS;
64 return GANTT_BY_WEEKS;
70 return GANTT_BY_HOURS;
74 public static double toDays(
double hours) {
78 public static double toWeeks(
double hours) {
79 return hours / (8.0d * 5.0d);
83 return hours / (8.0d * 22.0d);
87 return hours / (8.0d * 22.0d * 3.0d);
90 public static double toYears(
double hours) {
91 return hours / (8.0d * 22.0d * 12.0d);
static double toWeeks(double hours)
static GanttMeasure chooseMeasure(double hours)
static double toDays(double hours)
static double toQuarters(double hours)
static double toYears(double hours)
static double toMonths(double hours)
double convert(double hours)