public class ViewportLayout extends java.lang.Object implements java.awt.LayoutManager, java.io.Serializable
JViewport. The viewport makes its view the
same size as itself, but not smaller than its minimum size.
If the port extends extends into space past the edge of the view,
this layout manager moves the port up or to the left, in view space, by the
amount of empty space (keep the lower and right edges lined up).| Constructor and Description |
|---|
ViewportLayout() |
| Modifier and Type | Method and Description |
|---|---|
void |
addLayoutComponent(java.lang.String name,
java.awt.Component c)
The method is not used with this manager.
|
void |
layoutContainer(java.awt.Container parent)
Layout the view and viewport to respect the following rules.
|
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Get the minimum layout size.
|
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Get the preferred layout size.
|
void |
removeLayoutComponent(java.awt.Component c)
The method is not used with this manager.
|
public ViewportLayout()
public void addLayoutComponent(java.lang.String name, java.awt.Component c)
addLayoutComponent in interface java.awt.LayoutManagername - the name of the component to addc - the component to addpublic void removeLayoutComponent(java.awt.Component c)
removeLayoutComponent in interface java.awt.LayoutManagerc - the component to removepublic java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
Scrollable, this method returns
Scrollable.getPreferredScrollableViewportSize().
Otherwise, it returns Component.getPreferredSize().preferredLayoutSize in interface java.awt.LayoutManagerparent - the parent container to lay outLayoutManager.minimumLayoutSize(Container)public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
Component.getMinimumSize().
If the view is not set, the zero size is returned.minimumLayoutSize in interface java.awt.LayoutManagerparent - the viewportLayoutManager.preferredLayoutSize(Container)public void layoutContainer(java.awt.Container parent)
JViewport.setViewSize(Dimension), the view size is never
set smaller that its minimum size.layoutContainer in interface java.awt.LayoutManagerparent - the container to lay outJViewport.getViewSize(),
JViewport.setViewSize(java.awt.Dimension),
JViewport.getViewPosition(),
JViewport.setViewPosition(java.awt.Point)