Java Code Examples for org.apache.poi.hssf.util.HSSFColor#toHSSFColor()

The following examples show how to use org.apache.poi.hssf.util.HSSFColor#toHSSFColor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HSSFBorderFormatting.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public void setBottomBorderColor(Color color) {
    HSSFColor hcolor = HSSFColor.toHSSFColor(color);
    if (hcolor == null) {
        setBottomBorderColor((short)0);
    } else {
        setBottomBorderColor(hcolor.getIndex());
    }
}
 
Example 2
Source File: HSSFBorderFormatting.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void setDiagonalBorderColor(Color color) {
    HSSFColor hcolor = HSSFColor.toHSSFColor(color);
    if (hcolor == null) {
        setDiagonalBorderColor((short)0);
    } else {
        setDiagonalBorderColor(hcolor.getIndex());
    }
}
 
Example 3
Source File: HSSFBorderFormatting.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void setLeftBorderColor(Color color) {
    HSSFColor hcolor = HSSFColor.toHSSFColor(color);
    if (hcolor == null) {
        setLeftBorderColor((short)0);
    } else {
        setLeftBorderColor(hcolor.getIndex());
    }
}
 
Example 4
Source File: HSSFBorderFormatting.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void setRightBorderColor(Color color) {
    HSSFColor hcolor = HSSFColor.toHSSFColor(color);
    if (hcolor == null) {
        setRightBorderColor((short)0);
    } else {
        setRightBorderColor(hcolor.getIndex());
    }
}
 
Example 5
Source File: HSSFBorderFormatting.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void setTopBorderColor(Color color) {
    HSSFColor hcolor = HSSFColor.toHSSFColor(color);
    if (hcolor == null) {
        setTopBorderColor((short)0);
    } else {
        setTopBorderColor(hcolor.getIndex());
    }
}
 
Example 6
Source File: HSSFFontFormatting.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public void setFontColor(Color color) {
    HSSFColor hcolor = HSSFColor.toHSSFColor(color);
    if (hcolor == null) {
        fontFormatting.setFontColorIndex((short)0);
    } else {
        fontFormatting.setFontColorIndex(hcolor.getIndex());
    }
}
 
Example 7
Source File: HSSFPatternFormatting.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public void setFillBackgroundColor(Color bg) {
    HSSFColor hcolor = HSSFColor.toHSSFColor(bg);
    if (hcolor == null) {
        setFillBackgroundColor((short)0);
    } else {
        setFillBackgroundColor(hcolor.getIndex());
    }
}
 
Example 8
Source File: HSSFPatternFormatting.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
public void setFillForegroundColor(Color fg) {
    HSSFColor hcolor = HSSFColor.toHSSFColor(fg);
    if (hcolor == null) {
        setFillForegroundColor((short)0);
    } else {
        setFillForegroundColor(hcolor.getIndex());
    }
}