|
Modifier and Type |
Method and Description |
|
addLayoutComponent |
void addLayoutComponent(Component comp,
java.lang.Object constraints)
Adds the specified component to this card layout's internal
table of names.
public void addLayoutComponent( Component comp,
java.lang.Object constraints)
-
Adds the specified component to this card layout's internal
table of names. The object specified by constraints
must 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 the show method, an application can
display the component with the specified name.
- Specified by:
addLayoutComponent in interface LayoutManager2
- Parameters:
comp - the component to be added.constraints - a tag that identifies a particular
card in the layout.
- Throws:
java.lang.IllegalArgumentException - if the constraint is not a string.- See Also:
show(java.awt.Container, java.lang.String)
|
|
addLayoutComponent |
void addLayoutComponent(java.lang.String name,
Component comp)
Deprecated replaced by
addLayoutComponent(Component, Object) .
@Deprecated
public void addLayoutComponent(java.lang.String name,
Component comp)
Deprecated replaced by
addLayoutComponent(Component, Object) .
-
If the layout manager uses a per-component string,
adds the component comp to the layout,
associating it
with the string specified by name .
- Specified by:
addLayoutComponent in interface LayoutManager
- Parameters:
name - the string to be associated with the componentcomp - the component to be added
|
|
first |
void first(Container parent)
Flips to the first card of the container.
-
Flips to the first card of the container.
- Parameters:
parent - the parent container in which to do the layout- See Also:
last(java.awt.Container)
|
|
getHgap |
int getHgap()
Gets the horizontal gap between components.
public int getHgap()
-
Gets the horizontal gap between components.
- Returns:
- the horizontal gap between components.
- Since:
- JDK1.1
- See Also:
setHgap(int) ,
getVgap()
|
|
getLayoutAlignmentX |
float getLayoutAlignmentX(Container parent)
Returns the alignment along the x axis.
public float getLayoutAlignmentX( Container parent)
-
Returns 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:
getLayoutAlignmentX in interface LayoutManager2
|
|
getLayoutAlignmentY |
float getLayoutAlignmentY(Container parent)
Returns the alignment along the y axis.
public float getLayoutAlignmentY( Container parent)
-
Returns 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:
getLayoutAlignmentY in interface LayoutManager2
|
|
getVgap |
int getVgap()
Gets the vertical gap between components.
public int getVgap()
-
Gets the vertical gap between components.
- Returns:
- the vertical gap between components.
- See Also:
setVgap(int) ,
getHgap()
|
|
invalidateLayout |
void invalidateLayout(Container target)
Invalidates the layout, indicating that if the layout manager
has cached information it should be discarded.
public void invalidateLayout( Container target)
-
Invalidates the layout, indicating that if the layout manager
has cached information it should be discarded.
- Specified by:
invalidateLayout in interface LayoutManager2
|
|
last |
void last(Container parent)
Flips to the last card of the container.
-
Flips to the last card of the container.
- Parameters:
parent - the parent container in which to do the layout- See Also:
first(java.awt.Container)
|
|
layoutContainer |
void layoutContainer(Container parent)
Lays out the specified container using this card layout.
public void layoutContainer( Container parent)
-
Lays out the specified container using this card layout.
Each component in the parent container is reshaped
to be the size of the container, minus space for surrounding
insets, horizontal gaps, and vertical gaps.
- Specified by:
layoutContainer in interface LayoutManager
- Parameters:
parent - the parent container in which to do the layout- See Also:
Container.doLayout()
|
|
maximumLayoutSize |
Dimension maximumLayoutSize(Container target)
Returns the maximum dimensions for this layout given the components
in the specified target container.
|
|
minimumLayoutSize |
Dimension minimumLayoutSize(Container parent)
Calculates the minimum size for the specified panel.
|
|
next |
void next(Container parent)
Flips to the next card of the specified container.
-
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.
- Parameters:
parent - the parent container in which to do the layout- See Also:
previous(java.awt.Container)
|
|
preferredLayoutSize |
Dimension preferredLayoutSize(Container parent)
Determines the preferred size of the container argument using
this card layout.
|
|
previous |
void previous(Container parent)
Flips to the previous card of the specified container.
-
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.
- Parameters:
parent - the parent container in which to do the layout- See Also:
next(java.awt.Container)
|
|
removeLayoutComponent |
void removeLayoutComponent(Component comp)
Removes the specified component from the layout.
|
|
setHgap |
void setHgap(int hgap)
Sets the horizontal gap between components.
public void setHgap(int hgap)
-
Sets the horizontal gap between components.
- Parameters:
hgap - the horizontal gap between components.- Since:
- JDK1.1
- See Also:
getHgap() ,
setVgap(int)
|
|
setVgap |
void setVgap(int vgap)
Sets the vertical gap between components.
public void setVgap(int vgap)
-
Sets the vertical gap between components.
- Parameters:
vgap - the vertical gap between components.- Since:
- JDK1.1
- See Also:
getVgap() ,
setHgap(int)
|
|
show |
void show(Container parent,
java.lang.String name)
Flips to the component that was added to this layout with the
specified name , using addLayoutComponent .
public void show( Container parent,
java.lang.String name)
-
Flips to the component that was added to this layout with the
specified name , using addLayoutComponent .
If no such component exists, then nothing happens.
- Parameters:
parent - the parent container in which to do the layoutname - the component name- See Also:
addLayoutComponent(java.awt.Component, java.lang.Object)
|
|
toString |
java.lang.String toString()
Returns a string representation of the state of this card layout.
public java.lang.String toString()
-
Returns a string representation of the state of this card layout.
- Overrides:
toString in class java.lang.Object
- Returns:
- a string representation of this card layout.
|