356 |
* {@link TableColumnModel} and assign it to the {@link #columnModel} |
* {@link TableColumnModel} and assign it to the {@link #columnModel} |
357 |
* property when the {@link #dataModel} property is changed. |
* property when the {@link #dataModel} property is changed. |
358 |
* |
* |
359 |
* @see #setModel() |
* @see #setModel(TableModel) |
360 |
* @see #createColumnsFromModel() |
* @see #createColumnsFromModel() |
361 |
* @see #setColumnModel() |
* @see #setColumnModel(TableColumnModel) |
362 |
* @see #setAutoCreateColumnsFromModel() |
* @see #setAutoCreateColumnsFromModel(boolean) |
363 |
* @see #getAutoCreateColumnsFromModel() |
* @see #getAutoCreateColumnsFromModel() |
364 |
*/ |
*/ |
365 |
protected boolean autoCreateColumnsFromModel; |
protected boolean autoCreateColumnsFromModel; |
371 |
* #AUTO_RESIZE_SUBSEQUENT_COLUMNS}, or {@link #AUTO_RESIZE_OFF}. |
* #AUTO_RESIZE_SUBSEQUENT_COLUMNS}, or {@link #AUTO_RESIZE_OFF}. |
372 |
* |
* |
373 |
* @see #doLayout() |
* @see #doLayout() |
374 |
* @see #setAutoResizeMode() |
* @see #setAutoResizeMode(int) |
375 |
* @see #getAutoResizeMode() |
* @see #getAutoResizeMode() |
376 |
*/ |
*/ |
377 |
protected int autoResizeMode; |
protected int autoResizeMode; |
383 |
* {@link #columnModel}. |
* {@link #columnModel}. |
384 |
* |
* |
385 |
* @see #getRowHeight() |
* @see #getRowHeight() |
386 |
* @see #setRowHeight() |
* @see #setRowHeight(int) |
387 |
* @see TableColumn#getWidth() |
* @see TableColumn#getWidth() |
388 |
* @see TableColumn#setWidth() |
* @see TableColumn#setWidth(int) |
389 |
*/ |
*/ |
390 |
protected int rowHeight; |
protected int rowHeight; |
391 |
|
|
392 |
/** |
/** |
393 |
* The height in pixels of the gap left between any two rows of the table. |
* The height in pixels of the gap left between any two rows of the table. |
394 |
* |
* |
395 |
* @see #setRowMargin() |
* @see #setRowMargin(int) |
396 |
* @see #getRowHeight() |
* @see #getRowHeight() |
397 |
* @see #getIntercellSpacing() |
* @see #getIntercellSpacing() |
398 |
* @see #setIntercellSpacing() |
* @see #setIntercellSpacing(Dimension) |
399 |
* @see TableColumnModel#getColumnMargin() |
* @see TableColumnModel#getColumnMargin() |
400 |
* @see TableColumnModel#setColumnMargin() |
* @see TableColumnModel#setColumnMargin(int) |
401 |
*/ |
*/ |
402 |
protected int rowMargin; |
protected int rowMargin; |
403 |
|
|
408 |
* selection as an independent concept, but it is now represented solely |
* selection as an independent concept, but it is now represented solely |
409 |
* in terms of simultaneous row and column selection. |
* in terms of simultaneous row and column selection. |
410 |
* |
* |
411 |
* @see TableColumnModel#columnSelectionAllowed() |
* @see TableColumnModel#getColumnSelectionAllowed() |
412 |
* @see #setRowSelectionAllowed() |
* @see #setRowSelectionAllowed(boolean) |
413 |
* @see #getRowSelectionAllowed() |
* @see #getRowSelectionAllowed() |
414 |
* @see #getCellSelectionEnabled() |
* @see #getCellSelectionEnabled() |
415 |
* @see #setCellSelectionEnabled() |
* @see #setCellSelectionEnabled(boolean) |
416 |
*/ |
*/ |
417 |
protected boolean rowSelectionAllowed; |
protected boolean rowSelectionAllowed; |
418 |
|
|
419 |
/** |
/** |
420 |
* @deprecated Use {@link #rowSelectionAllowed}, {@link |
* @deprecated Use {@link #rowSelectionAllowed}, {@link |
421 |
* #columnSelectionAllowed}, or the combined methods {@link |
* #getColumnSelectionAllowed}, or the combined methods {@link |
422 |
* getCellSelectionEnabled} and {@link setCellSelectionEnabled}. |
* #getCellSelectionEnabled} and {@link #setCellSelectionEnabled(boolean)}. |
423 |
*/ |
*/ |
424 |
protected boolean cellSelectionEnabled; |
protected boolean cellSelectionEnabled; |
425 |
|
|
429 |
* property name. The table listens to its model as a {@link |
* property name. The table listens to its model as a {@link |
430 |
* TableModelListener}. |
* TableModelListener}. |
431 |
* |
* |
432 |
* @see #tableChanged() |
* @see #tableChanged(TableModelEvent) |
433 |
* @see TableModel#addTableModelListener() |
* @see TableModel#addTableModelListener(TableModelListener) |
434 |
*/ |
*/ |
435 |
protected TableModel dataModel; |
protected TableModel dataModel; |
436 |
|
|
444 |
* |
* |
445 |
* <p>The TableColumnModel also contains a {@link ListSelectionModel} which |
* <p>The TableColumnModel also contains a {@link ListSelectionModel} which |
446 |
* indicates which columns are currently selected. This selection model |
* indicates which columns are currently selected. This selection model |
447 |
* works in combination with the {@link selectionModel} of the table |
* works in combination with the {@link #selectionModel} of the table |
448 |
* itself to specify a <em>table selection</em>: a combination of row and |
* itself to specify a <em>table selection</em>: a combination of row and |
449 |
* column selections.</p> |
* column selections.</p> |
450 |
* |
* |
453 |
* columnModel automatically, and the table acts as a facade for most of |
* columnModel automatically, and the table acts as a facade for most of |
454 |
* the interesting properties of the columnModel anyways.</p> |
* the interesting properties of the columnModel anyways.</p> |
455 |
* |
* |
456 |
* @see #setColumnModel() |
* @see #setColumnModel(TableColumnModel) |
457 |
* @see #getColumnModel() |
* @see #getColumnModel() |
458 |
*/ |
*/ |
459 |
protected TableColumnModel columnModel; |
protected TableColumnModel columnModel; |
461 |
/** |
/** |
462 |
* A model of the rows of this table which are currently selected. This |
* A model of the rows of this table which are currently selected. This |
463 |
* model is used in combination with the column selection model held as a |
* model is used in combination with the column selection model held as a |
464 |
* member of the {@link columnModel} property, to represent the rows and |
* member of the {@link #columnModel} property, to represent the rows and |
465 |
* columns (or both: cells) of the table which are currently selected. |
* columns (or both: cells) of the table which are currently selected. |
466 |
* |
* |
467 |
* @see #rowSelectionAllowed |
* @see #rowSelectionAllowed |
468 |
* @see #setSelectionModel() |
* @see #setSelectionModel(ListSelectionModel) |
469 |
* @see #getSelectionModel() |
* @see #getSelectionModel() |
470 |
* @see TableColumnModel#getSelectionModel() |
* @see TableColumnModel#getSelectionModel() |
471 |
* @see ListSelectionModel#addListSelectionListener() |
* @see ListSelectionModel#addListSelectionListener(ListSelectionListener) |
472 |
*/ |
*/ |
473 |
protected ListSelectionModel selectionModel; |
protected ListSelectionModel selectionModel; |
474 |
|
|
494 |
* The color to paint the grid lines of the table, when either {@link |
* The color to paint the grid lines of the table, when either {@link |
495 |
* #showHorizontalLines} or {@link #showVerticalLines} is set. |
* #showHorizontalLines} or {@link #showVerticalLines} is set. |
496 |
* |
* |
497 |
* @see #setGridColor() |
* @see #setGridColor(Color) |
498 |
* @see #getGridColor() |
* @see #getGridColor() |
499 |
*/ |
*/ |
500 |
protected Color gridColor; |
protected Color gridColor; |
503 |
* The size this table would prefer its viewport assume, if it is |
* The size this table would prefer its viewport assume, if it is |
504 |
* contained in a {@link JScrollPane}. |
* contained in a {@link JScrollPane}. |
505 |
* |
* |
506 |
* @see #setPreferredScrollableViewportSize() |
* @see #setPreferredScrollableViewportSize(Dimension) |
507 |
* @see #getPreferredScrollableViewportSize() |
* @see #getPreferredScrollableViewportSize() |
508 |
*/ |
*/ |
509 |
protected Dimension preferredViewportSize; |
protected Dimension preferredViewportSize; |
513 |
* change event with name {@link #SELECTION_BACKGROUND_CHANGED_PROPERTY} |
* change event with name {@link #SELECTION_BACKGROUND_CHANGED_PROPERTY} |
514 |
* when its value changes. |
* when its value changes. |
515 |
* |
* |
516 |
* @see #setSelectionBackground() |
* @see #setSelectionBackground(Color) |
517 |
* @see #getSelectionBackground() |
* @see #getSelectionBackground() |
518 |
*/ |
*/ |
519 |
protected Color selectionBackground; |
protected Color selectionBackground; |
529 |
* change event with name {@link #SELECTION_FOREGROUND_CHANGED_PROPERTY} |
* change event with name {@link #SELECTION_FOREGROUND_CHANGED_PROPERTY} |
530 |
* when its value changes. |
* when its value changes. |
531 |
* |
* |
532 |
* @see #setSelectionForeground() |
* @see #setSelectionForeground(Color) |
533 |
* @see #getSelectionForeground() |
* @see #getSelectionForeground() |
534 |
*/ |
*/ |
535 |
protected Color selectionForeground; |
protected Color selectionForeground; |
896 |
} |
} |
897 |
|
|
898 |
/** |
/** |
899 |
* Get the value of the {@link #selectedRow} property by delegation to |
* Get the value of the selectedRow property by delegation to |
900 |
* the {@link ListSelectionModel#getMinSelectionIndex} method of the |
* the {@link ListSelectionModel#getMinSelectionIndex} method of the |
901 |
* {@link #selectionModel} field. |
* {@link #selectionModel} field. |
902 |
* |
* |
927 |
} |
} |
928 |
|
|
929 |
/** |
/** |
930 |
* Get the value of the {@link #scrollableTracksViewportHeight} property. |
* Get the value of the <code>scrollableTracksViewportHeight</code> property. |
931 |
* |
* |
932 |
* @return The constant value <code>false</code> |
* @return The constant value <code>false</code> |
933 |
*/ |
*/ |
|
|
|
934 |
public boolean getScrollableTracksViewportHeight() |
public boolean getScrollableTracksViewportHeight() |
935 |
{ |
{ |
936 |
return false; |
return false; |
937 |
} |
} |
938 |
|
|
939 |
/** |
/** |
940 |
* Get the value of the {@link #scrollableTracksViewportWidth} property. |
* Get the value of the <code>scrollableTracksViewportWidth</code> property. |
941 |
* |
* |
942 |
* @return <code>true</code> unless the {@link autoResizeMode} prperty is |
* @return <code>true</code> unless the {@link #autoResizeMode} property is |
943 |
* <code>AUTO_RESIZE_OFF</code> |
* <code>AUTO_RESIZE_OFF</code> |
944 |
*/ |
*/ |
|
|
|
945 |
public boolean getScrollableTracksViewportWidth() |
public boolean getScrollableTracksViewportWidth() |
946 |
{ |
{ |
947 |
if (autoResizeMode == AUTO_RESIZE_OFF) |
if (autoResizeMode == AUTO_RESIZE_OFF) |
1136 |
} |
} |
1137 |
|
|
1138 |
/** |
/** |
1139 |
* Get the value of the {@link #columnCount} property by |
* Get the value of the <code>columnCount</code> property by |
1140 |
* delegation to the @{link #columnModel} field. |
* delegation to the @{link #columnModel} field. |
1141 |
* |
* |
1142 |
* @return The current value of the columnCount property |
* @return The current value of the columnCount property |
1147 |
} |
} |
1148 |
|
|
1149 |
/** |
/** |
1150 |
* Get the value of the {@link #rowCount} property by |
* Get the value of the <code>rowCount</code> property by |
1151 |
* delegation to the @{link #dataModel} field. |
* delegation to the @{link #dataModel} field. |
1152 |
* |
* |
1153 |
* @return The current value of the rowCount property |
* @return The current value of the rowCount property |
1168 |
} |
} |
1169 |
|
|
1170 |
/** |
/** |
1171 |
* Get the value of the {@link #selectedColumn} property by |
* Get the value of the <code>selectedColumn</code> property by |
1172 |
* delegation to the @{link #columnModel} field. |
* delegation to the @{link #columnModel} field. |
1173 |
* |
* |
1174 |
* @return The current value of the selectedColumn property |
* @return The current value of the selectedColumn property |
1238 |
} |
} |
1239 |
|
|
1240 |
/** |
/** |
1241 |
* Get the value of the {@link #selectedColumnCount} property by |
* Get the value of the <code>selectedColumnCount</code> property by |
1242 |
* delegation to the @{link #columnModel} field. |
* delegation to the @{link #columnModel} field. |
1243 |
* |
* |
1244 |
* @return The current value of the selectedColumnCount property |
* @return The current value of the selectedColumnCount property |
1249 |
} |
} |
1250 |
|
|
1251 |
/** |
/** |
1252 |
* Get the value of the {@link #selectedColumns} property by |
* Get the value of the <code>selectedColumns</code> property by |
1253 |
* delegation to the @{link #columnModel} field. |
* delegation to the @{link #columnModel} field. |
1254 |
* |
* |
1255 |
* @return The current value of the selectedColumns property |
* @return The current value of the selectedColumns property |
1260 |
} |
} |
1261 |
|
|
1262 |
/** |
/** |
1263 |
* Get the value of the {@link #columnSelectionAllowed} property. |
* Get the value of the <code>columnSelectionAllowed</code> property. |
1264 |
* |
* |
1265 |
* @return The current value of the columnSelectionAllowed property |
* @return The current value of the columnSelectionAllowed property |
1266 |
*/ |
*/ |
1270 |
} |
} |
1271 |
|
|
1272 |
/** |
/** |
1273 |
* Get the value of the {@link #selectedRowCount} property by |
* Get the value of the <code>selectedRowCount</code> property by |
1274 |
* delegation to the @{link #selectionModel} field. |
* delegation to the @{link #selectionModel} field. |
1275 |
* |
* |
1276 |
* @return The current value of the selectedRowCount property |
* @return The current value of the selectedRowCount property |
1281 |
} |
} |
1282 |
|
|
1283 |
/** |
/** |
1284 |
* Get the value of the {@link #selectedRows} property by |
* Get the value of the <code>selectedRows</code> property by |
1285 |
* delegation to the @{link #selectionModel} field. |
* delegation to the @{link #selectionModel} field. |
1286 |
* |
* |
1287 |
* @return The current value of the selectedRows property |
* @return The current value of the selectedRows property |
1332 |
} |
} |
1333 |
|
|
1334 |
/** |
/** |
1335 |
* Get the value of the {@link #intercellSpacing} property. |
* Get the value of the <code>intercellSpacing</code> property. |
1336 |
* |
* |
1337 |
* @return The current value of the property |
* @return The current value of the property |
1338 |
*/ |
*/ |
1572 |
} |
} |
1573 |
|
|
1574 |
/** |
/** |
1575 |
* Set the value of the {@link #columnSelectionAllowed} property. |
* Set the value of the <code>columnSelectionAllowed</code> property. |
1576 |
* |
* |
1577 |
* @param c The new value of the property |
* @param c The new value of the property |
1578 |
*/ |
*/ |
1604 |
} |
} |
1605 |
|
|
1606 |
/** |
/** |
1607 |
* Set the value of the {@link #selectionMode} property by |
* Set the value of the <code>selectionMode</code> property by |
1608 |
* delegation to the {@link #selectionModel} field. The same selection |
* delegation to the {@link #selectionModel} field. The same selection |
1609 |
* mode is set for row and column selection models. |
* mode is set for row and column selection models. |
1610 |
* |
* |
1659 |
} |
} |
1660 |
|
|
1661 |
/** |
/** |
1662 |
* Set the value of the {@link #intercellSpacing} property. |
* Set the value of the <code>intercellSpacing</code> property. |
1663 |
* |
* |
1664 |
* @param i The new value of the intercellSpacing property |
* @param i The new value of the intercellSpacing property |
1665 |
*/ |
*/ |
1706 |
* <p>Set the value of the {@link #selectionForeground} property.</p> |
* <p>Set the value of the {@link #selectionForeground} property.</p> |
1707 |
* |
* |
1708 |
* <p>Fire a PropertyChangeEvent with name {@link |
* <p>Fire a PropertyChangeEvent with name {@link |
1709 |
* SELECTION_FOREGROUND_CHANGED_PROPERTY} to registered listeners, if |
* #SELECTION_FOREGROUND_CHANGED_PROPERTY} to registered listeners, if |
1710 |
* selectionForeground changed.</p> |
* selectionForeground changed.</p> |
1711 |
* |
* |
1712 |
* @param s The new value of the selectionForeground property |
* @param s The new value of the selectionForeground property |
1723 |
} |
} |
1724 |
|
|
1725 |
/** |
/** |
1726 |
* Set the value of the {@link #showGrid} property. |
* Set the value of the <code>showGrid</code> property. |
1727 |
* |
* |
1728 |
* @param s The new value of the showGrid property |
* @param s The new value of the showGrid property |
1729 |
*/ |
*/ |