|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.extentech.ExtenXLS.eventui.WorkBookModel
public class WorkBookModel
Model of a workbook that handles display-related logic. This class tracks the active sheet and cell and the current selection.
| Constructor Summary | |
|---|---|
WorkBookModel()
Creates a model of an empty workbook. |
|
WorkBookModel(WorkBookHandle target)
Creates a model of the given workbook. |
|
WorkBookModel(WorkBookHandle target,
int active)
Creates a model of the given workbook with the given sheet active. |
|
| Method Summary | |
|---|---|
void |
addActiveCellChangedListener(ActiveCellChangedListener listener)
|
void |
addActiveSheetChangedListener(ActiveSheetChangedListener listener)
|
void |
addSelectionChangedListener(SelectionChangedListener listener)
|
void |
addStructureChangedListener(StructureChangedListener listener)
|
void |
close()
clear out object references in preparation for closing |
int |
convertColToModel(int index)
Gets the workbook index of a column based on its view index. |
int |
convertColToView(int index)
Gets the view index of a column based on its workbook index. |
int |
convertRowToModel(int index)
Gets the workbook index of a row based on its view index. |
int |
convertRowToView(int index)
Gets the view index of a row based on its workbook index. |
CellHandle |
getActiveCell()
Returns the current active cell. |
int |
getActiveColumn()
|
int |
getActiveRow()
|
WorkSheetHandle |
getActiveSheet()
Returns the current active sheet. |
java.lang.String |
getColLabel(int col)
Returns the label for the given column. |
int |
getHeaderHeight()
Gets the height of the column headers. |
int |
getHeaderWidth()
Gets the width of the row headers. |
int |
getMaxCol()
Gets the last column that will be displayed. |
int |
getMaxRow()
Gets the last row that will be displayed. |
int |
getMinCol()
Gets the first column that will be displayed. |
int |
getMinRow()
Gets the first row that will be displayed. |
int |
getRowHeight(int index)
Returns the height of the given row on the current sheet. |
java.lang.String |
getRowLabel(int row)
Returns the label for the given row. |
double |
getScale()
Gets the current scaling factor. |
CellRange |
getSelectedRange()
|
CellRangeRef |
getSelectedRangeRef()
|
WorkBookHandle |
getWorkBook()
Returns the workbook this model wraps. |
boolean |
isEnableSelection()
|
void |
removeActiveCellChangedListener(ActiveCellChangedListener listener)
|
void |
removeActiveSheetChangedListener(ActiveSheetChangedListener listener)
|
void |
removeSelectionChangedListener(SelectionChangedListener listener)
|
void |
removeStructureChangedListener(StructureChangedListener listener)
|
void |
setActiveCell(int row,
int col)
|
void |
setActiveSheet(int index)
Sets the active sheet. |
void |
setColLabel(int col,
java.lang.String label)
Sets the label for a column. |
void |
setEnableSelection(boolean enable)
|
void |
setHeaderHeight(int height)
Sets the height of the column headers. |
void |
setHeaderWidth(int width)
Sets the width of the row headers. |
void |
setMaxCol(int max)
Sets the last column that will be displayed. |
void |
setMaxRow(int max)
Sets the last row that will be displayed. |
void |
setMinCol(int min)
Sets the first column that will be displayed. |
void |
setMinRow(int min)
Sets the first row that will be displayed. |
void |
setRowLabel(int row,
java.lang.String label)
Sets the label for a row. |
void |
setScale(double scale)
Sets the scaling factor. |
void |
setSelectedRange(CellRangeRef range)
Sets the selection to the given range. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WorkBookModel()
public WorkBookModel(WorkBookHandle target)
target - the WorkBookHandle that should be modeled
java.lang.IllegalArgumentException - if the given workbook is null
public WorkBookModel(WorkBookHandle target,
int active)
target - the WorkBookHandle that should be modeledactive - the index of the sheet that should be active on load
java.lang.IllegalArgumentException - if the given workbook is null
java.lang.IndexOutOfBoundsException - if the given sheet does not exist| Method Detail |
|---|
public void addActiveSheetChangedListener(ActiveSheetChangedListener listener)
public void removeActiveSheetChangedListener(ActiveSheetChangedListener listener)
public void addSelectionChangedListener(SelectionChangedListener listener)
public void removeSelectionChangedListener(SelectionChangedListener listener)
public void addActiveCellChangedListener(ActiveCellChangedListener listener)
public void removeActiveCellChangedListener(ActiveCellChangedListener listener)
public void addStructureChangedListener(StructureChangedListener listener)
public void removeStructureChangedListener(StructureChangedListener listener)
public CellHandle getActiveCell()
public int getActiveRow()
public int getActiveColumn()
public WorkSheetHandle getActiveSheet()
public int getMaxRow()
public int getMinRow()
public int getMaxCol()
public int convertRowToModel(int index)
java.lang.IndexOutOfBoundsException - if the given index is outside the
viewable area of the workbookpublic int convertRowToView(int index)
java.lang.IndexOutOfBoundsException - if the given index is outside the
viewable area of the workbookpublic int convertColToModel(int index)
java.lang.IndexOutOfBoundsException - if the given index is outside the
viewable area of the workbookpublic int convertColToView(int index)
java.lang.IndexOutOfBoundsException - if the given index is outside the
viewable area of the workbookpublic int getMinCol()
public int getRowHeight(int index)
index - the index of the row whose height should be returned
public int getHeaderHeight()
public int getHeaderWidth()
public java.lang.String getRowLabel(int row)
public java.lang.String getColLabel(int col)
public double getScale()
public CellRangeRef getSelectedRangeRef()
public CellRange getSelectedRange()
public WorkBookHandle getWorkBook()
public boolean isEnableSelection()
public void setEnableSelection(boolean enable)
public void setActiveCell(int row,
int col)
public void setActiveSheet(int index)
java.lang.IndexOutOfBoundsException - if the given sheet doesn't existpublic void setMaxRow(int max)
max - the index of the last row that should be displayedpublic void setMinRow(int min)
max - the index of the first row that should be displayedpublic void setMaxCol(int max)
max - the index of the last column that should be displayedpublic void setMinCol(int min)
max - the index of the first column that should be displayedpublic void setSelectedRange(CellRangeRef range)
range - the range that should become the selection
java.lang.IllegalArgumentException - if the given range is not a valid
selection for this workbookpublic void setHeaderHeight(int height)
height - the desired height in pixelspublic void setHeaderWidth(int width)
width - the desired width in pixels
public void setRowLabel(int row,
java.lang.String label)
public void setColLabel(int col,
java.lang.String label)
public void setScale(double scale)
public void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||