Search in sources :

Example 31 with CTColor

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTColor in project poi by apache.

the class XSSFBorderFormatting method setTopBorderColor.

@Override
public void setTopBorderColor(short color) {
    CTColor ctColor = CTColor.Factory.newInstance();
    ctColor.setIndexed(color);
    setTopBorderColor(ctColor);
}
Also used : CTColor(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)

Example 32 with CTColor

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTColor in project poi by apache.

the class XSSFBorderFormatting method setHorizontalBorderColor.

public void setHorizontalBorderColor(short color) {
    CTColor ctColor = CTColor.Factory.newInstance();
    ctColor.setIndexed(color);
    setHorizontalBorderColor(ctColor);
}
Also used : CTColor(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)

Example 33 with CTColor

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTColor in project poi by apache.

the class XSSFBorderFormatting method setDiagonalBorderColor.

@Override
public void setDiagonalBorderColor(short color) {
    CTColor ctColor = CTColor.Factory.newInstance();
    ctColor.setIndexed(color);
    setDiagonalBorderColor(ctColor);
}
Also used : CTColor(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)

Example 34 with CTColor

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTColor in project poi by apache.

the class TestXSSFCellFill method testGetFillBackgroundColor.

@Test
public void testGetFillBackgroundColor() {
    CTFill ctFill = CTFill.Factory.newInstance();
    XSSFCellFill cellFill = new XSSFCellFill(ctFill, null);
    CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
    CTColor bgColor = ctPatternFill.addNewBgColor();
    assertNotNull(cellFill.getFillBackgroundColor());
    bgColor.setIndexed(2);
    assertEquals(2, cellFill.getFillBackgroundColor().getIndexed());
}
Also used : CTFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill) CTPatternFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill) CTColor(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor) Test(org.junit.Test)

Example 35 with CTColor

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTColor in project poi by apache.

the class TestXSSFCellFill method testGetFillForegroundColor.

@Test
public void testGetFillForegroundColor() {
    CTFill ctFill = CTFill.Factory.newInstance();
    XSSFCellFill cellFill = new XSSFCellFill(ctFill, null);
    CTPatternFill ctPatternFill = ctFill.addNewPatternFill();
    CTColor fgColor = ctPatternFill.addNewFgColor();
    assertNotNull(cellFill.getFillForegroundColor());
    fgColor.setIndexed(8);
    assertEquals(8, cellFill.getFillForegroundColor().getIndexed());
}
Also used : CTFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill) CTPatternFill(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill) CTColor(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor) Test(org.junit.Test)

Aggregations

CTColor (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTColor)27 Test (org.junit.Test)12 CTColor (org.openxmlformats.schemas.drawingml.x2006.main.CTColor)10 CTPatternFill (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPatternFill)6 CTSRgbColor (org.openxmlformats.schemas.drawingml.x2006.main.CTSRgbColor)5 Color (java.awt.Color)4 XSSFColor (org.apache.poi.xssf.usermodel.XSSFColor)4 CTHslColor (org.openxmlformats.schemas.drawingml.x2006.main.CTHslColor)4 CTSystemColor (org.openxmlformats.schemas.drawingml.x2006.main.CTSystemColor)4 CTFont (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFont)4 PresetColor (org.apache.poi.sl.usermodel.PresetColor)3 XmlObject (org.apache.xmlbeans.XmlObject)2 CTColorScheme (org.openxmlformats.schemas.drawingml.x2006.main.CTColorScheme)2 CTFill (org.openxmlformats.schemas.spreadsheetml.x2006.main.CTFill)2 CTColor (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTColor)2 CTRPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr)2 FileOutputStream (java.io.FileOutputStream)1 LinkedHashMap (java.util.LinkedHashMap)1 DrawPaint (org.apache.poi.sl.draw.DrawPaint)1 SolidPaint (org.apache.poi.sl.usermodel.PaintStyle.SolidPaint)1