diff options
author | Mark Wielaard <mark@gcc.gnu.org> | 2006-03-10 21:46:48 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2006-03-10 21:46:48 +0000 |
commit | 8aa540d2f783474d1d2e06f16744bf67b9c1facc (patch) | |
tree | ea38c56431c5d4528fb54254c3f8e50f517bede3 /libjava/classpath/javax/swing/table/JTableHeader.java | |
parent | 27079765d00123f8e53d0e1ef7f9d46559266e6d (diff) | |
download | gcc-8aa540d2f783474d1d2e06f16744bf67b9c1facc.zip gcc-8aa540d2f783474d1d2e06f16744bf67b9c1facc.tar.gz gcc-8aa540d2f783474d1d2e06f16744bf67b9c1facc.tar.bz2 |
Imported GNU Classpath 0.90
Imported GNU Classpath 0.90
* scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore.
* gnu/classpath/jdwp/VMFrame.java (SIZE): New constant.
* java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5.
* java/lang/Math.java: New override file.
* java/lang/Character.java: Merged from Classpath.
(start, end): Now 'int's.
(canonicalName): New field.
(CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants.
(UnicodeBlock): Added argument.
(of): New overload.
(forName): New method.
Updated unicode blocks.
(sets): Updated.
* sources.am: Regenerated.
* Makefile.in: Likewise.
From-SVN: r111942
Diffstat (limited to 'libjava/classpath/javax/swing/table/JTableHeader.java')
-rw-r--r-- | libjava/classpath/javax/swing/table/JTableHeader.java | 89 |
1 files changed, 59 insertions, 30 deletions
diff --git a/libjava/classpath/javax/swing/table/JTableHeader.java b/libjava/classpath/javax/swing/table/JTableHeader.java index 163509a..4e8dcd7 100644 --- a/libjava/classpath/javax/swing/table/JTableHeader.java +++ b/libjava/classpath/javax/swing/table/JTableHeader.java @@ -67,6 +67,11 @@ import javax.swing.event.TableColumnModelEvent; import javax.swing.event.TableColumnModelListener; import javax.swing.plaf.TableHeaderUI; +/** + * Represents the table header. The header displays the column header values, + * is always visible event if the rest of the table scrolls up and down and + * supports column reordering and resizing with mouse. + */ public class JTableHeader extends JComponent implements TableColumnModelListener, Accessible { @@ -306,7 +311,10 @@ public class JTableHeader extends JComponent } }; } - + + /** + * Use serialVersionUid for interoperability. + */ private static final long serialVersionUID = 5144633983372967710L; /** @@ -409,9 +417,10 @@ public class JTableHeader extends JComponent } /** - * Get the value of the {@link #draggedColumn} property. + * Get the column that is currently being dragged. This is used when + * handling the column reordering with mouse. * - * @return The current value of the property + * @return the column being dragged, null if none. */ public TableColumn getDraggedColumn() { @@ -429,29 +438,34 @@ public class JTableHeader extends JComponent } /** - * Get the value of the {@link #reorderingAllowed} property. + * Check if it is possible to reorder the table columns by dragging column + * header with mouse. The table reordering is enabled by default, but can be + * disabled with {@link #setReorderingAllowed(boolean)}. * - * @return The current value of the property - */ + * @return true if reordering is allowed, false otherwise. + */ public boolean getReorderingAllowed() { return reorderingAllowed; } /** - * Get the value of the {@link #resizingAllowed} property. + * Check if it is possible to resize the table columns by dragging the column + * boundary in the table header with mouse. The resizing is enabled + * by default, but can be disabled with {@link #setResizingAllowed(boolean)}. * - * @return The current value of the property - */ + * @return true if resizing is allowed, false otherwise. + */ public boolean getResizingAllowed() { return resizingAllowed; } /** - * Get the value of the {@link #resizingColumn} property. + * Get the column that is currently being resized. This is used when + * handling the column resizing with mouse. * - * @return The current value of the property + * @return the column being currently resized, null if none. */ public TableColumn getResizingColumn() { @@ -459,9 +473,9 @@ public class JTableHeader extends JComponent } /** - * Get the value of the {@link #table} property. + * Get the table, having this header. * - * @return The current value of the property + * @return the table, having this header. */ public JTable getTable() { @@ -501,13 +515,15 @@ public class JTableHeader extends JComponent } /** - * Set the value of the {@link #draggedColumn} property. + * Set the column that is currently being dragged. This is used when + * dragging the column with mouse. Setting to null will stop the + * dragging session immediately. * - * @param d The new value of the property + * @param draggingIt the column being currently dragged, null if none. */ - public void setDraggedColumn(TableColumn d) + public void setDraggedColumn(TableColumn draggingIt) { - draggedColumn = d; + draggedColumn = draggingIt; } /** @@ -531,33 +547,39 @@ public class JTableHeader extends JComponent } /** - * Set the value of the {@link #reorderingAllowed} property. + * Set the table ability to reorder columns by dragging column header + * with mouse. The table reordering is enabled by default, but can be + * disabled with this method. * - * @param r The new value of the property + * @param allowed true if reordering is allowed, false otherwise. */ - public void setReorderingAllowed(boolean r) + public void setReorderingAllowed(boolean allowed) { - reorderingAllowed = r; + reorderingAllowed = allowed; } /** - * Set the value of the {@link #resizingAllowed} property. + * Set the table ability to resize columns by dragging the column + * boundary in the table header with mouse. The resizing is enabled + * by default, but can be disabled using this method. * - * @param r The new value of the property + * @param allowed true if resizing is allowed, false otherwise. */ - public void setResizingAllowed(boolean r) + public void setResizingAllowed(boolean allowed) { - resizingAllowed = r; + resizingAllowed = allowed; } /** - * Set the value of the {@link #resizingColumn} property. + * The the column that is currently being resized. This property is used + * when handling table resizing with mouse. Setting to null would stop + * the resizing session immediately. * - * @param r The new value of the property + * @param resizingIt the column being currently resized */ - public void setResizingColumn(TableColumn r) + public void setResizingColumn(TableColumn resizingIt) { - resizingColumn = r; + resizingColumn = resizingIt; } /** @@ -609,7 +631,14 @@ public class JTableHeader extends JComponent { this.cellRenderer = cellRenderer; } - + + /** + * Get the rectangle, occupied by the header of the given column. + * + * @param column the column, for that the header area is requested. + * + * @return the column header area. + */ public Rectangle getHeaderRect(int column) { Rectangle r = getTable().getCellRect(-1, column, false); |