use of org.apache.poi.hssf.record.cf.IconMultiStateFormatting in project poi by apache.
the class CFRule12Record method createMultiStateFormatting.
public IconMultiStateFormatting createMultiStateFormatting() {
if (multistate != null)
return multistate;
// Convert, setup and return
setConditionType(CONDITION_TYPE_ICON_SET);
multistate = new IconMultiStateFormatting();
return multistate;
}
use of org.apache.poi.hssf.record.cf.IconMultiStateFormatting in project poi by apache.
the class CFRule12Record method create.
/**
* Creates a new Icon Set / Multi-State formatting
*
* @param sheet the sheet
* @param iconSet the icon set
*
* @return a new Icon Set / Multi-State formatting
*/
public static CFRule12Record create(HSSFSheet sheet, IconSet iconSet) {
Threshold[] ts = new Threshold[iconSet.num];
for (int i = 0; i < ts.length; i++) {
ts[i] = new IconMultiStateThreshold();
}
CFRule12Record r = new CFRule12Record(CONDITION_TYPE_ICON_SET, ComparisonOperator.NO_COMPARISON);
IconMultiStateFormatting imf = r.createMultiStateFormatting();
imf.setIconSet(iconSet);
imf.setThresholds(ts);
return r;
}
use of org.apache.poi.hssf.record.cf.IconMultiStateFormatting in project poi by apache.
the class HSSFConditionalFormattingRule method getMultiStateFormatting.
private HSSFIconMultiStateFormatting getMultiStateFormatting(boolean create) {
CFRule12Record cfRule12Record = getCFRule12Record(create);
if (cfRule12Record == null)
return null;
IconMultiStateFormatting iconFormatting = cfRule12Record.getMultiStateFormatting();
if (iconFormatting == null) {
if (!create)
return null;
cfRule12Record.createMultiStateFormatting();
}
return new HSSFIconMultiStateFormatting(cfRule12Record, sheet);
}
Aggregations