private XWPFBorderType getBorderType(Border border) { final CTBorder b = getTblBorder(false, border); return (b != null) ? stBorderTypeMap.get(b.getVal().intValue()) : null; }
/** * Specifies the border which shall be displayed below a set of * paragraphs which have the same set of paragraph border settings. * * @return paragraphBorder - the bottom border for the paragraph * @see #setBorderBottom(Borders) * @see Borders a list of all types of borders */ public Borders getBorderBottom() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getBottom(); } STBorder.Enum ptrn = ct != null ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
/** * Specifies the border which shall be displayed between each paragraph in a * set of paragraphs which have the same set of paragraph border settings. * * @return ParagraphBorder - the between border for the paragraph * @see #setBorderBetween(Borders) * @see Borders for a list of all possible borders */ public Borders getBorderBetween() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getBetween(); } STBorder.Enum ptrn = ct != null ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
/** * Specifies the border which shall be displayed above a set of paragraphs * which have the same set of paragraph border settings. * * @return paragraphBorder - the top border for the paragraph * @see #setBorderTop(Borders) * @see Borders a list of all types of borders */ public Borders getBorderTop() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getTop(); } STBorder.Enum ptrn = (ct != null) ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
/** * Specifies the border which shall be displayed on the left side of the * page around the specified paragraph. * * @return ParagraphBorder - the left border for the paragraph * @see #setBorderLeft(Borders) * @see Borders for a list of all possible borders */ public Borders getBorderLeft() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getLeft(); } STBorder.Enum ptrn = ct != null ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
/** * Specifies the border which shall be displayed on the right side of the * page around the specified paragraph. * * @return ParagraphBorder - the right border for the paragraph * @see #setBorderRight(Borders) * @see Borders for a list of all possible borders */ public Borders getBorderRight() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getRight(); } STBorder.Enum ptrn = ct != null ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
private XWPFBorderType getBorderType(Border border) { final CTBorder b = getTblBorder(false, border); return (b != null) ? stBorderTypeMap.get(b.getVal().intValue()) : null; }
public static Color getBorderColor( CTBorder border ) { if ( border == null ) { return null; } // border.getColor returns object???, use attribute w:color to get // the color. Node colorAttr = border.getDomNode().getAttributes().getNamedItemNS( MAIN_NAMESPACE, "color" ); if ( colorAttr != null ) { Object val = border.getVal(); return ColorHelper.getColor( ( (Attr) colorAttr ).getValue(), val, false ); } return null; }
public static Color getBorderColor( CTBorder border ) { if ( border == null ) { return null; } // border.getColor returns object???, use attribute w:color to get // the color. Node colorAttr = border.getDomNode().getAttributes().getNamedItemNS( MAIN_NAMESPACE, "color" ); if ( colorAttr != null ) { Object val = border.getVal(); return ColorHelper.getColor( ( (Attr) colorAttr ).getValue(), val, false ); } return null; }
public XWPFBorderType getInsideHBorderType() { XWPFBorderType bt = null; CTTblPr tblPr = getTrPr(); if (tblPr.isSetTblBorders()) { CTTblBorders ctb = tblPr.getTblBorders(); if (ctb.isSetInsideH()) { CTBorder border = ctb.getInsideH(); bt = stBorderTypeMap.get(border.getVal().intValue()); } } return bt; }
public XWPFBorderType getInsideVBorderType() { XWPFBorderType bt = null; CTTblPr tblPr = getTrPr(); if (tblPr.isSetTblBorders()) { CTTblBorders ctb = tblPr.getTblBorders(); if (ctb.isSetInsideV()) { CTBorder border = ctb.getInsideV(); bt = stBorderTypeMap.get(border.getVal().intValue()); } } return bt; }
/** * Specifies the border which shall be displayed on the right side of the * page around the specified paragraph. * * @return ParagraphBorder - the right border for the paragraph * @see #setBorderRight(Borders) * @see Borders for a list of all possible borders */ public Borders getBorderRight() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getRight(); } STBorder.Enum ptrn = ct != null ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
/** * Specifies the border which shall be displayed on the right side of the * page around the specified paragraph. * * @return ParagraphBorder - the right border for the paragraph * @see #setBorderRight(Borders) * @see Borders for a list of all possible borders */ public Borders getBorderRight() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getRight(); } STBorder.Enum ptrn = ct != null ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
/** * Specifies the border which shall be displayed above a set of paragraphs * which have the same set of paragraph border settings. * * @return paragraphBorder - the top border for the paragraph * @see #setBorderTop(Borders) * @see Borders a list of all types of borders */ public Borders getBorderTop() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getTop(); } STBorder.Enum ptrn = (ct != null) ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
/** * Specifies the border which shall be displayed below a set of * paragraphs which have the same set of paragraph border settings. * * @return paragraphBorder - the bottom border for the paragraph * @see #setBorderBottom(Borders) * @see Borders a list of all types of borders */ public Borders getBorderBottom() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getBottom(); } STBorder.Enum ptrn = ct != null ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
/** * Specifies the border which shall be displayed above a set of paragraphs * which have the same set of paragraph border settings. * * @return paragraphBorder - the top border for the paragraph * @see #setBorderTop(Borders) * @see Borders a list of all types of borders */ public Borders getBorderTop() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getTop(); } STBorder.Enum ptrn = (ct != null) ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
/** * Specifies the border which shall be displayed between each paragraph in a * set of paragraphs which have the same set of paragraph border settings. * * @return ParagraphBorder - the between border for the paragraph * @see #setBorderBetween(Borders) * @see Borders for a list of all possible borders */ public Borders getBorderBetween() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getBetween(); } STBorder.Enum ptrn = ct != null ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
/** * Specifies the border which shall be displayed on the left side of the * page around the specified paragraph. * * @return ParagraphBorder - the left border for the paragraph * @see #setBorderLeft(Borders) * @see Borders for a list of all possible borders */ public Borders getBorderLeft() { CTPBdr border = getCTPBrd(false); CTBorder ct = null; if (border != null) { ct = border.getLeft(); } STBorder.Enum ptrn = ct != null ? ct.getVal() : STBorder.NONE; return Borders.valueOf(ptrn.intValue()); }
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; }