|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgov.nasa.gsfc.drl.rtstps.library.layout.DeckLayout
public class DeckLayout
This layout manager is a CardLayout substitute. If fixes one bug in removeComponent() and has enhanced capabilities. When you add components to a container that is using DeckLayout, you must add a constraint, which is a string that is a unique name for the component. DeckLayout stores the components in a list in the order in which they are added to the layout.
Nested Class Summary | |
---|---|
(package private) class |
DeckLayout.Info
An internal class with no expected public access. |
Field Summary | |
---|---|
private java.awt.Container |
_container
The container I am laying out. |
private java.util.ArrayList<DeckLayout.Info> |
_data
A list of all components (Info) controlled by this layout manager. |
private java.awt.Insets |
_insets
My insets. |
private int |
_showing
Index of the current visible component. |
private static java.awt.Dimension |
MAXLAYOUTSIZE
|
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
DeckLayout(java.awt.Container parent)
The DeckLayout constructor. |
Method Summary | |
---|---|
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraint)
Add a component to the layout. |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Add a component to the layout. |
private int |
find(java.lang.String name)
Find a component by name in my internal list. |
java.awt.Component |
getComponent(java.lang.String name)
Get the component with the passed name. |
java.awt.Component |
getFirstComponent()
Get the first component. |
java.awt.Component |
getLastComponent()
Get the last component. |
float |
getLayoutAlignmentX(java.awt.Container parent)
Get DeckLayout's X alignment. |
float |
getLayoutAlignmentY(java.awt.Container parent)
Get DeckLayout's Y alignment. |
java.awt.Component |
getNextComponent()
Get the next component after the currently showing one. |
java.awt.Component |
getPreviousComponent()
Get the component that precedes the currently showing one. |
java.awt.Component |
getVisibleComponent()
Get the currently visible component. |
int |
getVisibleComponentIndex()
Get the name index of the currently visible component. |
java.lang.String |
getVisibleComponentName()
Get the name of the currently visible component. |
void |
invalidateLayout(java.awt.Container parent)
Invalidate the layout. |
boolean |
isFirstShowing()
Determine if the first component is currently showing. |
boolean |
isLastShowing()
Determine if the last component is currently showing. |
void |
layoutContainer(java.awt.Container parent)
Lay out the components in the parent container. |
java.awt.Dimension |
maximumLayoutSize(java.awt.Container parent)
Get the maximum layout size. |
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 comp)
Remove a component from the layout. |
void |
setInsets(java.awt.Insets i)
Set a blank border. |
private void |
show(int index)
Show the component identified by the name index. |
void |
show(java.lang.String name)
Show the component with the passed component name. |
void |
showFirst()
Show the first component. |
void |
showLast()
Show the last component. |
void |
showNext()
Show the next component after the currently showing one. |
void |
showPrevious()
Show the component that precedes the currently showing one. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.awt.Dimension MAXLAYOUTSIZE
private java.util.ArrayList<DeckLayout.Info> _data
private int _showing
private java.awt.Insets _insets
private java.awt.Container _container
private static final long serialVersionUID
Constructor Detail |
---|
public DeckLayout(java.awt.Container parent)
parent
- The container that uses this layout manager.Method Detail |
---|
public void addLayoutComponent(java.awt.Component comp, java.lang.Object constraint)
addLayoutComponent
in interface java.awt.LayoutManager2
comp
- The component to be addedconstraint
- This must be a string. It is a label by which
DeckLayout references the component. It must be unique.public final void addLayoutComponent(java.lang.String name, java.awt.Component comp)
addLayoutComponent
in interface java.awt.LayoutManager
name
- This string is a label by which DeckLayout references the
component. It must be unique.comp
- The component to be addedprivate final int find(java.lang.String name)
public final void setInsets(java.awt.Insets i)
public void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize
in interface java.awt.LayoutManager
public java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize
in interface java.awt.LayoutManager
public java.awt.Dimension maximumLayoutSize(java.awt.Container parent)
maximumLayoutSize
in interface java.awt.LayoutManager2
public final float getLayoutAlignmentX(java.awt.Container parent)
getLayoutAlignmentX
in interface java.awt.LayoutManager2
public final float getLayoutAlignmentY(java.awt.Container parent)
getLayoutAlignmentY
in interface java.awt.LayoutManager2
public void invalidateLayout(java.awt.Container parent)
invalidateLayout
in interface java.awt.LayoutManager2
public void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
private void show(int index)
public void showFirst()
public java.awt.Component getFirstComponent()
public void showNext()
public java.awt.Component getNextComponent()
public void showPrevious()
public java.awt.Component getPreviousComponent()
public void showLast()
public java.awt.Component getLastComponent()
public java.awt.Component getVisibleComponent()
public int getVisibleComponentIndex()
public boolean isLastShowing()
public boolean isFirstShowing()
public java.lang.String getVisibleComponentName()
public void show(java.lang.String name)
public java.awt.Component getComponent(java.lang.String name)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |