⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hssfsheet.java

📁 Office格式转换代码
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
     */    public void setColumnWidth(short column, short width)    {        sheet.setColumnWidth(column, width);    }    /**     * get the width (in units of 1/256th of a character width )     * @param column - the column to set (0-based)     * @return width - the width in units of 1/256th of a character width     */    public short getColumnWidth(short column)    {        return sheet.getColumnWidth(column);    }    /**     * get the default column width for the sheet (if the columns do not define their own width) in     * characters     * @return default column width     */    public short getDefaultColumnWidth()    {        return sheet.getDefaultColumnWidth();    }    /**     * get the default row height for the sheet (if the rows do not define their own height) in     * twips (1/20 of  a point)     * @return  default row height     */    public short getDefaultRowHeight()    {        return sheet.getDefaultRowHeight();    }    /**     * get the default row height for the sheet (if the rows do not define their own height) in     * points.     * @return  default row height in points     */    public float getDefaultRowHeightInPoints()    {        return (sheet.getDefaultRowHeight() / 20);    }    /**     * set the default column width for the sheet (if the columns do not define their own width) in     * characters     * @param width default column width     */    public void setDefaultColumnWidth(short width)    {        sheet.setDefaultColumnWidth(width);    }    /**     * set the default row height for the sheet (if the rows do not define their own height) in     * twips (1/20 of  a point)     * @param  height default row height     */    public void setDefaultRowHeight(short height)    {        sheet.setDefaultRowHeight(height);    }    /**     * set the default row height for the sheet (if the rows do not define their own height) in     * points     * @param height default row height     */    public void setDefaultRowHeightInPoints(float height)    {        sheet.setDefaultRowHeight((short) (height * 20));    }    /**     * get whether gridlines are printed.     * @return true if printed     */    public boolean isGridsPrinted()    {        return sheet.isGridsPrinted();    }    /**     * set whether gridlines printed.     * @param value  false if not printed.     */    public void setGridsPrinted(boolean value)    {        sheet.setGridsPrinted(value);    }    /**     * adds a merged region of cells (hence those cells form one)     * @param region (rowfrom/colfrom-rowto/colto) to merge     * @return index of this region     */    public int addMergedRegion(Region region)    {        //return sheet.addMergedRegion((short) region.getRowFrom(),        return sheet.addMergedRegion( region.getRowFrom(),                region.getColumnFrom(),                //(short) region.getRowTo(),                region.getRowTo(),                region.getColumnTo());    }    /**     * determines whether the output is vertically centered on the page.     * @param value true to vertically center, false otherwise.     */    public void setVerticallyCenter(boolean value)    {        VCenterRecord record =                (VCenterRecord) sheet.findFirstRecordBySid(VCenterRecord.sid);        record.setVCenter(value);    }    /**     * Determine whether printed output for this sheet will be vertically centered.     */    public boolean getVerticallyCenter(boolean value)    {        VCenterRecord record =                (VCenterRecord) sheet.findFirstRecordBySid(VCenterRecord.sid);        return record.getVCenter();    }    /**     * determines whether the output is horizontally centered on the page.     * @param value true to horizontally center, false otherwise.     */    public void setHorizontallyCenter(boolean value)    {        HCenterRecord record =                (HCenterRecord) sheet.findFirstRecordBySid(HCenterRecord.sid);        record.setHCenter(value);    }    /**     * Determine whether printed output for this sheet will be horizontally centered.     */    public boolean getHorizontallyCenter()    {        HCenterRecord record =                (HCenterRecord) sheet.findFirstRecordBySid(HCenterRecord.sid);        return record.getHCenter();    }    /**     * removes a merged region of cells (hence letting them free)     * @param index of the region to unmerge     */    public void removeMergedRegion(int index)    {        sheet.removeMergedRegion(index);    }    /**     * returns the number of merged regions     * @return number of merged regions     */    public int getNumMergedRegions()    {        return sheet.getNumMergedRegions();    }    /**     * gets the region at a particular index     * @param index of the region to fetch     * @return the merged region (simple eh?)     */    public Region getMergedRegionAt(int index)    {        return new Region(sheet.getMergedRegionAt(index));    }    /**     * @return an iterator of the PHYSICAL rows.  Meaning the 3rd element may not     * be the third row if say for instance the second row is undefined.     */    public Iterator rowIterator()    {        return rows.values().iterator();    }    /**     * used internally in the API to get the low level Sheet record represented by this     * Object.     * @return Sheet - low level representation of this HSSFSheet.     */    protected Sheet getSheet()    {        return sheet;    }    /**     * whether alternate expression evaluation is on     * @param b  alternative expression evaluation or not     */    public void setAlternativeExpression(boolean b)    {        WSBoolRecord record =                (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid);        record.setAlternateExpression(b);    }    /**     * whether alternative formula entry is on     * @param b  alternative formulas or not     */    public void setAlternativeFormula(boolean b)    {        WSBoolRecord record =                (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid);        record.setAlternateFormula(b);    }    /**     * show automatic page breaks or not     * @param b  whether to show auto page breaks     */    public void setAutobreaks(boolean b)    {        WSBoolRecord record =                (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid);        record.setAutobreaks(b);    }    /**     * set whether sheet is a dialog sheet or not     * @param b  isDialog or not     */    public void setDialog(boolean b)    {        WSBoolRecord record =                (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid);        record.setDialog(b);    }    /**     * set whether to display the guts or not     *     * @param b  guts or no guts (or glory)     */    public void setDisplayGuts(boolean b)    {        WSBoolRecord record =                (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid);        record.setDisplayGuts(b);    }    /**     * fit to page option is on     * @param b  fit or not     */    public void setFitToPage(boolean b)    {        WSBoolRecord record =                (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid);        record.setFitToPage(b);    }    /**     * set if row summaries appear below detail in the outline     * @param b  below or not     */    public void setRowSumsBelow(boolean b)    {        WSBoolRecord record =                (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid);        record.setRowSumsBelow(b);    }    /**     * set if col summaries appear right of the detail in the outline     * @param b  right or not     */    public void setRowSumsRight(boolean b)    {        WSBoolRecord record =                (WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid);        record.setRowSumsRight(b);    }    /**     * whether alternate expression evaluation is on     * @return alternative expression evaluation or not     */    public boolean getAlternateExpression()    {        return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid))                .getAlternateExpression();    }    /**     * whether alternative formula entry is on     * @return alternative formulas or not     */    public boolean getAlternateFormula()    {        return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid))                .getAlternateFormula();    }    /**     * show automatic page breaks or not     * @return whether to show auto page breaks     */    public boolean getAutobreaks()    {        return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid))                .getAutobreaks();    }    /**     * get whether sheet is a dialog sheet or not     * @return isDialog or not     */    public boolean getDialog()    {        return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid))                .getDialog();    }    /**     * get whether to display the guts or not     *     * @return guts or no guts (or glory)     */    public boolean getDisplayGuts()    {        return ((WSBoolRecord) sheet.findFirstRecordBySid(WSBoolRecord.sid))                .getDisplayGuts();    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -