SVTableUtils.getAWTColor(s.getRightBorderColor(), SVTableUtils.black),
SVTableUtils.getAWTColor(s.getBottomBorderColor(), SVTableUtils.black),
SVTableUtils.getAWTColor(s.getLeftBorderColor(), SVTableUtils.black),
- s.getBorderTop(), s.getBorderRight(),
- s.getBorderBottom(), s.getBorderLeft(),
+ s.getBorderTopEnum(), s.getBorderRightEnum(),
+ s.getBorderBottomEnum(), s.getBorderLeftEnum(),
hasFocus);
setBorder(cellBorder);
isBorderSet=true;
String borderName;\r
switch (borderSide) {\r
case 't': default:\r
- b1 = style1.getBorderTop() == BorderStyle.THIN;\r
- b2 = style2.getBorderTop() == BorderStyle.THIN;\r
+ b1 = style1.getBorderTopEnum() == BorderStyle.THIN;\r
+ b2 = style2.getBorderTopEnum() == BorderStyle.THIN;\r
borderName = "TOP";\r
break;\r
case 'b':\r
- b1 = style1.getBorderBottom() == BorderStyle.THIN;\r
- b2 = style2.getBorderBottom() == BorderStyle.THIN;\r
+ b1 = style1.getBorderBottomEnum() == BorderStyle.THIN;\r
+ b2 = style2.getBorderBottomEnum() == BorderStyle.THIN;\r
borderName = "BOTTOM";\r
break;\r
case 'l':\r
- b1 = style1.getBorderLeft() == BorderStyle.THIN;\r
- b2 = style2.getBorderLeft() == BorderStyle.THIN;\r
+ b1 = style1.getBorderLeftEnum() == BorderStyle.THIN;\r
+ b2 = style2.getBorderLeftEnum() == BorderStyle.THIN;\r
borderName = "LEFT";\r
break;\r
case 'r':\r
- b1 = style1.getBorderRight() == BorderStyle.THIN;\r
- b2 = style2.getBorderRight() == BorderStyle.THIN;\r
+ b1 = style1.getBorderRightEnum() == BorderStyle.THIN;\r
+ b2 = style2.getBorderRightEnum() == BorderStyle.THIN;\r
borderName = "RIGHT";\r
break;\r
}\r
}
private void borderStyles(CellStyle style) {
- styleOut("border-left", style.getBorderLeft(), BORDER);
- styleOut("border-right", style.getBorderRight(), BORDER);
- styleOut("border-top", style.getBorderTop(), BORDER);
- styleOut("border-bottom", style.getBorderBottom(), BORDER);
+ styleOut("border-left", style.getBorderLeftEnum(), BORDER);
+ styleOut("border-right", style.getBorderRightEnum(), BORDER);
+ styleOut("border-top", style.getBorderTopEnum(), BORDER);
+ styleOut("border-bottom", style.getBorderBottomEnum(), BORDER);
}
private void fontStyle(CellStyle style) {
* @see VerticalAlignment
* @deprecated POI 3.15 beta 3. Use {@link #setVerticalAlignment(VerticalAlignment)} instead.
*/
+ @Removal(version="3.17")
@Override
public void setVerticalAlignment(short align)
{
* @see #BORDER_SLANTED_DASH_DOT
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderLeft(BorderStyle)} instead.
*/
+ @Removal(version="3.17")
@Override
public void setBorderLeft(short border)
{
/**
* set the type of border to use for the left border of the cell
* @param border type
+ * @since POI 3.15
*/
@Override
public void setBorderLeft(BorderStyle border)
/**
* get the type of border to use for the left border of the cell
* @return border type
+ * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderLeftEnum()}.
+ */
+ @Override
+ public short getBorderLeft()
+ {
+ return _format.getBorderLeft();
+ }
+ /**
+ * get the type of border to use for the left border of the cell
+ * @return border type
+ * @since POI 3.15
*/
@Override
- public BorderStyle getBorderLeft()
+ public BorderStyle getBorderLeftEnum()
{
return BorderStyle.valueOf(_format.getBorderLeft());
}
* @see #BORDER_SLANTED_DASH_DOT
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderRight(BorderStyle)} instead.
*/
+ @Removal(version="3.17")
@Override
public void setBorderRight(short border)
{
/**
* set the type of border to use for the right border of the cell
* @param border type
+ * @since POI 3.15
*/
@Override
public void setBorderRight(BorderStyle border)
/**
* get the type of border to use for the right border of the cell
* @return border type
+ * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderRightEnum()}.
+ */
+ @Override
+ public short getBorderRight()
+ {
+ return _format.getBorderRight();
+ }
+ /**
+ * get the type of border to use for the right border of the cell
+ * @return border type
+ * @since POI 3.15
*/
@Override
- public BorderStyle getBorderRight()
+ public BorderStyle getBorderRightEnum()
{
return BorderStyle.valueOf(_format.getBorderRight());
}
* @see #BORDER_SLANTED_DASH_DOT
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderTop(BorderStyle)} instead.
*/
+ @Removal(version="3.17")
@Override
public void setBorderTop(short border)
{
/**
* set the type of border to use for the top border of the cell
* @param border type
+ * @since POI 3.15
*/
@Override
public void setBorderTop(BorderStyle border)
/**
* get the type of border to use for the top border of the cell
* @return border type
+ * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderTopEnum()}.
*/
@Override
- public BorderStyle getBorderTop()
+ public short getBorderTop()
+ {
+ return _format.getBorderTop();
+ }
+ /**
+ * get the type of border to use for the top border of the cell
+ * @return border type
+ * @since 3.15
+ */
+ @Override
+ public BorderStyle getBorderTopEnum()
{
return BorderStyle.valueOf(_format.getBorderTop());
}
* @see #BORDER_SLANTED_DASH_DOT
* @deprecated 3.15 beta 2. Use {@link HSSFCellStyle#setBorderBottom(BorderStyle)} instead.
*/
+ @Removal(version="3.17")
@Override
public void setBorderBottom(short border)
{
/**
* set the type of border to use for the bottom border of the cell
* @param border type
+ * @since 3.15 beta 2
*/
@Override
public void setBorderBottom(BorderStyle border)
/**
* get the type of border to use for the bottom border of the cell
* @return border type
+ * @deprecated POI 3.15. Will return a BorderStyle enum in the future. Use {@link #getBorderBottomEnum()}.
*/
@Override
- public BorderStyle getBorderBottom()
+ public short getBorderBottom()
+ {
+ return _format.getBorderBottom();
+ }
+ /**
+ * get the type of border to use for the bottom border of the cell
+ * @return border type
+ * @since 3.15
+ */
+ @Override
+ public BorderStyle getBorderBottomEnum()
{
return BorderStyle.valueOf(_format.getBorderBottom());
}
* @param fp fill pattern (set to 1 to fill w/foreground color)
* @deprecated POI 3.15 beta 3. Use {@link #setFillPattern(FillPatternType)} instead.
*/
+ @Removal(version="3.17")
@Override
public void setFillPattern(short fp)
{
* @see #BORDER_SLANTED_DASH_DOT
* @deprecated 3.15 beta 2. Use {@link #setBorderLeft(BorderStyle)} instead
*/
+ @Removal(version="3.17")
void setBorderLeft(short border);
/**
* set the type of border to use for the left border of the cell
* @param border type
+ * @since POI 3.15
*/
void setBorderLeft(BorderStyle border);
/**
* get the type of border to use for the left border of the cell
* @return border type
+ * @deprecated POI 3.15. Use {@link #getBorderLeftEnum()} instead.
+ * This will return a BorderStyle enum in the future.
+ */
+ short getBorderLeft();
+ /**
+ * get the type of border to use for the left border of the cell
+ * @return border type
+ * @since POI 3.15
*/
- BorderStyle getBorderLeft();
+ BorderStyle getBorderLeftEnum();
/**
* set the type of border to use for the right border of the cell
* @see #BORDER_SLANTED_DASH_DOT
* @deprecated 3.15 beta 2. Use {@link #setBorderRight(BorderStyle)} instead
*/
+ @Removal(version="3.17")
void setBorderRight(short border);
/**
* set the type of border to use for the right border of the cell
* @param border type
+ * @since POI 3.15
*/
void setBorderRight(BorderStyle border);
/**
* get the type of border to use for the right border of the cell
* @return border type
+ * @deprecated POI 3.15. Use {@link #getBorderRightEnum()} instead.
+ * This will return a BorderStyle enum in the future.
+ */
+ short getBorderRight();
+ /**
+ * get the type of border to use for the right border of the cell
+ * @return border type
+ * @since POI 3.15
*/
- BorderStyle getBorderRight();
+ BorderStyle getBorderRightEnum();
/**
* set the type of border to use for the top border of the cell
* @see #BORDER_SLANTED_DASH_DOT
* @deprecated 3.15 beta 2. Use {@link #setBorderTop(BorderStyle)} instead
*/
+ @Removal(version="3.17")
void setBorderTop(short border);
/**
* set the type of border to use for the top border of the cell
* @param border type
+ * @since POI 3.15
*/
void setBorderTop(BorderStyle border);
/**
* get the type of border to use for the top border of the cell
* @return border type
+ * @deprecated POI 3.15. Use {@link #getBorderTopEnum()} instead.
+ * This will return a BorderStyle enum in the future.
+ */
+ short getBorderTop();
+ /**
+ * get the type of border to use for the top border of the cell
+ * @return border type
+ * @since POI 3.15
*/
- BorderStyle getBorderTop();
+ BorderStyle getBorderTopEnum();
/**
* set the type of border to use for the bottom border of the cell
* @see #BORDER_SLANTED_DASH_DOT
* @deprecated 3.15 beta 2. Use {@link #setBorderBottom(BorderStyle)} instead.
*/
+ @Removal(version="3.17")
void setBorderBottom(short border);
/**
* set the type of border to use for the bottom border of the cell
* @param border type
+ * @since POI 3.15
*/
void setBorderBottom(BorderStyle border);
/**
* get the type of border to use for the bottom border of the cell
* @return border type
+ * @deprecated POI 3.15. Use {@link #getBorderBottomEnum()} instead.
+ * This will return a BorderStyle enum in the future.
+ */
+ short getBorderBottom();
+ /**
+ * get the type of border to use for the bottom border of the cell
+ * @return border type
+ * @since POI 3.15
*/
- BorderStyle getBorderBottom();
+ BorderStyle getBorderBottomEnum();
/**
* set the color to use for the left border
Map<String, Object> properties = new HashMap<String, Object>();
put(properties, ALIGNMENT, style.getAlignmentEnum());
put(properties, VERTICAL_ALIGNMENT, style.getVerticalAlignmentEnum());
- put(properties, BORDER_BOTTOM, style.getBorderBottom());
- put(properties, BORDER_LEFT, style.getBorderLeft());
- put(properties, BORDER_RIGHT, style.getBorderRight());
- put(properties, BORDER_TOP, style.getBorderTop());
+ put(properties, BORDER_BOTTOM, style.getBorderBottomEnum());
+ put(properties, BORDER_LEFT, style.getBorderLeftEnum());
+ put(properties, BORDER_RIGHT, style.getBorderRightEnum());
+ put(properties, BORDER_TOP, style.getBorderTopEnum());
put(properties, BOTTOM_BORDER_COLOR, style.getBottomBorderColor());
put(properties, DATA_FORMAT, style.getDataFormat());
put(properties, FILL_PATTERN, style.getFillPatternEnum());
/**
* Get the type of border to use for the bottom border of the cell
+ * Will be removed when {@link #getBorderBottom()} returns a BorderStyle enum
*
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
+ * @since POI 3.15
*/
@Override
- public BorderStyle getBorderBottom() {
+ public BorderStyle getBorderBottomEnum() {
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
int idx = (int)_cellXf.getBorderId();
}
return BorderStyle.valueOf((short)(ptrn.intValue() - 1));
}
-
/**
* Get the type of border to use for the bottom border of the cell
+ * This will return a BorderStyle enum in the future.
*
- * @return border type as Java enum
- * @deprecated 3.15 beta 2. Use {@link #getBorderBottom}
+ * @return border type code
+ * @deprecated 3.15 beta 2. Use {@link #getBorderBottomEnum()}
*/
- public BorderStyle getBorderBottomEnum() {
- return getBorderBottom();
+ public short getBorderBottom() {
+ return getBorderBottomEnum().getCode();
}
/**
* Get the type of border to use for the left border of the cell
+ * Will be removed when {@link #getBorderLeft()} returns a BorderStyle enum
*
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
+ * @since POI 3.15
*/
@Override
- public BorderStyle getBorderLeft() {
+ public BorderStyle getBorderLeftEnum() {
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
int idx = (int)_cellXf.getBorderId();
/**
* Get the type of border to use for the left border of the cell
+ * This will return a BorderStyle enum in the future.
*
- * @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
- * @deprecated 3.15 beta 2. Use {@link #getBorderLeft}
+ * @return border type code
+ * @deprecated 3.15 beta 2. Use {@link #getBorderLeftEnum()}
*/
- public BorderStyle getBorderLeftEnum() {
- return getBorderLeft();
+ public short getBorderLeft() {
+ return getBorderLeftEnum().getCode();
}
/**
* Get the type of border to use for the right border of the cell
+ * Will be removed when {@link #getBorderRight()} returns a BorderStyle enum
*
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
+ * @since POI 3.15
*/
@Override
- public BorderStyle getBorderRight() {
+ public BorderStyle getBorderRightEnum() {
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
int idx = (int)_cellXf.getBorderId();
}
return BorderStyle.valueOf((short)(ptrn.intValue() - 1));
}
-
/**
* Get the type of border to use for the right border of the cell
+ * This will return a BorderStyle enum in the future.
*
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
- * @deprecated 3.15 beta 2. Use {@link #getBorderRight}
+ * @deprecated 3.15 beta 2. Use {@link #getBorderRightEnum()} instead
*/
- public BorderStyle getBorderRightEnum() {
- return getBorderRight();
+ public short getBorderRight() {
+ return getBorderRightEnum().getCode();
}
/**
* Get the type of border to use for the top border of the cell
+ * Will be removed when {@link #getBorderTop()} returns a BorderStyle enum
*
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
+ * @since POI 3.15
*/
@Override
- public BorderStyle getBorderTop() {
+ public BorderStyle getBorderTopEnum() {
if(!_cellXf.getApplyBorder()) return BorderStyle.NONE;
int idx = (int)_cellXf.getBorderId();
}
return BorderStyle.valueOf((short) (ptrn.intValue() - 1));
}
-
/**
* Get the type of border to use for the top border of the cell
+ * This will return a BorderStyle enum in the future.
*
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
- * @deprecated 3.15 beta 2. Use {@link #getBorderTop}
+ * @deprecated 3.15 beta 2. Use {@link #getBorderTopEnum()} instead.
*/
- public BorderStyle getBorderTopEnum() {
- return getBorderTop();
+ public short getBorderTop() {
+ return getBorderTopEnum().getCode();
}
/**
* @see org.apache.poi.ss.usermodel.CellStyle#ALIGN_CENTER_SELECTION
* @deprecated POI 3.15 beta 3. Use {@link #setAlignment(HorizontalAlignment)} instead.
*/
+ @Removal(version="3.17")
@Override
public void setAlignment(short align) {
setAlignment(HorizontalAlignment.forInt(align));
* @param border the type of border to use
* @deprecated 3.15 beta 2. Use {@link #setBorderBottom(BorderStyle)}
*/
+ @Removal(version="3.17")
@Override
public void setBorderBottom(short border) {
setBorderBottom(BorderStyle.valueOf(border));
*
* @param border - type of border to use
* @see org.apache.poi.ss.usermodel.BorderStyle
+ * @since POI 3.15
*/
@Override
public void setBorderBottom(BorderStyle border) {
* @param border the type of border to use
* @deprecated 3.15 beta 2. Use {@link #setBorderLeft(BorderStyle)}
*/
+ @Removal(version="3.17")
@Override
public void setBorderLeft(short border) {
setBorderLeft(BorderStyle.valueOf(border));
* Set the type of border to use for the left border of the cell
*
* @param border the type of border to use
+ * @since POI 3.15
*/
@Override
public void setBorderLeft(BorderStyle border) {
* @param border the type of border to use
* @deprecated 3.15 beta 2. Use {@link #setBorderRight(BorderStyle)}
*/
+ @Removal(version="3.17")
@Override
public void setBorderRight(short border) {
setBorderRight(BorderStyle.valueOf(border));
* Set the type of border to use for the right border of the cell
*
* @param border the type of border to use
+ * @since POI 3.15
*/
@Override
public void setBorderRight(BorderStyle border) {
* @param border the type of border to use
* @deprecated 3.15 beta 2. Use {@link #setBorderTop(BorderStyle)}
*/
+ @Removal(version="3.17")
@Override
public void setBorderTop(short border) {
setBorderTop(BorderStyle.valueOf(border));
* Set the type of border to use for the top border of the cell
*
* @param border the type of border to use
+ * @since POI 3.15
*/
@Override
public void setBorderTop(BorderStyle border) {
* @see org.apache.poi.ss.usermodel.VerticalAlignment
* @deprecated POI 3.15 beta 3. Use {@link #setVerticalAlignment(VerticalAlignment)} instead.
*/
+ @Removal(version="3.17")
@Override
public void setVerticalAlignment(short align) {
setVerticalAlignment(VerticalAlignment.forInt(align));
@Test
public void testGetSetBorderBottom() {
//default values
- assertEquals(BorderStyle.NONE, cellStyle.getBorderBottom());
+ assertEquals(BorderStyle.NONE, cellStyle.getBorderBottomEnum());
int num = stylesTable.getBorders().size();
cellStyle.setBorderBottom(BorderStyle.MEDIUM);
- assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottom());
+ assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottomEnum());
//a new border has been added
assertEquals(num + 1, stylesTable.getBorders().size());
//id of the created border
//setting the same border multiple times should not change borderId
for (int i = 0; i < 3; i++) {
cellStyle.setBorderBottom(BorderStyle.MEDIUM);
- assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottom());
+ assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderBottomEnum());
}
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
assertEquals(num, stylesTable.getBorders().size());
@Test
public void testGetSetBorderRight() {
//default values
- assertEquals(BorderStyle.NONE, cellStyle.getBorderRight());
+ assertEquals(BorderStyle.NONE, cellStyle.getBorderRightEnum());
int num = stylesTable.getBorders().size();
cellStyle.setBorderRight(BorderStyle.MEDIUM);
- assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRight());
+ assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRightEnum());
//a new border has been added
assertEquals(num + 1, stylesTable.getBorders().size());
//id of the created border
//setting the same border multiple times should not change borderId
for (int i = 0; i < 3; i++) {
cellStyle.setBorderRight(BorderStyle.MEDIUM);
- assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRight());
+ assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderRightEnum());
}
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
assertEquals(num, stylesTable.getBorders().size());
@Test
public void testGetSetBorderLeft() {
//default values
- assertEquals(BorderStyle.NONE, cellStyle.getBorderLeft());
+ assertEquals(BorderStyle.NONE, cellStyle.getBorderLeftEnum());
int num = stylesTable.getBorders().size();
cellStyle.setBorderLeft(BorderStyle.MEDIUM);
- assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeft());
+ assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeftEnum());
//a new border has been added
assertEquals(num + 1, stylesTable.getBorders().size());
//id of the created border
//setting the same border multiple times should not change borderId
for (int i = 0; i < 3; i++) {
cellStyle.setBorderLeft(BorderStyle.MEDIUM);
- assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeft());
+ assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderLeftEnum());
}
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
assertEquals(num, stylesTable.getBorders().size());
@Test
public void testGetSetBorderTop() {
//default values
- assertEquals(BorderStyle.NONE, cellStyle.getBorderTop());
+ assertEquals(BorderStyle.NONE, cellStyle.getBorderTopEnum());
int num = stylesTable.getBorders().size();
cellStyle.setBorderTop(BorderStyle.MEDIUM);
- assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTop());
+ assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTopEnum());
//a new border has been added
assertEquals(num + 1, stylesTable.getBorders().size());
//id of the created border
//setting the same border multiple times should not change borderId
for (int i = 0; i < 3; i++) {
cellStyle.setBorderTop(BorderStyle.MEDIUM);
- assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTop());
+ assertEquals(BorderStyle.MEDIUM, cellStyle.getBorderTopEnum());
}
assertEquals(borderId, cellStyle.getCoreXf().getBorderId());
assertEquals(num, stylesTable.getBorders().size());
private void testGetSetBorderXMLBean(BorderStyle border, STBorderStyle.Enum expected) {
cellStyle.setBorderTop(border);
- assertEquals(border, cellStyle.getBorderTop());
+ assertEquals(border, cellStyle.getBorderTopEnum());
int borderId = (int)cellStyle.getCoreXf().getBorderId();
assertTrue(borderId > 0);
//check changes in the underlying xml bean
@Test
public void testGetSetBorderNone() {
cellStyle.setBorderTop(BorderStyle.NONE);
- assertEquals(BorderStyle.NONE, cellStyle.getBorderTop());
+ assertEquals(BorderStyle.NONE, cellStyle.getBorderTopEnum());
int borderId = (int)cellStyle.getCoreXf().getBorderId();
assertTrue(borderId > 0);
//check changes in the underlying xml bean
assertEquals(style2.getRightBorderColor(), style1.getRightBorderColor());
assertEquals(style2.getBottomBorderColor(), style1.getBottomBorderColor());
- assertEquals(style2.getBorderBottom(), style1.getBorderBottom());
- assertEquals(style2.getBorderLeft(), style1.getBorderLeft());
- assertEquals(style2.getBorderRight(), style1.getBorderRight());
- assertEquals(style2.getBorderTop(), style1.getBorderTop());
+ assertEquals(style2.getBorderBottomEnum(), style1.getBorderBottomEnum());
+ assertEquals(style2.getBorderLeftEnum(), style1.getBorderLeftEnum());
+ assertEquals(style2.getBorderRightEnum(), style1.getBorderRightEnum());
+ assertEquals(style2.getBorderTopEnum(), style1.getBorderTopEnum());
wb2.close();
}
Workbook copy = XSSFTestDataSamples.writeOutAndReadBack(target);
// previously this failed because the border-element was not copied over
- copy.getCellStyleAt((short)1).getBorderBottom();
+ copy.getCellStyleAt((short)1).getBorderBottomEnum();
copy.close();
protected boolean isEmptyStyle( CellStyle cellStyle ) {
return cellStyle == null || (
cellStyle.getFillPattern() == 0
- && cellStyle.getBorderTop() == BorderStyle.NONE
- && cellStyle.getBorderRight() == BorderStyle.NONE
- && cellStyle.getBorderBottom() == BorderStyle.NONE
- && cellStyle.getBorderLeft() == BorderStyle.NONE
+ && cellStyle.getBorderTopEnum() == BorderStyle.NONE
+ && cellStyle.getBorderRightEnum() == BorderStyle.NONE
+ && cellStyle.getBorderBottomEnum() == BorderStyle.NONE
+ && cellStyle.getBorderLeftEnum() == BorderStyle.NONE
);
}
}
processCellStyleBorder( workbook, cellTarget, "top",
- cellStyle.getBorderTop(), cellStyle.getTopBorderColor() );
+ cellStyle.getBorderTopEnum(), cellStyle.getTopBorderColor() );
processCellStyleBorder( workbook, cellTarget, "right",
- cellStyle.getBorderRight(), cellStyle.getRightBorderColor() );
+ cellStyle.getBorderRightEnum(), cellStyle.getRightBorderColor() );
processCellStyleBorder( workbook, cellTarget, "bottom",
- cellStyle.getBorderBottom(), cellStyle.getBottomBorderColor() );
+ cellStyle.getBorderBottomEnum(), cellStyle.getBottomBorderColor() );
processCellStyleBorder( workbook, cellTarget, "left",
- cellStyle.getBorderLeft(), cellStyle.getLeftBorderColor() );
+ cellStyle.getBorderLeftEnum(), cellStyle.getLeftBorderColor() );
HSSFFont font = cellStyle.getFont( workbook );
processCellStyleFont( workbook, blockTarget, font );
break;
}
- buildStyle_border( workbook, style, "top", cellStyle.getBorderTop(),
+ buildStyle_border( workbook, style, "top", cellStyle.getBorderTopEnum(),
cellStyle.getTopBorderColor() );
buildStyle_border( workbook, style, "right",
- cellStyle.getBorderRight(), cellStyle.getRightBorderColor() );
+ cellStyle.getBorderRightEnum(), cellStyle.getRightBorderColor() );
buildStyle_border( workbook, style, "bottom",
- cellStyle.getBorderBottom(), cellStyle.getBottomBorderColor() );
- buildStyle_border( workbook, style, "left", cellStyle.getBorderLeft(),
+ cellStyle.getBorderBottomEnum(), cellStyle.getBottomBorderColor() );
+ buildStyle_border( workbook, style, "left", cellStyle.getBorderLeftEnum(),
cellStyle.getLeftBorderColor() );
HSSFFont font = cellStyle.getFont( workbook );
HSSFSheet sheet = wb.getSheetAt(0);
HSSFRow row = sheet.getRow(0);
HSSFCellStyle rstyle = row.getRowStyle();
- assertEquals(BorderStyle.DOUBLE, rstyle.getBorderBottom());
+ assertEquals(BorderStyle.DOUBLE, rstyle.getBorderBottomEnum());
wb.close();
}
HSSFCellStyle cs;
cs = s.getRow(0).getCell(0).getCellStyle();
- assertEquals(BorderStyle.HAIR, cs.getBorderRight());
+ assertEquals(BorderStyle.HAIR, cs.getBorderRightEnum());
cs = s.getRow(1).getCell(1).getCellStyle();
- assertEquals(BorderStyle.DOTTED, cs.getBorderRight());
+ assertEquals(BorderStyle.DOTTED, cs.getBorderRightEnum());
cs = s.getRow(2).getCell(2).getCellStyle();
- assertEquals(BorderStyle.DASH_DOT_DOT, cs.getBorderRight());
+ assertEquals(BorderStyle.DASH_DOT_DOT, cs.getBorderRightEnum());
cs = s.getRow(3).getCell(3).getCellStyle();
- assertEquals(BorderStyle.DASHED, cs.getBorderRight());
+ assertEquals(BorderStyle.DASHED, cs.getBorderRightEnum());
cs = s.getRow(4).getCell(4).getCellStyle();
- assertEquals(BorderStyle.THIN, cs.getBorderRight());
+ assertEquals(BorderStyle.THIN, cs.getBorderRightEnum());
cs = s.getRow(5).getCell(5).getCellStyle();
- assertEquals(BorderStyle.MEDIUM_DASH_DOT_DOT, cs.getBorderRight());
+ assertEquals(BorderStyle.MEDIUM_DASH_DOT_DOT, cs.getBorderRightEnum());
cs = s.getRow(6).getCell(6).getCellStyle();
- assertEquals(BorderStyle.SLANTED_DASH_DOT, cs.getBorderRight());
+ assertEquals(BorderStyle.SLANTED_DASH_DOT, cs.getBorderRightEnum());
cs = s.getRow(7).getCell(7).getCellStyle();
- assertEquals(BorderStyle.MEDIUM_DASH_DOT, cs.getBorderRight());
+ assertEquals(BorderStyle.MEDIUM_DASH_DOT, cs.getBorderRightEnum());
cs = s.getRow(8).getCell(8).getCellStyle();
- assertEquals(BorderStyle.MEDIUM_DASHED, cs.getBorderRight());
+ assertEquals(BorderStyle.MEDIUM_DASHED, cs.getBorderRightEnum());
cs = s.getRow(9).getCell(9).getCellStyle();
- assertEquals(BorderStyle.MEDIUM, cs.getBorderRight());
+ assertEquals(BorderStyle.MEDIUM, cs.getBorderRightEnum());
cs = s.getRow(10).getCell(10).getCellStyle();
- assertEquals(BorderStyle.THICK, cs.getBorderRight());
+ assertEquals(BorderStyle.THICK, cs.getBorderRightEnum());
cs = s.getRow(11).getCell(11).getCellStyle();
- assertEquals(BorderStyle.DOUBLE, cs.getBorderRight());
+ assertEquals(BorderStyle.DOUBLE, cs.getBorderRightEnum());
}
public void testShrinkToFit() {
newCell.setCellValue("2testtext2");
CellStyle newStyle = newCell.getCellStyle();
- assertEquals(BorderStyle.DOTTED, newStyle.getBorderBottom());
+ assertEquals(BorderStyle.DOTTED, newStyle.getBorderBottomEnum());
assertEquals(Font.COLOR_RED, ((HSSFCellStyle)newStyle).getFont(wb).getColor());
// OutputStream out = new FileOutputStream("/tmp/56959.xls");
// Check
assertEquals(23, wb.getNumCellStyles());
- assertEquals(BorderStyle.THICK, r.getCell(0).getCellStyle().getBorderBottom());
- assertEquals(BorderStyle.DASH_DOT, r.getCell(1).getCellStyle().getBorderBottom());
- assertEquals(BorderStyle.THICK, r.getCell(2).getCellStyle().getBorderBottom());
+ assertEquals(BorderStyle.THICK, r.getCell(0).getCellStyle().getBorderBottomEnum());
+ assertEquals(BorderStyle.DASH_DOT, r.getCell(1).getCellStyle().getBorderBottomEnum());
+ assertEquals(BorderStyle.THICK, r.getCell(2).getCellStyle().getBorderBottomEnum());
}
}
assertNotNull("Row is not null", r);
cs = r.getRowStyle();
- assertEquals("Bottom Border Style for row:", BorderStyle.THIN, cs.getBorderBottom());
- assertEquals("Left Border Style for row:", BorderStyle.THIN, cs.getBorderLeft());
- assertEquals("Right Border Style for row:", BorderStyle.THIN, cs.getBorderRight());
- assertEquals("Top Border Style for row:", BorderStyle.THIN, cs.getBorderTop());
+ assertEquals("Bottom Border Style for row:", BorderStyle.THIN, cs.getBorderBottomEnum());
+ assertEquals("Left Border Style for row:", BorderStyle.THIN, cs.getBorderLeftEnum());
+ assertEquals("Right Border Style for row:", BorderStyle.THIN, cs.getBorderRightEnum());
+ assertEquals("Top Border Style for row:", BorderStyle.THIN, cs.getBorderTopEnum());
assertEquals("FillForegroundColor for row:", 0xA, cs.getFillForegroundColor());
assertEquals("FillPattern for row:", 0x1, cs.getFillPattern());
protected void assertBorderStyleEquals(BorderStyle expected, Cell cell) {
CellStyle style = cell.getCellStyle();
- assertEquals(expected, style.getBorderTop());
- assertEquals(expected, style.getBorderBottom());
- assertEquals(expected, style.getBorderLeft());
- assertEquals(expected, style.getBorderRight());
+ assertEquals(expected, style.getBorderTopEnum());
+ assertEquals(expected, style.getBorderBottomEnum());
+ assertEquals(expected, style.getBorderLeftEnum());
+ assertEquals(expected, style.getBorderRightEnum());
}
}
assertNotNull("Formula Cell Style", cs);
assertEquals("Font Index Matches", f.getIndex(), cs.getFontIndex());
- assertEquals("Top Border", BorderStyle.THIN, cs.getBorderTop());
- assertEquals("Left Border", BorderStyle.THIN, cs.getBorderLeft());
- assertEquals("Right Border", BorderStyle.THIN, cs.getBorderRight());
- assertEquals("Bottom Border", BorderStyle.THIN, cs.getBorderBottom());
+ assertEquals("Top Border", BorderStyle.THIN, cs.getBorderTopEnum());
+ assertEquals("Left Border", BorderStyle.THIN, cs.getBorderLeftEnum());
+ assertEquals("Right Border", BorderStyle.THIN, cs.getBorderRightEnum());
+ assertEquals("Bottom Border", BorderStyle.THIN, cs.getBorderBottomEnum());
wb2.close();
}
\r
// A valid BorderStyle constant, as a Short\r
CellUtil.setCellStyleProperty(c, CellUtil.BORDER_BOTTOM, BorderStyle.DASH_DOT.getCode());\r
- assertEquals(BorderStyle.DASH_DOT, c.getCellStyle().getBorderBottom());\r
+ assertEquals(BorderStyle.DASH_DOT, c.getCellStyle().getBorderBottomEnum());\r
\r
// A valid BorderStyle constant, as an Enum\r
CellUtil.setCellStyleProperty(c, CellUtil.BORDER_TOP, BorderStyle.MEDIUM_DASH_DOT);\r
- assertEquals(BorderStyle.MEDIUM_DASH_DOT, c.getCellStyle().getBorderTop());\r
+ assertEquals(BorderStyle.MEDIUM_DASH_DOT, c.getCellStyle().getBorderTopEnum());\r
\r
wb.close();\r
}\r