java.lang.Object
com.iamsoft.util.ui.swing.OverlappingLayout
- All Implemented Interfaces:
- LayoutManager,- LayoutManager2,- Serializable
A 
CardLayout object is a layout manager for a
 container. It treats each component in the container as a card.
 Only one card is visible at a time, and the container acts as
 a stack of cards. The first component added to a
 CardLayout object is the visible component when the
 container is first displayed.
 
 The ordering of cards is determined by the container's own internal
 ordering of its component objects. CardLayout
 defines a set of methods that allow an application to flip
 through these cards sequentially, or to show a specified card.
 The addLayoutComponent(java.awt.Component, java.lang.Object)
 method can be used to associate a string identifier with a given card
 for fast random access.
- Since:
- JDK1.0
- Version:
- %I% %G%
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a new card layout with gaps of size zero.OverlappingLayout(int hgap, int vgap) Creates a new card layout with the specified horizontal and vertical gaps.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddLayoutComponent(Component comp, Object constraints) Adds the specified component to this card layout's internal table of names.voidaddLayoutComponent(String name, Component comp) Deprecated.intgetHgap()Gets the horizontal gap between components.floatgetLayoutAlignmentX(Container parent) Returns the alignment along the x axis.floatgetLayoutAlignmentY(Container parent) Returns the alignment along the y axis.intgetVgap()Gets the vertical gap between components.voidinvalidateLayout(Container target) Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.voidlayoutContainer(Container parent) Lays out the specified container using this card layout.maximumLayoutSize(Container target) Returns the maximum dimensions for this layout given the components in the specified target container.minimumLayoutSize(Container parent) Calculates the minimum size for the specified panel.preferredLayoutSize(Container parent) Determines the preferred size of the container argument using this card layout.voidRemoves the specified component from the layout.voidsetHgap(int hgap) Sets the horizontal gap between components.voidsetVgap(int vgap) Sets the vertical gap between components.toString()Returns a string representation of the state of this card layout.
- 
Constructor Details- 
OverlappingLayoutpublic OverlappingLayout()Creates a new card layout with gaps of size zero.
- 
OverlappingLayoutpublic OverlappingLayout(int hgap, int vgap) Creates a new card layout with the specified horizontal and vertical gaps. The horizontal gaps are placed at the left and right edges. The vertical gaps are placed at the top and bottom edges.- Parameters:
- hgap- the horizontal gap.
- vgap- the vertical gap.
 
 
- 
- 
Method Details- 
getHgappublic int getHgap()Gets the horizontal gap between components.- Returns:
- the horizontal gap between components.
- Since:
- JDK1.1
- See Also:
 
- 
setHgappublic void setHgap(int hgap) Sets the horizontal gap between components.- Parameters:
- hgap- the horizontal gap between components.
- Since:
- JDK1.1
- See Also:
 
- 
getVgappublic int getVgap()Gets the vertical gap between components.- Returns:
- the vertical gap between components.
- See Also:
 
- 
setVgappublic void setVgap(int vgap) Sets the vertical gap between components.- Parameters:
- vgap- the vertical gap between components.
- Since:
- JDK1.1
- See Also:
 
- 
addLayoutComponentAdds the specified component to this card layout's internal table of names. The object specified byconstraintsmust be a string. The card layout stores this string as a key-value pair that can be used for random access to a particular card. By calling theshowmethod, an application can display the component with the specified name.- Specified by:
- addLayoutComponentin interface- LayoutManager2
- Parameters:
- comp- the component to be added.
- constraints- a tag that identifies a particular card in the layout.
- Throws:
- IllegalArgumentException- if the constraint is not a string.
- See Also:
 
- 
addLayoutComponentDeprecated.replaced byaddLayoutComponent(Component, Object).- Specified by:
- addLayoutComponentin interface- LayoutManager
 
- 
removeLayoutComponentRemoves the specified component from the layout. If the card was visible on top, the next card underneath it is shown.- Specified by:
- removeLayoutComponentin interface- LayoutManager
- Parameters:
- comp- the component to be removed.
- See Also:
 
- 
preferredLayoutSizeDetermines the preferred size of the container argument using this card layout.- Specified by:
- preferredLayoutSizein interface- LayoutManager
- Parameters:
- parent- the parent container in which to do the layout
- Returns:
- the preferred dimensions to lay out the subcomponents of the specified container
- See Also:
 
- 
minimumLayoutSizeCalculates the minimum size for the specified panel.- Specified by:
- minimumLayoutSizein interface- LayoutManager
- Parameters:
- parent- the parent container in which to do the layout
- Returns:
- the minimum dimensions required to lay out the subcomponents of the specified container
- See Also:
 
- 
maximumLayoutSizeReturns the maximum dimensions for this layout given the components in the specified target container.- Specified by:
- maximumLayoutSizein interface- LayoutManager2
- Parameters:
- target- the component which needs to be laid out
- See Also:
 
- 
getLayoutAlignmentXReturns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.- Specified by:
- getLayoutAlignmentXin interface- LayoutManager2
 
- 
getLayoutAlignmentYReturns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. The value should be a number between 0 and 1 where 0 represents alignment along the origin, 1 is aligned the furthest away from the origin, 0.5 is centered, etc.- Specified by:
- getLayoutAlignmentYin interface- LayoutManager2
 
- 
invalidateLayoutInvalidates the layout, indicating that if the layout manager has cached information it should be discarded.- Specified by:
- invalidateLayoutin interface- LayoutManager2
 
- 
layoutContainerLays out the specified container using this card layout.Each component in the parentcontainer is reshaped to be the size of the container, minus space for surrounding insets, horizontal gaps, and vertical gaps.- Specified by:
- layoutContainerin interface- LayoutManager
- Parameters:
- parent- the parent container in which to do the layout
- See Also:
 
- 
toStringReturns a string representation of the state of this card layout.
 
- 
addLayoutComponent(Component, Object).