|
Generated by JDiff |
||||||||
| PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES | |||||||||
This file contains all the changes in documentation in the packagejavax.swing.tableas colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
This abstract class provides default implementations for most of the methods in theClass AbstractTableModel, void fireTableDataChanged()TableModelinterface. It takes care of the management of listeners and provides some conveniences for generatingTableModelEventsand dispatching them to the listeners. To create a concreteTableModelas asublcasssubclass ofAbstractTableModelyou need only provide implementations for the following three methods:public int getRowCount(); public int getColumnCount(); public Object getValueAt(int row int column);Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.28 0238 12/0203/0001 @author Alan Chung @author Philip Milne
Notifies all listeners that all cell values in the table's rows may have changed. The number of rows may also have changed and the JTable should redraw the table from scratch. The structure of the table (as in the order of the columns) is assumed to be the same. @see TableModelEvent @see EventListenerList @see javax.swing.JTable#tableChanged(TableModelEvent)
Class AbstractTableModel, EventListener[] getListeners(Class)Returns an array of all the objects currently registered asFooListeners upon thisAbstractTableModel.FooListeners are registered using theaddFooListenermethod.You can specify the
listenerslistenerTypeargument with a class literal such asFooListener.class. For example you can query a modelmfor its table modelofwith thegivenfollowingtypecode:thatTableModelListener[] tmls = (TableModelListener[])(m.getListeners(TableModelListener.class));were added toIf no such listeners exist thismodelmethod returns an empty array. @returnsparamalllistenerType the type ofthelisteners requested; this parameter should specify an interface that descends fromjava.util.EventListener@return an array of all objectsreceivingregistered asFooListeners on this component or an empty array if no such listeners have been added @exception ClassCastException iflistenerTypenotificationsdoesn'tfrom thisspecify amodelclass or interface that implementsjava.util.EventListener@see #getTableModelListeners @since 1.3
The standard class for rendering (displaying) individual cells in aJTable.Implementation Note: This class inherits from
JLabela standard component class. HoweverJTableemploys a unique mechanism for rendering its cells and therefore requires some slightly modified behavior from its cell renderer. The table class defines a single cell renderer and uses it as a as a rubber-stamp for rendering all cells in the table; it renders the first cell changes the contents of that cell renderer shifts the origin to the new location re-draws it and so on. The standardJLabelcomponent was not designed to be used this way and we want to avoid triggering arevalidateeach time the cell is drawn. This would greatly decrease performance because therevalidatemessage would be passed up the hierarchy of the container to determine whether any other components would be affected. So this class overrides thevalidaterevalidaterepaintandfirePropertyChangemethods to be no-ops. If you write your own renderer please keep this performance consideration in mind.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.25 0231 12/0203/0001 @author Philip Milne @see JTable
A subclass ofDefaultTableCellRendererthat implementsUIResource.DefaultTableCellRendererdoesn't implementUIResourcedirectly so that applications can safely override thecellRendererproperty withDefaultTableCellRenderersubclasses.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
A future releaseAs ofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder
Class DefaultTableCellRenderer, void setBackground(Color)Returns true ifOverridden for performancethis component is completely opaque. An opaque component paints every pixel within its rectangular boundsreasons.A non-opaque component paintsSeeonly a subset of its pixels or none at all allowingthepixels underneath it to "show through". Therefore aImplementationcomponentNotethat doesfor morenot fully paint its pixels provides a degree of transparency. Subclasses that guarantee to always completely paint their contents should override this method and return trueinformation.@return true if this component is completely opaque @see #setOpaque
Overrides JComponent.setForegroundsetBackground to assign the unselected-background color to the specified color. @param c set the background color to this value
Class DefaultTableCellRenderer, void setValue(Object)Sets thestringStringobject for the cell being rendered tovalue. @param value the string value for this cell; if value isnullit sets the text value to an empty string @see JLabel#setText
The standard column-handler for aClass DefaultTableColumnModel, int getColumnIndexAtX(int)JTable.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.35 0243 12/0203/0001 @author Alan Chung @author Philip Milne @see JTable
Returns the index of the column that lies at positionClass DefaultTableColumnModel, EventListener[] getListeners(Class)xor -1 if no column covers this point. In keeping with Swing's separable model architecture a TableColumnModel does not know how the table columns actually appear on screen. The visual presentation of the columns is the responsibility of the view/controller object using this model (typically JTable). The view/controller need not display the columns sequentially from left to right. For example columns could be displayed from right to left to accomodate a locale preference or some columns might be hidden at the request of the user. Because the model does not know how the columns are laid out on screen the givenxPositionshould not be considered to be a coordinate in 2D graphics space. Instead it should be considered to be a width from the start of the first column in the model. If the column index for a given X coordinate in 2D space is requiredJTable.columnAtPointcan be used instead. @param x the horizontal location of interest @return the index of the column or -1 if no column is found @see javax.swing.JTable#columnAtPoint
Returns an array of all the objects currently registered asFooListeners upon this model.FooListeners are registered using theaddFooListenermethod.You can specify the
listenerslistenerTypeargument with a class literal such asFooListener.class. For example you can query aDefaultTableColumnModelmfor its column modelofwith thegivenfollowingtypecode:thatColumnModelListener[] cmls = (ColumnModelListener[])(m.getListeners(ColumnModelListener.class));were added toIf no such listeners exist thismodelmethod returns an empty array. @param listenerType thelistenertypeclassof listeners requested; this parameter should specify an interfacetothat descends frommatchjava.util.EventListener@returnallan array oftheall objectsreceivingregistered aslistenerTypeFooListenernotificationssfromon this model or an empty array if no such listeners have been added @exception ClassCastException iflistenerTypedoesn't specify a class or interface that implementsjava.util.EventListener@see #getColumnModelListeners @since 1.3
This is an implementation ofClass DefaultTableModel, constructor DefaultTableModel(Object[], int)TableModelthat uses aVectorofVectorsto store the cell value objects.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.27 0234 12/0203/00 @author Alan Chung01 @author Philip Milne @see TableModel @see #getDataVector
Constructs aClass DefaultTableModel, constructor DefaultTableModel(Vector, int)DefaultTableModelwith as many columns as there are elements incolumnNamesandofnumRowsrowCountnullobject values. Each column's name will be taken from thecolumnNamesarray. @param columnNamesarraycontaining the names of the new columns.;Ifif this isnullthen the model has no columns @paramnumRowsrowCount the number of rows the table holds @see #setDataVector @see #setValueAt
Constructs aClass DefaultTableModel, constructor DefaultTableModel(int, int)DefaultTableModelwith as many columns as there are elements incolumnNamesandofnumRowsrowCountnullobject values. Each column's name will be taken from thecolumnNamesvector. @param columnNamesvectorcontaining the names of the new columns.;Ifif this isnullthen the model has no columns @paramnumRowsrowCount the number of rows the table holds @see #setDataVector @see #setValueAt
Constructs aClass DefaultTableModel, void addColumn(Object)DefaultTableModelwithandnumRowsrowCountofnumColumnscolumnCountnullobject values. @paramnumRowsrowCount the number of rows the table holds @paramnumColumnscolumnCount the number of columns the table holds @see #setValueAt
Adds a column to the model. The new column will have the identifierClass DefaultTableModel, void addColumn(Object, Vector)columnNamewhich may be null. This method will send atableChangednotification message to all the listeners. This method is a cover foraddColumn(Object Vector)which usesnullas the data vector. @param columnName the identifier of the column being added@exception IllegalArgumentException if columnName is null
Adds a column to the model. The new column will have the identifierClass DefaultTableModel, String getColumnName(int)columnNamewhich may be null.columnDatais the optional vector of data for the column. If it isnullthe column is filled withnullvalues. Otherwise the new data will be added to model starting with the first element going to row 0 etc. This method will send atableChangednotification message to all the listeners. @param columnName the identifier of the column being added @param columnData optional data of the column being added@exception IllegalArgumentException if columnName is null
Returns the column name. @return a name for this column using the string value of the appropriate member inClass DefaultTableModel, void moveRow(int, int, int)columnIdentifiers. IfcolumnIdentifiersis null ordoes not have an entry for this index returns the default name provided by the superclass
Moves one or more rowsClass DefaultTableModel, void newRowsAdded(TableModelEvent)startingfromatthe inlcusive rangestarttoto thestartIndexendposition in the model.endIndextotoAfter the move the row that was at indexstartwill be at index. This method will send atoIndextotableChangednotification message to all the listeners.
Examples of moves:@param1. moveRow(1 3 5); a|B|C|D|e|f|g|h|i|j|k - before a|e|f|g|h|B|C|D|
g|h|i|j|k - after2. moveRow(6 7 1); a|b|c|d|e|f|G|H|i|j|k - before a|G|H|b|c|d|e|f|i|j|k - after
startIndexstart the starting row index to be moved @paramendIndexend the ending row index to be moved @paramtoIndexto the destination of the rows to be moved @exception ArrayIndexOutOfBoundsException if any of theindices areelementsout of range;wouldor ifbe movedendIndexoutis lessof thethantable'sstartIndexrange
Ensures that the new rows have the correct number of columns. This is accomplished by using theClass DefaultTableModel, void setDataVector(Object[][], Object[])setSizemethod inVectorwhich truncates vectors which are too long and appendsnulls if they are too short. This method also sends out atableChangednotification message to all the listeners. @paramevente thisTableModelEventdescribes where the rows were added. Ifnullit assumes all the rows were newly added @see #getDataVector
Replaces the value in theClass DefaultTableModel, void setDataVector(Vector, Vector)dataVectorinstance variable with the values in the array. The first index in thenewDatadataVectorObject[][]array is the row index and the second is the column index.are the names of the new columns. @paramcolumnNamescolumnIdentifiersnewDatadataVector the new data vector @paramcolumnNamescolumnIdentifiers the names of the columns @see #setDataVector(Vector Vector)
Replaces the currentdataVectorinstance variable with the new Vector of rows.newDatadataVectorare the names of the new columns. The first name incolumnNamescolumnIdentifiersis mapped to column 0 incolumnNamescolumnIdentifiers. Each row innewDatadataVectoris adjusted to match the number of columns innewDatadataVectoreither by truncating thecolumnNamescolumnIdentifiersVectorif it is too long or addingnullvalues if it is too short.Note that passing in a
nullvalue fordataVectorresults in unspecified behavior an possibly an exception. @paramnewDatadataVector the new data vector @paramcolumnNamescolumnIdentifiers the names of the columns @see #newDataAvailable @see #getDataVector
This is the object which manages the header of theJTable.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.55 0461 12/0603/0001 @author Alan Chung @author Philip Milne @see javax.swing.JTable
This class implements accessibility support for theJTableHeaderclass. It provides an implementation of the Java Accessibility API appropriate to table header user-interface elements.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
AAsfuture releaseofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder
Invoked when a column is added to the table column model.Class JTableHeader, TableCellRenderer createDefaultRenderer()Application code will not use these methods explicitly they are used internally by
. @param e the event received @see TableColumnModelListenerJtableJTable
Returns a default renderer to be used when no header renderer is defined by aClass JTableHeader, TableColumn getResizingColumn()TableColumn. @paramreturndefault renderer to be used when theretheis no headerdefault table column renderer
Returns the resizing column. If no column is being resized this method returnsClass JTableHeader, void setDefaultRenderer(TableCellRenderer)null. @return the resizing column if a resize is in process otherwise returnsnull
Sets the default renderer to be used when noClass JTableHeader, void setDraggedColumn(TableColumn)headerRendereris defined by a. @param defaultRenderer the default rendererTabelColumnTableColumn
Sets the header'sClass JTableHeader, void setResizingColumn(TableColumn)draggedColumntoaColumn.Application code will not use this method explicitly it is used internally by the column dragging mechanism. @param aColumn the
new value forcolumn being draggeddraggedColumnornullif no column is being dragged
Sets the header'sresizingColumntoaColumn.Application code will not use this method explicitly it is used internally by the column sizing mechanism. @param aColumn the column being resized or
nullif no column is being resized
This interface defines the method any object that would like to be an editor of values for components such asJListBoxJComboBoxJTreeorJTableneeds to implement. @version 1.13 0214 12/0203/0001 @author Alan Chung
This interface defines the method required by any object that would like to be a renderer for cells in aJTable. @version 1.15 0216 12/0203/0001 @author Alan Chung
AClass TableColumn, void sizeWidthToFit()TableColumnrepresents all the attributes of a column in aJTablesuch as width resizibility minimum and maximum width. In addition theTableColumnprovides slots for a renderer and an editor that can be used to display and edit the values in this column.It is also possible to specify renderers and editors on a per type basis rather than a per column basis - see the
setDefaultRenderermethod in theJTableclass. This default mechanism is only used when the renderer (or editor) in theTableColumnisnull.The
TableColumnstores the link between the columns in theJTableand the columns in theTableModel. ThemodelIndexis the column in theTableModelwhich will be queried for the data values for the cells in this column. As the column moves around in the view thismodelIndexdoes not change.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing.
A future releaseAs ofSwing will provide1.4 support for long termpersistencestorage of all JavaBeansTM has been added to thejava.beanspackage. Please see java.beans.XMLEncoder @version 1.49 0254 12/0203/0001 @author Alan Chung @author Philip Milne @see javax.swing.table.TableColumnModel @see javax.swing.table.DefaultTableColumnModel @see javax.swing.table.JTableHeader#getDefaultRenderer() @see JTable#getDefaultRenderer(Class) @see JTable#getDefaultEditor(Class) @see JTable#getCellRenderer(int int) @see JTable#getCellEditor(int int)
Resizes theClass TableColumn, Object identifierTableColumnto fit the width of its header cell. This method does nothing if the header renderer isnull(the default case). Otherwise it sets the minimum maximum and preferred widths of this column to the widths of the minimum maximum and preferred sizes of the Component delivered by the header renderer. The transient "width" property of this TableColumn is also set to the preferred width. Note this method is not used internally by the table package. @see #setPreferredWidth
This object is not used internally by the drawing machinery of theJTable; identifiers may be set in theTableColumnas as an optional way to tag and locate table columns. The table package does not modify or invoke any methods in theseidentiferidentifier objects other than theequalsmethod which is used in thegetColumnIndex()method in theDefaultTableColumnModel.
Defines the requirements for a table column model object suitable for use withClass TableColumnModel, int getColumnIndexAtX(int)JTable. @version 1.20 0222 12/0203/0001 @author Alan Chung @author Philip Milne @see DefaultTableColumnModel
Returns the index of the column that lies on the horizontal pointxPosition; or -1 if it lies outside the any of the column's bounds. In keeping with Swing's separable model architecture a TableColumnModel does not know how the table columns actually appear on screen. The visual presentation of the columns is the responsibility of the view/controller object using this model (typically JTable). The view/controller need not display the columns sequentially from left to right. For example columns could be displayed from right to left to accomodate a locale preference or some columns might be hidden at the request of the user. Because the model does not know how the columns are laid out on screen the givenxPositionshould not be considered to be a coordinate in 2D graphics space. Instead it should be considered to be a width from the start of the first column in the model. If the column index for a given X coordinate in 2D space is requiredJTable.columnAtPointcan be used instead. @return the index of the column; or -1 if no column is found @see javax.swing.JTable#columnAtPoint
TheTableModelinterface specifies the methods theJTablewill use to interrogate a tabular data model.The
JTablecan be set up to display any data model which implements theTableModelinterface with a couple of lines of code:
TableModel myData = new MyTableModel(); JTable table = new JTable(myData);For further documentation see Creating a Table Model in The Java Tutorial.
@version 1.
22 0223 12/0203/0001 @author Philip Milne @see JTable