|
||||||||||
| 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
com.quadrique.jbuildingblocks.gui.Dlg
public class Dlg
This class is the base class for all the dialogs of the application. It provides all the common services as well as a consistent look&feel and behavior. Each dialog has an optional icon panel (west), a center panel and a button area. When a dialog window is opened, it is positioned at the golden mean of the parent window (a point directly on the parent's vertical midline and slightly above its horizontal midline). When a dialog window is opened, a specialized method (assignFocus()) is called so that you assign the initial focus to a specific component. Each dialog window can be resized but its dimension cannot be smaller than the minimum size for the components. If a dialog windows is closed, the returned value is set to -1
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Dialog |
|---|
Dialog.ModalExclusionType, Dialog.ModalityType |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Field Summary | |
|---|---|
static int |
RETURN_VALUE_IS_DLG_WINDOW_CLOSED
constants |
| Fields inherited from class java.awt.Dialog |
|---|
DEFAULT_MODALITY_TYPE |
| 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 | |
|---|---|
Dlg(Component zParentComponent,
String zTitle,
String zIconName,
boolean zIsModal)
constructor |
|
Dlg(Dialog zParentDialog,
String zTitle,
String zIconName,
boolean zIsModal)
use this constructor whenever the dialog is dispayed from a modal dialog. |
|
| Method Summary | |
|---|---|
JButton |
addButton(ActionBase zAction,
boolean zCloseDialogIfActivated,
boolean zIsDefault)
buttons are added from o to n-1 ==> return value contains the button id (0 to n-1) |
JButton |
addButton(String zLabel,
String zTooltip,
int zMnemonic,
boolean zCloseDialogIfActivated,
boolean zIsDefault)
buttons are added from o to n-1 ==> return value contains the button id (0 to n-1) |
void |
addCenterComponent(JComponent zComponent,
JComponent zComponentWithInitialFocus)
Adds the component to the "center" area of the dialog Please note that the Java Look&Feel recommended border is automatically added to the component. |
void |
addEmptySpaceInButtonArea(int zNbOfPixels)
add a fixed size empty space to the panel (e.g. |
void |
addHelpButton(String zLabel,
String zTooltip,
int zMnemonic,
String zHelpKey)
buttons are added from o to n-1 ==> return value contains the button id (0 to n-1) |
void |
buttonSelected(ButtonAreaEvent zEvent)
This method is called whenever one of the buttons is called |
void |
closeDialog(int zReturnValue)
to terminate the execution of the dialog |
void |
componentHidden(ComponentEvent zEvent)
|
void |
componentMoved(ComponentEvent e)
|
void |
componentResized(ComponentEvent e)
|
void |
componentShown(ComponentEvent e)
|
ButtonArea |
getButtonArea()
|
static Dialog |
getDialog(Component zComponent)
|
int |
getReturnValue()
This method returns the dialog return value. |
void |
setButtonAreaIsVisible(boolean zIsVisible)
|
void |
windowActivated(WindowEvent zEvent)
|
void |
windowClosed(WindowEvent zEvent)
|
void |
windowClosing(WindowEvent zEvent)
|
void |
windowDeactivated(WindowEvent zEvent)
|
void |
windowDeiconified(WindowEvent zEvent)
|
void |
windowIconified(WindowEvent zEvent)
|
void |
windowOpened(WindowEvent zEvent)
|
| Methods inherited from class javax.swing.JDialog |
|---|
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update |
| Methods inherited from class java.awt.Dialog |
|---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int RETURN_VALUE_IS_DLG_WINDOW_CLOSED
| Constructor Detail |
|---|
public Dlg(Component zParentComponent,
String zTitle,
String zIconName,
boolean zIsModal)
zParentComponent - the parent component that will be used to position the dialogzTitle - the title of the dialogzIconName - the name of the icon. use null if no icon is neededzIsModal - true if the dialog is modal
public Dlg(Dialog zParentDialog,
String zTitle,
String zIconName,
boolean zIsModal)
zParentDialog - zTitle - zIconName - zIsModal - | Method Detail |
|---|
public static Dialog getDialog(Component zComponent)
zComponent - the parent component that will be used to position the dialog
public void addCenterComponent(JComponent zComponent,
JComponent zComponentWithInitialFocus)
zComponent - the component to addzComponentWithInitialFocus - the component in the component (if any) who should have the focus
public JButton addButton(String zLabel,
String zTooltip,
int zMnemonic,
boolean zCloseDialogIfActivated,
boolean zIsDefault)
zLabel - the name of the buttonzTooltip - the text for the tooltipzMnemonic - the menmonic for the button (e.g. KeyEvent.VK_P or KeyEvent.VK_UNDEFINED)zCloseDialogIfActivated - if ture, the dialog is closed when the action is activatedzIsDefault - true if this is the default button
public JButton addButton(ActionBase zAction,
boolean zCloseDialogIfActivated,
boolean zIsDefault)
zAction - the action to usezCloseDialogIfActivated - if ture, the dialog is closed when the action is activatedzIsDefault - true if this is the default button
public void addHelpButton(String zLabel,
String zTooltip,
int zMnemonic,
String zHelpKey)
zLabel - the name of the buttonzTooltip - the text for the tooltipzMnemonic - the menmonic for the button (e.g. KeyEvent.VK_P or KeyEvent.VK_UNDEFINED)zHelpKey - the key of the corresponding section in the online HelpSet filepublic void addEmptySpaceInButtonArea(int zNbOfPixels)
zNbOfPixels - the number of pixelspublic void setButtonAreaIsVisible(boolean zIsVisible)
public int getReturnValue()
public void windowClosing(WindowEvent zEvent)
windowClosing in interface WindowListenerzEvent - the eventWindowListenerpublic void windowActivated(WindowEvent zEvent)
windowActivated in interface WindowListenerzEvent - the eventWindowListenerpublic void windowDeactivated(WindowEvent zEvent)
windowDeactivated in interface WindowListenerzEvent - the eventWindowListenerpublic void windowIconified(WindowEvent zEvent)
windowIconified in interface WindowListenerzEvent - the eventWindowListenerpublic void windowDeiconified(WindowEvent zEvent)
windowDeiconified in interface WindowListenerzEvent - the eventWindowListenerpublic void windowClosed(WindowEvent zEvent)
windowClosed in interface WindowListenerzEvent - the eventWindowListenerpublic void windowOpened(WindowEvent zEvent)
windowOpened in interface WindowListenerzEvent - the eventWindowListenerpublic void componentHidden(ComponentEvent zEvent)
componentHidden in interface ComponentListenerzEvent - the eventComponentListenerpublic void componentShown(ComponentEvent e)
componentShown in interface ComponentListenere - the eventComponentListenerpublic void componentMoved(ComponentEvent e)
componentMoved in interface ComponentListenere - the eventComponentListenerpublic void componentResized(ComponentEvent e)
componentResized in interface ComponentListenere - the eventComponentListenerpublic void buttonSelected(ButtonAreaEvent zEvent)
buttonSelected in interface ButtonAreaListenerzEvent - the eventButtonArea,
ButtonAreaEventpublic void closeDialog(int zReturnValue)
zReturnValue - to set the return value to the desired valuepublic ButtonArea getButtonArea()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||