Search in sources :

Example 1 with IconMultiStateFormatting

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;
}
Also used : IconMultiStateFormatting(org.apache.poi.hssf.record.cf.IconMultiStateFormatting)

Example 2 with IconMultiStateFormatting

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;
}
Also used : IconMultiStateThreshold(org.apache.poi.hssf.record.cf.IconMultiStateThreshold) IconMultiStateFormatting(org.apache.poi.hssf.record.cf.IconMultiStateFormatting) ColorGradientThreshold(org.apache.poi.hssf.record.cf.ColorGradientThreshold) Threshold(org.apache.poi.hssf.record.cf.Threshold) DataBarThreshold(org.apache.poi.hssf.record.cf.DataBarThreshold) IconMultiStateThreshold(org.apache.poi.hssf.record.cf.IconMultiStateThreshold)

Example 3 with IconMultiStateFormatting

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);
}
Also used : CFRule12Record(org.apache.poi.hssf.record.CFRule12Record) IconMultiStateFormatting(org.apache.poi.hssf.record.cf.IconMultiStateFormatting)

Aggregations

IconMultiStateFormatting (org.apache.poi.hssf.record.cf.IconMultiStateFormatting)3 CFRule12Record (org.apache.poi.hssf.record.CFRule12Record)1 ColorGradientThreshold (org.apache.poi.hssf.record.cf.ColorGradientThreshold)1 DataBarThreshold (org.apache.poi.hssf.record.cf.DataBarThreshold)1 IconMultiStateThreshold (org.apache.poi.hssf.record.cf.IconMultiStateThreshold)1 Threshold (org.apache.poi.hssf.record.cf.Threshold)1