|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
org.simbrain.util.StandardDialog
public class StandardDialog
StandardDialog implements a standard data entry dialog with "Ok" and "Cancel" buttons. Subclasses can override the isDataValid(), okButtonPressed(), and cancelButtonPressed() methods to perform implementation specific processing.
By default, the dialog is modal, and has a JPanel with a BorderLayout for its content pane.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JDialog |
|---|
JDialog.AccessibleJDialog |
| Nested classes/interfaces inherited from class java.awt.Dialog |
|---|
Dialog.AccessibleAWTDialog |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
(package private) ActionListener |
actionListener
Action listener. |
| Fields inherited from class javax.swing.JDialog |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
StandardDialog()
This method is the default constructor. |
|
StandardDialog(Dialog parent,
String title)
This method creates a StandardDialog with the given parent dialog and title. |
|
StandardDialog(Frame parent,
String title)
This method creates a StandardDialog with the given parent frame and title. |
|
| Method Summary | |
|---|---|
void |
addButton(JButton theButton)
Adds a new button to the panel. |
protected void |
closeDialogCancel()
Overriden to perform specific clean up when dialog closed. |
protected void |
closeDialogOk()
Overrideen to perform specific clean up when dialog closed. |
void |
commit()
Commit any changes made. |
Container |
getContentPane()
This method gets the content pane for adding components. |
boolean |
hasUserCancelled()
This method returns true if the User cancelled the dialog otherwise false. |
protected boolean |
isValidData()
This method is used to validate the current dialog box. |
void |
returnToCurrentPrefs()
Returns fields changed to current preferences. |
void |
setAsDefault()
Sets changed fields as current preferences. |
void |
setContentPane(Container contentPane)
This method sets the content pane for adding components. |
| Methods inherited from class java.awt.Dialog |
|---|
addNotify, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
ActionListener actionListener
| Constructor Detail |
|---|
public StandardDialog()
public StandardDialog(Frame parent,
String title)
parent - The parent frame for the dialog.title - The title to display in the dialog.
public StandardDialog(Dialog parent,
String title)
parent - The parent dialog for the dialog.title - The title to display in the dialog.| Method Detail |
|---|
public void commit()
public void returnToCurrentPrefs()
public void setAsDefault()
protected void closeDialogOk()
protected void closeDialogCancel()
public Container getContentPane()
getContentPane in interface RootPaneContainergetContentPane in class JDialogpublic void setContentPane(Container contentPane)
setContentPane in interface RootPaneContainersetContentPane in class JDialogcontentPane - The content pane for the dialog.public boolean hasUserCancelled()
true if the User cancelled the dialog otherwise false. The dialog
is cancelled if the "Cancel" button is pressed or the "Close" window button is pressed, or the "Escape" key is
pressed. In other words, if the User has caused the dialog to close by any method other than by pressing the
"Ok" button, this method will return true.
protected boolean isValidData()
true. This method should be implemented by each dialog that extends this class.
true indicates that all of the fields were
validated correctly and false indicates the validation failedpublic void addButton(JButton theButton)
theButton - button to be added
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||