private int getBorderSize(Border border) { final CTBorder b = getTblBorder(false, border); return (b != null) ? (b.isSetSz() ? b.getSz().intValue() : -1) : -1; }
private int getBorderSize(Border border) { final CTBorder b = getTblBorder(false, border); return (b != null) ? (b.isSetSz() ? b.getSz().intValue() : -1) : -1; }
public int getInsideHBorderSize() { int size = -1; CTTblPr tblPr = getTrPr(); if (tblPr.isSetTblBorders()) { CTTblBorders ctb = tblPr.getTblBorders(); if (ctb.isSetInsideH()) { CTBorder border = ctb.getInsideH(); size = border.getSz().intValue(); } } return size; }
public int getInsideVBorderSize() { int size = -1; CTTblPr tblPr = getTrPr(); if (tblPr.isSetTblBorders()) { CTTblBorders ctb = tblPr.getTblBorders(); if (ctb.isSetInsideV()) { CTBorder border = ctb.getInsideV(); size = border.getSz().intValue(); } } return size; }
public static TableCellBorder getTableCellBorder( CTBorder border, boolean fromTableCell ) { if ( border != null ) { boolean noBorder = ( STBorder.NONE == border.getVal() || STBorder.NIL == border.getVal() ); if ( noBorder ) { return new TableCellBorder( !noBorder, fromTableCell ); } Float borderSize = null; BigInteger size = border.getSz(); if ( size != null ) { // http://officeopenxml.com/WPtableBorders.php // if w:sz="4" => 1/4 points borderSize = size.floatValue() / 8f; } Color borderColor = ColorHelper.getBorderColor( border ); return new TableCellBorder( borderSize, borderColor, fromTableCell ); } return null; }
public static TableCellBorder getTableCellBorder( CTBorder border, boolean fromTableCell ) { if ( border != null ) { boolean noBorder = ( STBorder.NONE == border.getVal() || STBorder.NIL == border.getVal() ); if ( noBorder ) { return new TableCellBorder( !noBorder, fromTableCell ); } Float borderSize = null; BigInteger size = border.getSz(); if ( size != null ) { // http://officeopenxml.com/WPtableBorders.php // if w:sz="4" => 1/4 points borderSize = size.floatValue() / 8f; } Color borderColor = ColorHelper.getBorderColor( border ); return new TableCellBorder( borderSize, borderColor, fromTableCell ); } return null; }
private StyleBorder createBorder( CTBorder docxBorder, BorderType borderType ) { if ( docxBorder == null ) { return null; } StyleBorder styleBorder = new StyleBorder( docxBorder.getVal().toString(), borderType ); // XXX semi point ? styleBorder.setWidth( docxBorder.getSz() ); STHexColor hexColor = docxBorder.xgetColor(); Color bc = ColorRegistry.getInstance().getColor( "0x" + hexColor.getStringValue() ); styleBorder.setColor( bc ); return styleBorder; }
private StyleBorder createBorder( CTBorder docxBorder, BorderType borderType ) { if ( docxBorder == null ) { return null; } StyleBorder styleBorder = new StyleBorder( docxBorder.getVal().toString(), borderType ); // XXX semi point ? styleBorder.setWidth( docxBorder.getSz() ); STHexColor hexColor = docxBorder.xgetColor(); Color bc = ColorRegistry.getInstance().getColor( "0x" + hexColor.getStringValue() ); styleBorder.setColor( bc ); return styleBorder; }
cssStyleSheet.setCSSProperty( BORDER_BOTTOM_WIDTH, bottom.getSz().floatValue() / 2 + "pt" ); cssStyleSheet.setCSSProperty( BORDER_BOTTOM_COLOR, "#" + bottom.xgetColor().getStringValue() ); cssStyleSheet.setCSSProperty( BORDER_LEFT_WIDTH, left.getSz().floatValue() / 2 + "pt" ); cssStyleSheet.setCSSProperty( BORDER_LEFT_COLOR, "#" + left.xgetColor().getStringValue() ); cssStyleSheet.setCSSProperty( BORDER_TOP_WIDTH, top.getSz().floatValue() / 2 + "pt" ); cssStyleSheet.setCSSProperty( BORDER_TOP_COLOR, "#" + top.xgetColor().getStringValue() ); cssStyleSheet.setCSSProperty( BORDER_RIGHT_WIDTH, right.getSz().floatValue() / 2 + "pt" ); cssStyleSheet.setCSSProperty( BORDER_RIGHT_COLOR, "#" + right.xgetColor().getStringValue() );
BigInteger borderSize = border.getSz(); if ( borderSize != null )
BigInteger borderSize = border.getSz(); if ( borderSize != null )
BigInteger borderSize = border.getSz(); if ( borderSize != null )