ItEr57S08RFAspectosGraficosRecursoLimitantesItEr56S09: Added dependencies support to limitingresources queues
This commit is contained in:
parent
e34261e32d
commit
84f04d8eea
13 changed files with 387 additions and 34 deletions
|
|
@ -27,7 +27,6 @@ import java.util.Date;
|
|||
import org.apache.commons.lang.Validate;
|
||||
import org.zkoss.ganttz.data.Dependency;
|
||||
import org.zkoss.ganttz.data.DependencyType;
|
||||
import org.zkoss.ganttz.data.Task;
|
||||
import org.zkoss.ganttz.data.constraint.Constraint;
|
||||
import org.zkoss.ganttz.data.constraint.Constraint.IConstraintViolationListener;
|
||||
import org.zkoss.zk.au.out.AuInvoke;
|
||||
|
|
@ -121,7 +120,7 @@ public class LimitingDependencyComponent extends XulElement implements
|
|||
response("zoomChanged", new AuInvoke(this, "draw"));
|
||||
}
|
||||
|
||||
public boolean contains(Task task) {
|
||||
public boolean contains(QueueTask task) {
|
||||
return false;
|
||||
// Task sourceTask = getSource().getTask();
|
||||
// Task destinationTask = getDestination().getTask();
|
||||
|
|
|
|||
|
|
@ -132,10 +132,9 @@ public class LimitingDependencyList extends XulElement implements AfterCompose {
|
|||
// boolean dependencyMustBeVisible = visibilityToggler.dependencyMustBeVisible();
|
||||
// visibilityToggler.toggleDependencyExistence(dependencyMustBeVisible);
|
||||
// if (dependencyMustBeVisible) {
|
||||
// dependencyComponent.redrawDependency();
|
||||
// }
|
||||
// Always
|
||||
dependencyComponent.redrawDependency();
|
||||
// }
|
||||
// dependencyComponent.redrawDependency();
|
||||
}
|
||||
|
||||
public void setDependencyComponents(
|
||||
|
|
@ -161,6 +160,7 @@ public class LimitingDependencyList extends XulElement implements AfterCompose {
|
|||
};
|
||||
// getTimeTracker().addZoomListener(listener);
|
||||
}
|
||||
redrawDependencies();
|
||||
}
|
||||
|
||||
// private TimeTracker getTimeTracker() {
|
||||
|
|
@ -206,7 +206,7 @@ public class LimitingDependencyList extends XulElement implements AfterCompose {
|
|||
}
|
||||
}
|
||||
|
||||
public void taskRemoved(Task task) {
|
||||
public void taskRemoved(QueueTask task) {
|
||||
for (LimitingDependencyComponent dependencyComponent : LimitingDependencyList.this
|
||||
.getLimitingDependencyComponents()) {
|
||||
if (dependencyComponent.contains(task)) {
|
||||
|
|
|
|||
|
|
@ -45,13 +45,13 @@ public class LimitingResourcesList extends HtmlMacroComponent implements
|
|||
|
||||
private final IZoomLevelChangedListener zoomListener;
|
||||
|
||||
private Map<LimitingResourceQueue, LimitingResourcesComponent> fromTimeLineToComponent = new HashMap<LimitingResourceQueue, LimitingResourcesComponent>();
|
||||
private Map<LimitingResourceQueue, QueueComponent> fromTimeLineToComponent = new HashMap<LimitingResourceQueue, QueueComponent>();
|
||||
|
||||
private MutableTreeModel<LimitingResourceQueue> model;
|
||||
|
||||
private TimeTracker timeTracker;
|
||||
|
||||
private List<LimitingResourcesComponent> limitingResourcesComponents = new ArrayList<LimitingResourcesComponent>();
|
||||
private List<QueueComponent> limitingResourcesComponents = new ArrayList<QueueComponent>();
|
||||
|
||||
public LimitingResourcesList(TimeTracker timeTracker,
|
||||
MutableTreeModel<LimitingResourceQueue> timelinesTree) {
|
||||
|
|
@ -98,8 +98,26 @@ public class LimitingResourcesList extends HtmlMacroComponent implements
|
|||
};
|
||||
}
|
||||
|
||||
public void collapse(LimitingResourceQueue line) {
|
||||
private void insertAsComponents(TimeTracker timetracker,
|
||||
List<LimitingResourceQueue> children) {
|
||||
for (LimitingResourceQueue LimitingResourceQueue : children) {
|
||||
QueueComponent component = QueueComponent
|
||||
.create(timetracker, LimitingResourceQueue);
|
||||
limitingResourcesComponents.add(component);
|
||||
appendChild(component);
|
||||
fromTimeLineToComponent.put(LimitingResourceQueue, component);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void collapse(LimitingResourceQueue line) {
|
||||
}
|
||||
|
||||
|
||||
private QueueComponent getComponentFor(LimitingResourceQueue l) {
|
||||
QueueComponent resourceLoadComponent = fromTimeLineToComponent
|
||||
.get(l);
|
||||
return resourceLoadComponent;
|
||||
}
|
||||
|
||||
public void expand(LimitingResourceQueue line,
|
||||
|
|
@ -109,7 +127,7 @@ public class LimitingResourcesList extends HtmlMacroComponent implements
|
|||
@Override
|
||||
public void afterCompose() {
|
||||
super.afterCompose();
|
||||
for (LimitingResourcesComponent each : limitingResourcesComponents) {
|
||||
for (QueueComponent each : limitingResourcesComponents) {
|
||||
each.afterCompose();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,6 +85,8 @@ public class LimitingResourcesPanel extends HtmlMacroComponent {
|
|||
private static final String filterCriterions = _("Filter by criterions");
|
||||
private boolean filterbyResources = true;
|
||||
|
||||
private LimitingDependencyList dependencyList;
|
||||
|
||||
public LimitingResourcesPanel(List<LimitingResourceQueue> groups,
|
||||
TimeTracker timeTracker) {
|
||||
init(groups, timeTracker);
|
||||
|
|
@ -184,7 +186,8 @@ public class LimitingResourcesPanel extends HtmlMacroComponent {
|
|||
}
|
||||
|
||||
private void registerNeededScripts() {
|
||||
// getScriptsRegister().register(ScriptsRequiredByResourceLoadPanel.class);
|
||||
// getScriptsRegister().register(
|
||||
// ScriptsRequiredByLimitingResourcesPanel.class);
|
||||
}
|
||||
|
||||
private IScriptsRegister getScriptsRegister() {
|
||||
|
|
@ -224,25 +227,27 @@ public class LimitingResourcesPanel extends HtmlMacroComponent {
|
|||
leftPane.afterCompose();
|
||||
|
||||
// Insert timetracker watermarks and limitingResourcesQueues
|
||||
getFellow("insertionPointRightPanel").appendChild(timeTrackerComponent);
|
||||
getFellow("insertionPointRightPanel")
|
||||
.appendChild(limitingResourcesList);
|
||||
limitingResourcesList.afterCompose();
|
||||
|
||||
QueueTask source = new QueueTask(new LocalDate(), new LocalDate(), 100,
|
||||
50);
|
||||
QueueTask destination = new QueueTask(new LocalDate(), new LocalDate(),
|
||||
100, 50);
|
||||
|
||||
QueueTask source = new QueueTask(new LocalDate(), new LocalDate()
|
||||
.plusMonths(1), 100, 50);
|
||||
QueueTask destination = new QueueTask(new LocalDate(), new LocalDate()
|
||||
.plusMonths(2), 100, 50);
|
||||
LimitingDependencyComponent limitingDependencyComponent = new LimitingDependencyComponent(
|
||||
source, destination);
|
||||
|
||||
LimitingDependencyList dependencyList = new LimitingDependencyList(null);
|
||||
dependencyList.addDependencyComponent(limitingDependencyComponent);
|
||||
dependencyList = new LimitingDependencyList(null);
|
||||
|
||||
dependencyList.addDependencyComponent(limitingDependencyComponent);
|
||||
limitingDependencyComponent.afterCompose();
|
||||
limitingDependencyComponent.setParent(dependencyList);
|
||||
|
||||
getFellow("insertionPointRightPanel").appendChild(timeTrackerComponent);
|
||||
getFellow("insertionPointRightPanel")
|
||||
.appendChild(limitingResourcesList);
|
||||
getFellow("insertionPointRightPanel").appendChild(dependencyList);
|
||||
|
||||
dependencyList.afterCompose();
|
||||
limitingResourcesList.afterCompose();
|
||||
|
||||
limitingResourcesList.invalidate();
|
||||
|
||||
|
|
@ -256,6 +261,7 @@ public class LimitingResourcesPanel extends HtmlMacroComponent {
|
|||
listZoomLevels.setSelectedIndex(timeTracker.getDetailLevel().ordinal());
|
||||
}
|
||||
|
||||
|
||||
public void clearComponents() {
|
||||
getFellow("insertionPointLeftPanel").getChildren().clear();
|
||||
getFellow("insertionPointRightPanel").getChildren().clear();
|
||||
|
|
@ -271,4 +277,5 @@ public class LimitingResourcesPanel extends HtmlMacroComponent {
|
|||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -46,12 +46,12 @@ import org.zkoss.zul.impl.XulElement;
|
|||
* This class wraps ResourceLoad data inside an specific HTML Div component.
|
||||
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
|
||||
*/
|
||||
public class LimitingResourcesComponent extends XulElement implements
|
||||
public class QueueComponent extends XulElement implements
|
||||
AfterCompose {
|
||||
|
||||
public static LimitingResourcesComponent create(TimeTracker timeTracker,
|
||||
public static QueueComponent create(TimeTracker timeTracker,
|
||||
LimitingResourceQueue limitingResourceQueue) {
|
||||
return new LimitingResourcesComponent(timeTracker,
|
||||
return new QueueComponent(timeTracker,
|
||||
limitingResourceQueue);
|
||||
}
|
||||
|
||||
|
|
@ -60,7 +60,7 @@ public class LimitingResourcesComponent extends XulElement implements
|
|||
private transient IZoomLevelChangedListener zoomChangedListener;
|
||||
private List<Div> queueElementDivs = new ArrayList<Div>();
|
||||
|
||||
private LimitingResourcesComponent(final TimeTracker timeTracker,
|
||||
private QueueComponent(final TimeTracker timeTracker,
|
||||
final LimitingResourceQueue limitingResourceQueue) {
|
||||
this.limitingResourceQueue = limitingResourceQueue;
|
||||
this.timeTracker = timeTracker;
|
||||
|
|
@ -104,11 +104,11 @@
|
|||
</component>
|
||||
|
||||
<component>
|
||||
<component-name>limitingresources</component-name><!-- Limiting resources queue -->
|
||||
<component-class>org.navalplanner.web.limitingresources.LimitingResourcesComponent</component-class>
|
||||
<component-name>queuecomponent</component-name><!-- Limiting resources queue -->
|
||||
<component-class>org.navalplanner.web.limitingresources.QueueComponent</component-class>
|
||||
<mold>
|
||||
<mold-name>default</mold-name>
|
||||
<mold-uri>/limitingresources/limitingresources.dsp</mold-uri>
|
||||
<mold-uri>/limitingresources/queuecomponent.dsp</mold-uri>
|
||||
</mold>
|
||||
</component>
|
||||
|
||||
|
|
@ -122,5 +122,15 @@
|
|||
</mold>
|
||||
</component>
|
||||
|
||||
<component>
|
||||
<component-name>limitingdependency</component-name>
|
||||
<component-class>org.navalplanner.web.limitingresources.LimitingDependencyComponent</component-class>
|
||||
<mold>
|
||||
<mold-name>default</mold-name>
|
||||
<mold-uri>/limitingresources/limitingdependency.dsp</mold-uri>
|
||||
</mold>
|
||||
</component>
|
||||
|
||||
|
||||
|
||||
</language-addon>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,310 @@
|
|||
/*
|
||||
* This file is part of NavalPlan
|
||||
*
|
||||
* Copyright (C) 2009 Fundación para o Fomento da Calidade Industrial e
|
||||
* Desenvolvemento Tecnolóxico de Galicia
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Javascript behaviuor for TaskList elements
|
||||
* @author Lorenzo Tilve Álvaro <ltilve@igalia.com>
|
||||
*/
|
||||
|
||||
webapp_context_path = window.location.pathname.split( '/' )[1];
|
||||
|
||||
zkLimitingDependencies = {};
|
||||
zkLimitingDependencies.constants = {
|
||||
END_START: "END_START",
|
||||
START_START: "START_START",
|
||||
END_END: "END_END"
|
||||
};
|
||||
|
||||
zkLimitingDependencies.getImagesDir = function() {
|
||||
return "/" + webapp_context_path + "/zkau/web/ganttz/img/";
|
||||
}
|
||||
|
||||
zkLimitingDependencies.init = function(planner){
|
||||
|
||||
}
|
||||
|
||||
zkLimitingDependencies.findImageElement = function(arrow, name) {
|
||||
var children = arrow.getElementsByTagName("img");
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
var child = children[i];
|
||||
if (child.getAttribute("class").indexOf(name) != -1) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function get_origin() {
|
||||
return YAHOO.util.Dom.getXY('listdependencies');
|
||||
}
|
||||
|
||||
zkLimitingDependencies.findPos = function(obj) {
|
||||
var pos1 = get_origin();
|
||||
var pos2 = YAHOO.util.Dom.getXY(obj.id);
|
||||
return [ pos2[0] - pos1[0], pos2[1] - pos1[1] ];
|
||||
}
|
||||
zkLimitingDependencies.findPosForMouseCoordinates = function(x, y){
|
||||
/* var pos1 = get_origin() */
|
||||
var pos1 = YAHOO.util.Dom.getXY('listtasks');
|
||||
return [x - pos1[0], y - pos1[1]];
|
||||
}
|
||||
|
||||
function getContextPath(element){
|
||||
return element.getAttribute('contextpath');
|
||||
}
|
||||
|
||||
zkLimitingDependencies.setupArrow = function(arrowDiv){
|
||||
|
||||
var image_data = [ [ "start", "pixel.gif" ], [ "mid", "pixel.gif" ],
|
||||
[ "end", "pixel.gif" ], [ "arrow", "arrow.png" ] ];
|
||||
for ( var i = 0; i < image_data.length; i++) {
|
||||
var img = document.createElement('img');
|
||||
img.setAttribute("class", image_data[i][0]+" extra_padding");
|
||||
img.src = this.getImagesDir() + image_data[i][1];
|
||||
arrowDiv.appendChild(img);
|
||||
}
|
||||
}
|
||||
|
||||
zkLimitingDependencies.drawArrow = function(dependency, orig, dest) {
|
||||
switch(dependency.getAttribute('type'))
|
||||
{
|
||||
case zkLimitingDependencies.constants.START_START:
|
||||
zkLimitingDependencies.drawArrowStartStart(dependency, orig, dest);
|
||||
break;
|
||||
case zkLimitingDependencies.constants.END_END:
|
||||
zkLimitingDependencies.drawArrowEndEnd(dependency, orig, dest);
|
||||
break;
|
||||
case zkLimitingDependencies.constants.END_START:
|
||||
default:
|
||||
zkLimitingDependencies.drawArrowEndStart(dependency, orig, dest);
|
||||
}
|
||||
}
|
||||
|
||||
zkLimitingDependencies.drawArrowStartStart = function(arrow, orig, dest){
|
||||
var xorig = orig[0] - zkTask.HALF_DEPENDENCY_PADDING;
|
||||
var yorig = orig[1] - zkTask.CORNER_WIDTH/2 + zkTask.HALF_DEPENDENCY_PADDING;
|
||||
var xend = dest[0] + zkTask.HALF_DEPENDENCY_PADDING;
|
||||
var yend = dest[1] - zkTask.HALF_DEPENDENCY_PADDING;
|
||||
if (yend < yorig) {
|
||||
yorig = orig[1] + zkTask.DEPENDENCY_PADDING;
|
||||
}
|
||||
|
||||
width1 = zkTask.CORNER_WIDTH;
|
||||
width2 = Math.abs(xend - xorig) + zkTask.CORNER_WIDTH;
|
||||
height = Math.abs(yend - yorig);
|
||||
|
||||
if (xorig > xend) {
|
||||
width1 = width2;
|
||||
width2 = zkTask.CORNER_WIDTH;
|
||||
}
|
||||
|
||||
// First segment
|
||||
var depstart = this.findImageElement(arrow, 'start');
|
||||
depstart.style.left = (xorig - width1) + "px";
|
||||
depstart.style.top = yorig + "px";
|
||||
depstart.style.width = width1 + "px";
|
||||
depstart.style.display = "inline";
|
||||
|
||||
// Second segment
|
||||
var depmid = this.findImageElement(arrow, 'mid');
|
||||
depmid.style.left = depstart.style.left;
|
||||
if (yend > yorig) {
|
||||
depmid.style.top = yorig + "px";
|
||||
} else {
|
||||
depmid.style.top = yend + "px";
|
||||
}
|
||||
depmid.style.height = height + "px";
|
||||
|
||||
// Third segment
|
||||
var depend = this.findImageElement(arrow, 'end');
|
||||
depend.style.left = depstart.style.left;
|
||||
depend.style.top = yend + "px";
|
||||
depend.style.width = width2 - zkTask.HALF_HEIGHT + "px";
|
||||
|
||||
var deparrow = this.findImageElement(arrow, 'arrow');
|
||||
deparrow.src = this.getImagesDir()+"arrow.png";
|
||||
deparrow.style.top = yend - zkTask.HALF_HEIGHT + "px";
|
||||
deparrow.style.left = xend - 15 + "px";
|
||||
}
|
||||
|
||||
|
||||
zkLimitingDependencies.drawArrowEndEnd = function(arrow, orig, dest){
|
||||
var xorig = orig[0] - zkTask.DEPENDENCY_PADDING;
|
||||
var yorig = orig[1] - zkTask.CORNER_WIDTH/2 + zkTask.HALF_DEPENDENCY_PADDING;
|
||||
var xend = dest[0] + zkTask.HALF_DEPENDENCY_PADDING;
|
||||
var yend = dest[1] - zkTask.DEPENDENCY_PADDING;
|
||||
|
||||
width1 = Math.abs(xend - xorig) + zkTask.CORNER_WIDTH;
|
||||
width2 = zkTask.CORNER_WIDTH;
|
||||
height = Math.abs(yend - yorig);
|
||||
|
||||
if (xorig > xend) {
|
||||
width2 = width1;
|
||||
width1 = zkTask.CORNER_WIDTH;
|
||||
}
|
||||
|
||||
// First segment
|
||||
var depstart = this.findImageElement(arrow, 'start');
|
||||
depstart.style.left = xorig + "px";
|
||||
if (yend > yorig) {
|
||||
depstart.style.top = yorig + "px";
|
||||
} else {
|
||||
depstart.style.top = yorig + zkTask.HEIGHT + "px";
|
||||
}
|
||||
depstart.style.width = width1 + "px";
|
||||
depstart.style.display = "inline";
|
||||
|
||||
// Second segment
|
||||
var depmid = this.findImageElement(arrow, 'mid');
|
||||
depmid.style.left = (xorig + width1) + "px";
|
||||
if (yend > yorig) {
|
||||
depmid.style.top = yorig + "px";
|
||||
} else {
|
||||
depmid.style.top = yend + "px";
|
||||
height = height + 10;
|
||||
}
|
||||
depmid.style.height = height + "px";
|
||||
|
||||
// Third segment
|
||||
var depend = this.findImageElement(arrow, 'end');
|
||||
depend.style.left = (xorig + width1 - width2) + "px";
|
||||
depend.style.top = yend + "px";
|
||||
depend.style.width = width2 + "px";
|
||||
|
||||
var deparrow = this.findImageElement(arrow, 'arrow');
|
||||
deparrow.src = this.getImagesDir()+"arrow3.png";
|
||||
deparrow.style.top = yend - 5 + "px";
|
||||
deparrow.style.left = xend - 8 + "px";
|
||||
}
|
||||
|
||||
|
||||
zkLimitingDependencies.drawArrowEndStart = function(arrow, orig, dest){
|
||||
var xorig = orig[0] - zkTask.DEPENDENCY_PADDING;
|
||||
var yorig = orig[1] - zkTask.HALF_DEPENDENCY_PADDING;
|
||||
var xend = dest[0] - zkTask.DEPENDENCY_PADDING;
|
||||
var yend = dest[1] - zkTask.HALF_DEPENDENCY_PADDING;
|
||||
|
||||
var width = (xend - xorig);
|
||||
var xmid = xorig + width;
|
||||
|
||||
// First segment not used
|
||||
var depstart = this.findImageElement(arrow, 'start');
|
||||
depstart.style.display = "none";
|
||||
|
||||
// Second segment not used
|
||||
var depmid = this.findImageElement(arrow, 'mid');
|
||||
if (yend > yorig) {
|
||||
depmid.style.top = yorig + "px";
|
||||
depmid.style.height = yend - yorig + "px";
|
||||
} else {
|
||||
depmid.style.top = yend + "px";
|
||||
depmid.style.height = yorig - yend + "px";
|
||||
}
|
||||
depmid.style.left = xorig + "px";
|
||||
|
||||
var depend = this.findImageElement(arrow, 'end');
|
||||
depend.style.top = yend + "px";
|
||||
depend.style.left = xorig + "px";
|
||||
depend.style.width = width + "px";
|
||||
|
||||
if (width < 0) {
|
||||
depend.style.left = xend + "px";
|
||||
depend.style.width = Math.abs(width) + "px";
|
||||
}
|
||||
var deparrow = this.findImageElement(arrow, 'arrow');
|
||||
if ( width == 0 ) {
|
||||
deparrow.src = this.getImagesDir()+"arrow2.png";
|
||||
deparrow.style.top = yend - 10 + "px";
|
||||
deparrow.style.left = xend - 5 + "px";
|
||||
if ( yorig > yend ) {
|
||||
deparrow.src = this.getImagesDir()+"arrow4.png";
|
||||
deparrow.style.top = yend + "px";
|
||||
}
|
||||
} else {
|
||||
deparrow.style.top = yend - 5 + "px";
|
||||
deparrow.style.left = xend - 10 + "px";
|
||||
deparrow.src = this.getImagesDir()+"arrow.png";
|
||||
|
||||
if (width < 0) {
|
||||
deparrow.src = this.getImagesDir() + "arrow3.png";
|
||||
deparrow.style.left = xend + "px";
|
||||
deparrow.style.top = yend - 5 + "px";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
zkLimitingDependency = {};
|
||||
|
||||
zkLimitingDependency.origin = function(dependency) {
|
||||
var id = dependency.getAttribute("idTaskOrig");
|
||||
return document.getElementById(id);
|
||||
}
|
||||
|
||||
zkLimitingDependency.destination = function(dependency) {
|
||||
var id = dependency.getAttribute("idTaskEnd");
|
||||
return document.getElementById(id);
|
||||
}
|
||||
|
||||
zkLimitingDependency.draw = function(dependency) {
|
||||
var orig = zkLimitingDependencies.findPos(this.origin(dependency));
|
||||
var dest = zkLimitingDependencies.findPos(this.destination(dependency));
|
||||
|
||||
// This corner case may depend on dependence type
|
||||
offsetX = this.origin(dependency).offsetWidth - zkTask.CORNER_WIDTH;
|
||||
separation = orig[0] + this.origin(dependency).offsetWidth - dest[0];
|
||||
|
||||
if (separation > 0) {
|
||||
offsetX = offsetX - separation;
|
||||
}
|
||||
if (dependency.getAttribute('type') == zkLimitingDependencies.constants.END_START
|
||||
|| dependency.getAttribute('type') == null) {
|
||||
orig[0] = orig[0] + Math.max(0, offsetX);
|
||||
} else if (dependency.getAttribute('type') == zkLimitingDependencies.constants.END_END) {
|
||||
orig[0] = orig[0] + this.origin(dependency).offsetWidth;
|
||||
dest[0] = dest[0] + this.destination(dependency).offsetWidth;
|
||||
}
|
||||
|
||||
orig[1] = orig[1] + zkTask.HEIGHT;
|
||||
dest[1] = dest[1] + zkTask.HALF_HEIGHT;
|
||||
|
||||
if ((orig[1] > dest[1])) {
|
||||
orig[1] = orig[1] - zkTask.HEIGHT;
|
||||
}
|
||||
|
||||
zkLimitingDependencies.drawArrow(dependency, orig, dest);
|
||||
|
||||
}
|
||||
|
||||
zkLimitingDependency.init = function(dependency) {
|
||||
zkLimitingDependencies.setupArrow(dependency);
|
||||
var parent = dependency.parentNode;
|
||||
if (parent.id !== "listlimitingdependencies") {
|
||||
document.getElementById("listlimitingdependencies").appendChild(dependency);
|
||||
}
|
||||
YAHOO.util.Event.onDOMReady(function() {
|
||||
var origin = zkLimitingDependency.origin(dependency);
|
||||
var destination = zkLimitingDependency.destination(dependency);
|
||||
zkLimitingDependency.draw(dependency);
|
||||
zkTask.addRelatedDependency(origin, dependency);
|
||||
zkTask.addRelatedDependency(destination, dependency);
|
||||
});
|
||||
}
|
||||
|
|
@ -18,7 +18,7 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
zkDependencylist = {};
|
||||
zkLimitingDependencylist = {};
|
||||
|
||||
zkDependencylist.init = function (cmp) {
|
||||
zkLimitingDependencylist.init = function (cmp) {
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<%@ taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c" %>
|
||||
<%@ taglib uri="http://www.zkoss.org/dsp/zk/core" prefix="z" %>
|
||||
|
||||
<c:set var="self" value="${requestScope.arg.self}"/>
|
||||
|
||||
<div class="dependency" id="${self.uuid}" z.type="limitingresources.limitingdependency.LimitingDependency"
|
||||
idTaskOrig="${self.idTaskOrig}" idTaskEnd="${self.idTaskEnd}" ${self.outerAttrs}
|
||||
type=${self.dependencyType}>
|
||||
</div>
|
||||
|
|
@ -3,9 +3,9 @@
|
|||
|
||||
<c:set var="self" value="${requestScope.arg.self}"/>
|
||||
|
||||
<div id="${self.uuid}" z.type="ganttz.dependencylist.Dependencylist" z.autoz="true"${self.outerAttrs}">
|
||||
<div id="${self.uuid}" z.type="limitingresources.limitingdependencylist.LimitingDependencylist" z.autoz="true"${self.outerAttrs}">
|
||||
|
||||
<div id="listdependencies">
|
||||
<div id="listlimitingdependencies">
|
||||
<c:forEach var="child" items="${self.children}">
|
||||
${z:redraw(child, null)}
|
||||
</c:forEach>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<c:set var="self" value="${requestScope.arg.self}"/>
|
||||
|
||||
<div id="${self.uuid}" ${self.outerAttrs} class="limitingresourceslist"
|
||||
z.type="ganttz.limitingresources.limitingresourceslist.LimitingResourcesList">
|
||||
z.type="limitingresources.limitingresourceslist.LimitingResourcesList">
|
||||
<c:forEach var="child" items="${self.children}">
|
||||
${z:redraw(child, null)}
|
||||
</c:forEach>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue