ItEr13S14ArquitecturaClientesItEr11S12: Remove task without ivalidate and visual adjustments

* Tasks have been thinned and no label is shown inside the boxes
This commit is contained in:
Lorenzo Tilve 2009-06-23 11:47:37 +02:00 committed by Javier Moran Rua
parent 91901dd017
commit f5d9b8395e
9 changed files with 52 additions and 53 deletions

View file

@ -9,19 +9,15 @@ import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.ext.AfterCompose;
import org.zkoss.zul.impl.XulElement;
import org.zkoss.zk.au.out.AuInvoke;
public class Planner extends XulElement implements AfterCompose {
private DependencyAddedListener dependencyAddedListener;
private DependencyRegistry dependencyRegistry = new DependencyRegistry();
private DependencyRemovedListener dependencyRemovedListener;
private TaskRemovedListener taskRemovedListener;
private ListDetails listDetails;
private GanttPanel ganttPanel;
public Planner() {
@ -94,6 +90,7 @@ public class Planner extends XulElement implements AfterCompose {
ganttPanel.afterCompose();
TaskList taskList = getTaskList();
dependencyAddedListener = new DependencyAddedListener() {
@Override
public void dependenceAdded(Dependency dependency) {
getDependencyList().addDependency(dependency);
@ -102,11 +99,15 @@ public class Planner extends XulElement implements AfterCompose {
};
taskList.addDependencyListener(dependencyAddedListener);
taskRemovedListener = new TaskRemovedListener() {
@Override
public void taskRemoved(Task taskRemoved) {
dependencyRegistry.remove(taskRemoved.getTaskBean());
listDetails.taskRemoved(taskRemoved.getTaskBean());
ganttPanel.invalidate();
TaskList taskList = getTaskList();
setHeight(getHeight());// forcing smart update
taskList.adjustZoomColumnsHeight();
getDependencyList().redrawDependencies();
}
};
taskList.addTaskRemovedListener(taskRemovedListener);
@ -146,5 +147,4 @@ public class Planner extends XulElement implements AfterCompose {
this.ganttPanel = new GanttPanel(this.dependencyRegistry);
appendChild(ganttPanel);
}
}

View file

@ -36,6 +36,9 @@ import org.zkoss.zul.Div;
*/
public class Task extends Div implements AfterCompose {
private static final int HEIGHT_PER_TASK = 10;
private static final String STANDARD_TASK_COLOR = "#007bbe";
private static Pattern pixelsSpecificationPattern = Pattern
.compile("\\s*(\\d+)px\\s*;?\\s*");
@ -128,10 +131,10 @@ public class Task extends Div implements AfterCompose {
}
public Task(TaskBean taskBean) {
setHeight("20px"); /* Initial constant for standard task height */
setHeight( HEIGHT_PER_TASK + "px");
setContext("idContextMenuTaskAssigment");
this.taskBean = taskBean;
setColor("#007bbe");
setColor(STANDARD_TASK_COLOR);
setId(UUID.randomUUID().toString());
}
@ -302,6 +305,5 @@ public class Task extends Div implements AfterCompose {
public void remove() {
getTaskList().removeTask(this);
}
}

View file

@ -35,7 +35,7 @@ import org.zkoss.zul.impl.XulElement;
*/
public class TaskList extends XulElement implements AfterCompose {
private static final int HEIGHT_PER_ROW = 30;
private static final int HEIGHT_PER_ROW = 20; /* 30 */
private List<WeakReference<DependencyAddedListener>> listeners = new LinkedList<WeakReference<DependencyAddedListener>>();
@ -95,7 +95,7 @@ public class TaskList extends XulElement implements AfterCompose {
}
task.afterCompose();
if (relocate) {
response(null, new AuInvoke(task, "recolocateAfterAdding"));
response(null, new AuInvoke(task, "relocateAfterAdding"));
setHeight(getHeight());// forcing smart update
adjustZoomColumnsHeight();
getGanttPanel().getDependencyList().redrawDependencies();
@ -138,7 +138,6 @@ public class TaskList extends XulElement implements AfterCompose {
@Override
public void doNotify(TaskRemovedListener listener) {
listener.taskRemoved(task);
}
});
}
@ -239,7 +238,7 @@ public class TaskList extends XulElement implements AfterCompose {
return taskEditFormComposer;
}
private void adjustZoomColumnsHeight() {
public void adjustZoomColumnsHeight() {
response("adjust_height", new AuInvoke(TaskList.this, "adjust_height"));
}

View file

@ -4,7 +4,7 @@
]]>
</zscript>
<hbox>
<textbox id="nameBox" value="" onChange="top.updateBean();" />
<textbox id="nameBox" value="" onChange="top.updateBean();"/>
<textbox id="startDateTextBox" value="" onChange="top.updateBean();" onFocus="top.hasReceivedFocus(self);" />
<datebox id="startDateBox" compact="true" onChange="top.updateBean();" visible="${false}" onBlur="top.dateBoxHasLostFocus(self);"/>
<textbox id="endDateTextBox" value="" onChange="top.updateBean();" onFocus="top.hasReceivedFocus(self);"/>

View file

@ -7,8 +7,8 @@
zkTask = {};
zkTask.CORNER_WIDTH = 20;
zkTask.HEIGHT = 20;
zkTask.HALF_HEIGHT = 10;
zkTask.HEIGHT = 10;
zkTask.HALF_HEIGHT = 5;
zkTask.DEPENDENCY_PADDING = 4;
zkTask.HALF_DEPENDENCY_PADDING = 2;
@ -23,13 +23,18 @@ zkTask.getDD = function(cmp) {
return cmp.created_dd;
}
zkTask.recolocateAfterAdding = function(cmp){
zkTask.relocateAfterAdding = function(cmp){
var row = cmp.parentNode;
var taskList = row.parentNode.parentNode;
row.parentNode.removeChild(row);
taskList.appendChild(row);
}
zkTask.cleanup = function(cmp){
var row = cmp.parentNode;
row.parentNode.removeChild(row);
}
zkTask.init = function(cmp) {
//Instead of executing the code directly, a callback is created
//that will be executed when the user passes the mouse over the task

View file

@ -1,5 +1,5 @@
HEIGHT_PER_ROW = 30;
HEIGHT_TIME_TRACKER = 130;
HEIGHT_PER_ROW = 15;
HEIGHT_TIME_TRACKER = 120;
zkTasklist = {};

View file

@ -22,7 +22,7 @@ public class DataForPlanner {
}
public DependencyRegistry getLightLoad() {
return getModelWith(50);
return getModelWith(40);
}
public DependencyRegistry getMediumLoad() {

View file

@ -23,24 +23,6 @@ table {
border:0px;
}
.completion {
display: none;
width: 80%;
top: -16px;
margin-top:0px;
height: 20px;
background-color: #FFCC99;
z-index:5;
border:0px;
}
.row span {
position:relative;
z-index:5;
color:#BBBBBB;
white-space:nowrap;
}
.errorbox {
margin: 40px;
padding: 40px;

View file

@ -3,31 +3,43 @@
/*** Tasks ***/
#listtasks {
position:relative;
width:400px;
top:100px;
width:600px;
top:70px;
}
.listdetails {
width:200px;
float:left;
margin-top:79px;
margin-top:46px;
}
.listdetails table {
height:30px;
height:20px;
border-bottom: 1px solid #86A4BE;
}
.listdetails img {
display:none;
}
.listdetails td {
padding-left:3px;
padding-left:0px; /* 3 */
}
.listdetails input {
width: 90px;
width: 90px;
font-size:10px !important;
border-bottom:0px;
border-right:0px;
height:17px;
}
.z-datebox-inp {
width:100px;
.listdetails .z-datebox-inp {
height:17px;
font-size:10px !important;
border-bottom:0px;
border-right:0px;
}
@ -36,7 +48,6 @@
border: 1px solid;
text-align:center;
vertical-align: middle;
font-size:0.8em;
z-index:10;
cursor: pointer;
cursor: hand;
@ -44,7 +55,7 @@
/* Task lane properties */
.row {
height: 19px;
height: 9px; /* 19 */
border-bottom: dotted 1px #CCCCCC;
margin-bottom: 10px;
margin-top: 10px;
@ -82,7 +93,7 @@
/* Width: ganttpanel constant,
Height: is recalculated on number of tasks */
#ganttpanel {
height:400px;
height:800px;
width: 900px;
overflow-x: scroll;
}
@ -114,16 +125,16 @@ table {
.completion {
display: none;
width: 80%;
top: -16px;
width: 30%;
margin-top:0px;
height: 20px;
height: 10px;
background-color: #FFCC99;
z-index:5;
border:0px;
}
.row span {
display:none;
position:relative;
z-index:5;
color:#BBBBBB;