@Override public boolean match(GanttTask object, Object expression) { if (CollectionUtils.isEmpty(object.getChildren()) == true) { return false; } for (final GanttTask child : object.getChildren()) { if (child.getId() != null && child.getId().equals(expression) == true) { return true; } } return false; } }, id);
private Collection<GanttTask> getAllVisibleGanttObjects(final Collection<GanttTask> col, final GanttTask node) { if (node != rootNode) { if (node.isVisible() == true) { col.add(node); } } if (CollectionUtils.isEmpty(node.getChildren()) == true) { return col; } for (final GanttTask child : node.getChildren()) { getAllVisibleGanttObjects(col, child); } return col; }
@Override protected Object newInstance(final Class<?> clazz, final Element el, final String attrName, final String attrValue) { if ("predecessor".equals(attrName) == true && XmlConstants.NULL_IDENTIFIER.equals(attrValue) == true) { // Field should set to null. return Status.IGNORE; } if (GanttTask.class.isAssignableFrom(clazz) == true) { final GanttTask ganttObject = getGanttObject(taskTree, ganttChartData, el); if (ganttObject == null) { return new GanttTaskImpl(); // Gantt task not related to a ProjectForge task. } return ganttObject; } else if (Collection.class.isAssignableFrom(clazz) == true) { final GanttTask ganttObject = getGanttObject(taskTree, ganttChartData, el.getParent()); if (ganttObject != null && ganttObject.getChildren() != null) { return ganttObject.getChildren(); } } return null; }
protected void addDescendantNodes(GanttTreeTableNode parent) { final GanttTask parentObj = parent.getGanttObject(); if (parentObj.getChildren() != null) { for (final GanttTask childNode : parentObj.getChildren()) { final GanttTreeTableNode child = new GanttTreeTableNode(parent, childNode); addTreeTableNode(child); addDescendantNodes(child); } } } }
protected void refresh() { if (ganttChartData == null && getData().getTaskId() != null) { ganttChartData = getBaseDao().readGanttObjects(getData()); final GanttTask rootObject = ganttChartData.getRootObject(); if (rootObject != null && CollectionUtils.isNotEmpty(rootObject.getChildren()) == true && isNew() == true) { // For new charts set all children on level one as visible. for (final GanttTask child : rootObject.getChildren()) { child.setVisible(true); } } } form.ganttChartEditTreeTablePanel.setGanttChartData(ganttChartData).refresh(); redraw(); }
if (ganttTask.getChildren() != null) { for (final GanttTask child : ganttTask.getChildren()) { processPredecessor(ganttChartData, taskTree, child);
private Integer getNextId(final GanttTask node, final int id) { Integer result = null; if (node == null) { return null; } if (node.getId() != null && ((Integer) node.getId()) <= id) { result = ((Integer) node.getId()) - 1; } final List<GanttTask> children = node.getChildren(); if (children == null) { return result; } for (final GanttTask child : children) { final Integer i = getNextId(child, id); if (i == null) { continue; } if (result != null && i <= result || result == null && i <= id) { result = i; } } return result; } }
private static void setPredecessors(final Map<Serializable, Task> taskMap, final GanttTask ganttTask) { if (ganttTask.getPredecessor() != null) { final Task task = taskMap.get(ganttTask.getId()); final Task predecessor = taskMap.get(ganttTask.getPredecessorId()); if (task == null) { log.error("Oups, task with id '" + ganttTask.getId() + "' not found."); } else if (predecessor == null) { log.error("Oups, predecessor task with id '" + ganttTask.getPredecessorId() + "' not found."); } else { final Integer predecessorOffset = ganttTask.getPredecessorOffset(); final int value; if (predecessorOffset == null) { value = 0; } else { value = predecessorOffset.intValue(); } task.addPredecessor(predecessor, getRelationType(ganttTask.getRelationType()), Duration.getInstance(value, TimeUnit.DAYS)); } } final List<GanttTask> children = ganttTask.getChildren(); if (children == null) { return; } for (final GanttTask child : children) { setPredecessors(taskMap, child); } }
private void drawGanttObjects(final Document doc, final Element g, final Element diagram, final Element grid, final Collection<GanttTask> allVisibleGanttObjects) if (CollectionUtils.isEmpty(rootNode.getChildren()) == true) { return; } else { type = GanttObjectType.ACTIVITY; if (node.getChildren() != null) { for (final GanttTask child : node.getChildren()) { if (child.isVisible() == true) { type = GanttObjectType.SUMMARY;
&& node.getChildren() != null) { for (final GanttTask child : node.getChildren()) { final Date date = getCalculatedStartDate(child, startDateSet, endDateSet); if (startDate == null) {
&& node.getChildren() != null && node.getDuration() == null) { for (final GanttTask child : node.getChildren()) { final Date date = getCalculatedEndDate(child, startDateSet, endDateSet); if (date != null && (endDate == null || date.after(endDate)) == true) {
if (rootNode == null || rootNode.getChildren() == null) { return null;
final List<GanttTask> children = ganttTask.getChildren(); if (children == null) { return;
final List<GanttTask> children = ganttChart.getRootNode().getChildren(); if (children != null) { final Map<Serializable, Task> taskMap = new HashMap<Serializable, Task>();