public class DeckLayout extends CardLayout
Constructor and Description |
---|
DeckLayout() |
Modifier and Type | Method and Description |
---|---|
void |
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 |
first(Container parent)
Flips to the first card of the container.
|
Component |
getComponent(String name)
Get the component whose name is specified
|
int |
getIndex(Container parent,
String name)
Get the index of the component specified in the component heirarchy of
the container specified
|
String |
getName(Container parent,
int index)
Get the name of the component specified in the component heirarchy of
the container specified
|
void |
last(Container parent)
Flips to the last card of the container.
|
void |
layoutContainer(Container parent)
Lays out the specified container using this deck layout.
|
Dimension |
minimumLayoutSize(Container parent)
Calculates the minimum size for the specified panel.
|
void |
next(Container parent)
Flips to the next card of the specified container.
|
Dimension |
preferredLayoutSize(Container parent)
Calculates the preferred size for the specified panel.
|
void |
previous(Container parent)
Flips to the previous card of the specified container.
|
void |
removeLayoutComponent(Component comp)
Removes the specified component from the layout.
|
void |
show(Container parent,
int index)
Flips to the component at the numbered position.
|
void |
show(Container parent,
String name)
Flips to the component that was added to this layout using
the specified name.
|
getHgap, getLayoutAlignmentX, getLayoutAlignmentY, getVgap, invalidateLayout, maximumLayoutSize, setHgap, setVgap, toString
protected HashMap mCompMap
public void addLayoutComponent(Component comp, Object constraints)
addLayoutComponent
in interface LayoutManager2
addLayoutComponent
in class CardLayout
comp
- The component to be added.constraints
- A name that identifies the componentpublic void addLayoutComponent(String name, Component comp)
addLayoutComponent
in interface LayoutManager
addLayoutComponent
in class CardLayout
public void removeLayoutComponent(Component comp)
removeLayoutComponent
in interface LayoutManager
removeLayoutComponent
in class CardLayout
comp
- The component to be removed.public Dimension preferredLayoutSize(Container parent)
preferredLayoutSize
in interface LayoutManager
preferredLayoutSize
in class CardLayout
parent
- The name of the parent containerpublic Dimension minimumLayoutSize(Container parent)
minimumLayoutSize
in interface LayoutManager
minimumLayoutSize
in class CardLayout
parent
- The name of the parent containerpublic void layoutContainer(Container parent)
layoutContainer
in interface LayoutManager
layoutContainer
in class CardLayout
parent
- The name of the parent containerpublic void first(Container parent)
first
in class CardLayout
parent
- The name of the parent containerpublic void next(Container parent)
next
in class CardLayout
parent
- The name of the parent containerpublic void previous(Container parent)
previous
in class CardLayout
parent
- The name of the parent containerpublic void last(Container parent)
last
in class CardLayout
parent
- The name of the parent containerpublic void show(Container parent, String name)
show
in class CardLayout
parent
- The name of the parent container in which to do the layout.name
- The component name.public void show(Container parent, int index)
parent
- The name of the parent container in which to do the layout.index
- The index (between 0 and component count - 1)public Component getComponent(String name)
name
- of the component to be retrievedpublic String getName(Container parent, int index)
parent
- The parent containerindex
- The index of the component whose name is asked forCopyright © 2003, 2023, Oracle and/or its affiliates.