net.refractions.udig.ui.graphics
Class TableUtils

java.lang.Object
  extended by net.refractions.udig.ui.graphics.TableUtils

public class TableUtils
extends java.lang.Object

Utility class for dealing with the resizing of table columns.

Since:
1.0.1
Author:
chorner

Field Summary
static int MODE_AUTO
          Columns are automatically sized, and adjusted to fit into the TableSettings bounds.
static int MODE_JUMP
          We start off with MODE_AUTO, but switch to MODE_LAZY when the user modifies a column size (listener required).
static int MODE_LAZY
          The columns are left as is unless they exceed the bounds set by the TableSettings.
 
Constructor Summary
TableUtils()
           
 
Method Summary
static void resizeColumns(Table table, TableSettings settings, int mode)
          Given a table, this method resizes the columns as specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MODE_LAZY

public static final int MODE_LAZY
The columns are left as is unless they exceed the bounds set by the TableSettings.

See Also:
Constant Field Values

MODE_AUTO

public static final int MODE_AUTO
Columns are automatically sized, and adjusted to fit into the TableSettings bounds.

See Also:
Constant Field Values

MODE_JUMP

public static final int MODE_JUMP
We start off with MODE_AUTO, but switch to MODE_LAZY when the user modifies a column size (listener required).

See Also:
Constant Field Values
Constructor Detail

TableUtils

public TableUtils()
Method Detail

resizeColumns

public static void resizeColumns(Table table,
                                 TableSettings settings,
                                 int mode)
Given a table, this method resizes the columns as specified. Although automatic column sizing works well under Linux , it does not work well under Windows and Mac OSX and hence this method is needed (in particular, an empty column on the right appears under Win).

Parameters:
table -
settings - the configured settings for the table (column min, max, etc)
mode - one of MODE_AUTO, MODE_LAZY , MODE_JUMP