public class StructureToJC4XL extends Object
...
c.setStartRow(r.getRowNum());
c.setStartColumn(1);
c.addStructure(s, "utf8", m.getInputFormat());
c.setStartRow(r.getRowNum());
c.setStartColumn(2);
c.addStructure(s, "utf8", m.getInputFormat(), p);
c.setStartColumn(0);
Constructor and Description |
---|
StructureToJC4XL(OutputStream output)
Constructor for adding molecule/structure data one-by-one
to store them in a JChemExcel workbook.
|
StructureToJC4XL(Workbook wb,
OutputStream output) |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyColumnName(String propertyName,
String displayName)
Sets the displayed name in the header column of the given property
|
Row |
addStructure(byte[] structure,
String fmt)
A single structure can be added to the worksheet, in the current row
|
Row |
addStructure(byte[] structure,
String fmt,
Map<String,String> properties)
A single structure can be added to the worksheet, in the current row
|
Row |
addStructure(byte[] structure,
String fmt,
Map<String,String> properties,
String id,
boolean showId)
A single structure can be added to the worksheet, in the current row
|
Row |
addStructure(byte[] structure,
String fmt,
String id,
boolean showId)
A single structure can be added to the worksheet, in the current row
|
Row |
addStructure(Molecule mol,
String fmt)
A single structure can be added to the worksheet, in the current row
|
Row |
addStructure(Molecule mol,
String fmt,
String id,
boolean showId)
A single structure can be added to the worksheet, in the current row
|
Row |
addStructure(String structure,
String encoding,
String fmt)
A single structure can be added to the worksheet, in the current row
|
Row |
addStructure(String structure,
String encoding,
String fmt,
Map<String,String> properties)
A single structure can be added to the worksheet, in the current row
|
Row |
addStructure(String structure,
String encoding,
String fmt,
Map<String,String> properties,
String id,
boolean showId)
A single structure can be added to the worksheet, in the current row
|
Row |
addStructure(String structure,
String encoding,
String fmt,
String id,
boolean showId)
A single structure can be added to the worksheet, in the current row
|
void |
clearAllCellStyle()
Clears all the previously set cell style of the property columns
|
void |
clearAllColumnWidth()
Clears all the previously set width of the property columns
|
void |
clearPropertyColumnNames()
Clears the display name list of properties
|
void |
finalize() |
void |
finish()
Finishes the export operation, the workbook flushed and closed
|
CellStyle |
getDefaultStyle()
Returns the style applied for the value cells of the columns
having no explicit formatting.
|
CellStyle |
getHeaderStyle()
returns the cell style applied to the header row
|
String |
getSheetName()
Returns the sheet name the structures added to.
|
int |
getStartColumn() |
int |
getStructureCellHeight() |
int |
getStructureCellWidth() |
int |
getStructureColumnIndex() |
String |
getStructureColumnName() |
Workbook |
getWorkbook()
Returns the Workbook object model instance
|
static Workbook |
readWorkbook(InputStream input)
Loads a workbook from an
InputStream |
void |
setCellStyle(String propertyName,
CellStyle cellStyle)
Sets the cell style of the property column with the given name
|
void |
setColumnWidth(String propertyName,
int width)
Sets the column width of property column with the given name
|
void |
setDefaultStyle(CellStyle style)
Sets the cell style applied for the value cells of the columns
having no explicit formatting.
|
void |
setHeaderStyle(CellStyle cellStyle)
Sets the cell style for the header row
|
void |
setSheetName(String sheetName)
Sets the sheet name the structures/molecules added to.
|
void |
setStartColumn(int startColumn) |
void |
setStartRow(int startRow) |
void |
setStructureCellHeight(int height)
Sets the height of the structure cell.
|
void |
setStructureCellWidth(int width)
Sets the width of the structure cell in 1/256 of normal character width.
|
void |
setStructureColumnIndex(int idx) |
void |
setStructureColumnName(String name) |
void |
showHeader(boolean show) |
public StructureToJC4XL(Workbook wb, OutputStream output) throws FileNotFoundException, chemaxon.license.LicenseException, IOException
FileNotFoundException
chemaxon.license.LicenseException
IOException
public StructureToJC4XL(OutputStream output) throws FileNotFoundException, chemaxon.license.LicenseException
output
- the stream to be written the workbook toFileNotFoundException
chemaxon.license.LicenseException
public static Workbook readWorkbook(InputStream input) throws IOException
InputStream
input
- stream for an existing workbookIOException
public void setDefaultStyle(CellStyle style)
CellStyle
object with
getWorkbook().createCellStyle();
style
- the CellStyle to setpublic CellStyle getDefaultStyle()
public void setStructureCellWidth(int width)
width
- width of the cellpublic int getStructureCellWidth()
public void setStructureCellHeight(int height)
public int getStructureCellHeight()
public void setStructureColumnIndex(int idx)
public int getStructureColumnIndex()
public Workbook getWorkbook()
public String getSheetName()
public void setSheetName(String sheetName)
public void setStartRow(int startRow)
startRow
- the row number, where the insertion startspublic void setStartColumn(int startColumn)
startColumn
- the column number, where the insertion startspublic int getStartColumn()
public void showHeader(boolean show)
show
- a row added to the sheet containing property names as column namespublic void setStructureColumnName(String name)
name
- sets the name of the structure columnpublic String getStructureColumnName()
public void addPropertyColumnName(String propertyName, String displayName)
propertyName
- the structure/molecule property namedisplayName
- the name displayed in the header row for the given propertypublic void clearPropertyColumnNames()
public void setColumnWidth(String propertyName, int width)
propertyName
- the name of the propertywidth
- the desired width of the property column in 1/256 of normal character widthpublic void clearAllColumnWidth()
public void setCellStyle(String propertyName, CellStyle cellStyle)
propertyName
- the name of the propertycellStyle
- the style to setpublic void setHeaderStyle(CellStyle cellStyle)
cellStyle
- the style to setpublic CellStyle getHeaderStyle()
public void clearAllCellStyle()
public Row addStructure(Molecule mol, String fmt) throws IOException, UnsupportedOperationException
mol
- the molecule objectfmt
- the format of the structure stringIOException
UnsupportedOperationException
public Row addStructure(Molecule mol, String fmt, String id, boolean showId) throws IOException, UnsupportedOperationException
mol
- the molecule objectfmt
- the format of the structure stringid
- an Id for the structure also added to the cell (as =JCIDSYSStructure(...,id))showId
- shows the Id instead of the structure by defaultIOException
UnsupportedOperationException
public Row addStructure(String structure, String encoding, String fmt) throws IOException, UnsupportedOperationException
structure
- the molecule in string formatencoding
- the structure string character encodingfmt
- the format of the structure stringIOException
UnsupportedOperationException
public Row addStructure(String structure, String encoding, String fmt, String id, boolean showId) throws IOException, UnsupportedOperationException
structure
- the molecule in string formatencoding
- the structure string character encodingfmt
- the format of the structure stringid
- an Id for the structure also added to the cell (as =JCIDSYSStructure(...,id))showId
- shows the Id instead of the structure by defaultIOException
UnsupportedOperationException
public Row addStructure(byte[] structure, String fmt) throws IOException, UnsupportedOperationException
structure
- the molecule in binary formatfmt
- the format of the structure stringIOException
UnsupportedOperationException
public Row addStructure(byte[] structure, String fmt, String id, boolean showId) throws IOException, UnsupportedOperationException
structure
- the molecule in binary formatfmt
- the format of the structure stringid
- an Id for the structure also added to the cell (as =JCIDSYSStructure(...,id))showId
- shows the Id instead of the structure by defaultIOException
UnsupportedOperationException
public Row addStructure(String structure, String encoding, String fmt, Map<String,String> properties) throws IOException, UnsupportedOperationException
structure
- the molecule in string formatencoding
- the structure string character encodingfmt
- the format of the structure stringproperties
- a list of properties, whose values will be inserted right beside the structureIOException
UnsupportedOperationException
public Row addStructure(String structure, String encoding, String fmt, Map<String,String> properties, String id, boolean showId) throws IOException, UnsupportedOperationException
structure
- the molecule in string formatencoding
- the structure string character encodingfmt
- the format of the structure stringproperties
- a list of properties, whose values will be inserted right beside the structureid
- an Id for the structure also added to the cell (as =JCIDSYSStructure(...,id))showId
- shows the Id instead of the structure by defaultIOException
UnsupportedOperationException
public Row addStructure(byte[] structure, String fmt, Map<String,String> properties) throws IOException, UnsupportedOperationException
structure
- the molecule in binary formatfmt
- the format of the structure stringproperties
- a list of properties, whose values will be inserted right beside the structureIOException
UnsupportedOperationException
public Row addStructure(byte[] structure, String fmt, Map<String,String> properties, String id, boolean showId) throws IOException, UnsupportedOperationException
structure
- the molecule in binary formatfmt
- the format of the structure stringproperties
- a list of properties, whose values will be inserted right beside the structureid
- an Id for the structure also added to the cell (as =JCIDSYSStructure(...,id))IOException
UnsupportedOperationException
public void finalize() throws Throwable
public void finish() throws IOException
IOException