use of org.apache.poi.hssf.record.cf.DataBarFormatting in project poi by apache.
the class CFRule12Record method createDataBarFormatting.
public DataBarFormatting createDataBarFormatting() {
if (data_bar != null)
return data_bar;
// Convert, setup and return
setConditionType(CONDITION_TYPE_DATA_BAR);
data_bar = new DataBarFormatting();
return data_bar;
}
use of org.apache.poi.hssf.record.cf.DataBarFormatting in project poi by apache.
the class CFRule12Record method create.
/**
* Creates a new Data Bar formatting
*
* @param sheet the sheet
* @param color the data bar color
*
* @return a new Data Bar formatting
*/
public static CFRule12Record create(HSSFSheet sheet, ExtendedColor color) {
CFRule12Record r = new CFRule12Record(CONDITION_TYPE_DATA_BAR, ComparisonOperator.NO_COMPARISON);
DataBarFormatting dbf = r.createDataBarFormatting();
dbf.setColor(color);
dbf.setPercentMin((byte) 0);
dbf.setPercentMax((byte) 100);
DataBarThreshold min = new DataBarThreshold();
min.setType(RangeType.MIN.id);
dbf.setThresholdMin(min);
DataBarThreshold max = new DataBarThreshold();
max.setType(RangeType.MAX.id);
dbf.setThresholdMax(max);
return r;
}
use of org.apache.poi.hssf.record.cf.DataBarFormatting in project poi by apache.
the class HSSFConditionalFormattingRule method getDataBarFormatting.
private HSSFDataBarFormatting getDataBarFormatting(boolean create) {
CFRule12Record cfRule12Record = getCFRule12Record(create);
if (cfRule12Record == null)
return null;
DataBarFormatting databarFormatting = cfRule12Record.getDataBarFormatting();
if (databarFormatting == null) {
if (!create)
return null;
cfRule12Record.createDataBarFormatting();
}
return new HSSFDataBarFormatting(cfRule12Record, sheet);
}
Aggregations