Package com.portal.pfc.ui.wizard
Class DeckLayout
java.lang.Object
java.awt.CardLayout
com.portal.pfc.ui.wizard.DeckLayout
- All Implemented Interfaces:
LayoutManager
,LayoutManager2
,Serializable
DeckLayout treats each component in the container as a card.
Only one card is visible at a time, and the container acts
like a deck of cards.
The ordering of cards is determined by the container's own
internal ordering of its component objects. DeckLayout
defines a set of methods that allow an application to flip
through the cards sequentially, or to show a specified card.
The addLayoutComponent method can be used to associate a
string identifier with a given card for faster random access.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLayoutComponent
(Component comp, Object constraints) Adds the specified component to this deck layout's internal table, by name.void
addLayoutComponent
(String name, Component comp) Deprecated.replaced by addLayoutComponent(Component, Object)void
Flips to the first card of the container.getComponent
(String name) Get the component whose name is specifiedint
Get the index of the component specified in the component heirarchy of the container specifiedGet the name of the component specified in the component heirarchy of the container specifiedvoid
Flips to the last card of the container.void
layoutContainer
(Container parent) Lays out the specified container using this deck layout.minimumLayoutSize
(Container parent) Calculates the minimum size for the specified panel.void
Flips to the next card of the specified container.preferredLayoutSize
(Container parent) Calculates the preferred size for the specified panel.void
Flips to the previous card of the specified container.void
Removes the specified component from the layout.void
Flips to the component at the numbered position.void
Flips to the component that was added to this layout using the specified name.Methods inherited from class java.awt.CardLayout
getHgap, getLayoutAlignmentX, getLayoutAlignmentY, getVgap, invalidateLayout, maximumLayoutSize, setHgap, setVgap, toString
-
Field Details
-
mCompMap
-
-
Constructor Details
-
DeckLayout
public DeckLayout()
-
-
Method Details
-
addLayoutComponent
Adds the specified component to this deck layout's internal table, by name. The object specified by constraints must be a string. The deck layout stores this string as a key-value pair that can be used for random access to a particular card. By calling the show method, an application can display the component with the specified name.- Specified by:
addLayoutComponent
in interfaceLayoutManager2
- Overrides:
addLayoutComponent
in classCardLayout
- Parameters:
comp
- The component to be added.constraints
- A name that identifies the component
-
addLayoutComponent
Deprecated.replaced by addLayoutComponent(Component, Object)- Specified by:
addLayoutComponent
in interfaceLayoutManager
- Overrides:
addLayoutComponent
in classCardLayout
-
removeLayoutComponent
Removes the specified component from the layout.- Specified by:
removeLayoutComponent
in interfaceLayoutManager
- Overrides:
removeLayoutComponent
in classCardLayout
- Parameters:
comp
- The component to be removed.
-
preferredLayoutSize
Calculates the preferred size for the specified panel.- Specified by:
preferredLayoutSize
in interfaceLayoutManager
- Overrides:
preferredLayoutSize
in classCardLayout
- Parameters:
parent
- The name of the parent container- Returns:
- minimum dimensions required to lay out the components.
-
minimumLayoutSize
Calculates the minimum size for the specified panel.- Specified by:
minimumLayoutSize
in interfaceLayoutManager
- Overrides:
minimumLayoutSize
in classCardLayout
- Parameters:
parent
- The name of the parent container- Returns:
- minimum dimensions required to lay out the components.
-
layoutContainer
Lays out the specified container using this deck layout. Each component in the parent container is reshaped to be the same size as the container, minus insets, horizontal and vertical gaps.- Specified by:
layoutContainer
in interfaceLayoutManager
- Overrides:
layoutContainer
in classCardLayout
- Parameters:
parent
- The name of the parent container
-
first
Flips to the first card of the container.- Overrides:
first
in classCardLayout
- Parameters:
parent
- The name of the parent container
-
next
Flips to the next card of the specified container. If the currently visible card is the last one, this method flips to the first card in the layout.- Overrides:
next
in classCardLayout
- Parameters:
parent
- The name of the parent container
-
previous
Flips to the previous card of the specified container. If the currently visible card is the first one, this method flips to the last card in the layout.- Overrides:
previous
in classCardLayout
- Parameters:
parent
- The name of the parent container
-
last
Flips to the last card of the container.- Overrides:
last
in classCardLayout
- Parameters:
parent
- The name of the parent container
-
show
Flips to the component that was added to this layout using the specified name. If no such component exists, nothing happens.- Overrides:
show
in classCardLayout
- Parameters:
parent
- The name of the parent container in which to do the layout.name
- The component name.
-
show
Flips to the component at the numbered position. If no such component exists, nothing happens.- Parameters:
parent
- The name of the parent container in which to do the layout.index
- The index (between 0 and component count - 1)
-
getComponent
Get the component whose name is specified- Parameters:
name
- of the component to be retrieved- Returns:
- The component
-
getName
Get the name of the component specified in the component heirarchy of the container specified- Parameters:
parent
- The parent containerindex
- The index of the component whose name is asked for- Returns:
- The name
-
getIndex
Get the index of the component specified in the component heirarchy of the container specified- Parameters:
parent
- The parent containername
- The name of the component whose index is asked for- Returns:
- The index
-