net.java.sip.communicator.util.swing
Class FitLayout
java.lang.Object
net.java.sip.communicator.util.swing.FitLayout
- All Implemented Interfaces:
- LayoutManager
- Direct Known Subclasses:
- VideoLayout
public class FitLayout
- extends Object
- implements LayoutManager
Represents a LayoutManager which centers the first
Component within its Container and, if the
preferred size of the Component is larger than the size of the
Container, scales the former within the bounds of the latter
while preserving the aspect ratio. FitLayout is appropriate for
Containers which display a single image or video
Component in its entirety for which preserving the aspect ratio
is important.
- Author:
- Lyubomir Marinov
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FitLayout
public FitLayout()
addLayoutComponent
public void addLayoutComponent(String name,
Component comp)
- Specified by:
addLayoutComponent in interface LayoutManager
getComponent
protected Component getComponent(Container parent)
- Gets the first
Component of a specific
Container if there is such a Component.
- Parameters:
parent - the Container to retrieve the first
Component of
- Returns:
- the first
Component of a specific
Container if there is such a Component;
otherwise, null
layoutComponent
protected void layoutComponent(Component component,
Rectangle bounds,
float alignmentX,
float alignmentY)
layoutContainer
public void layoutContainer(Container parent)
- Specified by:
layoutContainer in interface LayoutManager
layoutContainer
protected void layoutContainer(Container parent,
float componentAlignmentX)
minimumLayoutSize
public Dimension minimumLayoutSize(Container parent)
- Specified by:
minimumLayoutSize in interface LayoutManager
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
- Specified by:
preferredLayoutSize in interface LayoutManager
removeLayoutComponent
public void removeLayoutComponent(Component comp)
- Specified by:
removeLayoutComponent in interface LayoutManager
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.