/** * Gets the CellFormat object for this cell. Used by the WritableWorkbook API * * @return the CellFormat used for this cell */ public CellFormat getCellFormat() { if (!initialized) { format = formattingRecords.getXFRecord(xfIndex); initialized = true; } return format; }
/** * Gets the column width for the specified column * * @param col the column number * @return the column format, or the default format if no override is specified */ public CellView getColumnView(int col) { ColumnInfoRecord cir = getColumnInfo(col); CellView cv = new CellView(); if (cir != null) { cv.setDimension(cir.getWidth() / 256); // deprecated cv.setSize(cir.getWidth()); cv.setHidden(cir.getHidden()); cv.setFormat(formattingRecords.getXFRecord(cir.getXFIndex())); } else { cv.setDimension(settings.getDefaultColumnWidth()); // deprecated cv.setSize(settings.getDefaultColumnWidth() * 256); } return cv; }
/** * Gets the row view for the specified row * * @param row the row number * @return the row format, or the default format if no override is specified */ public CellView getRowView(int row) { RowRecord rr = getRowInfo(row); CellView cv = new CellView(); if (rr != null) { cv.setDimension(rr.getRowHeight()); // deprecated cv.setSize(rr.getRowHeight()); cv.setHidden(rr.isCollapsed()); if (rr.hasDefaultFormat()) { cv.setFormat(formattingRecords.getXFRecord(rr.getXFIndex())); } } else { cv.setDimension(settings.getDefaultRowHeight()); cv.setSize(settings.getDefaultRowHeight()); // deprecated } return cv; }