util
Class ExcelWriter

java.lang.Object
  extended byutil.ExcelWriter

public class ExcelWriter
extends java.lang.Object

Defines the class used for saving pictures and information to an Excel file.

Author:
Mikael Jönsson & Per Klingnäs

Field Summary
private  jxl.write.WritableSheet graphSheet
           
private  jxl.write.WritableFont headerFont
           
private  jxl.write.WritableCellFormat headerFormat
           
private  jxl.write.WritableFont plainTextFont
           
private  jxl.write.WritableCellFormat plainTextFormat
           
private  jxl.write.WritableCellFormat reqHeaderFormat
           
private  jxl.write.WritableFont reqXFont
           
private  jxl.write.WritableCellFormat reqXFormat
           
private  jxl.write.WritableSheet tableSheet
           
private  jxl.write.WritableWorkbook workbook
           
 
Constructor Summary
ExcelWriter(java.io.File file)
          Creates an ExcelWriter, prepares the Excel workbook to save to and sets the formatting.
 
Method Summary
 void writeAndCloseWorkbook()
          Flushes the write cache and closes the file.
 void writeGraph(java.awt.Image image, java.lang.String sheetName)
          Saves the graph from GraphWindow to a file and to the Excel sheet.
 void writeTable(javax.swing.JTable rootCauseTable, javax.swing.JTable requirementsTable, java.lang.String sheetName)
          Writes the checked rows in the tables in root-cause window to the Excel file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

workbook

private jxl.write.WritableWorkbook workbook

tableSheet

private jxl.write.WritableSheet tableSheet

graphSheet

private jxl.write.WritableSheet graphSheet

reqXFont

private jxl.write.WritableFont reqXFont

headerFont

private jxl.write.WritableFont headerFont

plainTextFont

private jxl.write.WritableFont plainTextFont

reqXFormat

private jxl.write.WritableCellFormat reqXFormat

headerFormat

private jxl.write.WritableCellFormat headerFormat

plainTextFormat

private jxl.write.WritableCellFormat plainTextFormat

reqHeaderFormat

private jxl.write.WritableCellFormat reqHeaderFormat
Constructor Detail

ExcelWriter

public ExcelWriter(java.io.File file)
Creates an ExcelWriter, prepares the Excel workbook to save to and sets the formatting.

Parameters:
file - the file to save to
Method Detail

writeTable

public void writeTable(javax.swing.JTable rootCauseTable,
                       javax.swing.JTable requirementsTable,
                       java.lang.String sheetName)
Writes the checked rows in the tables in root-cause window to the Excel file.

Parameters:
rootCauseTable - the table containing root-causes and improvement suggestions (the left table)
requirementsTable - the table where requirements are added as columns and linked to root-causes
sheetName - the desired sheet name in the workbook

writeGraph

public void writeGraph(java.awt.Image image,
                       java.lang.String sheetName)
Saves the graph from GraphWindow to a file and to the Excel sheet.

Parameters:
image - the image to be saved
sheetName - the sheet name to save the graph in

writeAndCloseWorkbook

public void writeAndCloseWorkbook()
Flushes the write cache and closes the file.