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

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


     
      Set predecessors=new HashSet();
      Set successors=new HashSet();
      for (Iterator i=nodeMap.values().iterator();i.hasNext();){
          Node node=(Node)i.next();
          GraphicNode gnode=(GraphicNode)node.getValue();
          //resetCachePertLevel(gnode);
          if (node.getPredecessors().size()==0) predecessors.add(node);
      }
     
      while (predecessors.size()>0){
View Full Code Here


 
 
  private void updateSuccessorsPertLevel(Set predecessors,Set successors){
      for (Iterator i=predecessors.iterator();i.hasNext();){
          Node pre=(Node)i.next();
          GraphicNode gpre=(GraphicNode)pre.getValue();
          for (Iterator j=pre.getSuccessors().iterator();j.hasNext();){
              Node suc=(Node)j.next();
              successors.add(suc);
            GraphicNode gsuc=(GraphicNode)suc.getValue();
            correctPertLevel(gpre,gsuc);
          }
      }
  }
View Full Code Here

    Point p = e.getPoint();
    int row = rowAtPoint(p);
    int col = columnAtPoint(p);
    Rectangle bounds = getCellRect(row, col, false);
    SpreadSheetModel model = (SpreadSheetModel) getModel();
    GraphicNode node = model.getNode(row);
    return NameCellComponent.isOnIcon(new Point((int) (p.getX() - bounds.getX()), (int) (p.getY() - bounds.getY())), bounds.getSize(), model
        .getCache().getLevel(node));
  }
View Full Code Here

    Point p = e.getPoint();
    int row = rowAtPoint(p);
    int col = columnAtPoint(p);
    Rectangle bounds = getCellRect(row, col, false);
    SpreadSheetModel model = (SpreadSheetModel) getModel();
    GraphicNode node = model.getNode(row);
    return NameCellComponent.isOnText(new Point((int) (p.getX() - bounds.getX()), (int) (p.getY() - bounds.getY())), bounds.getSize(), model
        .getCache().getLevel(node));
  }
View Full Code Here

  }
 
  public Object getObjectInRow(int row) {
    if (row == -1)
      return null;
    GraphicNode gnode = getNodeFromCacheRow(row);
    if (gnode == null)
      return null;
    return gnode.getNode().getImpl();
 
  }
View Full Code Here

*
*/
public class CellUtility {
  public static void setAppearance(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column, JComponent component){
    CommonSpreadSheetModel model = (CommonSpreadSheetModel) table.getModel();
    GraphicNode node = model.getNode(row);
    CellFormat cellFormat=model.getCellProperties(node);
    if (isSelected){
      component.setForeground(/*table.getSelectionForeground()*/Color.WHITE);
      component.setBackground(/*Color.BLACK*/GraphicManager.getInstance().getLafManager().getSelectedBackgroundColor());
    }else{
 
View Full Code Here

//        column, textComponent);
    component.setOffline(false);
    CellUtility.setAppearance(table, value, isSelected, hasFocus, row,
        column, component);
    CommonSpreadSheetModel model = (CommonSpreadSheetModel) table.getModel();
    GraphicNode node = model.getNode(row);
    component.setText(value == null ? "" : value.toString());
    int level=model.getCache().getLevel(node);
    component.setLevel((node.isVoid())?(level+1):level);
    component.setLazy(node.isLazyParent());
    component.setFetched(node.isFetched());
    if (model.getCellProperties(node).isCompositeIcon()) {
      component.setCollapsed(node.isCollapsed());
    } else {
      component.setLeaf(node.isVoid());
    }
    FontManager.setComponentFont(model.getCellProperties(node),component);
    component.doLayout();
    return component;
  }
View Full Code Here

    public GraphZone getNodeAt(double x,double y){
    double rowHeight=((Gantt)graph).getRowHeight();
    int row=(int)Math.floor(y/rowHeight);
    if (row<0||row>=graph.getModel().getCache().getSize()) return null;
    GraphicNode node=(GraphicNode)graph.getModel().getCache().getElementAt(row);
    double y0=getBarY(row)+node.getGanttShapeOffset();//row*rowHeight+config.getGanttBarYOffset();
    double h=node.getGanttShapeHeight();
    double delta=config.getSelectionSquare();
    if (y<y0/*-delta*/||y>y0/*+delta*/+h) return null;
    CoordinatesConverter coord=getCoord();
    double t=coord.toTime(x);
    double deltat=coord.toDuration(delta);
    if  (node.contains(t,deltat,deltat,coord)==null) return null;
    double progessH=config.getGanttProgressBarHeight();
    GraphZone zone=new GraphZone();
    zone.setObject(node);
    if (y>=y0+h/2-progessH/2&&y<y0+h/2+progessH/2) zone.setZoneId(PROGRESS_BAR_ZONE_ID);
    return zone;
View Full Code Here

    }
    private NodeSelectionIntervalConsumer nodeSelectionIntervalConsumer=new NodeSelectionIntervalConsumer();

    protected void computeNodeSelection(double x,double y){
    //would have prefered an iterator
      GraphicNode node=(GraphicNode)selected;
    node.consumeIntervals(nodeSelectionIntervalConsumer.init(x,node));
    }
View Full Code Here


    protected Shape getBarShadowBounds(double x,double y){
    double deltaX=x-x0;
    CoordinatesConverter coord=getCoord();
    GraphicNode node=(GraphicNode)selected;
    Rectangle2D bounds;
    double xStart=coord.toX((selectedIntervalNumber==0&&state==BAR_MOVE)?node.getStart():selectedInterval.getStart());
    if (state==PROGRESS_BAR_MOVE){
      double completedX=coord.toX(node.getCompleted());//CoordinatesConverter.adaptSmallBarEndX(xStart,coord.toX(node.getCompleted()),config);
      bounds=new Rectangle2D.Double(xStart,((GanttUI)ui).getBarY(node.getRow())+node.getGanttShapeOffset()+(node.getGanttShapeHeight()-config.getGanttProgressBarHeight())/2,completedX-xStart+deltaX,config.getGanttProgressBarHeight());
    }else{
      double xEnd=(selectedIntervalNumber==0&&state==BAR_MOVE)?CoordinatesConverter.adaptSmallBarEndX(coord.toX(node.getStart()),coord.toX(node.getEnd()),node,config):coord.toX(selectedInterval.getEnd());
      double w=xEnd-xStart;
      switch (state) {
      case BAR_MOVE:
        bounds=new Rectangle2D.Double(xStart+deltaX,((GanttUI)ui).getBarY(node.getRow())+node.getGanttShapeOffset(),w,node.getGanttShapeHeight());
        break;
      case BAR_MOVE_START:
        bounds=new Rectangle2D.Double(xStart+deltaX,((GanttUI)ui).getBarY(node.getRow())+node.getGanttShapeOffset(),w-deltaX,node.getGanttShapeHeight());
        break;
      case BAR_MOVE_END:
        bounds=new Rectangle2D.Double(xStart,((GanttUI)ui).getBarY(node.getRow())+node.getGanttShapeOffset(),w+deltaX,node.getGanttShapeHeight());
        break;
      default:
        return null;
      }
    }
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.