org.fuin.utils4swing.layout.scalable
Class ScalableLayoutUtils

java.lang.Object
  extended by org.fuin.utils4swing.layout.scalable.ScalableLayoutUtils

public final class ScalableLayoutUtils
extends java.lang.Object

Utils for the package.


Method Summary
static void installScalableLayout(ScalableLayoutRegistry registry, java.awt.Container container)
          Install the appropriate scalable layout on the container.
static void installScalableLayoutAndKeys(ScalableLayoutRegistry registry, javax.swing.RootPaneContainer rootPaneContainer, double step)
          Install the appropriate scalable layout on the content pane of the RootPaneContainer and it's sub containers.
static void installScalableLayoutRecursive(ScalableLayoutRegistry registry, java.awt.Container container)
          Install the appropriate scalable layout on the container and it's sub containers.
static void installScaleKeys(javax.swing.RootPaneContainer rootPaneContainer, AbstractScalableLayout layout, double step)
          Install two key strokes (CTRL+ and CTRL-) for scaling the layout up and down on the content pane of the root pane container.
static java.awt.Dimension scale(java.awt.Dimension dim, double factor)
          Scales the dimension.
static java.awt.Font scale(java.awt.Font font, double factor)
          Scales the font.
static void scale(java.awt.Insets current, java.awt.Insets original, double factor)
          Scales the insets.
static int scale(int value, double factor)
          Scales a value.
static java.awt.Rectangle scale(java.awt.Rectangle rect, double factor)
          Scales the rectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

scale

public static java.awt.Font scale(java.awt.Font font,
                                  double factor)
Scales the font.

Parameters:
font - Font to scale.
factor - Factor to use.
Returns:
New instance with scaled size.

scale

public static java.awt.Rectangle scale(java.awt.Rectangle rect,
                                       double factor)
Scales the rectangle.

Parameters:
rect - Rectangle to scale.
factor - Factor to use.
Returns:
New instance with scaled sizes.

scale

public static java.awt.Dimension scale(java.awt.Dimension dim,
                                       double factor)
Scales the dimension.

Parameters:
dim - Dimension to scale.
factor - Factor to use.
Returns:
New instance with scaled sizes.

scale

public static int scale(int value,
                        double factor)
Scales a value.

Parameters:
value - Value to scale.
factor - Factor to use.
Returns:
New instance with scaled sizes.

scale

public static void scale(java.awt.Insets current,
                         java.awt.Insets original,
                         double factor)
Scales the insets.

Parameters:
current - Insets that will be changed (result insets).
original - Insets that will be used with the factor.
factor - Factor to use.

installScaleKeys

public static void installScaleKeys(javax.swing.RootPaneContainer rootPaneContainer,
                                    AbstractScalableLayout layout,
                                    double step)
Install two key strokes (CTRL+ and CTRL-) for scaling the layout up and down on the content pane of the root pane container.

Parameters:
rootPaneContainer - The content pane of this root pane container will be used to install the keys on. The root pane container itself will also be scaled.
layout - Layout to scale.
step - Scaling steps (For example 0.1 is a good value).

installScalableLayout

public static void installScalableLayout(ScalableLayoutRegistry registry,
                                         java.awt.Container container)
Install the appropriate scalable layout on the container.

Parameters:
registry - Registry to use.
container - Container to replace the existing layout with a scalable layout.

installScalableLayoutRecursive

public static void installScalableLayoutRecursive(ScalableLayoutRegistry registry,
                                                  java.awt.Container container)
Install the appropriate scalable layout on the container and it's sub containers.

Parameters:
registry - Registry to use.
container - Container to replace the existing layout with a scalable layout.

installScalableLayoutAndKeys

public static void installScalableLayoutAndKeys(ScalableLayoutRegistry registry,
                                                javax.swing.RootPaneContainer rootPaneContainer,
                                                double step)
Install the appropriate scalable layout on the content pane of the RootPaneContainer and it's sub containers. Additionally installScaleKeys(JComponent component, AbstractScalableLayout, double) is called to install scaling keys on the content pane.

Parameters:
registry - Registry to use.
rootPaneContainer - Content pane of this root pane container will be used. The content is expected to be a JComponent!
step - Scaling steps (For example 0.1 is a good value).


Copyright © 2011 Future Invent Informationsmanagement GmbH. All Rights Reserved.