/** * Sets the height of the specified row, as well as its collapse status * * @param row the row to be formatted * @param height the row height in 1/20ths of a point * @exception RowsExceededException * @deprecated use the override which takes a CellView object */ public void setRowView(int row, int height) throws RowsExceededException { CellView cv = new CellView(); cv.setSize(height); cv.setHidden(false); setRowView(row, cv); }
try { if ( column < data.templateColumns ) { CellFormat format = data.sheet.getColumnView( column ).getFormat(); if ( format != null ) { cellFormat = new WritableCellFormat( format );
/** * Gets the column width for the specified column * * @param col the column number * @return the column width, or the default width if the column has no * specified format */ public int getColumnWidth(int col) { return getColumnView(col).getSize() / 256; }
CellView columnAView = new CellView(); columnAView.setAutoSize(true); s.setColumnView(1, columnAView);
/** * 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); cv.setSize(cir.getWidth()); cv.setHidden(cir.getHidden()); cv.setFormat(cir.getCellFormat()); } else { cv.setDimension(settings.getDefaultColumnWidth()/256); cv.setSize(settings.getDefaultColumnWidth() * 256); } return cv; }
/** * Sets the width (in characters) and format options for a * particular column in this sheet * * @param col the column to set * @param width the width in characters * @param format the formt details for the column */ public void setColumnView(int col, int width, CellFormat format) { CellView cv = new CellView(); cv.setSize(width * 256); cv.setFormat(format); setColumnView(col, cv); }
CellView cv = new CellView(); cv.setSize(25 * 256); cv.setFormat(wcf); ws.setColumnView(0, cv); ws.setColumnView(1, 15); ws.addCell(l6); CellView cf = new CellView(); cf.setAutosize(true); ws.setColumnView(5, cf);
XFRecord xfr = (XFRecord) view.getFormat(); if (xfr == null) int width = view.depUsed() ? view.getDimension() * 256 : view.getSize(); if (view.isAutosize()) xfr); if (view.isHidden()) (col, view.getDimension()*256, WritableWorkbook.NORMAL_STYLE); if (!columnFormats.contains(cir))
/** * Sets the width (in characters) for a particular column in this sheet * * @param col the column whose width to set * @param width the width of the column in characters */ public void setColumnView(int col, int width) { CellView cv = new CellView(); cv.setSize(width * 256); setColumnView(col, cv); }
/** * Applies column settings to a column * * @param uiColumn The settings to apply * @param worksheet The worksheet to apply the column to * @param columnIndex The column index to the column */ public void applyColumnSettings(UIColumn uiColumn, WritableSheet worksheet, int columnIndex) { ColumnStyle columnStyle = new ColumnStyle(parser.getCascadedStyleMap(uiColumn)); if (log.isTraceEnabled()) { log.trace("Applying column settings #0 on column #1", columnStyle, columnIndex); } CellView cellView = worksheet.getColumnView(columnIndex); if (columnStyle.autoSize != null) { cellView.setAutosize(columnStyle.autoSize); } if (columnStyle.hidden != null) { cellView.setHidden(columnStyle.hidden); } if (columnStyle.width != null) { cellView.setSize(columnStyle.width); } worksheet.setColumnView(columnIndex, cellView); }
@Override public void updateRowHeight(String srcSheetName, int srcRowNum, String targetSheetName, int targetRowNum) { SheetData sheetData = sheetMap.get(srcSheetName); RowData rowData = sheetData.getRowData(srcRowNum); WritableSheet destSheet = writableWorkbook.getSheet(targetSheetName); if( destSheet == null ){ destSheet = createSheet(srcSheetName, targetSheetName); } try { CellView rowView = destSheet.getRowView(targetRowNum); if( rowData != null ) { rowView.setSize((short) rowData.getHeight()); }else{ rowView.setAutosize(true); } destSheet.setRowView(targetRowNum, rowView); } catch (RowsExceededException e) { logger.error("Could not set Row View for row {}", targetRowNum, e); } }
setColumnView(i, new CellView()); cir = getColumnInfo(i);
int firstColWidth = cellView.getSize(); double firstColImageWidth = (1 - (x - firstCol)) * firstColWidth; double pointSize = (cellView.getFormat() != null) ? cellView.getFormat().getFont().getPointSize() : DEFAULT_FONT_SIZE; double firstColWidthInPoints = firstColImageWidth * 0.59 * pointSize / 256; lastColWidth = cellView.getSize(); lastColImageWidth = (x + width - lastCol) * lastColWidth; pointSize = (cellView.getFormat() != null) ? cellView.getFormat().getFont().getPointSize() : DEFAULT_FONT_SIZE; lastColWidthInPoints = lastColImageWidth * 0.59 * pointSize / 256; pointSize = (cellView.getFormat() != null) ? cellView.getFormat().getFont().getPointSize() : DEFAULT_FONT_SIZE; width += cellView.getSize() * 0.59 * pointSize / 256;
public static void autoSizeColumns(WritableSheet sheet, int columns) { for (int c = 0; c < columns; c++) { CellView cell = sheet.getColumnView(c); cell.setAutosize(true); sheet.setColumnView(c, cell); } }
/** * Gets the row height for the specified column * * @param row the row number * @return the row height, or the default height if the row has no * specified format * @deprecated use getRowView instead */ public int getRowHeight(int row) { return getRowView(row).getDimension(); }
if (!isIgnoreColumnProps()) { CellView columnView = destSheet.getColumnView(targetCellRef.getCol()); columnView.setSize(sheetData.getColumnWidth(srcCellRef.getCol())); destSheet.setColumnView(targetCellRef.getCol(), columnView); try { CellView rowView = destSheet.getRowView(targetCellRef.getRow()); rowView.setSize(sheetData.getRowData(srcCellRef.getRow()).getHeight()); destSheet.setRowView(targetCellRef.getRow(), rowView); } catch (RowsExceededException e) {