Package com.projity.pm.graphic.views

Examples of com.projity.pm.graphic.views.BaseView



//      taskType && (!notVoid || currentImpl == null || ((Task)currentImpl).getOwningProject() == null || ((Task)currentImpl).getOwningProject() == project);
    getMenuManager().setActionEnabled(ACTION_INSERT_PROJECT,!readOnly &&insertProject);

    BaseView view=null;
    DocumentFrame frame=getCurrentFrame();
    if (frame!=null){
      view=(BaseView)frame.getMainView().getTopComponent();
    }
    getMenuManager().setActionEnabled(ACTION_SCROLL_TO_TASK,isHasStartAndEnd&&view.canScrollToTask());

    if (currentFrame != null) {
      currentFrame.refreshUndoButtons();
      //refreshSaveStatus(false);
    }
View Full Code Here


  public static PrintDocumentFactory getInstance(){
    if (instance==null) instance=new PrintDocumentFactory();
    return instance;
  }
  public GraphPageable createDocument(DocumentFrame frame,boolean pdfAsDefault){
    BaseView view=frame.getActiveTopView();
    SVGRenderer renderer;
    NodeModelCache cache;
    if (view instanceof GanttView){
      renderer=new GanttSVGRenderer();
      SpreadSheet sp=frame.getActiveSpreadSheet();
      SpreadSheetFieldArray fieldArray=sp.getFieldArrayWithWidths(null);
      List<Integer> colWidth=null;
//      if (sp!=null){
//        fieldArray=(SpreadSheetFieldArray)sp.getFieldArray();
//        colWidth=getColWidth(sp, fieldArray);
//      }
      cache=NodeModelCacheFactory.getInstance().createFilteredCache((ReferenceNodeModelCache)frame.getReferenceCache(true),"OfflineGantt",null);
      ((GanttSVGRenderer)renderer).init(frame.getProject(),cache,fieldArray,colWidth,frame.getScale(),true);
      renderer.getParams().setSupportLeftAndRightParts(true);
    }else if (view instanceof ResourceView){
      renderer=new GanttSVGRenderer();
      SpreadSheet sp=frame.getActiveSpreadSheet();
      SpreadSheetFieldArray fieldArray=sp.getFieldArrayWithWidths(null);
      List<Integer> colWidth=null;
//      if (sp!=null){
//        fieldArray=(SpreadSheetFieldArray)sp.getFieldArray();
//        colWidth=getColWidth(sp, fieldArray);
//      }
      cache=NodeModelCacheFactory.getInstance().createFilteredCache((ReferenceNodeModelCache)frame.getReferenceCache(false),"OfflineResources",null);
      ((GanttSVGRenderer)renderer).init(frame.getProject(),cache,fieldArray,colWidth,frame.getScale(),false);
    }else if (view instanceof ProjectView){
      renderer=new GanttSVGRenderer();
      SpreadSheet sp=frame.getActiveSpreadSheet();
      SpreadSheetFieldArray fieldArray=sp.getFieldArrayWithWidths(null);
      List<Integer> colWidth=null;
//      if (sp!=null){
//        fieldArray=(SpreadSheetFieldArray)sp.getFieldArray();
//        colWidth=getColWidth(sp, fieldArray);
//      }
      Portfolio portfolio = frame.getGraphicManager().getProjectFactory().getPortfolio();
      cache=NodeModelCacheFactory.getInstance().createDefaultCache(portfolio.getNodeModel(), portfolio,NodeModelCache.PROJECT_TYPE,"OfflineProjects",null);
      ((GanttSVGRenderer)renderer).init(frame.getProject(),cache,fieldArray,colWidth,frame.getScale(),false);
    }else if (view instanceof PertView){
      renderer=new NetworkSVGRenderer();
      cache=NodeModelCacheFactory.getInstance().createFilteredCache((ReferenceNodeModelCache)frame.getReferenceCache(true),"Network",null);
      ((NetworkSVGRenderer)renderer).init(frame.getProject(),cache,NetworkSVGRenderer.PERT,frame.getScale());
    }else if (view instanceof TreeView){
      renderer=new NetworkSVGRenderer();
      TreeView treeView=(TreeView)view;
      if ("WBS".equals(treeView.getViewName())){
        cache=NodeModelCacheFactory.getInstance().createFilteredCache((ReferenceNodeModelCache)frame.getReferenceCache(true),"WBS",null);
        ((NetworkSVGRenderer)renderer).init(frame.getProject(),cache,NetworkSVGRenderer.WBS,frame.getScale());
      }else{
        cache=NodeModelCacheFactory.getInstance().createFilteredCache((ReferenceNodeModelCache)frame.getReferenceCache(false),"RBS",null);
        ((NetworkSVGRenderer)renderer).init(frame.getProject(),cache,NetworkSVGRenderer.RBS,frame.getScale());
      }
    }else return null;
    NodeModelCache srcCache=view.getCache();
    ViewTransformer transformer=((NodeCacheTransformer)cache.getVisibleNodes().getTransformer()).getTransformer();
    ViewTransformer srcTransformer=((NodeCacheTransformer)srcCache.getVisibleNodes().getTransformer()).getTransformer();
    transformer.setUserFilterId(srcTransformer.getUserFilterId()); //this is valid just because the views have the same transformers
    transformer.setUserSorterId(srcTransformer.getUserSorterId()); //this is valid just because the views have the same transformers
    transformer.setUserGrouperId(srcTransformer.getUserGrouperId()); //this is valid just because the views have the same transformers
View Full Code Here

    coord.toggleMinWidth(normalMinWidth);
  }


  public boolean activateView(String viewName) {
    BaseView topView = null;
    BaseView bottomView = null;
    boolean top = true;
    if (viewName.equals(ACTION_GANTT)) {
      activateGanttView();
      return top;
    } else if (viewName.equals(ACTION_TRACKING_GANTT)) {
View Full Code Here


//      taskType && (!notVoid || currentImpl == null || ((Task)currentImpl).getOwningProject() == null || ((Task)currentImpl).getOwningProject() == project);
    getMenuManager().setActionEnabled(ACTION_INSERT_PROJECT,!readOnly &&insertProject);

    BaseView view=null;
    DocumentFrame frame=getCurrentFrame();
    if (frame!=null){
      view=(BaseView)frame.getMainView().getTopComponent();
    }
    getMenuManager().setActionEnabled(ACTION_SCROLL_TO_TASK,isHasStartAndEnd&&view.canScrollToTask());

    if (currentFrame != null) {
      currentFrame.refreshUndoButtons();
      //refreshSaveStatus(false);
    }
View Full Code Here

TOP

Related Classes of com.projity.pm.graphic.views.BaseView

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.