net.sourceforge.geeboss.util
Class LayoutUtil

java.lang.Object
  extended by net.sourceforge.geeboss.util.LayoutUtil

public class LayoutUtil
extends java.lang.Object

Factory class for some LayoutData concerns in Geeboss.


Method Summary
static void centerShell(org.eclipse.swt.widgets.Display display, org.eclipse.swt.widgets.Shell shell)
          Center a shell on the monitor
static org.eclipse.swt.layout.FillLayout createFillLayout(int marginWidth, int marginHeight)
          Create a new FillLayout with the given parameters
static org.eclipse.swt.layout.GridLayout createGridLayout(int rows)
          Create a new GridLayout with the given parameters
static org.eclipse.swt.layout.GridLayout createGridLayout(int rows, int marginWidth)
          Create a new GridLayout with the given parameters
static org.eclipse.swt.layout.GridLayout createGridLayout(int rows, int marginWidth, int marginHeight)
          Create a new GridLayout with the given parameters
static org.eclipse.swt.layout.GridLayout createGridLayout(int rows, int marginWidth, int marginHeight, boolean makeColumnsEqualWidth)
          Create a new GridLayout with the given parameters
static org.eclipse.swt.layout.GridLayout createGridLayout(int rows, int marginWidth, int marginHeight, int verticalSpacing)
          Create a new GridLayout with the given parameters
static org.eclipse.swt.layout.GridLayout createGridLayout(int rows, int marginWidth, int marginHeight, int verticalSpacing, int horizontalSpacing, boolean makeColumnsEqualWidth)
          Create a new GridLayout with the given parameters
static void packAll(org.eclipse.swt.widgets.Control control)
          Pack all controls and sub composites
static void positionShell(org.eclipse.swt.widgets.Shell shell)
          Sets the initial location to use for the shell.
static void positionShell(org.eclipse.swt.widgets.Shell shell, boolean computeSize)
          Sets the initial location to use for the shell.
static void positionShell(org.eclipse.swt.widgets.Shell shell, boolean computeSize, int sameDialogCount)
          Sets the initial location to use for the shell.
static void setDialogSpacer(org.eclipse.swt.widgets.Composite composite, int cols, int rows)
          Set invisible labels as spacer to a composite.
static void setLayoutForAll(org.eclipse.swt.widgets.Control control)
          Recursivly update layout for given control and childs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

centerShell

public static void centerShell(org.eclipse.swt.widgets.Display display,
                               org.eclipse.swt.widgets.Shell shell)
Center a shell on the monitor

Parameters:
display - The display
shell - The shell to center

createFillLayout

public static org.eclipse.swt.layout.FillLayout createFillLayout(int marginWidth,
                                                                 int marginHeight)
Create a new FillLayout with the given parameters

Parameters:
marginWidth - Margin width in pixel
marginHeight - Margin height in pixel
Returns:
FillLayout New FillLayout with the given parameters

createGridLayout

public static org.eclipse.swt.layout.GridLayout createGridLayout(int rows)
Create a new GridLayout with the given parameters

Parameters:
rows - The number of rows
Returns:
GridLayout New GridLayout with the given parameters

createGridLayout

public static org.eclipse.swt.layout.GridLayout createGridLayout(int rows,
                                                                 int marginWidth)
Create a new GridLayout with the given parameters

Parameters:
rows - The number of rows
marginWidth - Margin width in pixel
Returns:
GridLayout New GridLayout with the given parameters

createGridLayout

public static org.eclipse.swt.layout.GridLayout createGridLayout(int rows,
                                                                 int marginWidth,
                                                                 int marginHeight)
Create a new GridLayout with the given parameters

Parameters:
rows - The number of rows
marginWidth - Margin width in pixel
marginHeight - Margin height in pixel
Returns:
GridLayout New GridLayout with the given parameters

createGridLayout

public static org.eclipse.swt.layout.GridLayout createGridLayout(int rows,
                                                                 int marginWidth,
                                                                 int marginHeight,
                                                                 boolean makeColumnsEqualWidth)
Create a new GridLayout with the given parameters

Parameters:
rows - The number of rows
marginWidth - Margin width in pixel
marginHeight - Margin height in pixel
makeColumnsEqualWidth - true if columns should be equals in size
Returns:
GridLayout New GridLayout with the given parameters

createGridLayout

public static org.eclipse.swt.layout.GridLayout createGridLayout(int rows,
                                                                 int marginWidth,
                                                                 int marginHeight,
                                                                 int verticalSpacing)
Create a new GridLayout with the given parameters

Parameters:
rows - The number of rows
marginWidth - Margin width in pixel
marginHeight - Margin height in pixel
verticalSpacing - Vertical spacing in pixel
Returns:
GridLayout New GridLayout with the given parameters

createGridLayout

public static org.eclipse.swt.layout.GridLayout createGridLayout(int rows,
                                                                 int marginWidth,
                                                                 int marginHeight,
                                                                 int verticalSpacing,
                                                                 int horizontalSpacing,
                                                                 boolean makeColumnsEqualWidth)
Create a new GridLayout with the given parameters

Parameters:
rows - The number of rows
marginWidth - Margin width in pixel
marginHeight - Margin height in pixel
verticalSpacing - Vertical spacing in pixel
horizontalSpacing - Horizontal spacing in pixel
makeColumnsEqualWidth - true if columns should be equals in size
Returns:
GridLayout New GridLayout with the given parameters

packAll

public static void packAll(org.eclipse.swt.widgets.Control control)
Pack all controls and sub composites

Parameters:
control - Control to start

positionShell

public static void positionShell(org.eclipse.swt.widgets.Shell shell)
Sets the initial location to use for the shell. The default implementation centers the shell horizontally (1/2 of the difference to the left and 1/2 to the right) and vertically (1/3 above and 2/3 below) relative to the parent shell

Parameters:
shell - The shell to set the location

positionShell

public static void positionShell(org.eclipse.swt.widgets.Shell shell,
                                 boolean computeSize)
Sets the initial location to use for the shell. The default implementation centers the shell horizontally (1/2 of the difference to the left and 1/2 to the right) and vertically (1/3 above and 2/3 below) relative to the parent shell

Parameters:
shell - The shell to set the location
computeSize - If true, initialSize is computed from the Shell

positionShell

public static void positionShell(org.eclipse.swt.widgets.Shell shell,
                                 boolean computeSize,
                                 int sameDialogCount)
Sets the initial location to use for the shell. The default implementation centers the shell horizontally (1/2 of the difference to the left and 1/2 to the right) and vertically (1/3 above and 2/3 below) relative to the parent shell

Parameters:
shell - The shell to set the location
computeSize - If true, initialSize is computed from the Shell
sameDialogCount - In the case the same dialog is opened more than once, do not position the Shells on the same position. The sameDialogCount integer tells how many dialogs of the same kind are already open. This number is used to move the new dialog by some pixels.

setDialogSpacer

public static void setDialogSpacer(org.eclipse.swt.widgets.Composite composite,
                                   int cols,
                                   int rows)
Set invisible labels as spacer to a composite. The labels will grab vertical space.

Parameters:
composite - The control to add the spacer into
cols - Is used as horizontal span in the GridData
rows - Number of labels that are created

setLayoutForAll

public static void setLayoutForAll(org.eclipse.swt.widgets.Control control)
Recursivly update layout for given control and childs

Parameters:
control - The control to set the layout


Copyright (c) 2005 The Geeboss team (http://geeboss.sourceforge.net). All Rights Reserved.