Package org.jjazz.uiutilities.api
Class SingleComponentAspectRatioKeeperLayout
java.lang.Object
org.jjazz.uiutilities.api.SingleComponentAspectRatioKeeperLayout
- All Implemented Interfaces:
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:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayoutComponent
(String arg0, Component arg1) void
layoutContainer
(Container parent) minimumLayoutSize
(Container parent) preferredLayoutSize
(Container parent) void
removeLayoutComponent
(Component parent)
-
Constructor Details
-
SingleComponentAspectRatioKeeperLayout
public SingleComponentAspectRatioKeeperLayout()
-
-
Method Details
-
addLayoutComponent
- Specified by:
addLayoutComponent
in interfaceLayoutManager
-
layoutContainer
- Specified by:
layoutContainer
in interfaceLayoutManager
-
minimumLayoutSize
- Specified by:
minimumLayoutSize
in interfaceLayoutManager
-
preferredLayoutSize
- Specified by:
preferredLayoutSize
in interfaceLayoutManager
-
removeLayoutComponent
- Specified by:
removeLayoutComponent
in interfaceLayoutManager
-