|
JBCSolutions - Jbcgrid v1.6 This document is the API specification for the JbcGrid, version 1.6 |
|||||||
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
jbc.grid.JbcGridTable
public class JbcGridTable
All you ever wanted to do with a JTable/JTree... but were afraid to code.
If the JTable component allows the developper to present data in a spreadsheet fashion, allowing the end-user to edit the cells may become quite difficult. More, if you want to display some of these data in a customized way then programming can quickly become a challenge. Not only the JbcGridTable component comes with its own set of editors and renderers, it accepts any other bean you may use. (The associated demo uses the JCB Gui Beans Suite).
More, it allows the dynamic insertion of any other swing component inside the table area that may be used to display or edit the contents of a row. (This feature can dramaticaly simplify the verification of the user's modification of the row data whithout the need of opening a new window at the user's request). This row expansion can be triggered by any event.
As a generalization of the insertion of any component, you can even expand a row into another JbcGridTable giving to the resulting one the best of the JTable and the JTree components. You can even nest as many levels of JbcGridTable as your application may need.
You may put your data into a vector or not, or use information directly from a database (see JbcGridDefaultTableModel or JbcGridAbstractTableModel).
This screenshot shows the JBCGridTable ability for nesting components and displaying a hierarchy of tables.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JTable |
---|
javax.swing.JTable.PrintMode |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Field Summary |
---|
Fields inherited from class javax.swing.JTable |
---|
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS |
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, 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 | |
---|---|
JbcGridTable()
Constructs a default JbcGridTable that is initialized with a default
data model, a default column model, and a default selection
model. |
|
JbcGridTable(int numRows,
int numColumns)
Constructs a JbcGridTable with numRows
and numColumns of empty cells using
JbcGridDefaultTableModel . |
|
JbcGridTable(java.lang.Object[][] rowData,
java.lang.Object[] columnNames)
Constructs a JbcGridTable to display the values in the two dimensional array,
rowData , with column names, columnNames . |
|
JbcGridTable(javax.swing.table.TableModel dm)
Constructs a JbcGridTable that is initialized with
dm as the data model, a default column model,
and a default selection model. |
|
JbcGridTable(javax.swing.table.TableModel dm,
javax.swing.table.TableColumnModel cm)
Constructs a JbcGridTable that is initialized with
dm as the data model, cm
as the column model, and a default selection model. |
|
JbcGridTable(javax.swing.table.TableModel dm,
javax.swing.table.TableColumnModel cm,
javax.swing.ListSelectionModel sm)
Constructs a JbcGridTable that is initialized with
dm as the data model, cm as the
column model, and sm as the selection model. |
|
JbcGridTable(java.util.Vector rowData,
java.util.Vector columnNames)
Constructs a JbcGridTable to display the values in the
Vector of Vectors , rowData ,
with column names, columnNames . |
Method Summary | |
---|---|
void |
collapseAllRows()
This function collapses all the expanded rows. |
void |
collapseAllTreeviews()
This function collapses all the expanded treeview rows. |
int |
convertRealIndexToRow(int index)
This function converts the number of a DataBase-row to a number of a table-row. |
int |
convertRowToRealIndex(int row)
This function converts the number of a table-row to a number of a DataBase-row. |
boolean |
editCellAt(int row,
int column,
java.util.EventObject e)
Programmatically starts editing the cell at row and
column , if the cell is editable. |
java.lang.String |
getAbout()
Application code will not use these methods explicitly. |
java.awt.Color |
getAlternateBackgroundColor()
Gets the alternate background color of this component. |
int |
getAutoResizeMode()
Returns the auto resize mode of the table. |
static int |
getClickCountToStart()
Returns the number of clicks needed to start editing. |
java.awt.Color |
getConnectingLineColor()
Gets the connectingLineColor color of this component. |
java.awt.Color |
getExpandColumnColor()
Gets the expandColumnColor color of this component. |
int[] |
getExpandedRows(boolean realIndex)
This method returns an array for all the expanded rows. |
int |
getExpandedTreeviewRowCount()
This functions returns the number of rows that will be expanded (Treeview). |
int[] |
getExpandedTreeviewRows(boolean realIndex)
This method returns an array for all the expanded, treeview rows. |
java.awt.Color |
getFillerColor()
Gets the filler color of this component. |
static JbcGridTable |
getGridTableFromComponent(javax.swing.JComponent component)
This method returns the GridTable owned by the expanded component. |
static int |
getRowFromComponent(javax.swing.JComponent component)
This method returns the row owned by the expanded component. |
javax.swing.border.Border |
getTreeViewBorder()
Returns the current border used for nested treeview components. |
java.lang.Object |
getValueAt(int row,
int column)
Returns the cell value at row and column . |
boolean |
isExpandedRow(int row)
Returns true if this row is overloaded by a component. |
boolean |
isExpandedTreeview(int row)
Returns true if this row is expanded with a tree-view component. |
boolean |
isTreeViewAllowed()
Returns true if the Grid table may be expanded in tree view. |
void |
repaint(long tm,
int x,
int y,
int width,
int height)
Repaints the specified rectangle of this component within tm milliseconds. |
void |
setAbout(java.lang.String text)
Application code will not use these methods explicitly. |
void |
setAlternateBackgroundColor(java.awt.Color c)
Sets the alternate background color of this component. |
void |
setAutoResizeMode(int mode)
Sets the table's auto resize mode when the table is resized. |
static void |
setClickCountToStart(int clickCountToStartEditors)
clickCountToStart controls the number of clicks required to start editing. |
void |
setConnectingLineColor(java.awt.Color c)
Sets the connectingLine Color color of this component. |
void |
setExpandColumnColor(java.awt.Color c)
Sets the expandColumn Color color of this component. |
void |
setExpandedRow(int row,
boolean expanded)
Sets if the row should be overloaded by a component. |
void |
setExpandedTreeview(int row,
boolean expanded)
Sets if the row should be expanded with a tree-view component. |
void |
setFillerColor(java.awt.Color c)
Sets the filler color of this component. |
void |
setIntercellSpacing(java.awt.Dimension intercellSpacing)
Sets the rowMargin and the columnMargin --
the height and width of the space between cells -- to
intercellSpacing . |
void |
setModel(javax.swing.table.TableModel dataModel)
Sets the data model for this table to newModel and registers
with it for listener notifications from the new data model. |
void |
setRowHeight(int rowHeight)
Sets the height, in pixels, of all cells to rowHeight ,
revalidates, and repaints. |
void |
setRowHeight(int row,
int rowHeight)
Sets the height for row to rowHeight ,
revalidates, and repaints. |
void |
setRowMargin(int rowMargin)
Sets the amount of empty space between cells in adjacent rows. |
void |
setTreeViewAllowed(boolean treeViewAllowed)
If true the component may be expanded in tree view. |
void |
setTreeViewBorder(javax.swing.border.Border treeViewBorder)
Sets the border for nested treeviews. |
void |
setValueAt(java.lang.Object aValue,
int row,
int column)
Sets the value for the cell in the table model at row
and column . |
void |
tableChanged(javax.swing.event.TableModelEvent e)
Invoked when this table's TableModel generates
a TableModelEvent . |
void |
updateUI()
Notification from the UIManager that the L&F has changed. |
Methods inherited from class javax.swing.JTable |
---|
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, convertColumnIndexToModel, convertColumnIndexToView, createDefaultColumnsFromModel, createScrollPaneForTable, doLayout, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getEditingColumn, getEditingRow, getEditorComponent, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, prepareEditor, prepareRenderer, print, print, print, print, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setEditingColumn, setEditingRow, setGridColor, setPreferredScrollableViewportSize, setRowSelectionAllowed, setRowSelectionInterval, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, sizeColumnsToFit, sizeColumnsToFit, valueChanged |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JbcGridTable()
JbcGridTable
that is initialized with a default
data model, a default column model, and a default selection
model.
public JbcGridTable(javax.swing.table.TableModel dm)
JbcGridTable
that is initialized with
dm
as the data model, a default column model,
and a default selection model.
dm
- the data model for the tablepublic JbcGridTable(javax.swing.table.TableModel dm, javax.swing.table.TableColumnModel cm)
JbcGridTable
that is initialized with
dm
as the data model, cm
as the column model, and a default selection model.
dm
- the data model for the tablecm
- the column model for the tablepublic JbcGridTable(javax.swing.table.TableModel dm, javax.swing.table.TableColumnModel cm, javax.swing.ListSelectionModel sm)
JbcGridTable
that is initialized with
dm
as the data model, cm
as the
column model, and sm
as the selection model.
If any of the parameters are null
this method
will initialize the table with the corresponding default model.
The autoCreateColumnsFromModel
flag is set to false
if cm
is non-null, otherwise it is set to true
and the column model is populated with suitable
TableColumns
for the columns in dm
.
dm
- the data model for the tablecm
- the column model for the tablesm
- the row selection model for the tablepublic JbcGridTable(int numRows, int numColumns)
JbcGridTable
with numRows
and numColumns
of empty cells using
JbcGridDefaultTableModel
. The columns will have
names of the form "A", "B", "C", etc.
numRows
- the number of rows the table holdsnumColumns
- the number of columns the table holdspublic JbcGridTable(java.util.Vector rowData, java.util.Vector columnNames)
JbcGridTable
to display the values in the
Vector
of Vectors
, rowData
,
with column names, columnNames
. The
Vectors
contained in rowData
should contain the values for that row. In other words,
the value of the cell at row 1, column 5 can be obtained
with the following code:
((Vector)rowData.elementAt(1)).elementAt(5);
rowData
- the data for the new tablecolumnNames
- names of each columnpublic JbcGridTable(java.lang.Object[][] rowData, java.lang.Object[] columnNames)
JbcGridTable
to display the values in the two dimensional array,
rowData
, with column names, columnNames
.
rowData
is an array of rows, so the value of the cell at row 1,
column 5 can be obtained with the following code:
rowData[1][5];
All rows must be of the same length as columnNames
.
rowData
- the data for the new tablecolumnNames
- names of each columnMethod Detail |
---|
public void setAbout(java.lang.String text)
public final java.lang.String getAbout()
public boolean isTreeViewAllowed()
setTreeViewAllowed(boolean)
public void setTreeViewAllowed(boolean treeViewAllowed)
treeViewAllowed
- true if the component may be
expanded in tree viewisTreeViewAllowed()
public static void setClickCountToStart(int clickCountToStartEditors)
public static int getClickCountToStart()
public void setTreeViewBorder(javax.swing.border.Border treeViewBorder)
treeViewBorder
- The border to become this component's
current border.
If this parameter is null then the initial (default) border will be restored.getTreeViewBorder()
public javax.swing.border.Border getTreeViewBorder()
public java.awt.Color getConnectingLineColor()
setConnectingLineColor(java.awt.Color)
,
updateUI()
public void setConnectingLineColor(java.awt.Color c)
color
- The color to become this component's
connectingLine color.
If this parameter is null then this component will inherit
the default connectingLine.
The connectingLine color is used to paint connectingLine (tree view areas).getConnectingLineColor()
,
updateUI()
public java.awt.Color getExpandColumnColor()
setExpandColumnColor(java.awt.Color)
,
updateUI()
public void setExpandColumnColor(java.awt.Color c)
color
- The color to become this component's
expandColumn color.
If this parameter is null then this component will inherit
the default expandColumn.
The expandColumn color is used to paint expandColumn (tree view areas).getExpandColumnColor()
,
updateUI()
public java.awt.Color getFillerColor()
setFillerColor(java.awt.Color)
,
updateUI()
public void setFillerColor(java.awt.Color c)
color
- The color to become this component's
filler color.
If this parameter is null then this component will inherit
the default filler.
The filler color is used to paint tree view areas.getFillerColor()
,
updateUI()
public java.awt.Color getAlternateBackgroundColor()
setAlternateBackgroundColor(java.awt.Color)
,
updateUI()
public void setAlternateBackgroundColor(java.awt.Color c)
color
- The color to become this component's
filler color.
If this parameter is null then this component will inherit
the default alternate background.#geAlternateBackgroundColor
,
updateUI()
public void setModel(javax.swing.table.TableModel dataModel)
newModel
and registers
with it for listener notifications from the new data model.
setModel
in class javax.swing.JTable
newModel
- the new data source for this table
java.lang.IllegalArgumentException
- if newModel
is null
or not
an instance of JbcGridInterfaceTableModelJbcGridDefaultTableModel
,
JbcGridAbstractTableModel
,
JbcGridInterfaceTableModel
public void repaint(long tm, int x, int y, int width, int height)
tm
milliseconds.
repaint
in class javax.swing.JComponent
tm
- maximum time in milliseconds before updatex
- the x coordinatey
- the y coordinatewidth
- the widthheight
- the heightpublic void tableChanged(javax.swing.event.TableModelEvent e)
TableModel
generates
a TableModelEvent
.
The TableModelEvent
should be constructed in the
coordinate system of the model; the appropriate mapping to the
view coordinate system is performed by this JTable
when it receives the event.
Application code will not use these methods explicitly, they
are used internally by JTable
.
tableChanged
in interface javax.swing.event.TableModelListener
tableChanged
in class javax.swing.JTable
public boolean editCellAt(int row, int column, java.util.EventObject e)
row
and
column
, if the cell is editable.
To prevent the JTable
from editing a particular table,
column or cell value, return false from the isCellEditable
method in the TableModel
interface.
editCellAt
in class javax.swing.JTable
row
- the row to be editedcolumn
- the column to be editede
- event to pass into shouldSelectCell
;
note that as of Java 2 platform v1.2, the call to
shouldSelectCell
is no longer made
java.lang.IllegalArgumentException
- if row
or
column
is not in the valid rangepublic void setRowMargin(int rowMargin)
setRowMargin
in class javax.swing.JTable
rowMargin
- the number of pixels between cells in a rowJTable.getRowMargin()
public void setIntercellSpacing(java.awt.Dimension intercellSpacing)
rowMargin
and the columnMargin
--
the height and width of the space between cells -- to
intercellSpacing
.
setIntercellSpacing
in class javax.swing.JTable
intercellSpacing
- a Dimension
specifying the new width
and height between cellsJTable.getIntercellSpacing()
public void setRowHeight(int rowHeight)
rowHeight
,
revalidates, and repaints.
The height of the cells will be equal to the row height minus
the row margin.
setRowHeight
in class javax.swing.JTable
rowHeight
- new row height
java.lang.IllegalArgumentException
- if rowHeight
is
less than 1JTable.getRowHeight()
public void setRowHeight(int row, int rowHeight)
row
to rowHeight
,
revalidates, and repaints. The height of the cells in this row
will be equal to the row height minus the row margin.
setRowHeight
in class javax.swing.JTable
row
- the row whose height is being
changedrowHeight
- new row height, in pixels
java.lang.IllegalArgumentException
- if rowHeight
is
less than 1public void updateUI()
UIManager
that the L&F has changed.
Replaces the current UI object with the latest version from the
UIManager
.
If filler color is null or instanceof javax.swing.plaf.ColorUIResource the filler color is reset to the default filler color.
If expandColumn color is null or instanceof javax.swing.plaf.ColorUIResource the expandColumn color is reset to the default expandColumn color.
If connectingLine color is null or instanceof javax.swing.plaf.ColorUIResource the connectingLine color is reset to the default connectingLine color.
If alternateBackground color is null or instanceof javax.swing.plaf.ColorUIResource the alternateBackground color is reset to the default alternateBackground color.
updateUI
in class javax.swing.JTable
JComponent.updateUI()
public java.lang.Object getValueAt(int row, int column)
row
and column
.
Note: The column is specified in the table view's display
order, and not in the TableModel
's column
order. This is an important distinction because as the
user rearranges the columns in the table,
the column at a given index in the view will change.
Meanwhile the user's actions never affect the model's
column ordering.
getValueAt
in class javax.swing.JTable
row
- the row whose value is to be queriedcolumn
- the column whose value is to be queried
public void setValueAt(java.lang.Object aValue, int row, int column)
row
and column
.
Note: The column is specified in the table view's display
order, and not in the TableModel
's column
order. This is an important distinction because as the
user rearranges the columns in the table,
the column at a given index in the view will change.
Meanwhile the user's actions never affect the model's
column ordering.
aValue
is the new value.
setValueAt
in class javax.swing.JTable
aValue
- the new valuerow
- the row of the cell to be changedcolumn
- the column of the cell to be changedgetValueAt(int, int)
public static int getRowFromComponent(javax.swing.JComponent component)
component
- the expanded component
public static JbcGridTable getGridTableFromComponent(javax.swing.JComponent component)
component
- the expanded component
public boolean isExpandedTreeview(int row)
row
- the row
setExpandedTreeview(int, boolean)
public void setExpandedTreeview(int row, boolean expanded)
row
- the rowexpanded
- the rowisExpandedTreeview(int)
public boolean isExpandedRow(int row)
row
- the row
setExpandedRow(int, boolean)
public void setExpandedRow(int row, boolean expanded)
row
- the rowexpanded
- the rowisExpandedRow(int)
public int[] getExpandedTreeviewRows(boolean realIndex)
realIndex
- True if rows should be converted by using the
convertRowToRealIndex method.
setExpandedTreeview(int, boolean)
,
convertRowToRealIndex(int)
public void collapseAllTreeviews()
setExpandedTreeview(int, boolean)
public int[] getExpandedRows(boolean realIndex)
realIndex
- True if rows should be converted by using the
convertRowToRealIndex method.
setExpandedRow(int, boolean)
,
convertRowToRealIndex(int)
public void collapseAllRows()
setExpandedRow(int, boolean)
public int convertRowToRealIndex(int row)
Each time a row is expanded (Treeview), a virtual row is inserted. This function converts a row index of the view (table) without considering the virtual rows that might have been added. This method may be useful when using data from a database..
row
- the row index of the row to be converted
convertRealIndexToRow(int)
public int convertRealIndexToRow(int index)
Each time a row is expanded (Treeview), a virtual row is inserted. This function converts a row index of the data base with considering the virtual rows that might have been added. This method may be useful when using data from a database.
index
- the index of the row to be converted
convertRowToRealIndex(int)
public int getExpandedTreeviewRowCount()
public void setAutoResizeMode(int mode)
setAutoResizeMode
in class javax.swing.JTable
mode
- One of 5 legal values:
AUTO_RESIZE_OFF,
AUTO_RESIZE_NEXT_COLUMN,
AUTO_RESIZE_SUBSEQUENT_COLUMNS,
AUTO_RESIZE_LAST_COLUMN,
AUTO_RESIZE_ALL_COLUMNS
About Horizontal ScrollBarPolicy : only HORIZONTAL_SCROLLBAR_AS_NEEDED or HORIZONTAL_SCROLLBAR_ALWAYS are supported.
Setting "auto resize mode" to AUTO_RESIZE_OFF forces HorizontalScrollBarPolicy to HORIZONTAL_SCROLLBAR_ALWAYS.
getAutoResizeMode()
,
JTable.doLayout()
public int getAutoResizeMode()
getAutoResizeMode
in class javax.swing.JTable
setAutoResizeMode(int)
,
JTable.doLayout()
|
JBCSolutions - Jbcgrid v1.6 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |