Class UIPropertyDialog
public class UIPropertyDialog extends UIDialog
{
// Fields
public static final int CENTER;
public static final int LARGE;
public static final int LEFT;
public static final int MEDIUM;
public static final int RIGHT;
public static final int SMALL;
// Constructors
public UIPropertyDialog(UIFrame frame, String title,
boolean modal, int pageSize);
public UIPropertyDialog(UIFrame frame, String title,
boolean modal);
// Methods
public boolean action(Event e, Object o);
public void addNotify();
public void addPage(UIPanel comp);
public void addPage(String name, IUIComponent comp);
public Object display();
public boolean doApplyAction(Event e, Object o);
public boolean doCancelAction(Event e, Object o);
public boolean doOKAction(Event e, Object o);
public int getButtonAlignment();
public Insets getInsets();
public Dimension getPageDimension();
public int getPageSize();
public Insets insets();
public boolean isApplyable();
public void setApplyable(boolean apply);
public void setButtonAlignment(int Align);
public void setPageSize(int size);
}
This class implements a property dialog window. An UIPropertyDialog control contains a set of UIPropertyPage objects.
UIComponent
|
+--UIContainer
|
+--UIStateContainer
|
+--UIPanel
|
+--UIRoot
|
+--UIWindow
|
+--UIDialog
|
+--UIPropertyDialog
public UIPropertyDialog(UIFrame frame, String title, boolean modal,
int pageSize);
Creates an empty property dialog window.
- Comments:To add a page to the dialog window, call addPage.
Note Clicking on the close window button will not close the window if the window is non-modal.
Parameter | Description |
frame
| The parent frame.
|
title
| The title of the dialog window.
|
modal
| If true, the dialog window is modal (meaning no other window can receive input while this window is visible); otherwise, the dialog window is modeless.
|
pageSize
| The size of the pages in the dialog window. Possible values include SMALL, MEDIUM, and LARGE.
|
public UIPropertyDialog(UIFrame frame, String title, boolean modal);
Creates an empty property dialog window.
- Comments:
- By default, the size of the pages in the property dialog window are set to MEDIUM. To add a page to the dialog window, call addPage.
Note Clicking on the close window button will not close the window if the window is non-modal.
Parameter | Description |
frame
| The parent frame.
|
title
| The title of the dialog window.
|
modal
| If true, the dialog window is modal (meaning no other window can receive input while this window is visible); otherwise, the dialog window is modeless.
|
public boolean action(Event e, Object o);
Responds to the buttons in the property dialog window being clicked.
- Comments:
- Depending on the button that was clicked, action calls one of the following methods.
Note When cancelling the dialog, the method calls UIDialog.dispose.
Return Value:
Returns true if the event was handled; otherwise, returns false.
Parameter | Description |
e
| The event posted to the property dialog window.
|
o
| The object that posted the event.
|
public void addNotify();
Called to perform initialization when the graphics context is first available.
- Comments:This method adds OK, Cancel, and Apply buttons to the property dialog window.
Return Value:
No return value.
public void addPage(UIPanel comp);
Adds the specified panel to the property dialog window.
Return Value:
No return value.
Parameter | Description |
comp
| The UIPanel to add to the dialog box. The name of the page is retrieved from the getName method in the UIPanel class.
|
public void addPage(String name, IUIComponent comp);
Adds the specified page to the property dialog window.
Return Value:
No return value.
Parameter | Description |
name
| The name of the page.
|
comp
| The page component to be added. Typically, you pass a UIPropertyPage object.
|
public Object display();
Displays the property dialog window and its pages.
Return Value:
Returns the button that was clicked; otherwise, returns null if the dialog window was cancelled.
public boolean doApplyAction(Event e, Object o);
Responds to the Apply button being clicked.
- Comments:
- This method is invoked by action. If the Apply button can change the state of the application, this method calls the doApplyAction method for each page in the dialog window.
Return Value:
Returns true if the event was handled; otherwise, returns false.
Parameter | Description |
e
| The event posted to the property dialog window.
|
o
| The object that posted the event.
|
See Also: isApplyable
public boolean doCancelAction(Event e, Object o);
Responds to the Cancel button being clicked.
- Comments:
- This method is invoked by action, and by default, simply returns true.
Return Value:
Returns true if the event was handled; otherwise, returns false. If this method returns false, the dialog was not dismissed.
Parameter | Description |
e
| The event posted to the property dialog window.
|
o
| The object that posted the event.
|
public boolean doOKAction(Event e, Object o);
Responds to the OK button being clicked.
- Comments:
- This method is invoked by action and by default, calls doApplyAction. If this method returns false, the dialog is not dismissed. If a page returned false from doApplyAction, that page is selected.
Return Value:
Returns true if the event was handled; otherwise, returns false.
Parameter | Description |
e
| The event posted to the property dialog window.
|
o
| The object that posted the event.
|
public int getButtonAlignment();
Retrieves the alignment of the buttons in the property dialog window.
Return Value:
Returns an integer identifying the button alignment. Possible values include LEFT, CENTER, and RIGHT.
See Also: setButtonAlignment
public Insets getInsets();
Retrieves the insets of the property dialog box. This method performs the same function as the insets method.
Return Value:
Returns an Insets object containing the insets.
See Also: insets
public Dimension getPageDimension();
Retrieves the dimensions of the pages in the property dialog window. Override this method to specify custom page sizes.
Return Value:
Returns the dimensions that correspond to the size of the pages (SMALL, MEDIUM, or LARGE).
See Also: getPageSize
public int getPageSize();
Retrieves the size of the pages in the property dialog window.
Return Value:
Returns an integer identifying the page size. Possible values include SMALL, MEDIUM, and LARGE.
See Also: setPageSize
public Insets insets();
Retrieves the insets of the property dialog window. This method performs the same function as the getInsets method.
Return Value:
Returns an Insets object containing the insets.
See Also: getInsets
public boolean isApplyable();
Determines whether changes made to the property page by the user will be applied when the Apply button is pressed.
Return Value:
Returns true if the isApplyable method of any page in the dialog window returns true; otherwise, returns false.
See Also: setApplyable
public void setApplyable(boolean apply);
Sets the state of the Apply button.
Return Value:
No return value.
Parameter | Description |
apply
| If true, changes will be applied to the application when the Apply button is pressed; otherwise, changes will not be applied.
|
See Also: isApplyable
public void setButtonAlignment(int Align);
Sets the alignment of the buttons in the property dialog window.
Return Value:
No return value.
Parameter | Description |
Align
| The button alignment. Possible values include LEFT, CENTER, and RIGHT.
|
See Also: getButtonAlignment
public void setPageSize(int size);
Sets the size of the pages in the property dialog window.
Return Value:
No return value.
Parameter | Description |
size
| The page size. Possible values include SMALL, MEDIUM, and LARGE.
|
See Also: getPageSize
- CENTER
- The buttons in the property dialog window are horizontally centered.
- LARGE
- The pages in the property dialog window have a width of 235 pixels and a height of 156 pixels.
- LEFT
- The buttons in the property dialog window are left-aligned.
- MEDIUM
- The pages in the property dialog window have a width of 210 pixels and a height of 154 pixels.
- RIGHT
- The buttons in the property dialog window are right-aligned.
- SMALL
- The pages in the property dialog window have a width of 195 pixels and a height of 127 pixels.