|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.awt.CardLayout
com.wordpress.tipsforjava.swing.RXCardLayout
public class RXCardLayout extends CardLayout
The RXCardLayout provides some extensions to the
CardLayout class. In particular adding support for:
a) setting focus on the card when it is displayed
b) getting the currently displayed Card
c) Next and Previous Actions
This added support will only work when a JComponent is added as a Card.
| Nested Class Summary | |
|---|---|
class |
RXCardLayout.CardAction
|
| Field Summary | |
|---|---|
private ArrayList |
cards
|
private JComponent |
currentCard
|
private JComponent |
firstCard
|
private boolean |
isRequestFocusOnCard
|
private JComponent |
lastCard
|
private Action |
nextAction
|
private Action |
previousAction
|
| Constructor Summary | |
RXCardLayout()
Creates a new card layout with gaps of size zero. |
|
RXCardLayout(int hgap, int vgap)
Creates a new card layout with the specified horizontal and vertical gaps. |
|
| Method Summary | |
|---|---|
void
|
addLayoutComponent(Component comp, Object constraints)
|
void
|
ancestorAdded(AncestorEvent event)
|
void
|
ancestorMoved(AncestorEvent event)
|
void
|
ancestorRemoved(AncestorEvent event)
|
JComponent
|
getCurrentCard()
|
Action
|
getNextAction()
|
Action
|
getNextAction(String name)
|
Action
|
getPreviousAction()
|
Action
|
getPreviousAction(String name)
|
boolean
|
isNextCardAvailable()
|
boolean
|
isPreviousCardAvailable()
|
boolean
|
isRequestFocusOnCard()
|
void
|
removeLayoutComponent(Component comp)
|
void
|
setRequestFocusOnCard(boolean isRequestFocusOnCard)
|
| Methods inherited from class CardLayout | |
|---|---|
| toString, next, previous, last, first, removeLayoutComponent, addLayoutComponent, addLayoutComponent, layoutContainer, invalidateLayout, preferredLayoutSize, minimumLayoutSize, maximumLayoutSize, getLayoutAlignmentX, getLayoutAlignmentY, show, getHgap, setHgap, getVgap, setVgap, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll |
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private ArrayList cards
private JComponent currentCard
private JComponent firstCard
private boolean isRequestFocusOnCard
private JComponent lastCard
private Action nextAction
private Action previousAction
| Constructor Detail |
|---|
public RXCardLayout()
public RXCardLayout(int hgap, int vgap)
hgap - the horizontal gap.vgap - the vertical gap.
| Method Detail |
|---|
public void addLayoutComponent(Component comp, Object constraints)
public void ancestorAdded(AncestorEvent event)
public void ancestorMoved(AncestorEvent event)
public void ancestorRemoved(AncestorEvent event)
public JComponent getCurrentCard()
public Action getNextAction()
public Action getNextAction(String name)
public Action getPreviousAction()
public Action getPreviousAction(String name)
public boolean isNextCardAvailable()
public boolean isPreviousCardAvailable()
public boolean isRequestFocusOnCard()
public void removeLayoutComponent(Component comp)
public void setRequestFocusOnCard(boolean isRequestFocusOnCard)
Groovy Documentation