Package org.zkoss.ganttz.data.resourceload

Examples of org.zkoss.ganttz.data.resourceload.LoadTimeLine


    private TreeitemRenderer getRendererForTree() {
        return new TreeitemRenderer() {
            @Override
            public void render(Treeitem item, Object data)
                    {
                LoadTimeLine line = (LoadTimeLine) data;
                item.setOpen(false);
                item.setValue(line);

                Treerow row = new Treerow();
                Treecell cell = new Treecell();
                Component component = createComponent(line);
                item.appendChild(row);
                row.appendChild(cell);

                appendOperations(cell, line);

                cell.appendChild(component);

                collapse(line);
                addExpandedListener(item, line);

                row.setSclass("resourceload-leftpanel-row");
            }

            private void appendOperations(final Treecell cell,
                    final LoadTimeLine line) {
                if (line.getRole().isVisibleScheduled()) {
                    appendButtonPlan(cell, line);
                }
            }

            private void appendButtonPlan(final Treecell cell,
View Full Code Here


        return result;
    }

    private List<LoadTimeLine> getLineChildrenBy(Treeitem item) {
        List<LoadTimeLine> result = new ArrayList<LoadTimeLine>();
        LoadTimeLine line = getLineByTreeitem(item);
        if (line != null) {
            result.addAll(line.getAllChildren());
        }
        return result;
    }
View Full Code Here

        }
        return result;
    }

    private LoadTimeLine getLineByTreeitem(Treeitem child) {
        LoadTimeLine line = null;
        try {
            line = (LoadTimeLine) child.getValue();
        } catch (Exception e) {
            return null;
        }
View Full Code Here

    public ResourceLoadList(TimeTracker timeTracker,
            MutableTreeModel<LoadTimeLine> timelinesTree) {
        zoomListener = adjustTimeTrackerSizeListener();
        timeTracker.addZoomListener(zoomListener);
        LoadTimeLine current = timelinesTree.getRoot();
        List<LoadTimeLine> toInsert = new ArrayList<LoadTimeLine>();
        fill(timelinesTree, current, toInsert);
        insertAsComponents(timeTracker, toInsert);
    }
View Full Code Here

    private void fill(MutableTreeModel<LoadTimeLine> timelinesTree,
            LoadTimeLine current, List<LoadTimeLine> result) {
        final int length = timelinesTree.getChildCount(current);
        for (int i = 0; i < length; i++) {
            LoadTimeLine child = timelinesTree.getChild(current, i);
            result.add(child);
            fill(timelinesTree, child, result);
        }
    }
View Full Code Here

                Criterion criterion,
                List<? extends ResourceAllocation<?>> allocations) {
            List<SpecificResourceAllocation> specific = ResourceAllocation
                    .getOfType(SpecificResourceAllocation.class, allocations);

            LoadTimeLine main = new LoadTimeLine(_("Specific Allocations"),
                    createPeriods(criterion, specific), "related-specific",
                    getCurrentTimeLineRole(criterion));
            List<LoadTimeLine> children = buildGroupsFor(ResourceAllocation
                    .byResource(new ArrayList<ResourceAllocation<?>>(specific)));
            return new LoadTimeLine(main, children);
        }
View Full Code Here

        private List<LoadTimeLine> buildGroupsFor(
                Map<Resource, List<ResourceAllocation<?>>> map) {
            List<LoadTimeLine> result = new ArrayList<LoadTimeLine>();
            for (Entry<Resource, List<ResourceAllocation<?>>> each : map
                    .entrySet()) {
                LoadTimeLine l = buildGroupFor(each.getKey(), each.getValue());
                if (!l.isEmpty()) {
                    result.add(l);
                }
            }
            return result;
        }
View Full Code Here

        }

        LoadTimeLine buildGroupFor(Resource resource,
                List<? extends ResourceAllocation<?>> sortedByStartDate) {
            TimeLineRole<BaseEntity> role = getCurrentTimeLineRole(resource);
            LoadTimeLine result = new LoadTimeLine(buildTimeLine(resource,
                    resource.getName(), sortedByStartDate, "resource", role),
                    buildSecondLevel(resource, sortedByStartDate));
            return result;
        }
View Full Code Here

                    result.addAll(buildTimeLinesForOrder(resource,
                            forCurrentOrder));
                }
                byOrder.remove(getCurrentOrder());
                // build time lines for other orders
                LoadTimeLine lineOthersOrders = buildTimeLinesForOtherOrders(
                        resource, byOrder);
                if (lineOthersOrders != null) {
                    result.add(lineOthersOrders);
                }
            } else {
View Full Code Here

            List<LoadTimeLine> secondLevel = new ArrayList<LoadTimeLine>();
            for (Entry<Task, List<ResourceAllocation<?>>> entry : byTask
                    .entrySet()) {
                Task task = entry.getKey();
                TimeLineRole<BaseEntity> role = getCurrentTimeLineRole(task);
                LoadTimeLine timeLine = buildTimeLine(resource, task.getName(),
                        entry.getValue(), "specific", role);
                if (!timeLine.isEmpty()) {
                    secondLevel.add(timeLine);
                }

            }
            return secondLevel;
View Full Code Here

TOP

Related Classes of org.zkoss.ganttz.data.resourceload.LoadTimeLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.