|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openbp.swing.components.treetable.resize.ColumnSizeConstraint
public class ColumnSizeConstraint
Constraint for the column width. Each column get the preferred width of the component with the maximal width.
| Field Summary | |
|---|---|
protected int |
absoluteMinSize
The absolute minimal width of a column. |
protected int[][] |
columnSizes
Hold the mix/max/prefered sizes for each column. |
protected static int |
MAX
Index for max width. |
protected static int |
MIN
Index for min width. |
protected int[] |
minSizeOfColumns
Minimal size of the columns. |
protected static int |
PREFERRED
Index for preferred width. |
protected int |
treeColumnMaxWidth
Max width of tree column. |
| Constructor Summary | |
|---|---|
ColumnSizeConstraint()
Constructor. |
|
| Method Summary | |
|---|---|
void |
addMaxSizeForColumn(int column,
double maxValue)
Add a maximal width for a column |
void |
adjustMaximalWidthOfColumn(JTreeTable treetable)
Update the max width of column if they are set. |
void |
adjustPreferredToWidth(JTreeTable treetable)
Adjust the prefered width of all columns to the width of the whole tree table. |
void |
calculateColumnSizes(JTreeTable treetable)
Calculates the size of each column in the tree table. |
int |
determineMaxColumnWidth(JTreeTable treetable,
int column)
Determines the maximum width of the tree column according to the text displayed. |
int |
determineMaxTreeColumnWidth(JTreeTable treetable)
Determines the maximum width of the tree column according to the text displayed. |
int |
getAbsoluteMinimum()
Get the absolute minimal widht of all columns. |
int |
getMaxWidthOfColumn(int column)
Get the maximal widht of the column |
int |
getMinWidthOfColumn(int column)
Get the minimal width of the column |
int |
getPreferredWidthOfColumn(int column)
Get the preferred widht of the column |
boolean |
isRecalculateNeeded(JTreeTable treetable)
Determine if the preferred width of the columns needs to be re-calculated or not. |
void |
setAboluteMinimun(int minSize)
Set the absolute minimal width of all columns. |
protected void |
setColumnWidth(int type,
int column,
int width)
Set a width for a column. |
void |
setMinimumOfColumn(int columnWidth,
int column,
JTreeTable treetable)
Set the minimal width of a column. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int absoluteMinSize
protected static final int MAX
protected static final int MIN
protected static final int PREFERRED
protected int[][] columnSizes
protected int[] minSizeOfColumns
protected int treeColumnMaxWidth
| Constructor Detail |
|---|
public ColumnSizeConstraint()
| Method Detail |
|---|
public void calculateColumnSizes(JTreeTable treetable)
getMinWidthOfColumn(int),
getMaxWidthOfColumn(int) and getPreferredWidthOfColumn(int).
The sizes don't change until the method is re-executed.
treetable - The treetable whose columns are to be resizedpublic void adjustPreferredToWidth(JTreeTable treetable)
treetable - The treetable whose columns are to be resizedpublic void adjustMaximalWidthOfColumn(JTreeTable treetable)
treetable - The tree tablepublic boolean isRecalculateNeeded(JTreeTable treetable)
treetable - The tree table
public int getMinWidthOfColumn(int column)
column - The column
public int getMaxWidthOfColumn(int column)
column - The column
public int getPreferredWidthOfColumn(int column)
column - The column
protected void setColumnWidth(int type,
int column,
int width)
type - The type to set MAX, MIN or PREFERREDcolumn - The column to setwidth - The width to setpublic void setAboluteMinimun(int minSize)
minSize - the widthpublic int getAbsoluteMinimum()
public void setMinimumOfColumn(int columnWidth,
int column,
JTreeTable treetable)
columnWidth - The minimal widthcolumn - The index of the columntreetable - The treetable
public int determineMaxColumnWidth(JTreeTable treetable,
int column)
treetable - The treetablecolumn - The index of the column
public int determineMaxTreeColumnWidth(JTreeTable treetable)
treetable - The treetable
public void addMaxSizeForColumn(int column,
double maxValue)
column - The column for that the maximal width is setmaxValue - The maximal value wherea 1.0 means the column
can be as width as the tree table and 0.5 means the column
can be maximal half as width as the tree table.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||