org.openbp.swing.components.treetable.resize
Class RatioConstraint

java.lang.Object
  extended by org.openbp.swing.components.treetable.resize.ColumnSizeConstraint
      extended by org.openbp.swing.components.treetable.resize.RatioConstraint

public class RatioConstraint
extends ColumnSizeConstraint

Constrain to divide the space the columns on a ratio. If there is no ratio, the columns are divided evenly.

Author:
Baumgartner Michael

Field Summary
 
Fields inherited from class org.openbp.swing.components.treetable.resize.ColumnSizeConstraint
absoluteMinSize, columnSizes, MAX, MIN, minSizeOfColumns, PREFERRED, treeColumnMaxWidth
 
Constructor Summary
RatioConstraint(boolean firstColumnFull)
          Constructor.
RatioConstraint(int[] ratio, boolean firstColumnFull)
          Constructor.
 
Method Summary
 void calculateColumnSizes(JTreeTable treetable)
          Initialises the arrays needed for the calculations.
 
Methods inherited from class org.openbp.swing.components.treetable.resize.ColumnSizeConstraint
addMaxSizeForColumn, adjustMaximalWidthOfColumn, adjustPreferredToWidth, determineMaxColumnWidth, determineMaxTreeColumnWidth, getAbsoluteMinimum, getMaxWidthOfColumn, getMinWidthOfColumn, getPreferredWidthOfColumn, isRecalculateNeeded, setAboluteMinimun, setColumnWidth, setMinimumOfColumn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RatioConstraint

public RatioConstraint(boolean firstColumnFull)
Constructor. Only the first column is shown fully. The other are evenly distributed.

Parameters:
firstColumnFull - Flag to show the fist column, true Set the size to the maximal width of the column false all columns are evenly distributed

RatioConstraint

public RatioConstraint(int[] ratio,
                       boolean firstColumnFull)
Constructor. Divide the available space on a ratio for each column

Parameters:
ratio - The ratio for the columns. If the first column is shown fully, then the first ratio is ignored. If there are not enought ratios for the table, the other get a ratio of one. All ratios tha exceed the column count are ignored.
firstColumnFull - Flag to show the fist column,
Method Detail

calculateColumnSizes

public void calculateColumnSizes(JTreeTable treetable)
Initialises the arrays needed for the calculations.

Overrides:
calculateColumnSizes in class ColumnSizeConstraint
Parameters:
treetable - The treetable


Copyright © 2011. All Rights Reserved.