jxl.write.biff
Class MergedCells

java.lang.Object
  |
  +--jxl.write.biff.MergedCells

class MergedCells
extends java.lang.Object

Contains all the merged cells, and the necessary logic for checking for intersections and for handling very large amounts of merging


Field Summary
private static int maxRangesPerSheet
          The maximum number of ranges per sheet
private  java.util.ArrayList ranges
          The list of merged cells
private  WritableSheet sheet
          The sheet containing the cells
 
Constructor Summary
MergedCells(WritableSheet ws)
          Constructor
 
Method Summary
(package private)  void add(Range r)
          Adds the range to the list of merged cells.
(package private)  void checkIntersections()
          Called prior to writing out in order to check for intersections
private  void checkRanges()
          Checks the cell ranges for intersections, or if the merged cells contains more than one item of data
(package private)  Range[] getMergedCells()
          Gets the cells which have been merged on this sheet
(package private)  void insertColumn(int col)
          Used to adjust the merged cells following a column insertion
(package private)  void insertRow(int row)
          Used to adjust the merged cells following a row insertion
(package private)  void removeColumn(int col)
          Used to adjust the merged cells following a column removal
(package private)  void removeRow(int row)
          Used to adjust the merged cells following a row removal
(package private)  void unmergeCells(Range r)
          Unmerges the specified cells.
(package private)  void write(File outputFile)
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

ranges

private java.util.ArrayList ranges
The list of merged cells

sheet

private WritableSheet sheet
The sheet containing the cells

maxRangesPerSheet

private static final int maxRangesPerSheet
The maximum number of ranges per sheet
Constructor Detail

MergedCells

public MergedCells(WritableSheet ws)
Constructor
Method Detail

add

void add(Range r)
Adds the range to the list of merged cells. Does no checking at this stage
Parameters:
range - the range to add

insertRow

void insertRow(int row)
Used to adjust the merged cells following a row insertion

insertColumn

void insertColumn(int col)
Used to adjust the merged cells following a column insertion

removeColumn

void removeColumn(int col)
Used to adjust the merged cells following a column removal

removeRow

void removeRow(int row)
Used to adjust the merged cells following a row removal

getMergedCells

Range[] getMergedCells()
Gets the cells which have been merged on this sheet
Returns:
an array of range objects

unmergeCells

void unmergeCells(Range r)
Unmerges the specified cells. The Range passed in should be one that has been previously returned as a result of the getMergedCells method
Parameters:
r - the range of cells to unmerge

checkIntersections

void checkIntersections()
Called prior to writing out in order to check for intersections

checkRanges

private void checkRanges()
Checks the cell ranges for intersections, or if the merged cells contains more than one item of data

write

void write(File outputFile)
     throws java.io.IOException