|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.workbook.StyleRegion
Represents a region and its associated style.
Note that the style can be changed, but the region is immutable. This is done because the regions form part of a non-overlapping collection that completely cover a worksheet. If you could change the region, that would potentially break the collection.
Field Summary | |
protected int |
endColumn
The end column. |
protected int |
endRow
The end row. |
protected int |
startColumn
The start column. |
protected int |
startRow
The start row. |
protected Style |
style
The style. |
Constructor Summary | |
StyleRegion(Style style,
int startRow,
int startColumn,
int endRow,
int endColumn)
Constructs a style region. |
Method Summary | |
boolean |
contains(int row,
int column)
Returns true if the region include the cell at the specified row and column. |
int |
getEndColumn()
Returns the end column of the region. |
int |
getEndRow()
Returns the end row of the region. |
int |
getIntersectCase(int r1,
int c1,
int r2,
int c2)
Returns an integer denoting one of the 17 cases of intersection. |
StyleRegion |
getIntersectionStyleRegion(int r1,
int c1,
int r2,
int c2,
StyleModifier modifier)
Returns a StyleRegion representing the portion of this region that intersects with the specified region. |
java.util.List |
getNonIntersectionStyleRegionList(int row1,
int col1,
int row2,
int col2)
Returns a list of StyleRegions equivalent to the non-intersection with the specified range. |
java.util.List |
getNonIntersectionStyleRegionList(StyleRegion region)
Returns a list of style regions that cover the non-intersecting part of this region. |
int |
getStartColumn()
Returns the start column of the region. |
int |
getStartRow()
Returns the start row of the region. |
Style |
getStyle()
Returns the style for this region. |
boolean |
intersects(int row1,
int col1,
int row2,
int col2)
Returns true if the specified range intersects with this region, and false otherwise. |
boolean |
intersects(StyleRegion region)
Returns true if the specified region intersects with this region, and false otherwise. |
void |
setStyle(Style style)
Sets the style for this region. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Style style
protected int startRow
protected int startColumn
protected int endRow
protected int endColumn
Constructor Detail |
public StyleRegion(Style style, int startRow, int startColumn, int endRow, int endColumn)
style
- the style.startRow
- the start row for the region.startColumn
- the start column for the region.endRow
- the end row for the region.endColumn
- the end column for the region.Method Detail |
public Style getStyle()
public void setStyle(Style style)
style
- the new style.public int getStartRow()
public int getStartColumn()
public int getEndRow()
public int getEndColumn()
public boolean contains(int row, int column)
row
- the row.column
- the column.
public boolean intersects(int row1, int col1, int row2, int col2)
row1
- the start row of the range.col1
- the start column of the range.row2
- the end row of the range.col2
- the end column of the range.
public boolean intersects(StyleRegion region)
region
- the region being tested.
public StyleRegion getIntersectionStyleRegion(int r1, int c1, int r2, int c2, StyleModifier modifier)
r1
- the start row of the region.c1
- the start column of the region.r2
- the end row of the region.c2
- the end column of the region.modifier
- an optional style modifier that will be applied to the style before
returning the intersecting region.
public java.util.List getNonIntersectionStyleRegionList(StyleRegion region)
region
- the region to calculate the intersection against.
public java.util.List getNonIntersectionStyleRegionList(int row1, int col1, int row2, int col2)
There are 17 cases to deal with, one of which entirely obliterates the existing StyleRegion.
row1
- the start row.col1
- the start column.row2
- the end row.col2
- the end column.
public int getIntersectCase(int r1, int c1, int r2, int c2)
The 17 cases to deal with are: 0: no intersection; 1: top left corner; 2: top section; 3: top right corner; 4: left section; 5: all; 6: right section; 7: bottom left corner; 8: bottom section; 9: bottom right corner; 10: top "bite"; 11: right "bite"; 12: bottom "bite"; 13: left "bite"; 14: central "bite"; 15: vertical section; 16: horizontal section;
c1
- the start column.r1
- the start row.c2
- the end column.r2
- the end row.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |