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);
// }