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;