case VERTICAL: if (extent == BorderExtent.ALL || extent == BorderExtent.HORIZONTAL) { drawTopBorder(range, borderType); drawBottomBorder(range, borderType);
lastCol); if (extent == BorderExtent.ALL || i > firstRow) { drawTopBorder(row, borderType);
/** * <p> * Sets the color of the top border for a range of cells. * </p> * * @param range * - {@link CellRangeAddress} range of cells on which colors are * set. * @param color * - Color index from {@link IndexedColors} used to draw the * borders. */ private void drawTopBorderColor(CellRangeAddress range, short color) { int row = range.getFirstRow(); int firstCol = range.getFirstColumn(); int lastCol = range.getLastColumn(); for (int i = firstCol; i <= lastCol; i++) { if (getBorderStyle(row, i, CellUtil.BORDER_TOP) == BorderStyle.NONE) { drawTopBorder(new CellRangeAddress(row, row, i, i), BorderStyle.THIN); } addProperty(row, i, CellUtil.TOP_BORDER_COLOR, color); } }
break; case TOP: drawTopBorder(range, borderType); break; case BOTTOM:
case VERTICAL: if (extent == BorderExtent.ALL || extent == BorderExtent.HORIZONTAL) { drawTopBorder(range, borderType); drawBottomBorder(range, borderType);
lastCol); if (extent == BorderExtent.ALL || i > firstRow) { drawTopBorder(row, borderType);
/** * <p> * Sets the color of the top border for a range of cells. * </p> * * @param range * - {@link CellRangeAddress} range of cells on which colors are * set. * @param color * - Color index from {@link IndexedColors} used to draw the * borders. */ private void drawTopBorderColor(CellRangeAddress range, short color) { int row = range.getFirstRow(); int firstCol = range.getFirstColumn(); int lastCol = range.getLastColumn(); for (int i = firstCol; i <= lastCol; i++) { if (getBorderStyle(row, i, CellUtil.BORDER_TOP) == BorderStyle.NONE) { drawTopBorder(new CellRangeAddress(row, row, i, i), BorderStyle.THIN); } addProperty(row, i, CellUtil.TOP_BORDER_COLOR, color); } }
break; case TOP: drawTopBorder(range, borderType); break; case BOTTOM: