|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.tools.propertyEditor.AbstractLayout | +--com.objectwave.tools.propertyEditor.DeckLayout
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.
Field Summary | |
protected int |
count
|
protected java.util.Hashtable |
tab
|
protected boolean |
wrap
|
Fields inherited from class com.objectwave.tools.propertyEditor.AbstractLayout |
hgap, vgap |
Constructor Summary | |
DeckLayout()
|
|
DeckLayout(boolean wrap)
|
|
DeckLayout(int hgap,
int vgap)
|
|
DeckLayout(int hgap,
int vgap,
boolean wrap)
|
Method Summary | |
void |
addLayoutComponent(java.awt.Component comp,
java.lang.Object constraints)
Adds the specified component to this deck layout's internal table, by name. |
void |
addLayoutComponent(java.lang.String name,
java.awt.Component comp)
Adds the specified component with the specified name to the layout. |
void |
first(java.awt.Container parent)
Flips to the first card of the container. |
java.awt.Component |
getComponent(java.lang.String name)
|
int |
getIndex(java.awt.Container parent,
java.lang.String name)
|
java.lang.String |
getName(java.awt.Container parent,
int index)
|
void |
last(java.awt.Container parent)
Flips to the last card of the container. |
void |
layoutContainer(java.awt.Container parent)
Lays out the specified container using this deck layout. |
java.awt.Dimension |
minimumLayoutSize(java.awt.Container parent)
Calculates the minimum size for the specified panel. |
int |
next(java.awt.Container parent)
Flips to the next card of the specified container. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent)
Calculates the preferred size for the specified panel. |
int |
previous(java.awt.Container parent)
Flips to the previous card of the specified container. |
void |
removeLayoutComponent(java.awt.Component comp)
Removes the specified component from the layout. |
void |
show(java.awt.Container parent,
int index)
Flips to the component at the numbered position. |
void |
show(java.awt.Container parent,
java.lang.String name)
Flips to the component that was added to this layout using the specified name. |
Methods inherited from class com.objectwave.tools.propertyEditor.AbstractLayout |
getHgap, getLayoutAlignmentX, getLayoutAlignmentY, getVgap, invalidateLayout, maximumLayoutSize, setHgap, setVgap, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.LayoutManager2 |
getLayoutAlignmentX, getLayoutAlignmentY, invalidateLayout, maximumLayoutSize |
Field Detail |
protected java.util.Hashtable tab
protected int count
protected boolean wrap
Constructor Detail |
public DeckLayout()
public DeckLayout(int hgap, int vgap)
public DeckLayout(int hgap, int vgap, boolean wrap)
public DeckLayout(boolean wrap)
Method Detail |
public void addLayoutComponent(java.awt.Component comp, java.lang.Object constraints)
addLayoutComponent
in interface java.awt.LayoutManager2
addLayoutComponent
in class AbstractLayout
comp
- The component to be added.constraints
- A name that identifies the componentpublic void addLayoutComponent(java.lang.String name, java.awt.Component comp)
AbstractLayout
addLayoutComponent
in interface java.awt.LayoutManager
addLayoutComponent
in class AbstractLayout
name
- The name of the componentcomp
- The component to be addedpublic void first(java.awt.Container parent)
parent
- The name of the parent containerpublic java.awt.Component getComponent(java.lang.String name)
public int getIndex(java.awt.Container parent, java.lang.String name)
public java.lang.String getName(java.awt.Container parent, int index)
public void last(java.awt.Container parent)
parent
- The name of the parent containerpublic void layoutContainer(java.awt.Container parent)
layoutContainer
in interface java.awt.LayoutManager
parent
- The name of the parent containerpublic java.awt.Dimension minimumLayoutSize(java.awt.Container parent)
minimumLayoutSize
in interface java.awt.LayoutManager
parent
- The name of the parent container
public int next(java.awt.Container parent)
parent
- The name of the parent container
public java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize
in interface java.awt.LayoutManager
parent
- The name of the parent container
public int previous(java.awt.Container parent)
parent
- The name of the parent container
public void removeLayoutComponent(java.awt.Component comp)
removeLayoutComponent
in interface java.awt.LayoutManager
removeLayoutComponent
in class AbstractLayout
comp
- The component to be removed.public void show(java.awt.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 void show(java.awt.Container parent, java.lang.String name)
parent
- The name of the parent container in which to do the layout.name
- The component name.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |