|
JComponentPack 1.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.zfqjava.swing.JCardPane
public class JCardPane
JCardPane provides a multiple card panel based
on CardLayout2.
| Nested Class Summary | |
|---|---|
protected class |
JCardPane.AccessibleJCardPane
This class implements accessibility support for the JCardPane class. |
protected class |
JCardPane.ModelListener
We pass ModelChanged events along to the listeners with
the cardpane (instead of the model itself) as the event source. |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JCardPane()
Constructs a JCardPane. |
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener l)
Adds a ChangeListener to this cardpane. |
protected void |
addImpl(Component comp,
Object constraints,
int index)
|
protected ChangeListener |
createChangeListener()
Subclasses that want to handle ChangeEvents differently
can override this to return a subclass of ModelListener or
another ChangeListener implementation. |
protected void |
fireStateChanged()
Sends a ChangeEvent, whose source is this cardpane,
to each listener. |
AccessibleContext |
getAccessibleContext()
Gets the AccessibleContext associated with this JCardPane. |
ChangeListener[] |
getChangeListeners()
Returns an array of all the ChangeListeners added
to this JCardpane with addChangeListener. |
Component |
getSelectedComponent()
Returns the currently selected component for this cardpane. |
int |
getSelectedIndex()
Returns the currently selected index for this cardpane. |
SingleSelectionModel |
getSelectionModel()
Returns the selectionModel associated with this cardpane. |
int |
indexOfComponent(Component comp)
Gets the component index in this container. |
protected String |
paramString()
Returns a string representation of this JCardPane. |
void |
remove(int index)
|
void |
removeAll()
|
void |
removeChangeListener(ChangeListener l)
Removes a ChangeListener from this cardpane. |
void |
setSelectedComponent(Component comp)
Sets the selected component for this cardpane. |
void |
setSelectedIndex(int index)
Sets the selected index for this cardpane. |
void |
setSelectionModel(SingleSelectionModel selectionModel)
Sets the selectionModel to be used with this cardpane. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JCardPane()
JCardPane.
| Method Detail |
|---|
protected void addImpl(Component comp,
Object constraints,
int index)
addImpl in class Containerpublic void remove(int index)
remove in class Containerpublic void removeAll()
removeAll in class Containerprotected ChangeListener createChangeListener()
ChangeEvents differently
can override this to return a subclass of ModelListener or
another ChangeListener implementation.
fireStateChanged()public void addChangeListener(ChangeListener l)
ChangeListener to this cardpane.
l - the ChangeListener to addfireStateChanged(),
removeChangeListener(javax.swing.event.ChangeListener)public void removeChangeListener(ChangeListener l)
ChangeListener from this cardpane.
l - the ChangeListener to removefireStateChanged(),
addChangeListener(javax.swing.event.ChangeListener)public ChangeListener[] getChangeListeners()
ChangeListeners added
to this JCardpane with addChangeListener.
ChangeListeners added or an empty
array if no listeners have been addedprotected void fireStateChanged()
ChangeEvent, whose source is this cardpane,
to each listener. This method method is called each time
a ChangeEvent is received from the model.
addChangeListener(javax.swing.event.ChangeListener),
EventListenerListpublic SingleSelectionModel getSelectionModel()
setSelectionModel(javax.swing.SingleSelectionModel)public void setSelectionModel(SingleSelectionModel selectionModel)
selectionModel - the selectionModel to be usedgetSelectionModel()public void setSelectedIndex(int index)
index - the index to be selected
IndexOutOfBoundsException - if index is out of range
(index < -1 || index >= component count)getSelectedIndex(),
SingleSelectionModel.setSelectedIndex(int)public int getSelectedIndex()
setSelectedIndex(int)public void setSelectedComponent(Component comp)
selectedIndex to the index
corresponding to the specified component.
IllegalArgumentException - if component not found in componentbed
panegetSelectedComponent()public int indexOfComponent(Component comp)
comp - the component
public Component getSelectedComponent()
null if there is no currently display card.
setSelectedComponent(java.awt.Component)protected String paramString()
null.
paramString in class JComponentpublic AccessibleContext getAccessibleContext()
getAccessibleContext in interface AccessiblegetAccessibleContext in class JComponent
|
JComponentPack 1.5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||