diff options
author | Michael Koch <konqueror@gmx.de> | 2003-06-24 20:17:27 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-06-24 20:17:27 +0000 |
commit | bbe53f03c8de1126e442866620409007c7df88fe (patch) | |
tree | 8d80296e8b413cdaf683251d6bff73920ddd04ee /libjava/javax/swing/event/TableModelEvent.java | |
parent | 7aff2f289b390ebab933209b9eb1a9de5354dbfe (diff) | |
download | gcc-bbe53f03c8de1126e442866620409007c7df88fe.zip gcc-bbe53f03c8de1126e442866620409007c7df88fe.tar.gz gcc-bbe53f03c8de1126e442866620409007c7df88fe.tar.bz2 |
AncestorEvent.java, [...]: New versions from classpath.
2003-06-24 Michael Koch <konqueror@gmx.de>
* javax/swing/event/AncestorEvent.java,
javax/swing/event/HyperlinkEvent.java,
javax/swing/event/InternalFrameEvent.java,
javax/swing/event/ListDataEvent.java,
javax/swing/event/TableModelEvent.java,
javax/swing/event/TreeWillExpandListener.java,
javax/swing/plaf/ComponentUI.java,
javax/swing/plaf/DesktopIconUI.java,
javax/swing/plaf/DesktopPaneUI.java,
javax/swing/plaf/DimensionUIResource.java,
javax/swing/plaf/FileChooserUI.java,
javax/swing/plaf/FontUIResource.java,
javax/swing/plaf/IconUIResource.java,
javax/swing/plaf/InputMapUIResource.java,
javax/swing/plaf/InsetsUIResource.java,
javax/swing/plaf/InternalFrameUI.java,
javax/swing/plaf/LabelUI.java,
javax/swing/plaf/ListUI.java,
javax/swing/plaf/MenuBarUI.java,
javax/swing/plaf/MenuItemUI.java,
javax/swing/plaf/OptionPaneUI.java,
javax/swing/plaf/PanelUI.java,
javax/swing/plaf/ProgressBarUI.java,
javax/swing/plaf/doc-files/ComponentUI-1.dia,
javax/swing/plaf/doc-files/ComponentUI-1.png:
New versions from classpath.
From-SVN: r68438
Diffstat (limited to 'libjava/javax/swing/event/TableModelEvent.java')
-rw-r--r-- | libjava/javax/swing/event/TableModelEvent.java | 269 |
1 files changed, 111 insertions, 158 deletions
diff --git a/libjava/javax/swing/event/TableModelEvent.java b/libjava/javax/swing/event/TableModelEvent.java index c598955..222d194c 100644 --- a/libjava/javax/swing/event/TableModelEvent.java +++ b/libjava/javax/swing/event/TableModelEvent.java @@ -42,163 +42,116 @@ import java.util.EventObject; import javax.swing.table.TableModel; /** - * TableModelEvent * @author Andrew Selkirk */ -public class TableModelEvent extends EventObject { - - //------------------------------------------------------------- - // Constants -------------------------------------------------- - //------------------------------------------------------------- - - /** - * ALL_COLUMNS - */ - public static int ALL_COLUMNS = -1; - - /** - * DELETE - */ - public static int DELETE = -1; - - /** - * HEADER_ROW - */ - public static int HEADER_ROW = -1; - - /** - * INSERT - */ - public static int INSERT = 1; - - /** - * UPDATE - */ - public static int UPDATE = 0; - - - //------------------------------------------------------------- - // Variables -------------------------------------------------- - //------------------------------------------------------------- - - /** - * column - */ - protected int column = 0; - - /** - * firstRow - */ - protected int firstRow = 0; - - /** - * lastRow - */ - protected int lastRow = 0; - - /** - * type - */ - protected int type = 0; - - - //------------------------------------------------------------- - // Initialization --------------------------------------------- - //------------------------------------------------------------- - - /** - * Constructor TableModelEvent - * @param source Source object - */ - public TableModelEvent(TableModel source) { - this(source, 0, source.getRowCount(), ALL_COLUMNS, UPDATE); - } // TableModelEvent() - - /** - * Constructor TableModelEvent - * @param source Source table model - * @param row Updated row - */ - public TableModelEvent(TableModel source, int row) { - this(source, row, row, ALL_COLUMNS, UPDATE); - } // TableModelEvent() - - /** - * Constructor TableModelEvent - * @param source Source table model - * @param firstRow First row of update - * @param lastRow Last row of update - */ - public TableModelEvent(TableModel source, int firstRow, - int lastRow) { - this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE); - } // TableModelEvent() - - /** - * Constructor TableModelEvent - * @param source Source table model - * @param firstRow First row of update - * @param lastRow Last row of update - * @param column Affected column - */ - public TableModelEvent(TableModel source, int firstRow, - int lastRow, int column) { - this(source, firstRow, lastRow, column, UPDATE); - } // TableModelEvent() - - /** - * Constructor TableModelEvent - * @param source Source table model - * @param firstRow First row of update - * @param lastRow Last row of update - * @param column Affected column - * @param type Type of change - */ - public TableModelEvent(TableModel source, int firstRow, - int lastRow, int column, int type) { - super(source); - this.firstRow = firstRow; - this.lastRow = lastRow; - this.column = column; - this.type = type; - } // TableModelEvent() - - - //------------------------------------------------------------- - // Methods ---------------------------------------------------- - //------------------------------------------------------------- - - /** - * getColumn - * @returns column - */ - public int getColumn() { - return column; - } // getColumn() - - /** - * getFirstRow - * @returns row - */ - public int getFirstRow() { - return firstRow; - } // getFirstRow() - - /** - * getLastRow - * @returns row - */ - public int getLastRow() { - return lastRow; - } // getLastRow() - - /** - * Get type - * @returns Type of event - */ - public int getType() { - return type; - } // getType() - - -} // TableModelEvent +public class TableModelEvent extends EventObject +{ + private static final serialVersionUID = -7037680193569691706L; + + public static int ALL_COLUMNS = -1; + public static int DELETE = -1; + public static int HEADER_ROW = -1; + public static int INSERT = 1; + public static int UPDATE = 0; + + protected int column = 0; + protected int firstRow = 0; + protected int lastRow = 0; + protected int type = 0; + + /** + * Creates a <code>TableModelEvent</code> event. + * + * @param source The source object + */ + public TableModelEvent(TableModel source) + { + this(source, 0, source.getRowCount(), ALL_COLUMNS, UPDATE); + } + + /** + * Creates a <code>TableModelEvent</code> event. + * + * @param source The source object + * @param row The updated row + */ + public TableModelEvent(TableModel source, int row) + { + this(source, row, row, ALL_COLUMNS, UPDATE); + } + + /** + * Creates a <code>TableModelEvent</code> event. + * + * @param source The source object + * @param firstRow The first row of update + * @param lastRow The last row of update + */ + public TableModelEvent(TableModel source, int firstRow, int lastRow) + { + this(source, firstRow, lastRow, ALL_COLUMNS, UPDATE); + } + + /** + * Creates a <code>TableModelEvent</code> event. + * + * @param source The source object + * @param firstRow The first row of update + * @param lastRow The last row of update + * @param column The affected column + */ + public TableModelEvent(TableModel source, int firstRow, int lastRow, int column) + { + this(source, firstRow, lastRow, column, UPDATE); + } + + /** + * Creates a <code>TableModelEvent</code> event. + * + * @param source The source object + * @param firstRow The first row of update + * @param lastRow The last row of update + * @param column The affected column + * @param type The type of change + */ + public TableModelEvent(TableModel source, int firstRow, int lastRow, int column, int type) + { + super(source); + this.firstRow = firstRow; + this.lastRow = lastRow; + this.column = column; + this.type = type; + } + + /** + * Returns the affected column of this event. + */ + public int getColumn() + { + return column; + } + + /** + * Returns the first affected row of this event. + */ + public int getFirstRow() + { + return firstRow; + } + + /** + * Returns the last affected row of this event. + */ + public int getLastRow() + { + return lastRow; + } + + /** + * Returns the type of change of this event. + */ + public int getType() + { + return type; + } +} |