|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JTable | +--uk.ac.starlink.table.gui.MultilineJTable
JTable which can display multiple-line elements. This class behaves like a JTable except that any of its cells which contain String objects with newline characters ('\n'), or String[] arrays are displayed on multiple table rows.
The implementation may make some demands in consequence of this; it may require that the data in the TableModel does not change while this table is active, and it may need to read the whole TableModel prior to startup. If these demands exist, they may be relaxed by improved implemenatation in the future.
Because the number of rows is modified, it is unwise to make any TableCellRenderers (or TableCellEditors?) associated with this table sensitive to the index of the row with which they are dealing.
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 | |
MultilineJTable()
Constructs a MultilineJTable without any data. |
|
MultilineJTable(TableModel baseModel)
Constructs a new table given a base TableModel. |
Method Summary | |
TableModel |
getModel()
Returns the model which this table is using for data display. |
Component |
prepareRenderer(TableCellRenderer rend,
int row,
int col)
|
void |
setGridColor(Color gridColor)
|
void |
setModel(TableModel baseModel)
Sets the model which this table should display. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public MultilineJTable(TableModel baseModel)
baseModel
- a TableModel describing the data this table
will displaypublic MultilineJTable()
Method Detail |
public void setModel(TableModel baseModel)
setModel
in class JTable
baseModel
- a TableModel describing the data this table
will displaypublic TableModel getModel()
setModel(javax.swing.table.TableModel)
method, it will be
some model derived from that one (potentially with more rows).
getModel
in class JTable
public Component prepareRenderer(TableCellRenderer rend, int row, int col)
prepareRenderer
in class JTable
public void setGridColor(Color gridColor)
setGridColor
in class JTable
|
Copyright © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |