|
||||||||||
| 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
javax.swing.JPanel
org.tbee.swing.cardlayout.CardLayoutNavigator
public class CardLayoutNavigator
This class examines a container with the CardLayout and shows a button for each component. Clicking on the button will show that component (basically this is ver similar to a JTabbedPanem however the navigator is disconnected). If changes occur in the container (components are added or removed) it will be updated, because it listens to container events. TODO: optimize the number of times populateButtons is called.
| Nested Class Summary | |
|---|---|
static class |
CardLayoutNavigator.ORIENTATION
|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| 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 | |
|---|---|
static String |
SOURCECODE_VERSION
Standard variable for determining version of a class file. |
| 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 | |
|---|---|
CardLayoutNavigator(Container container)
TODO: provide good default images |
|
CardLayoutNavigator(Container container,
Icon defaultCurrentlyVisibleIcon,
Icon defaultHiddenImage)
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
|
void |
cardChanged(CardChangeEvent e)
|
void |
cardChanging(CardChangeEvent e)
|
void |
componentAdded(ContainerEvent e)
|
void |
componentRemoved(ContainerEvent e)
|
Container |
getContainer()
Container |
CardLayout |
getContainerLayout()
|
Icon |
getDefaultHiddenIcon()
default hidden icon |
Icon |
getDefaultVisibleIcon()
default visible icon |
Icon |
getHiddenIcon(Component component)
per panel hidden button |
Icon |
getHiddenIcon(String name)
|
CardLayoutNavigator.ORIENTATION |
getOrientation()
Orientation |
Icon |
getVisibleButton(String name)
|
Icon |
getVisibleIcon(Component component)
per panel visible button |
void |
highlight(Component component)
|
void |
highlight(Component component,
String name)
|
void |
highlight(String name)
|
void |
removeHiddenIcon(Component component)
|
void |
removeHiddenIcon(String name)
|
void |
removeVisibleIcon(Component component)
|
void |
removeVisibleIcon(String name)
|
void |
setButtonsAlignmentX(float alignment)
For aligning inside a BoxLayout When BoxLayout is vertical, 0.0 aligns left and 1.0 aligns right |
void |
setButtonsAlignmentY(float alignment)
For aligning inside a BoxLayout When BoxLayet is horizontal, 0.0 aligns top and 1.0 aligns bottom |
void |
setContainer(Container container)
|
void |
setDefaultHiddenIcon(Icon value)
|
void |
setDefaultVisibleIcon(Icon value)
|
void |
setHiddenIcon(Component component,
Icon value)
|
void |
setHiddenIcon(String name,
Icon value)
|
void |
setOrientation(CardLayoutNavigator.ORIENTATION value)
|
void |
setVisibleIcon(Component component,
Icon value)
|
void |
setVisibleIcon(String name,
Icon value)
|
JPanel |
wrapInCompoundPanel(String borderLayoutOrientation)
Quickly wrap the container and myself in a panel with BorderLayout |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String SOURCECODE_VERSION
| Constructor Detail |
|---|
public CardLayoutNavigator(Container container)
container -
public CardLayoutNavigator(Container container,
Icon defaultCurrentlyVisibleIcon,
Icon defaultHiddenImage)
container - defaultCurrentlyVisibleIcon - defaultHiddenImage - | Method Detail |
|---|
public Container getContainer()
public void setContainer(Container container)
public CardLayout getContainerLayout()
public Icon getDefaultVisibleIcon()
public void setDefaultVisibleIcon(Icon value)
public Icon getDefaultHiddenIcon()
public void setDefaultHiddenIcon(Icon value)
public Icon getVisibleIcon(Component component)
public void setVisibleIcon(Component component,
Icon value)
public void removeVisibleIcon(Component component)
public Icon getVisibleButton(String name)
public void setVisibleIcon(String name,
Icon value)
public void removeVisibleIcon(String name)
public Icon getHiddenIcon(Component component)
public void setHiddenIcon(Component component,
Icon value)
public void removeHiddenIcon(Component component)
public Icon getHiddenIcon(String name)
public void setHiddenIcon(String name,
Icon value)
public void removeHiddenIcon(String name)
public CardLayoutNavigator.ORIENTATION getOrientation()
public void setOrientation(CardLayoutNavigator.ORIENTATION value)
public void componentAdded(ContainerEvent e)
componentAdded in interface ContainerListenerpublic void componentRemoved(ContainerEvent e)
componentRemoved in interface ContainerListenerpublic void cardChanged(CardChangeEvent e)
cardChanged in interface CardChangedListenerpublic void cardChanging(CardChangeEvent e)
cardChanging in interface CardChangeListenerpublic void setButtonsAlignmentX(float alignment)
alignment - public void setButtonsAlignmentY(float alignment)
alignment - public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerActionListener.actionPerformed(java.awt.event.ActionEvent)public void highlight(String name)
name - public void highlight(Component component)
component -
public void highlight(Component component,
String name)
component - name - public JPanel wrapInCompoundPanel(String borderLayoutOrientation)
borderLayoutOrientation -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||