public class ConditionFormat
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static short |
eOperatorBetween
The format is applied if the cell is greater than or equal to formula1 and less than or equal to formula2.
|
static short |
eOperatorEqual
The format is applied if the cell is equal to formula1.
|
static short |
eOperatorGreaterThan
The format is applied if the cell is greater than formula1.
|
static short |
eOperatorGreaterThanOrEqual
The format is applied if the cell is greater than or equal to formula1.
|
static short |
eOperatorLessThan
The format is applied if the cell is less than formula1.
|
static short |
eOperatorLessThanOrEqual
The format is applied if the cell is less than or equal to formula1.
|
static short |
eOperatorNone
No operator.
|
static short |
eOperatorNotBetween
The format is applied if the cell is less than formula1 or greater than formula2.
|
static short |
eOperatorNotEqual
The format is applied if the cell is not equal to formula1.
|
static short |
eTypeCell
Condition has a type of "Cell".
|
static short |
eTypeFormula
Condition has a type of "Formula".
|
static short |
eTypeNone
No condition type.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFormula1(int row,
int col)
Returns the first formula associated with this conditional format
|
java.lang.String |
getFormula2(int row,
int col)
Returns the second formula associated with this conditional format
|
short |
getOperator()
Returns the operator for this conditional format.
|
RangeStyle |
getRangeStyle()
Returns the cell format with the formatting options for this conditional format.
|
short |
getType()
Returns the conditional format type associated with this conditional format.
|
void |
setColorScale(int conType,
java.awt.Color[] colors)
Sets the colorscale's type of this conditional format.
|
void |
setFormula1(java.lang.String formula,
int row,
int col)
Sets the first formula associated with this conditional format
|
void |
setFormula2(java.lang.String formula,
int row,
int col)
Sets the second formula associated with this conditional format
|
void |
setOperator(short operator)
Sets the operator for this conditional format.
|
void |
setRangeStyle(RangeStyle cfmt)
Sets formatting options for this conditional format from the specified RangeStyle object.
|
void |
setType(short type)
Sets the type of this conditional format.
|
public static final short eTypeNone
public static final short eTypeCell
public static final short eTypeFormula
public static final short eOperatorNone
public static final short eOperatorBetween
public static final short eOperatorNotBetween
public static final short eOperatorEqual
public static final short eOperatorNotEqual
public static final short eOperatorGreaterThan
public static final short eOperatorLessThan
public static final short eOperatorGreaterThanOrEqual
public static final short eOperatorLessThanOrEqual
public RangeStyle getRangeStyle()
public void setRangeStyle(RangeStyle cfmt) throws java.lang.Exception
cfmt
- the formatting to apply to this conditional format.java.lang.Exception
- exceptionpublic short getType()
public void setType(short type)
type
- a short indicating the type of this conditional format: eTypeNone, eTypeCell or eTypeFormula.public short getOperator()
public void setOperator(short operator)
operator
- the operator for this conditional format:
Conditional Format Operators eOperatorNone eOperatorBetween eOperatorNotBetween
eOperatorEqual eOperatorNotEqual eOperatorGreaterThan
eOperatorLessThan eOperatorGreaterThanOrEqual eOperatorLessThanOrEqualpublic java.lang.String getFormula1(int row, int col) throws java.lang.Exception
row
- the row this formula is relative to.col
- the column this formula is relative to.java.lang.Exception
- exceptionpublic void setFormula1(java.lang.String formula, int row, int col) throws java.lang.Exception
formula
- the first formula for this conditional format.row
- the row the formula will be relative to.col
- the column the formula will be relative to.java.lang.Exception
- if there is an error in the formula.public java.lang.String getFormula2(int row, int col) throws java.lang.Exception
row
- the row this formula is relative to.col
- the column this formula is relative to.java.lang.Exception
- exceptionpublic void setFormula2(java.lang.String formula, int row, int col) throws java.lang.Exception
formula
- the first formula for this conditional format.row
- the row the formula will be relative to.col
- the column the formula will be relative to.java.lang.Exception
- if there is an error in the formula.public void setColorScale(int conType, java.awt.Color[] colors)
conType
- 2 or 3.colors
- colors to be set