|
||||||||||
| 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
com.quadrique.jbuildingblocks.gui.ButtonAreaBase
public class ButtonAreaBase
This class implements a generic buttons area. It groups all the common and generic features but does not cover any presentation logic (which is left to be implemented in the sub-classes)
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, 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 | |
|---|---|
ButtonAreaBase()
constructor |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent zEvent)
This method is called whenever one of the buttons in the buttons bar is selected by the user |
void |
addButton(JButton zButton,
int zButtonId)
This method adds a button to the ButtonArea |
void |
addButtonSelectedEventListener(ButtonAreaListener zListener)
Call this method to receive a ButtonAreaEvent whenever a button is selected |
JButton |
getButton(int zButtonId)
This method retrieves the button that is associated to the given button identifier |
int |
getNbOfButtons()
|
void |
removeButtonSelectedEventListener(ButtonAreaListener zListener)
Call this method to remove a previously registered listener |
void |
setEnabled(int zButtonId,
boolean zState)
This method is called to enable/disable a button in the button area |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ButtonAreaBase()
| Method Detail |
|---|
public void addButton(JButton zButton,
int zButtonId)
zButton - the button to addzButtonId - the identifier of the button (must be unique,
this routine does not check for identifier uniqueness).
The button identifier is used to determine which button has been
selected or to specify which button you want to access (e.g. to set
the focus or to enable/disable a specific button).public void addButtonSelectedEventListener(ButtonAreaListener zListener)
zListener - Reference to the object implementing the
ButtonAreaListener interface.ButtonAreaListener,
ButtonAreaEventpublic void removeButtonSelectedEventListener(ButtonAreaListener zListener)
zListener - Reference to the object implementing the
ButtonAreaListener interface.ButtonAreaListener,
ButtonAreaEvent
public void setEnabled(int zButtonId,
boolean zState)
zButtonId - the identifier of the button (i.e. the identifier
value that you used for the zButtonId parameter in ButtonArea.addButton()).zState - true if the button is to be enabled, false otherwisepublic void actionPerformed(ActionEvent zEvent)
actionPerformed in interface ActionListenerzEvent - the ActionEvent instancepublic JButton getButton(int zButtonId)
zButtonId - the identifier of the button (i.e. the identifier
value that you used for the zButtonId parameter in ButtonArea.addButton())
addButton(javax.swing.JButton, int)public int getNbOfButtons()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||