org.jfree.workbook
Class Styles

java.lang.Object
  |
  +--org.jfree.workbook.Styles

public class Styles
extends java.lang.Object

A collection of style regions. This class performs some of the background work, restructuring the regions as required for applying new styles.

At the moment we restructure so that the entire worksheet region is covered by non-overlapping style regions. Gnumeric appears to have a different strategy, still non-overlapping but it chooses different ways to restructure. We should try to match what Gnumeric does, although it seems to handle any differences relatively smoothly in the limited testing done so far.


Field Summary
protected  java.util.List regions
          Storage for the style regions.
 
Constructor Summary
Styles()
          Constructs a new default styles collection.
 
Method Summary
 void addStyleRegion(StyleRegion styleRegion)
          Adds the specified style region, restructuring the existing style regions to avoid any overlapping.
 Style getStyle(int row, int column)
          Returns the style that applies to the specified row and column.
 java.util.Iterator getStylesIterator()
          Returns an iterator that provides access to all the styles in the collection.
 void modifyStyle(StyleModifier modifier, int r1, int c1, int r2, int c2)
          Apply the style modifier to the styles that cover the specified region.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

regions

protected java.util.List regions
Storage for the style regions.

Constructor Detail

Styles

public Styles()
Constructs a new default styles collection.

Method Detail

getStyle

public Style getStyle(int row,
                      int column)
Returns the style that applies to the specified row and column.

Parameters:
row - the row.
column - the column.
Returns:
The style.

addStyleRegion

public void addStyleRegion(StyleRegion styleRegion)
Adds the specified style region, restructuring the existing style regions to avoid any overlapping.

Parameters:
styleRegion - the new style region.

modifyStyle

public void modifyStyle(StyleModifier modifier,
                        int r1,
                        int c1,
                        int r2,
                        int c2)
Apply the style modifier to the styles that cover the specified region. This will usually involve some restructuring of the regions.

Parameters:
modifier - the modifier.
r1 - the start row.
c1 - the start column.
r2 - the end row.
c2 - the end column.

getStylesIterator

public java.util.Iterator getStylesIterator()
Returns an iterator that provides access to all the styles in the collection.

Returns:
An iterator.