Class SingleComponentAspectRatioKeeperLayout

java.lang.Object
org.jjazz.uiutilities.api.SingleComponentAspectRatioKeeperLayout
All Implemented Interfaces:
LayoutManager

public class SingleComponentAspectRatioKeeperLayout extends Object implements LayoutManager
A Swing Layout that will shrink or enlarge to keep the content of a container while keeping it's aspect ratio.

The caveat is that only a single component is supported or an exception will be thrown. This is the component's Component.getPreferredSize() method that must return the correct ratio. The preferredSize will not be preserved but the ratio will.

Author: