JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Class SpanHandler

java.lang.Object
  |
  +--com.klg.jclass.table.SpanHandler
All Implemented Interfaces:
Serializable

public class SpanHandler
extends Object
implements Serializable

SpanHandler controls the creation, validation, removal and repaint of spanned cell ranges.

See Also:
Serialized Form

Field Summary
protected  Vector spans
           
protected  com.klg.jclass.table.JCTable table
           
 
Constructor Summary
SpanHandler()
          Creates a new SpanHandler
 
Method Summary
 void addSpannedRange(com.klg.jclass.table.JCCellRange cr)
          Adds a new JCCellRange to the spanned list.
 void clearSpannedRanges()
          Removes all spanned cell ranges.
 com.klg.jclass.table.JCCellRange getCompleteRange(int start_row, int start_column, int end_row, int end_column)
          Ensures that the given cell range includes all cells that are part of spans.
 com.klg.jclass.table.JCCellRange getSpannedRange(int row, int column)
          Returns a JCCellRange containing the given row and column.
 Collection getSpannedRanges()
          Returns a Vector containing all of the spanned cell ranges.
 boolean isControllingCell(com.klg.jclass.table.JCCellRange cr, int row, int column)
          Returns true if the given cell is the upper-left-most non-hidden cell in a span.
 void removeSpannedRange(com.klg.jclass.table.JCCellRange cr)
          Removes a cell range from the list of spanned cell ranges.
 void setSpannedRanges(Collection ranges)
          Sets the spanned cell ranges to a Collection of JCCellRanges.
 void setTable(com.klg.jclass.table.JCTable table)
           
 void validateAllRanges()
          Reprocesses all cell ranges to ensure that none overlap or cross scrollable/non-scrollable regions.
protected  void validateRange(Vector spans, com.klg.jclass.table.JCCellRange cr)
          Validates a cell ranges against the current list of spanned cell ranges.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected com.klg.jclass.table.JCTable table

spans

protected Vector spans
Constructor Detail

SpanHandler

public SpanHandler()
Creates a new SpanHandler

Method Detail

setTable

public void setTable(com.klg.jclass.table.JCTable table)

addSpannedRange

public void addSpannedRange(com.klg.jclass.table.JCCellRange cr)
                     throws IllegalArgumentException
Adds a new JCCellRange to the spanned list. Throws an IllegalArgumentException if the cell range overlaps an existing spanned cell range.

Throws:
IllegalArgumentException - thrown if a cell range overlaps and existing cell range or crosses over scrollable/non-scrollable regions.

validateRange

protected void validateRange(Vector spans,
                             com.klg.jclass.table.JCCellRange cr)
                      throws IllegalArgumentException
Validates a cell ranges against the current list of spanned cell ranges. Validation will fail if the cell range overlaps an existing cell range or crosses over scrollable/non-scrollabel regions.

Throws:
IllegalArgumentException - thrown if a cell range overlaps and existing cell range or crosses over scrollable/non-scrollable regions.

getCompleteRange

public com.klg.jclass.table.JCCellRange getCompleteRange(int start_row,
                                                         int start_column,
                                                         int end_row,
                                                         int end_column)
Ensures that the given cell range includes all cells that are part of spans.

Returns:
JCCellRange a complete cell range

validateAllRanges

public void validateAllRanges()
                       throws IllegalArgumentException
Reprocesses all cell ranges to ensure that none overlap or cross scrollable/non-scrollable regions. Validation may fail if the number of frozen rows or columns changes.

Throws:
IllegalArgumentException - thrown if a cell range overlaps and existing cell range or crosses over scrollable/non-scrollable regions.

clearSpannedRanges

public void clearSpannedRanges()
Removes all spanned cell ranges.


getSpannedRanges

public Collection getSpannedRanges()
Returns a Vector containing all of the spanned cell ranges.


removeSpannedRange

public void removeSpannedRange(com.klg.jclass.table.JCCellRange cr)
Removes a cell range from the list of spanned cell ranges.


setSpannedRanges

public void setSpannedRanges(Collection ranges)
                      throws IllegalArgumentException
Sets the spanned cell ranges to a Collection of JCCellRanges. Ranges are validated in order of iteration in the Collection.

Throws:
IllegalArgumentException - thrown if a cell range overlaps and existing cell range or crosses over scrollable/non-scrollable regions.

getSpannedRange

public com.klg.jclass.table.JCCellRange getSpannedRange(int row,
                                                        int column)
Returns a JCCellRange containing the given row and column. If the cell is not spanned, null is returned.


isControllingCell

public boolean isControllingCell(com.klg.jclass.table.JCCellRange cr,
                                 int row,
                                 int column)
Returns true if the given cell is the upper-left-most non-hidden cell in a span.


Copyright © 2004 Quest Software Inc..
All rights reserved.