ItEr22S12CUVistaRecursosTempoPorProxectoItEr21S07: Grouping leftPane and GanttPanel into a tab

This commit is contained in:
Óscar González Fernández 2009-08-18 12:26:56 +02:00
parent c0179bc2a9
commit 9ac36eecf7
2 changed files with 30 additions and 8 deletions

View file

@ -111,7 +111,7 @@ public class Planner extends XulElement {
this.context = context;
clear();
context.add(configuration.getData());
recreate();
createTasksPlanningTab();
}
private void clear() {
@ -157,17 +157,17 @@ public class Planner extends XulElement {
return diagramGraph;
}
private void recreate() {
private TasksPlanningTab createTasksPlanningTab() {
this.leftPane = new LeftPane(contextualizedGlobalCommands,
this.diagramGraph.getTopLevelTasks());
this.leftPane.setParent(this);
this.leftPane.afterCompose();
this.leftPane
.setGoingDownInLastArrowCommand(goingDownInLastArrowCommand);
this.ganttPanel = new GanttPanel(this.context,
commandsOnTasksContextualized, editTaskCommand);
ganttPanel.setParent(this);
ganttPanel.afterCompose();
TasksPlanningTab result = new TasksPlanningTab(this, leftPane,
ganttPanel);
result.afterCompose();
this.leftPane
.setGoingDownInLastArrowCommand(goingDownInLastArrowCommand);
return result;
}
void removeTask(Task task) {

View file

@ -0,0 +1,22 @@
package org.zkoss.ganttz;
public class TasksPlanningTab {
private final Planner planner;
private final LeftPane leftPane;
private final GanttPanel ganttPanel;
public TasksPlanningTab(Planner planner, LeftPane leftPane,
GanttPanel ganttPanel) {
this.planner = planner;
this.leftPane = leftPane;
this.ganttPanel = ganttPanel;
}
public void afterCompose() {
leftPane.setParent(planner);
ganttPanel.setParent(planner);
leftPane.afterCompose();
ganttPanel.afterCompose();
}
}