org.yasl.layout
Class YASLLayoutUtils

java.lang.Object
  extended byorg.yasl.layout.YASLLayoutUtils

public class YASLLayoutUtils
extends Object

Collects static util methods for manipulating Layouts.


Method Summary
static Dimension determineMaxSize(JComponent[] items)
          Checks the preferred size for each item and returns a Dimension holding the largest width and height encountered.
static void normalizeComponents(JComponent[] components)
          Takes an array of JComponents and adjusts the preferred size such that all components are the same size, ie all components are the same size as the largest component.
static void normalizeComponentsHeight(JComponent[] components)
          Takes an array of JComponents and adjusts the preferred height such that all components have the same height, ie all components have the same height as the largest component.
static void normalizeComponentsWidth(JComponent[] components)
          Takes an array of JComponents and adjusts the preferred width such that all components have the same width, ie all components have the same width as the largest component.
static void setMaximumHeight(int height, JComponent[] items)
           
static void setMaximumSize(Dimension maxDim, JComponent[] items)
           
static void setMaximumWidth(int width, JComponent[] items)
           
static void setPreferredHeight(int height, JComponent[] items)
           
static void setPreferredSize(Dimension prefDim, JComponent[] items)
           
static void setPreferredWidth(int width, JComponent[] items)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

normalizeComponents

public static void normalizeComponents(JComponent[] components)
Takes an array of JComponents and adjusts the preferred size such that all components are the same size, ie all components are the same size as the largest component.

This is particularly useful for normalizing a row or column of buttons.

Parameters:
components - JComponent[]

normalizeComponentsWidth

public static void normalizeComponentsWidth(JComponent[] components)
Takes an array of JComponents and adjusts the preferred width such that all components have the same width, ie all components have the same width as the largest component.

Parameters:
components - JComponent[]

normalizeComponentsHeight

public static void normalizeComponentsHeight(JComponent[] components)
Takes an array of JComponents and adjusts the preferred height such that all components have the same height, ie all components have the same height as the largest component.

Parameters:
components - JComponent[]

determineMaxSize

public static Dimension determineMaxSize(JComponent[] items)
Checks the preferred size for each item and returns a Dimension holding the largest width and height encountered.

Parameters:
items - JComponent[]
Returns:
Dimension

setPreferredSize

public static void setPreferredSize(Dimension prefDim,
                                    JComponent[] items)

setMaximumSize

public static void setMaximumSize(Dimension maxDim,
                                  JComponent[] items)

setPreferredHeight

public static void setPreferredHeight(int height,
                                      JComponent[] items)

setMaximumHeight

public static void setMaximumHeight(int height,
                                    JComponent[] items)

setPreferredWidth

public static void setPreferredWidth(int width,
                                     JComponent[] items)

setMaximumWidth

public static void setMaximumWidth(int width,
                                   JComponent[] items)