|
JIDE 3.5.15 | ||||||||
| 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
com.jidesoft.grid.JideTable
com.jidesoft.grid.ContextSensitiveTable
com.jidesoft.grid.NavigableTable
public class NavigableTable
An extension to JTable which can programmatically avoid navigation on certain cells.
NavigableModel,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.jidesoft.grid.JideTable |
|---|
JideTable.NonContiguousTransferHandler |
| Nested classes/interfaces inherited from class javax.swing.JTable |
|---|
JTable.AccessibleJTable, JTable.DropLocation, 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| 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 | |
|---|---|
NavigableTable()
|
|
NavigableTable(int numRows,
int numColumns)
|
|
NavigableTable(Object[][] rowData,
Object[] columnNames)
|
|
NavigableTable(TableModel dm)
|
|
NavigableTable(TableModel dm,
TableColumnModel cm)
|
|
NavigableTable(TableModel dm,
TableColumnModel cm,
ListSelectionModel sm)
|
|
NavigableTable(Vector<?> rowData,
Vector<?> columnNames)
|
|
| Method Summary | |
|---|---|
void |
changeSelection(int row,
int column,
boolean toggle,
boolean expand)
Override the default implementation to adjust the selection avoiding the non-navigable cells. |
protected int[] |
findNearestNavigableCellInColumn(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
Finds the nearest navigable cell from the specified cell that is in the same column. |
protected int[] |
findNearestNavigableCellInRow(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
Finds the nearest navigable cell from the specified cell that is in the same row. |
protected int[] |
findNextNavigableCell(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
Finds the next navigable cell from the specified cell. |
protected int[] |
findNextNavigableCellInColumn(int row,
int column,
int rowCount)
Finds the next navigable row in the same column. |
protected int[] |
findNextNavigableCellInRow(int row,
int column,
int columnCount)
Finds the next navigable cell in the same row. |
protected int[] |
findNextNavigableCellVertically(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
Finds the next navigable cell from the specified cell vertically. |
protected int[] |
findPreviousNavigableCell(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
Finds the previous navigable cell from the specified cell. |
protected int[] |
findPreviousNavigableCellInColumn(int row,
int column)
Finds the previous navigable row in the same column. |
protected int[] |
findPreviousNavigableCellInRow(int row,
int column)
Finds the previous navigable cell in the same row. |
protected int[] |
findPreviousNavigableCellVertically(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
Finds the previous navigable cell from the specified cell vertically. |
TableModel |
getNavigableModel()
|
TableModel |
getNextNavigableModel(TableModel model)
Gets the next style model of the specified model. |
boolean |
isCellNavigable(int row,
int column)
Checks if the cell is navigable. |
protected boolean |
isNavigationKey(KeyStroke ks)
Checks if the key stroke and the input event will respect the NavigableModel. |
boolean |
processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.jidesoft.grid.TableAdapter |
|---|
getCellSelectionEnabled, getColumnClass, getColumnCount, getColumnName, getColumnSelectionAllowed, getRowCount, getRowSelectionAllowed, isCellEditable, setCellSelectionEnabled, setValueAt |
| Constructor Detail |
|---|
public NavigableTable()
public NavigableTable(int numRows,
int numColumns)
public NavigableTable(TableModel dm)
public NavigableTable(Object[][] rowData,
Object[] columnNames)
public NavigableTable(Vector<?> rowData,
Vector<?> columnNames)
public NavigableTable(TableModel dm,
TableColumnModel cm)
public NavigableTable(TableModel dm,
TableColumnModel cm,
ListSelectionModel sm)
| Method Detail |
|---|
public TableModel getNavigableModel()
public TableModel getNextNavigableModel(TableModel model)
model - the model.
public boolean isCellNavigable(int row,
int column)
row - the row index.column - the column index.
protected boolean isNavigationKey(KeyStroke ks)
return ks != null;
It works because if the ks is null, it means the selection change is not triggered by a key stroke. In fact, it
could be either by a mouse click or by code using Java API.
ks - the key stroke if any. If KeyStroke is null, it means the selection is changed not because of a key.
public boolean processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
processKeyBinding in class JideTable
public void changeSelection(int row,
int column,
boolean toggle,
boolean expand)
This implementation uses the following conventions:
toggle: false,
extend: false. Clear the previous selection and ensure the new cell is selected. toggle: false, extend: true. Extend the previous selection to include
the specified cell. toggle: true, extend: false. If the
specified cell is selected, deselect it. If it is not selected, select it. toggle:
true, extend: true. Leave the selection state as it is, but move the anchor index
to the specified location.
changeSelection in interface TableAdapterchangeSelection in class JideTablerow - Affects the selection at rowcolumn - Affects the selection at columntoggle - See description aboveexpand - If true, extend the current selection
protected int[] findNextNavigableCell(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
row - row index of the specified cellcolumn - column index of the specified cellcurrentRow - current row indexcurrentColumn - current column indexrowCount - row countcolumnCount - column count
protected int[] findNextNavigableCellVertically(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
row - row index of the specified cellcolumn - column index of the specified cellcurrentRow - current row indexcurrentColumn - current column indexrowCount - row countcolumnCount - column count
protected int[] findPreviousNavigableCell(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
row - row index of the specified cellcolumn - column index of the specified cellcurrentRow - current row indexcurrentColumn - current column indexrowCount - row countcolumnCount - column count
protected int[] findPreviousNavigableCellVertically(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
row - row index of the specified cellcolumn - column index of the specified cellcurrentRow - current row indexcurrentColumn - current column indexrowCount - row countcolumnCount - column count
protected int[] findNextNavigableCellInRow(int row,
int column,
int columnCount)
row - row index of the specified cellcolumn - column index of the specified cellcolumnCount - the column count
protected int[] findPreviousNavigableCellInRow(int row,
int column)
row - row index of the specified cellcolumn - column index of the specified cell
protected int[] findNextNavigableCellInColumn(int row,
int column,
int rowCount)
row - row index of the specified cellcolumn - column index of the specified cellrowCount - the row count.
protected int[] findPreviousNavigableCellInColumn(int row,
int column)
row - row index of the specified cellcolumn - column index of the specified cell
protected int[] findNearestNavigableCellInRow(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
row - row index of the specified cellcolumn - column index of the specified cellcurrentRow - current row indexcurrentColumn - current column indexrowCount - row countcolumnCount - column count
protected int[] findNearestNavigableCellInColumn(int row,
int column,
int currentRow,
int currentColumn,
int rowCount,
int columnCount)
row - row index of the specified cellcolumn - column index of the specified cellcurrentRow - current row indexcurrentColumn - current column indexrowCount - row countcolumnCount - column count
|
JIDE 3.5.15 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||