|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.citra.table.TableCellResizer
public class TableCellResizer
TableCellResizer adds cell-resizing functionality to a JTable.
Field Summary | |
---|---|
static int |
COLUMN_RESIZE
integer indicating that the column will be resized to its contents should the user double-click on its border |
protected int |
columnMargin
the pixels to add to the columns that are resized |
protected boolean |
columnResizingEnabled
flag indicating whether column resizing is enabled |
static int |
DEFAULT_COLUMN_MARGIN
the default column margin |
protected int |
minRowHeight
the minimum row height a row is allowed to resize to |
static int |
NO_RESIZE
integer indicating that nothing will happen should the user double-click on a column border |
protected boolean |
resizeAllColumns
flag indicating whether all columns will be resized to the resizing column |
protected boolean |
resizeAllRows
flag indicating whether all rows will be resized to the resizing row |
protected int |
resizeMode
the resize mode |
static int |
ROW_COLUMN_RESIZE
integer indicating that both row and column will be resized to its contents should the user double-click on its border |
static int |
ROW_RESIZE
integer indicating that the row will be resized to its contents should the user double-click on its border |
protected boolean |
rowResizingEnabled
flag indicating whether row resizing is enabled |
protected JTable |
table
the associated table |
Constructor Summary | |
---|---|
TableCellResizer(JTable table)
Constructs a TableCellResizer. |
Method Summary | |
---|---|
protected boolean |
canResizeColumn(int columnIndex)
Returns true if the column is allowed to be resized. |
protected boolean |
canResizeRow(int row)
Returns true if the row is allowed to be resized. |
boolean |
check(MouseEvent e)
Processes the mouse event and determines whether the table is being resized. |
int |
getColumnMargin()
Determines the pixels to increase the width of a column by, when it is being automatically resized with the TableCellResizer.resizeColumnToContents(int) method. |
boolean |
getColumnResizingEnabled()
Determines whether column resizing is enabled. |
int |
getMinRowHeight()
Determines the minimum row height a row is allowed to be resized to. |
boolean |
getResizeAllColumns()
Determines whether all columns will be resized to the resizing column. |
boolean |
getResizeAllRows()
Determines whether all rows will be resized to the resizing row. |
int |
getResizeMode()
Determines the current resize mode, when a user double clicks on a cell border. |
boolean |
getRowResizingEnabled()
Determines whether row resizing is enabled. |
JTable |
getTable()
Returns the associated table. |
void |
resizeColumnsToContents()
Resizes all columns to their contents. |
void |
resizeColumnToContents(int column)
Resizes a column to its contents. |
void |
resizeRowsToContents()
Resizes all rows to their contents. |
void |
resizeRowToContents(int row)
Resizes a row to its contents. |
void |
setColumnMargin(int columnMargin)
Assigns the pixels to increase the width of a column by, when it is being automatically resized with the TableCellResizer.resizeColumnToContents(int) method. |
void |
setColumnResizingEnabled(boolean columnResizingEnabled)
Determines whether column resizing is enabled. |
void |
setMinRowHeight(int minRowHeight)
Determines the minimum row height a row is allowed to be resized to. |
void |
setResizeAllColumns(boolean resizeAllColumns)
Determines whether all columns will be resized to the resizing column. |
void |
setResizeAllRows(boolean resizeAllRows)
Determines whether all rows will be resized to the resizing row. |
void |
setResizeMode(int resizeMode)
Assigns the resize mode, when a user double clicks on a cell border. |
void |
setRowResizingEnabled(boolean rowResizingEnabled)
Determines whether row resizing is enabled. |
void |
setTable(JTable table)
Assigns the table to be resized. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean resizeAllRows
protected boolean resizeAllColumns
protected JTable table
protected boolean rowResizingEnabled
protected boolean columnResizingEnabled
protected int minRowHeight
public static final int NO_RESIZE
public static final int ROW_RESIZE
public static final int COLUMN_RESIZE
public static final int ROW_COLUMN_RESIZE
protected int resizeMode
public static final int DEFAULT_COLUMN_MARGIN
protected int columnMargin
Constructor Detail |
---|
public TableCellResizer(JTable table)
Method Detail |
---|
protected boolean canResizeColumn(int columnIndex)
columnIndex
- the column
protected boolean canResizeRow(int row)
row
- the row
public boolean check(MouseEvent e)
e
- the mouse event
public int getColumnMargin()
TableCellResizer.resizeColumnToContents(int)
method.
public boolean getColumnResizingEnabled()
public int getMinRowHeight()
public boolean getResizeAllColumns()
public boolean getResizeAllRows()
public int getResizeMode()
The mode may be:
NO_RESIZE: nothing will happen
ROW_RESIZE: row will be resized to its contents
COLUMN_RESIZE: column will be resized to its contents
ROW_COLUMN_RESIZE: both row and column will be resized to its contents
The default mode is ROW_COLUMN_RESIZE.
public boolean getRowResizingEnabled()
public JTable getTable()
public void resizeColumnsToContents()
public void resizeColumnToContents(int column)
column
- the column to be resizedpublic void resizeRowsToContents()
public void resizeRowToContents(int row)
row
- the row to be resizedpublic void setColumnMargin(int columnMargin)
TableCellResizer.resizeColumnToContents(int)
method.
columnMargin
- the number of pixelspublic void setColumnResizingEnabled(boolean columnResizingEnabled)
columnResizingEnabled
- true if column resizing is enabled, false otherwisepublic void setMinRowHeight(int minRowHeight)
minRowHeight
- the minimum row heightpublic void setResizeAllColumns(boolean resizeAllColumns)
resizeAllColumns
- true if all columns will be resized to the resizing column, false otherwisepublic void setResizeAllRows(boolean resizeAllRows)
resizeAllRows
- true if all rows will be resized to the resizing row, false otherwisepublic void setResizeMode(int resizeMode)
The mode may be:
NO_RESIZE: nothing will happen
ROW_RESIZE: row will be resized to its contents
COLUMN_RESIZE: column will be resized to its contents
ROW_COLUMN_RESIZE: both row and column will be resized to its contents
The default mode is ROW_COLUMN_RESIZE.
resizeMode
- the resize modepublic void setRowResizingEnabled(boolean rowResizingEnabled)
rowResizingEnabled
- true if row resizing is enabled, false otherwisepublic void setTable(JTable table)
table
- the associated table
|
Copyright © 2011 Citra Technologies. All Rights Reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |