@@ -0,0 +1,1815 @@
+package bdv.ui;%0A%0Aimport java.awt.Color;%0Aimport java.awt.Component;%0Aimport java.awt.Dimension;%0A%0A/**%0A * AWT/Swing helpers.%0A *%0A * @author Tobias Pietzsch%0A */%0Apublic class UIUtils%0A%7B%0A%09/**%0A%09 * Mix colors %7B@code c1%7D and %7B@code c2%7D by ratios %7B@code c1Weight%7D and %7B@code (1-c1Weight)%7D, respectively.%0A%09 */%0A%09public static Color mix( final Color c1, final Color c2, final double c1Weight )%0A%09%7B%0A%09%09final double c2Weight = 1.0 - c1Weight;%0A%09%09return new Color(%0A%09%09%09%09( int ) ( c1.getRed() * c1Weight + c2.getRed() * c2Weight ),%0A%09%09%09%09( int ) ( c1.getGreen() * c1Weight + c2.getGreen() * c2Weight ),%0A%09%09%09%09( int ) ( c1.getBlue() * c1Weight + c2.getBlue() * c2Weight ) );%0A%09%7D%0A%0A%09/**%0A%09 * Set the preferred width of a component (leaving the preferred height untouched).%0A%09 */%0A%09public static void setPreferredWidth( final Component component, final int preferredWidth )%0A%09%7B%0A%09%09component.setPreferredSize( new Dimension( preferredWidth, component.getPreferredSize().height ) );%0A%09%7D%0A%0A%09/**%0A%09 * Set the preferred height of a component (leaving the preferred width untouched).%0A%09 */%0A%09public static void setPreferredHeight( final Component component, final int preferredHeight )%0A%09%7B%0A%09%09component.setPreferredSize( new Dimension( component.getPreferredSize().width, preferredHeight ) );%0A%09%7D%0A%0A%09/**%0A%09 * Set the minimum width of a component (leaving the minimum height untouched).%0A%09 */%0A%09public static void setMinimumWidth( final Component component, final int minimumWidth )%0A%09%7B%0A%09%09component.setMinimumSize( new Dimension( minimumWidth, component.getMinimumSize().height ) );%0A%09%7D%0A%0A%09/**%0A%09 * Set the minimum height of a component (leaving the minimum width untouched).%0A%09 */%0A%09public static void setMinimumHeight( final Component component, final int minimumHeight )%0A%09%7B%0A%09%09component.setMinimumSize( new Dimension( component.getMinimumSize().width, minimumHeight ) );%0A%09%7D%0A%7D%0A

Add UIUtils helpers