Extract local variables to class static attributes.

FEA: ItEr75S27PerProjectDashboard
This commit is contained in:
Nacho Barrientos 2011-11-22 18:01:06 +01:00 committed by Manuel Rego Casasnovas
parent f3134887c0
commit 33054a4899

View file

@ -51,11 +51,18 @@ import org.springframework.stereotype.Component;
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public class DashboardModel {
/* Parameters */
public final static int EA_STRETCHES_PERCENTAGE_STEP = 10;
public final static int EA_STRETCHES_MIN_VALUE = -100;
public final static int EA_STRETCHES_MAX_VALUE = 150;
public final static int LTC_NUMBER_OF_INTERVALS = 10;
/* To be calculated */
public static double LTC_STRETCHES_STEP = 0;
public static double LTC_STRETCHES_MIN_VALUE = 0;
public static double LTC_STRETCHES_MAX_VALUE = 0;
private Order currentOrder;
private Integer taskCount = null;
@ -225,12 +232,14 @@ public class DashboardModel {
rootTask.acceptVisitor(visitor);
List<Double> deviations = visitor.getDeviations();
Double minDeviation = Collections.min(deviations);
Double maxDeviation = Collections.max(deviations);
LTC_STRETCHES_MIN_VALUE = Collections.min(deviations);
LTC_STRETCHES_MAX_VALUE = Collections.max(deviations);
LTC_STRETCHES_STEP = (LTC_STRETCHES_MAX_VALUE - LTC_STRETCHES_MIN_VALUE)
/LTC_NUMBER_OF_INTERVALS;
this.lagInTaskCompletionHistogram = createHistogram(
Collections.min(deviations),
Collections.max(deviations),
(maxDeviation - minDeviation)/LTC_NUMBER_OF_INTERVALS,
LTC_STRETCHES_MIN_VALUE,
LTC_STRETCHES_MAX_VALUE,
LTC_STRETCHES_STEP,
deviations);
}