|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jxcell.ConditionFormat
public class ConditionFormat
This class represents a conditional format condition and the associated formatting. Conditional cell formats are formats that are applied to a cell only when the value of a cell or formula meets a predetermined set of conditions. A range of cells can be formatted with up to three conditional formats. Conditional formats may inclued font colors and styles and cell border colors, styles and patterns.
Field Summary | |
---|---|
static short |
OperatorBetween
The format is applied if the cell is greater than or equal to formula1 and less than or equal to formula2. |
static short |
OperatorEqual
The format is applied if the cell is equal to formula1. |
static short |
OperatorGreaterThan
The format is applied if the cell is greater than formula1. |
static short |
OperatorGreaterThanOrEqual
The format is applied if the cell is greater than or equal to formula1. |
static short |
OperatorLessThan
The format is applied if the cell is less than formula1. |
static short |
OperatorLessThanOrEqual
The format is applied if the cell is less than or equal to formula1. |
static short |
OperatorNone
No operator. |
static short |
OperatorNotBetween
The format is applied if the cell is less than formula1 or greater than formula2. |
static short |
OperatorNotEqual
The format is applied if the cell is not equal to formula1. |
static short |
TypeCell
Condition has a type of "Cell". |
static short |
TypeFormula
Condition has a type of "Formula". |
static short |
TypeNone
No condition type. |
Method Summary | |
---|---|
CellFormat |
getCellFormat()
Returns the cell format with the formatting options for this conditional format. |
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. |
short |
getType()
Returns the conditional format type associated with this conditional format. |
void |
setCellFormat(CellFormat cfmt)
Sets formatting options for this conditional format from the specified RangeStyle object. |
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 |
setType(short type)
Sets the type of this conditional format. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short TypeNone
public static final short TypeCell
public static final short TypeFormula
public static final short OperatorNone
public static final short OperatorBetween
public static final short OperatorNotBetween
public static final short OperatorEqual
public static final short OperatorNotEqual
public static final short OperatorGreaterThan
public static final short OperatorLessThan
public static final short OperatorGreaterThanOrEqual
public static final short OperatorLessThanOrEqual
Method Detail |
---|
public CellFormat getCellFormat()
public void setCellFormat(CellFormat 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.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |