com.jrefinery.workbook
Class Styles

java.lang.Object
  |
  +--com.jrefinery.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.ArrayList regions
          Storage for the style regions.
 
Constructor Summary
Styles()
          Default constructor.
 
Method Summary
 void addStyleRegion(StyleRegion styleRegion)
          Adds the specified style region, restructuring the existing style regions to avoid any overlapping.
 void modifyStyle(StyleModifier modifier, int c1, int r1, int c2, int r2)
          Apply the style modifier to the styles that cover the specified region.
 void writeStyles(java.io.PrintStream out, java.lang.String indent)
          Writes a styles element to the stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

regions

protected java.util.ArrayList regions
Storage for the style regions.
Constructor Detail

Styles

public Styles()
Default constructor.
Method Detail

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 c1,
                        int r1,
                        int c2,
                        int r2)
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.
c1 - The start column.
r1 - The start row.
c2 - The end column.
r2 - The end row.

writeStyles

public void writeStyles(java.io.PrintStream out,
                        java.lang.String indent)
Writes a styles element to the stream.
Parameters:
out - The output stream.
indent - The indentation.