Examples of CTPatternFill


Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill

     * Set the background fill color represented as a indexed color value.
     *
     * @param index
     */
    public void setFillBackgroundColor(int index) {
        CTPatternFill ptrn = ensureCTPatternFill();
        CTColor ctColor = ptrn.isSetBgColor() ? ptrn.getBgColor() : ptrn.addNewBgColor();
        ctColor.setIndexed(index);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill

     * Set the background fill color represented as a {@link XSSFColor} value.
     *
     * @param color
     */
    public void setFillBackgroundColor(XSSFColor color) {
        CTPatternFill ptrn = ensureCTPatternFill();
        ptrn.setBgColor(color.getCTColor());
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill

     * Get the foreground fill color.
     *
     * @return XSSFColor - foreground color. null if color is not set
     */
    public XSSFColor getFillForegroundColor() {
        CTPatternFill ptrn = _fill.getPatternFill();
        if (ptrn == null) return null;

        CTColor ctColor = ptrn.getFgColor();
        return ctColor == null ? null : new XSSFColor(ctColor);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill

     * Set the foreground fill color as a indexed color value
     *
     * @param index - the color to use
     */
    public void setFillForegroundColor(int index) {
        CTPatternFill ptrn = ensureCTPatternFill();
        CTColor ctColor = ptrn.isSetFgColor() ? ptrn.getFgColor() : ptrn.addNewFgColor();
        ctColor.setIndexed(index);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill

     * Set the foreground fill color represented as a {@link XSSFColor} value.
     *
     * @param color - the color to use
     */
    public void setFillForegroundColor(XSSFColor color) {
        CTPatternFill ptrn = ensureCTPatternFill();
        ptrn.setFgColor(color.getCTColor());
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill

     * get the fill pattern
     *
     * @return fill pattern type. null if fill pattern is not set
     */
    public STPatternType.Enum getPatternType() {
        CTPatternFill ptrn = _fill.getPatternFill();
        return ptrn == null ? null : ptrn.getPatternType();
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill

     * set the fill pattern
     *
     * @param patternType fill pattern to use
     */
    public void setPatternType(STPatternType.Enum patternType) {
        CTPatternFill ptrn = ensureCTPatternFill();
        ptrn.setPatternType(patternType);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill

        CTPatternFill ptrn = ensureCTPatternFill();
        ptrn.setPatternType(patternType);
    }

    private CTPatternFill ensureCTPatternFill() {
        CTPatternFill patternFill = _fill.getPatternFill();
        if (patternFill == null) {
            patternFill = _fill.addNewPatternFill();
        }
        return patternFill;
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill

    ctFgColor.setIndexed(5);
    assertEquals(5, cellStyle.getFillForegroundColor());
  }
 
  public void testGetFillPattern() {
    CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
    ctPatternFill.setPatternType(STPatternType.DARK_DOWN);
    assertEquals(8, cellStyle.getFillPattern());
  }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill

public class TestXSSFCellFill extends TestCase {
 
  public void testGetFillBackgroundColor() {
    CTFill ctFill = CTFill.Factory.newInstance();
    XSSFCellFill cellFill = new XSSFCellFill(ctFill);
    CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
    CTColor bgColor = ctPatternFill.addNewBgColor();
    assertNotNull(cellFill.getFillBackgroundColor());
    bgColor.setIndexed(2);
    assertEquals(2, cellFill.getFillBackgroundColor().getIndexed());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.