Package com.projity.pm.graphic.model.cache

Examples of com.projity.pm.graphic.model.cache.GraphicNode$CacheIntervalConsumer


              i.remove();
            }
        }
    }
    private void removeAssignments(List list){
      GraphicNode current;
        for (ListIterator i=list.listIterator();i.hasNext();){
            current=(GraphicNode)i.next();
            if (current.isAssignment()){
              i.remove();
            }
        }
    }
View Full Code Here


            }
        }
    }
    private Map<GraphicNode,List<GraphicNode>> extractAssignments(List list){
      Map<GraphicNode,List<GraphicNode>> map=new HashMap<GraphicNode, List<GraphicNode>>();
      GraphicNode current,last;
      Stack<GraphicNode> path=new Stack<GraphicNode>();
        for (ListIterator i=list.listIterator();i.hasNext();){
            current=(GraphicNode)i.next();
            if (current.getLevel()==1){
              path.clear();
              path.push(current);
              continue;
            }
            while ((last=path.peek()).getLevel()>=current.getLevel()) path.pop();
            if (current.isAssignment()){
              GraphicNode task=path.peek();
              List<GraphicNode> ass=map.get(task);
              if (ass==null){
                ass=new LinkedList<GraphicNode>();
                map.put(task, ass);
              }
View Full Code Here

            path.push(current);
        }
        return map;
    }
    private void recoverAssignments(List list,Map<GraphicNode,List<GraphicNode>> map){
      GraphicNode current=null;
        for (ListIterator i=list.listIterator();i.hasNext();){
            current=(GraphicNode)i.next();
            if (map.containsKey(current)){
              List<GraphicNode> ass=map.get(current);
              for (GraphicNode a : ass) {
View Full Code Here

      private GraphicNodeComparator(NodeSorter comparator,NodeTransformer composition){
          this.comparator=comparator;
          this.composition=composition;
      }
      public int compare(Object o1, Object o2) {
        GraphicNode n1=(GraphicNode)o1;
        GraphicNode n2=(GraphicNode)o2;
        if (n1==n2) return 0;
        else if (n1.isVoid()) return 1;
        else if (n2.isVoid()) return -1;
        if (composition==null)
          return comparator.compare(n1.getNode(),n2.getNode());
        else return comparator.compare(composition.evaluate(n1.getNode()),composition.evaluate(n2.getNode()));
      }
View Full Code Here

        dependency=(GraphicDependency)i.next();
        paintLink(g2,dependency);
      }
     
     
      GraphicNode node;
      Rectangle bounds;
      for (ListIterator i=graphInfo.getCache().getIterator();i.hasNext();){
        node=(GraphicNode)i.next();
        bounds=getBounds(node);
        if (bounds==null) continue;
View Full Code Here

  }

 
    protected boolean switchOnLinkCreation(double x, double y){
      if (state!=BAR_SELECTION) return false;
    GraphicNode node=(GraphicNode)selected;
    GeneralPath shape=getShape(node);
    if (shape==null) return false;
    return (node.getNode().getImpl() instanceof HasDependencies&&!shape.contains(x,y));
    }
View Full Code Here

   
    public void execute(Object arg0) {
      format = (BarFormat)arg0;
     
      //if (format.getMiddle()!=null){
          GraphicNode from=dependency.getPredecessor();
          GraphicNode to=dependency.getSuccessor();
//          Rectangle2D fromBounds=scale(getBounds(from));
//          Rectangle2D toBounds=scale(getBounds(to));
          double[] fromPoints=new double[4];
          double[] toPoints=new double[4];
          updateLinkConnections(from,fromPoints);
View Full Code Here

      spreadsheetBounds=new Rectangle(spreadsheetBounds.x,spreadsheetBounds.y,printSpreadsheetBounds.width,printSpreadsheetBounds.height);
    }
//    System.out.println("spreadsheetBounds="+spreadsheetBounds);
    int row=row0;
    for (Iterator i=graphInfo.getCache().getIterator(row0);i.hasNext()&&row<=row1;row++){
      GraphicNode gnode=(GraphicNode)i.next();
      paintRow(g2, row, row0, h,col0,col1,gnode,spreadsheetBounds);
      h+=rowH;
    }
    paintColumnHeader(g2,col0,col1,spreadsheetBounds);
  }
View Full Code Here

    Rectangle2D ref=new Rectangle2D.Double(config.getPertXOffset(),config.getPertYOffset(),config.getPertCellWidth(),config.getPertCellHeight());
    int row=0;
    int col=-1;
    setEmpty();
    for (Iterator i=cache.getIterator();i.hasNext();){
        GraphicNode current=(GraphicNode)i.next();
        int currentCol=cache.getPertLevel(current)-1;
        if (currentCol<=col) row++;
        col=currentCol;
       
        TexturedShape texturedShape=findShape(current);
        if (texturedShape==null) continue;
        double centerX=origin.getX()+ref.getMaxX()*col+ref.getWidth()/2;
        double centerY=origin.getY()+ref.getMaxY()*row+ref.getHeight()/2;
        //System.out.println(centerX+"/"+centerY);
        GeneralPath shape=texturedShape.toGeneralPath(ref.getWidth(),ref.getHeight(),centerX-ref.getWidth()/2,centerY,null);
        current.setPertShape(shape,centerX,centerY);
        Rectangle cellBounds=network.scale(shape.getBounds());
        if (isEmpty())
        bounds.setBounds(cellBounds);
      else Rectangle.union(bounds,cellBounds,bounds);
    }
View Full Code Here

        if (i.hasPrevious())
          i.previous();
    }

    boolean found = false;
    GraphicNode gnode = null;
    Object obj;
    Node node;
    while (ctx.isForward() ? i.hasNext() : i.hasPrevious()) {
      gnode=(GraphicNode)(ctx.isForward() ? i.next() : i.previous());
      if (gnode.isVoid())
        continue;
      node = gnode.getNode();
      obj = node.getImpl();
      if (ctx.matches(obj)) {
        found = true;
        break;
      }
View Full Code Here

TOP

Related Classes of com.projity.pm.graphic.model.cache.GraphicNode$CacheIntervalConsumer

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.