Groovy Documentation

com.wordpress.tipsforjava.swing
[Java] Class RXCardLayout

java.lang.Object
  java.awt.CardLayout
      com.wordpress.tipsforjava.swing.RXCardLayout
All Implemented Interfaces:
AncestorListener

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.

Authors:
Rob Camick
Darryl Burke


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

cards

private ArrayList cards


currentCard

private JComponent currentCard


firstCard

private JComponent firstCard


isRequestFocusOnCard

private boolean isRequestFocusOnCard


lastCard

private JComponent lastCard


nextAction

private Action nextAction


previousAction

private Action previousAction


 
Constructor Detail

RXCardLayout

public RXCardLayout()
Creates a new card layout with gaps of size zero.


RXCardLayout

public RXCardLayout(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 Detail

addLayoutComponent

public void addLayoutComponent(Component comp, Object constraints)


ancestorAdded

public void ancestorAdded(AncestorEvent event)


ancestorMoved

public void ancestorMoved(AncestorEvent event)


ancestorRemoved

public void ancestorRemoved(AncestorEvent event)


getCurrentCard

public JComponent getCurrentCard()


getNextAction

public Action getNextAction()


getNextAction

public Action getNextAction(String name)


getPreviousAction

public Action getPreviousAction()


getPreviousAction

public Action getPreviousAction(String name)


isNextCardAvailable

public boolean isNextCardAvailable()


isPreviousCardAvailable

public boolean isPreviousCardAvailable()


isRequestFocusOnCard

public boolean isRequestFocusOnCard()


removeLayoutComponent

public void removeLayoutComponent(Component comp)


setRequestFocusOnCard

public void setRequestFocusOnCard(boolean isRequestFocusOnCard)


 

Groovy Documentation