|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
csheets.ui.grid.Grid
csheets.ui.sheet.SpreadsheetTable
public class SpreadsheetTable
A customized JTable component, used to visualize a spreadsheet.
| Nested Class Summary | |
|---|---|
protected class |
SpreadsheetTable.ClearSelectionAction
An action for clearing the content of the selected cells, without invoking the editor. |
| Nested classes/interfaces inherited from class csheets.ui.grid.Grid |
|---|
Grid.ResumeEditAction |
| Nested classes/interfaces inherited from class javax.swing.JTable |
|---|
JTable.AccessibleJTable, JTable.PrintMode |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
CLEAR_SELECTION_COMMAND
The action command used for the action |
| Fields inherited from class csheets.ui.grid.Grid |
|---|
RESUME_EDIT_COMMAND |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
SpreadsheetTable(SpreadsheetTableModel tableModel,
UIController uiController)
Creates a spreadsheet table for the given spreadsheet table model. |
|
SpreadsheetTable(Spreadsheet spreadsheet,
UIController uiController)
Creates a spreadsheet table for the given spreadsheet. |
|
| Method Summary | |
|---|---|
void |
changeSelection(int row,
int column,
boolean toggle,
boolean extend)
Changes the current selection in the table. |
void |
clearSelectedCells()
Clears the currently selected cells in the table. |
Cell |
getSelectedCell()
Returns the active cell of the spreadsheet table. |
Cell[][] |
getSelectedCells()
Returns the currently selected cells in the spreadsheet table. |
Spreadsheet |
getSpreadsheet()
Returns the spreadsheet that the table displays. |
protected void |
paintComponent(Graphics g)
Overridden to delegate painting to decorators. |
void |
selectAll()
Selects all cells in the spreadsheet table. |
void |
selectionChanged(SelectionEvent event)
Updates the selection in the table when the active cell is changed. |
void |
setModel(TableModel dataModel)
Sets the data model of the table. |
void |
setRowHeight(int row,
int rowHeight)
Sets the height for row to rowHeight, revalidates, and repaints. |
void |
setSpreadsheet(Spreadsheet spreadsheet)
Sets the spreadsheet that is displayed by the table. |
| Methods inherited from class csheets.ui.grid.Grid |
|---|
configureEnclosingScrollPane, processKeyBinding, unconfigureEnclosingScrollPane |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String CLEAR_SELECTION_COMMAND
| Constructor Detail |
|---|
public SpreadsheetTable(Spreadsheet spreadsheet,
UIController uiController)
spreadsheet - the spreadsheet to display in the tableuiController - the user interface controller
public SpreadsheetTable(SpreadsheetTableModel tableModel,
UIController uiController)
tableModel - the spreadsheet table model to display in the tableuiController - the user interface controller| Method Detail |
|---|
public Spreadsheet getSpreadsheet()
public void setSpreadsheet(Spreadsheet spreadsheet)
spreadsheet - the spreadsheet that is displayed by the tablepublic void setModel(TableModel dataModel)
SpreadsheetTableModel class.
setModel in class JTabledataModel - the new data source for this table, must be a SpreadsheetTableModelpublic Cell getSelectedCell()
public Cell[][] getSelectedCells()
public void clearSelectedCells()
public void changeSelection(int row,
int column,
boolean toggle,
boolean extend)
changeSelection in class Gridrow - the row that was selectedcolumn - the column that was selectedtoggle - whether the selection should be toggledextend - whether the selection should be extendedpublic void selectAll()
selectAll in class JTablepublic void selectionChanged(SelectionEvent event)
selectionChanged in interface SelectionListenerevent - the selection event that was firedprotected void paintComponent(Graphics g)
paintComponent in class JComponentg - the Graphics object to protect
public void setRowHeight(int row,
int rowHeight)
setRowHeight in class JTablerow - - the row whose height is being changedrowHeight - - new row height, in pixels
IllegalArgumentException - if rowHeight is less than 1
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||