Package org.ganttproject.chart.pert.PertChartAbstraction

Examples of org.ganttproject.chart.pert.PertChartAbstraction.TaskGraphNode


     */
    private void updateGraphNodesInfo() {
        if (myTaskGraphNodes != null) {
            Iterator it = myTaskGraphNodes.iterator();
            while (it.hasNext()) {
                TaskGraphNode tgn = (TaskGraphNode) it.next();
                int id = tgn.getID();
                if(getGraphicalNodeByID(id) != null)
                    getGraphicalNodeByID(id).updateData(tgn);
            }
        }
    }
View Full Code Here


     */
    private boolean isZeroPosition(TaskGraphNode taskGraphNode) {
        Iterator it = myTaskGraphNodes.iterator();
        while (it.hasNext())
        {
            TaskGraphNode t = (TaskGraphNode) it.next();
            if (t.getSuccessors().contains(taskGraphNode))
                return false;
        }
        return true;
    }
View Full Code Here

    private void process() {
        Iterator it = myTaskGraphNodes.iterator();
        while (it.hasNext())
        {
            TaskGraphNode tgn = (TaskGraphNode) it.next();
            if (isZeroPosition(tgn))
            {
                add(0, new GraphicalNode(tgn));
            }
        }
        int col = 0;
        List l = getNodesThatAreInASpecificSuccessorPosition(col);
        // ici tous les 0 position sont faits.
        while (l != null)
        {
            Iterator it2 = l.iterator();
            while (it2.hasNext())
            {
                TaskGraphNode tnode = (TaskGraphNode) it2.next();
                GraphicalNode gnode = this.getGraphicalNodeByID(tnode.getID());
                if(gnode == null)
                {
                    gnode = this.createGraphicalNode(tnode);
                }
                else
View Full Code Here

    private void moveRight(GraphicalNode graphicalNode)
    {
        Iterator successors = graphicalNode.node.getSuccessors().iterator();
        while(successors.hasNext())
        {
            TaskGraphNode successor = (TaskGraphNode)successors.next();
            this.moveRight(this.getGraphicalNodeByID(successor.getID()));
        }
        int newCol = graphicalNode.col +1;
        if(this.isOccupied(graphicalNode.row, newCol))
            this.moveRight(this.getNode(graphicalNode.row, newCol));
        graphicalNode.col = newCol;
View Full Code Here

            return null;
       
        List res = new ArrayList();
        for (int i = 0; i < graphicaleNodes.size(); i++) {
            GraphicalNode gn = (GraphicalNode) graphicaleNodes.get(i);
            TaskGraphNode tgn = gn.node;
            res.addAll(tgn.getSuccessors());
        }
       
        return res;
    }
View Full Code Here

    {
        List ancestors = new ArrayList();
        Iterator tnodes = this.myTaskGraphNodes.iterator();
        while(tnodes.hasNext())
        {
            TaskGraphNode tnode = (TaskGraphNode)tnodes.next();
            List successor = tnode.getSuccessors();
            if(successor.contains(tgn))
                ancestors.add(tnode);
        }
       
        return ancestors;
View Full Code Here

        return ancestors;
    }
   
    private boolean isCrossingNode(GraphicalNode gnode)
    {
        TaskGraphNode tgn = gnode.node;
        List list = this.getAncestor(tgn);
        if(list.size()>0)
        {
            Iterator ancestors = list.iterator();
            while(ancestors.hasNext())
            {
                TaskGraphNode ancestor = (TaskGraphNode)ancestors.next();
                GraphicalNode gancestor = this.getGraphicalNodeByID(ancestor.getID());
                if(gancestor.col<gnode.col-1)
                {
                    for(int col=gnode.col-1; col>gancestor.col; col--)
                    {
                        if(this.isOccupied(gnode.row, col))
View Full Code Here

        {
            GraphicalNode othergnode = (GraphicalNode)nodes.next();
            Iterator othersuccessors = othergnode.node.getSuccessors().iterator();
            while(othersuccessors.hasNext())
            {
                TaskGraphNode othersuccessor = (TaskGraphNode)othersuccessors.next();
                GraphicalNode othersuccessornode = this.getGraphicalNodeByID(othersuccessor.getID());
                if(maxUp < gnode.row)
                {
                    //some arrows are going up
                    if(othersuccessornode.row <= gnode.row && !gnode.node.getSuccessors().contains(othersuccessor))
                        return true;
View Full Code Here

        Iterator it = myGraphicalNodes.iterator();
        while (it.hasNext()) {
            GraphicalNode gn = (GraphicalNode) it.next();
            Iterator itSuccessors = gn.node.getSuccessors().iterator();
            while (itSuccessors.hasNext()) {
                TaskGraphNode tgn = (TaskGraphNode) itSuccessors.next();
                int id = tgn.getID();

                GraphicalArrow arrow = new GraphicalArrow(gn,
                        getGraphicalNodeByID(id));
                myGraphicalArrows.add(arrow);
            }
View Full Code Here

TOP

Related Classes of org.ganttproject.chart.pert.PertChartAbstraction.TaskGraphNode

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.