java在线查看excel_worksheet.java 源代码在线查看 - 非常实用的java描述的excel组件 资源下载 虫虫电子下载站...

/* ================================================= * JWorkbook : data export from Java to spreadsheets * ================================================= * * Project Info: http://www.jfree.org/jworkbook/index.html; * Project Lead: David Gilbert (david.gilbert@object-refinery.com); * * (C) Copyright 2001-2003, by Object Refinery Limited. * * This library is free software; you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Foundation; * either version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with this * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * * -------------- * Worksheet.java * -------------- * (C) Copyright 2001, 2003, by Object Refinery Limited. * * Original Author: David Gilbert (for Object Refinery Limited); * Contributor(s): -; * * $Id$ * * Changes: * -------- * 05-Nov-2001 : Version 1 (DG); * 11-Feb-2002 : Implemented GnumericWriter.java and XLWriter.java (DG); * 07-Jul-2003 : Changed GPL --> LGPL, changed package name, updated company name (DG); * */package org.jfree.workbook;import java.util.ArrayList;import java.util.Collections;import java.util.List;import org.jfree.workbook.date.SerialDate;/** * Represents one worksheet within a workbook. */public class Worksheet { /** The maximum number of columns in a worksheet. */ public static final int MAX_COLUMNS = 256; /** The maximum number of rows in a worksheet. */ public static final int MAX_ROWS = 65536; /** The default width for columns. */ public static final double DEFAULT_COLUMN_WIDTH = 48; /** The default height for rows. */ public static final double DEFAULT_ROW_HEIGHT = 12.8; /** The name of the worksheet. */ protected String name; /** Display formulae rather than calculated values (true/false). */ protected boolean displayFormulae; /** Hide zeros (true/false). */ protected boolean hideZeros; /** A flag indicating whether or not the grid is visible. */ protected boolean gridVisible; /** A flag indicating whether or not the column header is visible. */ protected boolean columnHeaderVisible; /** A flag indicating whether or not the row header is visible. */ protected boolean rowHeaderVisible; /** The index of the right-most column used in the worksheet. */ protected int maxColumn; /** The index of the bottom-most row used in the worksheet. */ protected int maxRow; /** The current zoom factor (in the range 0.05 to 5.00, that is 5% to 500%). */ protected double zoom; /** Manager for names defined in the worksheet. */ protected NamesManager namesManager; /** Print setup. */ protected PrintInformation printInfo; /** Styles that apply to ranges within the worksheet. */ protected Styles styles; /** Column attributes (width, margins, hidden etc). */ protected ColumnAttributesManager columnAttributesManager; /** Row attributes (height, margins, hidden etc). */ protected RowAttributesManager rowAttributesManager; /** Ranges that are selected. */ protected Selections selections; /** The cells in the worksheet. */ protected Cells cells; /** Comments for cells in the worksheet. */ protected List comments; /** Settings for the solver utility. */ protected Solver solver; /** * Standard constructor: creates a named empty worksheet. * * @param name the name of the worksheet. */ public Worksheet(String name) { this.name = name; this.maxColumn = -1; this.maxRow = -1; this.zoom = 1.0; this.namesManager = new NamesManager(); this.printInfo = new PrintInformation(); this.styles = new Styles(); this.columnAttributesManager = new ColumnAttributesManager(); this.rowAttributesManager = new RowAttributesManager(); this.selections = new Selections(); this.cells = new Cells(); this.comments = new ArrayList(); this.solver = new Solver(); } /** * Returns the name of the worksheet. * * @return The name of the worksheet. */ public String getName() { return this.name; } /** * Sets the name of the worksheet. * * @param name the name. */ public void setName(String name) { this.name = name; } /** * Returns the index of the rightmost column in the sheet. * * @return The maximum column index. */ public int getMaxColumn() { return this.maxColumn; } /** * Returns the index of the bottommost row in the sheet. * * @return The maximum row index. */ public int getMaxRow() { return this.maxRow; } /** * Returns the zoom factor. * * @return The zoom factor. */ public double getZoom() { return this.zoom; } /** * Sets the zoom factor. * * @param percent the new zoom factor (should be in the range 0.05 to 5.00). */ public void setZoom(double percent) { if ((percent < 0.05) || (percent > 5.00)) { throw new IllegalArgumentException("Worksheet.setZoom(): value outside valid range."); } this.zoom = percent; } /** * Returns true if formulae rather than values are being displayed in the worksheet. * * @return True if formulae rather than values are being displayed in the worksheet. */ public boolean getDisplayFormulae() { return this.displayFormulae; } /** * Returns a flag indicating whether or not zero values are displayed. * * @return A boolean. */ public boolean getHideZeros() { return this.hideZeros; } /** * Returns a flag indicating whether or not the grid is visible. * * @return A boolean. */ public boolean isGridVisible() { return this.gridVisible; } /** * Returns a flag indicating whether or not the column header is visible. * * @return A boolean. */ public boolean isColumnHeaderVisible() { return this.columnHeaderVisible; } /** * Returns a flag indicating whether or not the row header is visible. * * @return A boolean. */ public boolean isRowHeaderVisible() { return this.rowHeaderVisible; } /** * Returns a reference to the names manager. * * @return A reference to the names manager. */ public NamesManager getNamesManager() { return this.namesManager; } /** * Returns the print information for the sheet. * * @return Print information. */ public PrintInformation getPrintInformation() { return this.printInfo; } /** * Returns the styles information for the sheet. * * @return Styles information. */ public Styles getStyles() { return this.styles; } /** * Returns the selections for the sheet. * * @return The selections. */ public Selections getSelections() { return this.selections; } /** * Returns the cells for the worksheet. * * @return The cells. */ public Cells getCells() { return this.cells; } /** * Returns the solver for the worksheet. * * @return The solver. */ public Solver getSolver() { return this.solver; } /** * Returns the comments for the worksheet. * * @return The comments. */ public List getComments() { return this.comments; } /** * Returns a reference to the object managing the column attributes. * * @return The column attributes manager. */ public ColumnAttributesManager getColumnAttributesManager() { return this.columnAttributesManager; } /** * Returns a reference to the object managing the row attributes. * * @return The row attributes manager. */ public RowAttributesManager getRowAttributesManager() { return this.rowAttributesManager; } /** * Sets the height of one row. * * @param row the row (0 * @param height the new height. */ public void setRowHeight(int row, double height) {

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值