import org.apache.poi.ss.SpreadsheetVersion;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Cell;
-import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
/**
* <p>
- * A {@link PropertyTemplate} is a template that can be applied to any sheet in
+ * A PropertyTemplate is a template that can be applied to any sheet in
* a project. It contains all the border type and color attributes needed to
* draw all the borders for a single sheet. That template can be applied to any
* sheet in any workbook.
*
* This class requires the full spreadsheet to be in memory so
* {@link SWorkbook} Spreadsheets are not supported. The same
- * {@link PropertyTemplate} can, however, be applied to both
+ * PropertyTemplate can, however, be applied to both
* {@link org.apache.poi.hssf.usermodel.HSSFWorkbook}, and Workbook objects
* if necessary. Portions of the border that fall outside the max range of the
* {@link HSSFWorkbook} sheet are ignored.
* applied to the cells at this time, just the template is drawn. To apply
* the drawn borders to a sheet, use {@link #applyBorders}.
*
- * @param range
- * - {@link CellRangeAddress} range of cells on which borders are
- * drawn.
- * @param borderType
- * - Type of border to draw. Use BORDER_XXX constants in
- * {@link CellStyle}.
- * @param extent
- * - {@link PropertyTemplate.Extent} of the borders to be
- * applied.
+ * @param range range of cells on which borders are drawn.
+ * @param borderType Type of border to draw.
+ * @param extent Extent of the borders to be applied.
*/
public void drawBorders(CellRangeAddress range, BorderStyle borderType, Extent extent) {
switch (extent) {
* applied to the cells at this time, just the template is drawn. To apply
* the drawn borders to a sheet, use {@link #applyBorders}.
*
- * @param range
- * - {@link CellRangeAddress} range of cells on which borders are
- * drawn.
- * @param borderType
- * - Type of border to draw. Use BORDER_XXX constants in
- * {@link CellStyle}.
- * @param color
- * - Color index from {@link IndexedColors} used to draw the
- * borders.
- * @param extent
- * - {@link PropertyTemplate.Extent} of the borders to be
- * applied.
+ * @param range range of cells on which borders are drawn.
+ * @param borderType Type of border to draw.
+ * @param color Color index from {@link IndexedColors} used to draw the borders.
+ * @param extent Extent of the borders to be applied.
*/
public void drawBorders(CellRangeAddress range, BorderStyle borderType, short color, Extent extent) {
drawBorders(range, borderType, extent);
* Draws the top border for a range of cells
* </p>
*
- * @param range
- * - {@link CellRangeAddress} range of cells on which borders are
- * drawn.
- * @param borderType
- * - Type of border to draw. Use BORDER_XXX constants in
- * {@link CellStyle}.
+ * @param range range of cells on which borders are drawn.
+ * @param borderType Type of border to draw.
*/
private void drawTopBorder(CellRangeAddress range, BorderStyle borderType) {
int row = range.getFirstRow();
* Draws the bottom border for a range of cells
* </p>
*
- * @param range
- * - {@link CellRangeAddress} range of cells on which borders are
- * drawn.
- * @param borderType
- * - Type of border to draw. Use BORDER_XXX constants in
- * {@link CellStyle}.
+ * @param range range of cells on which borders are drawn.
+ * @param borderType Type of border to draw.
*/
private void drawBottomBorder(CellRangeAddress range, BorderStyle borderType) {
int row = range.getLastRow();
* Draws the left border for a range of cells
* </p>
*
- * @param range
- * - {@link CellRangeAddress} range of cells on which borders are
- * drawn.
- * @param borderType
- * - Type of border to draw. Use BORDER_XXX constants in
- * {@link CellStyle}.
+ * @param range range of cells on which borders are drawn.
+ * @param borderType Type of border to draw.
*/
private void drawLeftBorder(CellRangeAddress range, BorderStyle borderType) {
int firstRow = range.getFirstRow();
* Draws the right border for a range of cells
* </p>
*
- * @param range
- * - {@link CellRangeAddress} range of cells on which borders are
- * drawn.
- * @param borderType
- * - Type of border to draw. Use BORDER_XXX constants in
- * {@link CellStyle}.
+ * @param range range of cells on which borders are drawn.
+ * @param borderType Type of border to draw.
*/
private void drawRightBorder(CellRangeAddress range, BorderStyle borderType) {
int firstRow = range.getFirstRow();
* Draws the outside borders for a range of cells.
* </p>
*
- * @param range
- * - {@link CellRangeAddress} range of cells on which borders are
- * drawn.
- * @param borderType
- * - Type of border to draw. Use BORDER_XXX constants in
- * {@link CellStyle}.
- * @param extent
- * - {@link PropertyTemplate.Extent} of the borders to be
- * applied. Valid Values are:
+ * @param range range of cells on which borders are drawn.
+ * @param borderType Type of border to draw.
+ * @param extent Extent of the borders to be applied. Valid Values are:
* <ul>
- * <li>CellBorder.Extent.ALL</li>
- * <li>CellBorder.Extent.HORIZONTAL</li>
- * <li>CellBorder.Extent.VERTICAL</li>
+ * <li>Extent.ALL</li>
+ * <li>Extent.HORIZONTAL</li>
+ * <li>Extent.VERTICAL</li>
* </ul>
*/
private void drawOutsideBorders(CellRangeAddress range, BorderStyle borderType, Extent extent) {
* Draws the horizontal borders for a range of cells.
* </p>
*
- * @param range
- * - {@link CellRangeAddress} range of cells on which borders are
- * drawn.
- * @param borderType
- * - Type of border to draw. Use BORDER_XXX constants in
- * {@link CellStyle}.
- * @param extent
- * - {@link PropertyTemplate.Extent} of the borders to be
- * applied. Valid Values are:
+ * @param range range of cells on which borders are drawn.
+ * @param borderType Type of border to draw.
+ * @param extent Extent of the borders to be applied. Valid Values are:
* <ul>
- * <li>CellBorder.Extent.ALL</li>
- * <li>CellBorder.Extent.INSIDE</li>
+ * <li>Extent.ALL</li>
+ * <li>Extent.INSIDE</li>
* </ul>
*/
private void drawHorizontalBorders(CellRangeAddress range, BorderStyle borderType, Extent extent) {
* Draws the vertical borders for a range of cells.
* </p>
*
- * @param range
- * - {@link CellRangeAddress} range of cells on which borders are
- * drawn.
- * @param borderType
- * - Type of border to draw. Use BORDER_XXX constants in
- * {@link CellStyle}.
- * @param extent
- * - {@link PropertyTemplate.Extent} of the borders to be
- * applied. Valid Values are:
+ * @param range range of cells on which borders are drawn.
+ * @param borderType Type of border to draw.
+ * @param extent Extent of the borders to be applied. Valid Values are:
* <ul>
- * <li>CellBorder.Extent.ALL</li>
- * <li>CellBorder.Extent.INSIDE</li>
+ * <li>Extent.ALL</li>
+ * <li>Extent.INSIDE</li>
* </ul>
*/
private void drawVerticalBorders(CellRangeAddress range, BorderStyle borderType, Extent extent) {
}
/**
- * Removes all border properties from this {@link PropertyTemplate} for the
+ * Removes all border properties from this PropertyTemplate for the
* specified range.
*
- * @parm range - {@link CellRangeAddress} range of cells to remove borders.
+ * @param range - range of cells to remove borders.
*/
private void removeBorders(CellRangeAddress range) {
int firstRow = range.getFirstRow();
* drawn borders to a sheet, use {@link #applyBorders}.
*
* @param range
- * - {@link CellRangeAddress} range of cells on which colors are
+ * - range of cells on which colors are
* set.
* @param color
* - Color index from {@link IndexedColors} used to draw the
* borders.
* @param extent
- * - {@link PropertyTemplate.Extent} of the borders for which
+ * - of the borders for which
* colors are set.
*/
public void drawBorderColors(CellRangeAddress range, short color, Extent extent) {
* </p>
*
* @param range
- * - {@link CellRangeAddress} range of cells on which colors are
+ * - range of cells on which colors are
* set.
* @param color
* - Color index from {@link IndexedColors} used to draw the
* </p>
*
* @param range
- * - {@link CellRangeAddress} range of cells on which colors are
+ * - range of cells on which colors are
* set.
* @param color
* - Color index from {@link IndexedColors} used to draw the
* </p>
*
* @param range
- * - {@link CellRangeAddress} range of cells on which colors are
+ * - range of cells on which colors are
* set.
* @param color
* - Color index from {@link IndexedColors} used to draw the
* </p>
*
* @param range
- * - {@link CellRangeAddress} range of cells on which colors are
+ * - range of cells on which colors are
* set.
* @param color
* - Color index from {@link IndexedColors} used to draw the
* </p>
*
* @param range
- * - {@link CellRangeAddress} range of cells on which colors are
+ * - range of cells on which colors are
* set.
* @param color
* - Color index from {@link IndexedColors} used to draw the
* borders.
* @param extent
- * - {@link PropertyTemplate.Extent} of the borders for which
+ * - of the borders for which
* colors are set. Valid Values are:
* <ul>
- * <li>CellBorder.Extent.ALL</li>
- * <li>CellBorder.Extent.HORIZONTAL</li>
- * <li>CellBorder.Extent.VERTICAL</li>
+ * <li>Extent.ALL</li>
+ * <li>Extent.HORIZONTAL</li>
+ * <li>Extent.VERTICAL</li>
* </ul>
*/
private void drawOutsideBorderColors(CellRangeAddress range, short color, Extent extent) {
* </p>
*
* @param range
- * - {@link CellRangeAddress} range of cells on which colors are
+ * - range of cells on which colors are
* set.
* @param color
* - Color index from {@link IndexedColors} used to draw the
* borders.
* @param extent
- * - {@link PropertyTemplate.Extent} of the borders for which
+ * - of the borders for which
* colors are set. Valid Values are:
* <ul>
- * <li>CellBorder.Extent.ALL</li>
- * <li>CellBorder.Extent.INSIDE</li>
+ * <li>Extent.ALL</li>
+ * <li>Extent.INSIDE</li>
* </ul>
*/
private void drawHorizontalBorderColors(CellRangeAddress range, short color, Extent extent) {
* </p>
*
* @param range
- * - {@link CellRangeAddress} range of cells on which colors are
+ * - range of cells on which colors are
* set.
* @param color
* - Color index from {@link IndexedColors} used to draw the
* borders.
* @param extent
- * - {@link PropertyTemplate.Extent} of the borders for which
+ * - Extent of the borders for which
* colors are set. Valid Values are:
* <ul>
- * <li>CellBorder.Extent.ALL</li>
- * <li>CellBorder.Extent.INSIDE</li>
+ * <li>Extent.ALL</li>
+ * <li>Extent.INSIDE</li>
* </ul>
*/
private void drawVerticalBorderColors(CellRangeAddress range, short color, Extent extent) {
}
/**
- * Removes all border properties from this {@link PropertyTemplate} for the
+ * Removes all border properties from this PropertyTemplate for the
* specified range.
*
- * @parm range - {@link CellRangeAddress} range of cells to remove borders.
+ * @parm range - range of cells to remove borders.
*/
private void removeBorderColors(CellRangeAddress range) {
int firstRow = range.getFirstRow();
}
/**
- * Adds a property to this {@link PropertyTemplate} for a given cell
+ * Adds a property to this PropertyTemplate for a given cell
*
* @param row
* @param col
}
/**
- * Removes a set of properties from this {@link PropertyTemplate} for a
+ * Removes a set of properties from this PropertyTemplate for a
* given cell
*
- * @param row
- * @param col
- * @param properties
+ * @param row the row index of the cell to remove properties from
+ * @param col the column index of the cell to remove properties from
+ * @param properties a list of the property names to remove from the cell
*/
private void removeProperties(int row, int col, Set<String> properties) {
CellAddress cell = new CellAddress(row, col);
}
/**
- * Retrieves the number of borders assigned to a cell (a value between 0 and 4
+ * Retrieves the number of borders assigned to a cell (a value between 0 and 4)
*
- * @param cell
+ * @param cell the cell to count the number of borders on
*/
public int getNumBorders(CellAddress cell) {
Map<String, Object> cellProperties = _propertyTemplate.get(cell);