|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--com.jrefinery.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 startColumn,
int startRow,
int endColumn,
int endRow)
Standard constructor. |
|
| Method Summary | |
int |
getEndColumn()
Returns the end column of the region. |
int |
getEndRow()
Returns the end row of the region. |
int |
getIntersectCase(int c1,
int r1,
int c2,
int r2)
Returns an integer denoting one of the 17 cases of intersection. |
StyleRegion |
getIntersectionStyleRegion(int c1,
int r1,
int c2,
int r2,
StyleModifier modifier)
Returns a StyleRegion representing the portion of this region that intersects with the specified region. |
java.util.List |
getNonIntersectionStyleRegionList(int col1,
int row1,
int col2,
int row2)
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 col1,
int row1,
int col2,
int row2)
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. |
void |
writeStyleRegion(java.io.PrintStream out,
java.lang.String indent)
Writes a style region element to the stream. |
| 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 startColumn
protected int startRow
protected int endColumn
protected int endRow
| Constructor Detail |
public StyleRegion(Style style,
int startColumn,
int startRow,
int endColumn,
int endRow)
style - The style.startColumn - The start column for the region.startRow - The start row for the region.endColumn - The end column for the region.endRow - The end row for the region.| Method Detail |
public Style getStyle()
public void setStyle(Style style)
style - The new style.public int getStartColumn()
public int getStartRow()
public int getEndColumn()
public int getEndRow()
public boolean intersects(int col1,
int row1,
int col2,
int row2)
col1 - The start column of the range.row1 - The start row of the range.col2 - The end column of the range.row2 - The end row of the range.public boolean intersects(StyleRegion region)
region - The region being tested.
public StyleRegion getIntersectionStyleRegion(int c1,
int r1,
int c2,
int r2,
StyleModifier modifier)
c1 - The start column of the region.r1 - The start row of the region.c2 - The end column of the region.r2 - The end row 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 col1,
int row1,
int col2,
int row2)
There are 17 cases to deal with, one of which entirely obliterates the existing StyleRegion.
col1 - The start column.row1 - The start row.col2 - The end column.row2 - The end row.
public int getIntersectCase(int c1,
int r1,
int c2,
int r2)
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.
public void writeStyleRegion(java.io.PrintStream out,
java.lang.String indent)
out - The output stream.indent - The indentation.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||