From a2e8c3ea2edfab00e2c68bbf7868704d4c80c94e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20Gonz=C3=A1lez=20Fern=C3=A1ndez?= Date: Wed, 29 Dec 2010 22:15:42 +0100 Subject: [PATCH] Rename method to reflect better is meaning FEA: ItEr66OTS07PlanificacionHaciaAtrasItEr65OTS03 --- .../org/navalplanner/business/planner/entities/Task.java | 9 ++++++--- .../org/navalplanner/web/planner/TaskElementAdapter.java | 2 +- .../web/planner/allocation/AllocationResult.java | 2 +- .../web/planner/allocation/AllocationRowsHandler.java | 4 ++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/Task.java b/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/Task.java index 61bc7b60d..f5098cfed 100644 --- a/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/Task.java +++ b/navalplanner-business/src/main/java/org/navalplanner/business/planner/entities/Task.java @@ -514,7 +514,7 @@ public class Task extends TaskElement implements ITaskPositionConstrained { } setIntraDayEndDate(endDate); updateWorkableDays(); - doReassignment(getLastAllocationDirection()); + doReassignment(getAllocationDirection()); } private void updateWorkableDays() { @@ -623,7 +623,10 @@ public class Task extends TaskElement implements ITaskPositionConstrained { } } - public Direction getLastAllocationDirection() { + /** + * The allocation direction in which the allocation must be done + */ + public Direction getAllocationDirection() { if (lastAllocationDirection == null) { return Direction.FORWARD; } @@ -632,7 +635,7 @@ public class Task extends TaskElement implements ITaskPositionConstrained { public void reassignAllocationsWithNewResources(Scenario scenario, IResourceDAO resourceDAO) { - reassign(scenario, getLastAllocationDirection(), + reassign(scenario, getAllocationDirection(), new WithAnotherResources(resourceDAO)); } diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/TaskElementAdapter.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/TaskElementAdapter.java index 0f05a1789..d2df4a3f1 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/TaskElementAdapter.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/TaskElementAdapter.java @@ -894,7 +894,7 @@ public class TaskElementAdapter implements ITaskElementAdapter { public List> getCurrentLengthConstraint() { if (taskElement instanceof Task) { Task task = (Task) taskElement; - if (task.getLastAllocationDirection() == Direction.FORWARD) { + if (task.getAllocationDirection() == Direction.FORWARD) { return Collections .singletonList(biggerOrEqualThan(getEndDate())); } diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java index ed4a92ba5..e940f6401 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationResult.java @@ -198,7 +198,7 @@ public class AllocationResult { } private boolean isForwardsScheduled() { - return Direction.FORWARD.equals(task.getLastAllocationDirection()); + return Direction.FORWARD.equals(task.getAllocationDirection()); } public IntraDayDate getIntraDayStart() { diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java index a796c933d..8804bc887 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/planner/allocation/AllocationRowsHandler.java @@ -260,14 +260,14 @@ public class AllocationRowsHandler { } public boolean isForwardsAllocation() { - return Direction.FORWARD.equals(task.getLastAllocationDirection()); + return Direction.FORWARD.equals(task.getAllocationDirection()); } private void calculateEndDateOrStartDateAllocation() { List allocations = AllocationRow .createAndAssociate(task, currentRows); ResourceAllocation.allocating(allocations).untilAllocating( - task.getLastAllocationDirection(), + task.getAllocationDirection(), formBinder.getAssignedHours(), notFullfiledReceiver()); }