ItEr57S08RFAspectosGraficosRecursoLimitantesItEr56S09: Fixed dependencies relations matching with queueTasks
This commit is contained in:
parent
c1d69bc389
commit
6804d9e310
4 changed files with 79 additions and 78 deletions
|
|
@ -220,44 +220,18 @@ public class LimitingResourcesPanel extends HtmlMacroComponent {
|
|||
getFellow("insertionPointLeftPanel").appendChild(leftPane);
|
||||
leftPane.afterCompose();
|
||||
|
||||
// FIXME: Insert calculated dependencies
|
||||
dependencyList = new LimitingDependencyList(this);
|
||||
|
||||
System.out
|
||||
.println("tasks!" + queueListComponent.getQueueTasks().size());
|
||||
// for (LimitingResourceQueue each: limitingResourceQueues) {
|
||||
// each.getLimitingResourceQueueElements();
|
||||
// }
|
||||
|
||||
if (queueListComponent.getQueueTasks().size() > 3) {
|
||||
QueueTask source = queueListComponent.getQueueTasks().get(1);
|
||||
QueueTask destination = queueListComponent.getQueueTasks().get(2);
|
||||
QueueTask destination2 = queueListComponent.getQueueTasks().get(3);
|
||||
|
||||
LimitingDependencyComponent limitingDependencyComponent = new LimitingDependencyComponent(
|
||||
source, destination);
|
||||
LimitingDependencyComponent limitingDependencyComponent2 = new LimitingDependencyComponent(
|
||||
source, destination2);
|
||||
|
||||
dependencyList.addDependencyComponent(limitingDependencyComponent);
|
||||
dependencyList.addDependencyComponent(limitingDependencyComponent2);
|
||||
|
||||
// Extra
|
||||
QueueTask destination3 = queueListComponent.getQueueTasks().get(3);
|
||||
LimitingDependencyComponent limitingDependencyComponent3 = new LimitingDependencyComponent(
|
||||
source, destination3);
|
||||
dependencyList.addDependencyComponent(limitingDependencyComponent3);
|
||||
}
|
||||
|
||||
getFellow("insertionPointRightPanel").appendChild(timeTrackerComponent);
|
||||
getFellow("insertionPointRightPanel").appendChild(queueListComponent);
|
||||
getFellow("insertionPointRightPanel").appendChild(dependencyList);
|
||||
|
||||
dependencyList.afterCompose();
|
||||
queueListComponent.afterCompose();
|
||||
|
||||
queueListComponent.invalidate();
|
||||
|
||||
// FIXME: Obtaing real dependency list
|
||||
// dependencyList = generateSimulatedDependencyList();
|
||||
if (dependencyList != null) {
|
||||
dependencyList.afterCompose();
|
||||
getFellow("insertionPointRightPanel").appendChild(dependencyList);
|
||||
}
|
||||
|
||||
// Insert timetracker headers
|
||||
TimeTrackerComponent timeTrackerHeader = createTimeTrackerHeader();
|
||||
getFellow("insertionPointTimetracker").appendChild(timeTrackerHeader);
|
||||
|
|
@ -268,6 +242,27 @@ public class LimitingResourcesPanel extends HtmlMacroComponent {
|
|||
listZoomLevels.setSelectedIndex(timeTracker.getDetailLevel().ordinal());
|
||||
}
|
||||
|
||||
private LimitingDependencyList generateSimulatedDependencyList() {
|
||||
dependencyList = new LimitingDependencyList(this);
|
||||
List<QueueTask> queueTasks = queueListComponent.getQueueTasks();
|
||||
if (queueTasks.size() > 3) {
|
||||
QueueTask source = queueTasks.get(1);
|
||||
QueueTask destination = queueTasks.get(2);
|
||||
QueueTask destination2 = queueTasks.get(3);
|
||||
QueueTask destination3 = queueTasks.get(3);
|
||||
|
||||
LimitingDependencyComponent limitingDependencyComponent = new LimitingDependencyComponent(
|
||||
source, destination);
|
||||
LimitingDependencyComponent limitingDependencyComponent2 = new LimitingDependencyComponent(
|
||||
source, destination2);
|
||||
LimitingDependencyComponent limitingDependencyComponent3 = new LimitingDependencyComponent(
|
||||
source, destination3);
|
||||
dependencyList.addDependencyComponent(limitingDependencyComponent);
|
||||
dependencyList.addDependencyComponent(limitingDependencyComponent2);
|
||||
dependencyList.addDependencyComponent(limitingDependencyComponent3);
|
||||
}
|
||||
return dependencyList;
|
||||
}
|
||||
|
||||
public void clearComponents() {
|
||||
getFellow("insertionPointLeftPanel").getChildren().clear();
|
||||
|
|
|
|||
|
|
@ -51,10 +51,6 @@ public class QueueListComponent extends HtmlMacroComponent implements
|
|||
|
||||
private Map<LimitingResourceQueue, QueueComponent> fromQueueToElement = new HashMap<LimitingResourceQueue, QueueComponent>();
|
||||
|
||||
private List<QueueComponent> limitingResourcesComponents = new ArrayList<QueueComponent>();
|
||||
|
||||
private List<QueueTask> queueTasks = new ArrayList<QueueTask>();
|
||||
|
||||
public QueueListComponent(TimeTracker timeTracker,
|
||||
MutableTreeModel<LimitingResourceQueue> timelinesTree) {
|
||||
|
||||
|
|
@ -72,12 +68,6 @@ public class QueueListComponent extends HtmlMacroComponent implements
|
|||
QueueComponent component = QueueComponent.create(timeTracker, each);
|
||||
this.appendChild(component);
|
||||
fromQueueToElement.put(each, component);
|
||||
|
||||
// FIXME: Added for temporary dependencies
|
||||
limitingResourcesComponents.add(component);
|
||||
if (!component.getQueueTasks().isEmpty()) {
|
||||
queueTasks.addAll(component.getQueueTasks());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -108,14 +98,14 @@ public class QueueListComponent extends HtmlMacroComponent implements
|
|||
@Override
|
||||
public void afterCompose() {
|
||||
super.afterCompose();
|
||||
for (QueueComponent each : limitingResourcesComponents) {
|
||||
System.out.println("Composing!");
|
||||
each.afterCompose();
|
||||
}
|
||||
}
|
||||
|
||||
public List<QueueTask> getQueueTasks() {
|
||||
return queueTasks;
|
||||
List<QueueTask> result = new ArrayList<QueueTask>();
|
||||
for (QueueComponent each : fromQueueToElement.values()) {
|
||||
result.addAll(each.getQueueTasks());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,21 +128,25 @@ zkLimitingDependencies.newdraw = function(arrow, orig, dest, param) {
|
|||
if (yend > yorig) {
|
||||
depstart.style.top = yorig + "px";
|
||||
depstart.style.height = ( height - param ) + "px";
|
||||
} else if (yend = yorig) {
|
||||
} else if (yend == yorig) {
|
||||
depstart.style.top = yorig + "px";
|
||||
depstart.style.height = param + "px";
|
||||
} else if (yend < yorig) {
|
||||
depstart.style.top = yorig + "px";
|
||||
depstart.style.top = ( yend + param ) + "px";
|
||||
depstart.style.height = ( height - param ) + "px";
|
||||
}
|
||||
|
||||
// --------- Second segment -----------
|
||||
var depmid = this.findImageElement(arrow, 'mid');
|
||||
depmid.style.width = width + "px";
|
||||
depmid.style.left = depstart.style.left;
|
||||
if (xorig < xend ) {
|
||||
depmid.style.left = xorig + "px";
|
||||
} else {
|
||||
depmid.style.left = xend + "px";
|
||||
}
|
||||
if (yend > yorig) {
|
||||
depmid.style.top = ( yend - param ) + "px";
|
||||
} else if (yend = yorig) {
|
||||
} else if (yend == yorig) {
|
||||
depmid.style.top = ( yend + param ) + "px";
|
||||
} else if (yend < yorig) {
|
||||
depmid.style.top = ( yend + param ) + "px";
|
||||
|
|
@ -154,12 +158,12 @@ zkLimitingDependencies.newdraw = function(arrow, orig, dest, param) {
|
|||
if (yend > yorig) {
|
||||
depend.style.top = ( yend - param ) + "px";
|
||||
depend.style.height = param + "px";
|
||||
} else if (yend = yorig) {
|
||||
} else if (yend == yorig) {
|
||||
depend.style.top = yorig + "px";
|
||||
depend.style.height = param + "px";
|
||||
} else if (yend < yorig) {
|
||||
depend.style.top = yorig + "px";
|
||||
depend.style.height = ( height - param ) + "px";
|
||||
depend.style.top = yend + "px";
|
||||
depend.style.height = param + "px";
|
||||
}
|
||||
|
||||
// --------- Arrow -----------
|
||||
|
|
@ -168,35 +172,38 @@ zkLimitingDependencies.newdraw = function(arrow, orig, dest, param) {
|
|||
if (yend > yorig) {
|
||||
deparrow.src = this.getImagesDir()+"arrow2.png";
|
||||
deparrow.style.top = ( yend - param ) + "px";
|
||||
} else if (yend = yorig) {
|
||||
} else if (yend == yorig) {
|
||||
deparrow.src = this.getImagesDir()+"arrow4.png";
|
||||
deparrow.style.top = yorig + "px";
|
||||
} else if (yend < yorig) {
|
||||
deparrow.src = this.getImagesDir()+"arrow4.png";
|
||||
deparrow.style.top = yorig + "px";
|
||||
deparrow.style.top = yend + "px";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
zkLimitingDependency.draw = function(dependency) {
|
||||
var orig = zkLimitingDependencies.findPos(this.origin(dependency));
|
||||
var dest = zkLimitingDependencies.findPos(this.destination(dependency));
|
||||
|
||||
var verticalSeparation = 15;
|
||||
switch(dependency.getAttribute('type'))
|
||||
{
|
||||
case zkLimitingDependencies.constants.START_START:
|
||||
verticalSeparation = 5;
|
||||
break;
|
||||
case zkLimitingDependencies.constants.END_END:
|
||||
verticalSeparation = 10;
|
||||
break;
|
||||
case zkLimitingDependencies.constants.END_START:
|
||||
default:
|
||||
verticalSeparation = 15;
|
||||
}
|
||||
zkLimitingDependencies.newdraw(dependency, orig, dest, verticalSeparation);
|
||||
var posOrig = this.origin(dependency);
|
||||
var posDest = this.destination(dependency);
|
||||
if ( ( posOrig != null ) && ( posDest!= null ) ) {
|
||||
var orig = zkLimitingDependencies.findPos(posOrig);
|
||||
var dest = zkLimitingDependencies.findPos(posDest);
|
||||
|
||||
var verticalSeparation = 15;
|
||||
switch(dependency.getAttribute('type'))
|
||||
{
|
||||
case zkLimitingDependencies.constants.START_START:
|
||||
verticalSeparation = 5;
|
||||
break;
|
||||
case zkLimitingDependencies.constants.END_END:
|
||||
verticalSeparation = 10;
|
||||
break;
|
||||
case zkLimitingDependencies.constants.END_START:
|
||||
default:
|
||||
verticalSeparation = 15;
|
||||
}
|
||||
zkLimitingDependencies.newdraw(dependency, orig, dest, verticalSeparation);
|
||||
}
|
||||
}
|
||||
|
||||
zkLimitingDependency.init = function(dependency) {
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@
|
|||
}
|
||||
|
||||
/* -------------- Dependencies -------------- */
|
||||
#listdependencies {
|
||||
#listdependencies, #listlimitingdependencies {
|
||||
position: relative;
|
||||
width: 400px;
|
||||
float: left;
|
||||
|
|
@ -183,14 +183,23 @@
|
|||
z-index:0;
|
||||
}
|
||||
|
||||
.end,.start {
|
||||
height: 1px;
|
||||
#listdependencies .end,
|
||||
#listdependencies .start {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.mid {
|
||||
#listdependencies .mid {
|
||||
width: 1px;
|
||||
}
|
||||
|
||||
#listlimitingdependencies .end,
|
||||
#listlimitingdependencies .start {
|
||||
width: 1px;
|
||||
}
|
||||
#listlimitingdependencies .mid {
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
.completion {
|
||||
width: 0%;
|
||||
margin-top: 0px;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue