|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tbee.swing.table.JTableHelper
public class JTableHelper
A few static methods that calculate and set optimal column width based on the preferred sizes of the renderers, editors and headers. TODO: `can we optimize speed by only scanning the visual columns and rows?
| Field Summary | |
|---|---|
static java.lang.String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| Constructor Summary | |
|---|---|
JTableHelper(javax.swing.JTable table)
|
|
| Method Summary | |
|---|---|
int |
getOptimalCellWidth(int col,
int row)
Calculates the optimal width for a cell in the table. |
static int |
getOptimalCellWidth(javax.swing.JTable table,
int col,
int row)
Static wrapper for the instance method (backwards compatibility) |
int |
getOptimalColumnWidth(int col)
Calculates the optimal width for the column of the given table. |
int |
getOptimalColumnWidth(int col,
int row)
sets the optimal column width for the given column based on the column and header. |
static int |
getOptimalColumnWidth(javax.swing.JTable table,
int col)
Static wrapper for the instance method (backwards compatibility) |
int |
getOptimalHeaderWidth(int col)
Calculates the optimal width for the header of the given table. |
static int |
getOptimalHeaderWidth(javax.swing.JTable table,
int col)
Static wrapper for the instance method (backwards compatibility) |
static void |
scrollToVisible(javax.swing.JTable table,
int col,
int row)
Assumes table is contained in a JScrollPane. |
void |
setOptimalColumnWidth()
sets the optimal column width for alls column if the given table based on the column and header. |
void |
setOptimalColumnWidth(int col)
sets the optimal column width for the given column based on the column and header. |
void |
setOptimalColumnWidth(int col,
int row)
sets the optimal column width for the given column based on the column and header. |
static void |
setOptimalColumnWidth(javax.swing.JTable table)
Static wrapper for the instance method (backwards compatibility) |
static void |
setOptimalColumnWidth(javax.swing.JTable table,
int col)
Static wrapper for the instance method (backwards compatibility) |
static void |
setOptimalColumnWidth(javax.swing.JTable table,
int col,
int row)
Static wrapper for the instance method (backwards compatibility) |
void |
setOptimalColumnWidthBasedOnRow(int row)
sets the optimal column width for the given column based on the column and header. |
static void |
setOptimalColumnWidthBasedOnRow(javax.swing.JTable table,
int row)
Static wrapper for the instance method (backwards compatibility) |
void |
setOptimalColumnWidthDelayed()
sets the optimal column width for alls column if the given table based on the column and header. |
static void |
setOptimalColumnWidthDelayed(javax.swing.JTable table)
Static wrapper for the instance method (backwards compatibility) |
void |
setOptimalColumnWidthIfLarger()
sets the optimal column width for alls column if the given table based on the column and header. |
void |
setOptimalColumnWidthIfLarger(int col)
sets the optimal column width for the given column based on the column and header. |
void |
setOptimalColumnWidthIfLarger(int col,
int row)
sets the optimal column width for the given column based on the column and header. |
static void |
setOptimalColumnWidthIfLarger(javax.swing.JTable table)
Static wrapper for the instance method (backwards compatibility) |
static void |
setOptimalColumnWidthIfLarger(javax.swing.JTable table,
int col)
Static wrapper for the instance method (backwards compatibility) |
static void |
setOptimalColumnWidthIfLarger(javax.swing.JTable table,
int col,
int row)
Static wrapper for the instance method (backwards compatibility) |
void |
setOptimalColumnWidthIfLargerBasedOnRow(int row)
sets the optimal column width for the given column based on the column and header. |
static void |
setOptimalColumnWidthIfLargerBasedOnRow(javax.swing.JTable table,
int row)
Static wrapper for the instance method (backwards compatibility) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String SOURCECODE_VERSION
| Constructor Detail |
|---|
public JTableHelper(javax.swing.JTable table)
| Method Detail |
|---|
public static int getOptimalCellWidth(javax.swing.JTable table,
int col,
int row)
public static int getOptimalColumnWidth(javax.swing.JTable table,
int col)
public static int getOptimalHeaderWidth(javax.swing.JTable table,
int col)
public static void setOptimalColumnWidth(javax.swing.JTable table,
int col)
public static void setOptimalColumnWidth(javax.swing.JTable table,
int col,
int row)
public static void setOptimalColumnWidthBasedOnRow(javax.swing.JTable table,
int row)
public static void setOptimalColumnWidthIfLarger(javax.swing.JTable table,
int col)
public static void setOptimalColumnWidthIfLarger(javax.swing.JTable table,
int col,
int row)
public static void setOptimalColumnWidthIfLargerBasedOnRow(javax.swing.JTable table,
int row)
public static void setOptimalColumnWidth(javax.swing.JTable table)
public static void setOptimalColumnWidthDelayed(javax.swing.JTable table)
public static void setOptimalColumnWidthIfLarger(javax.swing.JTable table)
public int getOptimalHeaderWidth(int col)
col - the column to calculate the widths
public int getOptimalCellWidth(int col,
int row)
col - the column to calculate the widths
public int getOptimalColumnWidth(int col)
col - the column to calculate the widths
public int getOptimalColumnWidth(int col,
int row)
public void setOptimalColumnWidth(int col)
public void setOptimalColumnWidth(int col,
int row)
public void setOptimalColumnWidthIfLarger(int col)
public void setOptimalColumnWidthIfLarger(int col,
int row)
public void setOptimalColumnWidthBasedOnRow(int row)
public void setOptimalColumnWidthIfLargerBasedOnRow(int row)
public void setOptimalColumnWidth()
public void setOptimalColumnWidthDelayed()
public void setOptimalColumnWidthIfLarger()
public static void scrollToVisible(javax.swing.JTable table,
int col,
int row)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||