Package net.sourceforge.ganttproject.chart.GraphicPrimitiveContainer

Examples of net.sourceforge.ganttproject.chart.GraphicPrimitiveContainer.Rectangle


    private void renderLoads(
            Load prevLoad, Load curLoad, LinkedList/*<Offset>*/ offsets, int ypos, String suffix) {
        final Date prevEnd = curLoad.startDate;
        final Date prevStart = prevLoad.startDate;

        Rectangle nextRect = createRectangle(offsets, prevStart, prevEnd, ypos);
        if (nextRect==null) {
            return;
        }
        String style;
        if (prevLoad.isResourceUnavailable()) {
            style = "dayoff";
        }
        else {
            suffix += curLoad.load == 0 ? ".last" : "";

            if (prevLoad.load < 100f) {
                style = "load.underload";
            }
            else if (prevLoad.load > 100f) {
                style = "load.overload";
            }
            else {
                style = "load.normal";
            }
            style += suffix;
        }
        nextRect.setStyle(style);
        nextRect.setModelObject(new ResourceLoad(prevLoad.load));
    }
View Full Code Here


        while (loads.hasNext() && offsets.getFirst()!=null) {
            final Load nextLoad = (Load) loads.next();
            final Date nextStart = nextLoad.startDate;
            final Date nextEnd = nextLoad.endDate;

            Rectangle nextRect = createRectangle(offsets, nextStart, nextEnd, ypos);
            if (nextRect==null) {
                continue;
            }
            String style;
            if (nextLoad.load < 100f) {
                style = "load.underload";
            }
            else if (nextLoad.load > 100f) {
                style = "load.overload";
            }
            else {
                style = "load.normal";
            }
            style += ".first.last";
            nextRect.setStyle(style);
            nextRect.setModelObject(new ResourceLoad(nextLoad.load));
        }
    }
View Full Code Here

            rectStart = -1;
        }
        if (rectStart==-1 || rectEnd==-1) {
            return createRectangle(getDefaultOffsetsInRange(offsetBefore, offsetAfter), start, end, ypos);
        }
        Rectangle nextRect = getPrimitiveContainer().createRectangle(
                rectStart, ypos, rectEnd-rectStart, getConfig().getRowHeight());
        return nextRect;
    }
View Full Code Here

        for (int i=0; i<myActivitiesOutOfView.size(); i++) {
            TaskActivity next = (TaskActivity) myActivitiesOutOfView.get(i);
            Integer nextOrdNumber = (Integer) myActivity2ordinalNumber.get(next);
            int topy = nextOrdNumber.intValue() * getRowHeight() + 4; // JA Added
            GraphicPrimitiveContainer container = getContainerFor(next.getTask());
            Rectangle rectangle = container.createRectangle(-10, topy, 1, getRowHeight());
            container.bind(rectangle, next);
        }
        for (int i=0; i<myVisibleActivities.size(); i++) {
            TaskActivity next = (TaskActivity) myVisibleActivities.get(i);
            Integer nextOrdNumber = (Integer) myActivity2ordinalNumber.get(next);
            int topy = nextOrdNumber.intValue() * getRowHeight() + 4; // JA Added
            GraphicPrimitiveContainer container = getContainerFor(next.getTask());
            Rectangle rectangle = container.createRectangle(getWidth()+10, topy, 1, getRowHeight());
            container.bind(rectangle, next);
        }
       
        if (myDependenciesRenderingEnabled) {
            createDependencyLines();
View Full Code Here

                .getBottomUnitWidth());

        Integer nextOrdNumber = (Integer) myActivity2ordinalNumber.get(task);
        GraphicPrimitiveContainer container = getPrimitiveContainer();

        Rectangle rect = container.createRectangle(posX, topy, length, 6);
        String style = "";
        if (task.isMilestone()) {
            style = "previousStateTask.milestone";
        } else if (task.hasNested()) {
            style = "previousStateTask.super";
            if (task.isAPart())
                style = "previousStateTask.super.apart";
        } else {
            style = "previousStateTask";
        }
        if (task.getState() == GanttPreviousStateTask.EARLIER)
            style = style + ".earlier";
        else if (task.getState() == GanttPreviousStateTask.LATER)
            style = style + ".later";
        rect.setStyle(style);
    }
View Full Code Here

                primitiveContainer.createLine(first.x, first.y, second.x,
                        second.y);
                primitiveContainer.createLine(second.x, second.y, third.x,
                        third.y);
                if (arrowBoundary != null) {
                    Rectangle arrow = getPrimitiveContainer().createRectangle(
                            arrowBoundary.x, arrowBoundary.y,
                            arrowBoundary.width, arrowBoundary.height);
                    arrow.setStyle(style);
                }
            } else {
                Point first = next.myDependeeVector.getPoint(3);
                if (next.myDependantVector.reaches(first)) {
                    Point second = new Point(first.x, next.myDependantVector
                            .getPoint().y);
                    primitiveContainer.createLine(next.myDependeeVector
                            .getPoint().x, next.myDependeeVector.getPoint().y,
                            first.x, first.y);
                    primitiveContainer.createLine(first.x, first.y, second.x,
                            second.y);
                    primitiveContainer.createLine(second.x, second.y,
                            next.myDependantVector.getPoint().x,
                            next.myDependantVector.getPoint().y);
                    int xsign = signum(next.myDependantVector.getPoint().x
                            - second.x);
                    java.awt.Rectangle arrowBoundary = new java.awt.Rectangle(
                            next.myDependantVector.getPoint(7).x,
                            next.myDependantVector.getPoint().y - 3, xsign * 7,
                            6);
                    Rectangle arrow = primitiveContainer.createRectangle(
                            arrowBoundary.x, arrowBoundary.y,
                            arrowBoundary.width, arrowBoundary.height);
                    arrow.setStyle(xsign < 0 ? "dependency.arrow.left"
                            : "dependency.arrow.right");
                } else {
                    Point forth = next.myDependantVector.getPoint(3);
                    Point second = new Point(first.x, (first.y + forth.y) / 2);
                    Point third = new Point(forth.x, (first.y + forth.y) / 2);
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.chart.GraphicPrimitiveContainer.Rectangle

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.