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 TypeMethodDescriptionvoidaddLayoutComponent(Component comp, Object constraints) Adds the specified component to this deck layout's internal table, by name.voidaddLayoutComponent(String name, Component comp) Deprecated.replaced by addLayoutComponent(Component, Object)voidFlips to the first card of the container.getComponent(String name) Get the component whose name is specifiedintGet 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 specifiedvoidFlips to the last card of the container.voidlayoutContainer(Container parent) Lays out the specified container using this deck layout.minimumLayoutSize(Container parent) Calculates the minimum size for the specified panel.voidFlips to the next card of the specified container.preferredLayoutSize(Container parent) Calculates the preferred size for the specified panel.voidFlips to the previous card of the specified container.voidRemoves the specified component from the layout.voidFlips to the component at the numbered position.voidFlips 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:
addLayoutComponentin interfaceLayoutManager2- Overrides:
addLayoutComponentin classCardLayout- Parameters:
comp- The component to be added.constraints- A name that identifies the component
-
addLayoutComponent
Deprecated.replaced by addLayoutComponent(Component, Object)- Specified by:
addLayoutComponentin interfaceLayoutManager- Overrides:
addLayoutComponentin classCardLayout
-
removeLayoutComponent
Removes the specified component from the layout.- Specified by:
removeLayoutComponentin interfaceLayoutManager- Overrides:
removeLayoutComponentin classCardLayout- Parameters:
comp- The component to be removed.
-
preferredLayoutSize
Calculates the preferred size for the specified panel.- Specified by:
preferredLayoutSizein interfaceLayoutManager- Overrides:
preferredLayoutSizein 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:
minimumLayoutSizein interfaceLayoutManager- Overrides:
minimumLayoutSizein 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:
layoutContainerin interfaceLayoutManager- Overrides:
layoutContainerin classCardLayout- Parameters:
parent- The name of the parent container
-
first
Flips to the first card of the container.- Overrides:
firstin 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:
nextin 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:
previousin classCardLayout- Parameters:
parent- The name of the parent container
-
last
Flips to the last card of the container.- Overrides:
lastin 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:
showin 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
-